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 + }) } }) },