@@ -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(){
+ //点击确认
+ clickconfirm(){
+ console.log('删除了');
+ this.deletecircle()
+ }
}
})
@@ -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"
@@ -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}}">