Browse Source

点赞功能刷新修改

master
xuxu 5 years ago
parent
commit
aae429bcbc
  1. 16
      pages/topics/interactive/topicArticle/index.js

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

Loading…
Cancel
Save