jwyu 2 jaren geleden
bovenliggende
commit
212551af95
1 gewijzigde bestanden met toevoegingen van 12 en 8 verwijderingen
  1. 12 8
      pages/question/question.vue

+ 12 - 8
pages/question/question.vue

@@ -147,7 +147,7 @@
 		<!-- 评论弹窗 -->
 		<van-action-sheet 
 			:show="isShowComment" 
-			title="全部评论"
+			title="问答评论"
 			@close="closeCommentHandle"
 			@clickOverlay="isShowComment=false"
 		>
@@ -155,7 +155,7 @@
 			   <view class="commment-top">
 				   <text class="title">{{comment_obj.title}} {{comment_obj.total}}</text>
 				   <view class="comment-top-right">
-					   <text :class="select_comment_type === 1 && 'act'" @click="changeCommentTypeHandle(1)">精选</text>
+					   <text :class="select_comment_type === 1 && 'act'" @click="changeCommentTypeHandle(1)">全部</text>
 					   <text :class="select_comment_type === 2 && 'act'" @click="changeCommentTypeHandle(2)">我的</text>
 				   </view>
 			   </view>
@@ -243,10 +243,10 @@ export default {
 			isShowComment: false,
 			comment_cont: '',
 			writeBottom: 50,
-			select_comment_type:1,//默认精选
+			select_comment_type:1,//默认全部
 			select_question_item: {},
 			comment_obj: {
-				title: '精选评论',
+				title: '全部评论',
 				total: 0
 			},
 			comment_total: 0,
@@ -388,7 +388,7 @@ export default {
          this.isShowComment = false;
          this.select_question_item = {};
          this.comment_cont = '';
-         this.select_comment_type = 1;//默认精选
+         this.select_comment_type = 1;//默认全部
       },
       
       /* 切换评论类型*/
@@ -411,7 +411,7 @@ export default {
          if(code !== 200) return
          this.commentList = data.list || [];
          this.comment_obj = {
-            title: this.select_comment_type === 1 ? '精选评论' : '我的评论',
+            title: this.select_comment_type === 1 ? '全部评论' : '我的评论',
             total: data.paging.totals
          }
       },
@@ -429,8 +429,10 @@ export default {
                if( code !== 200 ) return
                
                this.commentList.splice(index,1)
+			   this.comment_obj.total--
                         
                wx.showToast({title: '删除成功'});
+			   this.refreshPage()
             }
          })
       },
@@ -484,8 +486,10 @@ export default {
          if(code !== 200) return
          wx.showToast({title: '发布成功'});
          this.comment_cont = '';
-         this.select_comment_type === 2 && this.getComment();
-      })
+        //  this.select_comment_type === 2 && this.getComment();
+		this.getComment()
+		this.refreshPage()//刷新列表
+      }),
 	}
 }
 </script>