瀏覽代碼

circle page

邹能昇 1 周之前
父節點
當前提交
72dc14a181

+ 20 - 2
nova-werun/components/circle-card/index.js

@@ -40,7 +40,9 @@ Component({
         //评论
         commenttext: "评论",
         focusedCommentId: null,
-        isCommentFocused: false
+        isCommentFocused: false,
+        //
+        showconfirm:false
     },
     lifetimes: {
 
@@ -515,6 +517,22 @@ Component({
 
 
         },
-
+        //显示确认框
+        showconfirm(){
+            this.setData({
+                showconfirm:true
+            })
+        },
+        //取消确认框
+        cancleconfirm(){
+            this.setData({
+                showconfirm:false
+            })
+        },
+        //点击确认
+        clickconfirm(){
+            console.log('删除了');
+            this.deletecircle()
+        }
     }
 })

+ 2 - 1
nova-werun/components/circle-card/index.json

@@ -2,6 +2,7 @@
     "component": true,
     "usingComponents": {
         "van-icon": "@vant/weapp/icon/index",
-        "van-popup": "@vant/weapp/popup/index"
+        "van-popup": "@vant/weapp/popup/index",
+        "van-dialog": "@vant/weapp/dialog/index"
     }
 }

+ 2 - 1
nova-werun/components/circle-card/index.wxml

@@ -52,7 +52,8 @@
     <view class="timebox">
         <view class="time-box">
             <view class="time">{{time}}</view>
-            <van-icon wx:if="{{ permission=='delete'}}"  color='#1a1abd' bind:click='deletecircle' name="delete-o" size='20' />
+            <van-icon wx:if="{{ permission=='delete'}}"  color='#1a1abd' bind:click='showconfirm' name="delete-o" size='20' />
+            <van-dialog id="van-dialog" showCancelButton message='你确认要删除吗' show="{{ showconfirm }}" bind:cancel='cancleconfirm' bind:confirm='clickconfirm' />
         </view>
         <!-- 点赞评论 -->
         <view class="functionbox" wx:if="{{isgood}}">