From aae429bcbc855cac788e6e9fe66598d201cba0bd Mon Sep 17 00:00:00 2001 From: xuxu Date: Fri, 14 Aug 2020 15:53:22 +0800 Subject: [PATCH] =?UTF-8?q?=E7=82=B9=E8=B5=9E=E5=8A=9F=E8=83=BD=E5=88=B7?= =?UTF-8?q?=E6=96=B0=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/topics/interactive/topicArticle/index.js | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/pages/topics/interactive/topicArticle/index.js b/pages/topics/interactive/topicArticle/index.js index a381188..70543b6 100644 --- a/pages/topics/interactive/topicArticle/index.js +++ b/pages/topics/interactive/topicArticle/index.js @@ -153,7 +153,6 @@ Page({ fetchTopicUnCollect(){ let collectionId = this.data.collectionId topicModel.topicUnCollect(collectionId, res => { - //console.log('取消收藏') if (res.code === 200) { this.fetchDetail() wx.showToast({ @@ -168,8 +167,19 @@ Page({ wx.showLoading() topicModel.topicCommentPraise(commentId,res =>{ if (res.code === 200) { - wx.hideLoading() - this.fetchDetailComment() + wx.hideLoading(); + var list = this.data.commentList; + + for(var index in list){ + if(list[index]['id'] == res.result.id){ + list[index]['praiseNum'] = res.result.supportNum; + list[index]['isSupport'] = res.result.isSupport; + break; + } + } + this.setData({ + commentList:list + }) } }) },