|
|
@ -41,14 +41,11 @@ Page({ |
|
|
this.data.id = options.id |
|
|
this.data.id = options.id |
|
|
this.data.form.articleId = options.id |
|
|
this.data.form.articleId = options.id |
|
|
wx.showLoading({ title: '加载中', mask: true }) |
|
|
wx.showLoading({ title: '加载中', mask: true }) |
|
|
// /article/get/Article-detail/{id}文章详情
|
|
|
|
|
|
getMomentDetail(options.id).then(result => { |
|
|
getMomentDetail(options.id).then(result => { |
|
|
//成功回调
|
|
|
|
|
|
this.setData({ momentDetail: result.data }) |
|
|
this.setData({ momentDetail: result.data }) |
|
|
this.fetchCommentList() |
|
|
this.fetchCommentList() |
|
|
wx.hideLoading() |
|
|
wx.hideLoading() |
|
|
}).catch(err => { |
|
|
}).catch(err => { |
|
|
//异常回调
|
|
|
|
|
|
wx.hideLoading() |
|
|
wx.hideLoading() |
|
|
util.showToast(err) |
|
|
util.showToast(err) |
|
|
}) |
|
|
}) |
|
|
@ -67,7 +64,6 @@ Page({ |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
this.setData({ requesting: true }) |
|
|
this.setData({ requesting: true }) |
|
|
// /article-reply/get/reply-list/in/{articleId} 帖子评论列表
|
|
|
|
|
|
getCommentList(this.data.id, this.data.form).then(result => { |
|
|
getCommentList(this.data.id, this.data.form).then(result => { |
|
|
if (result.data.records.length) { |
|
|
if (result.data.records.length) { |
|
|
var respList = result.data.records |
|
|
var respList = result.data.records |
|
|
@ -96,7 +92,6 @@ Page({ |
|
|
this.setData({ requesting: false, finished: true }) |
|
|
this.setData({ requesting: false, finished: true }) |
|
|
} |
|
|
} |
|
|
}).catch(err => { |
|
|
}).catch(err => { |
|
|
//异常回调
|
|
|
|
|
|
this.setData({ requesting: false }) |
|
|
this.setData({ requesting: false }) |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
@ -138,7 +133,6 @@ Page({ |
|
|
} |
|
|
} |
|
|
wx.showLoading({ title: '处理中', mask: true }) |
|
|
wx.showLoading({ title: '处理中', mask: true }) |
|
|
var form = { content: this.data.comment, articleId: this.data.id} |
|
|
var form = { content: this.data.comment, articleId: this.data.id} |
|
|
// /article-reply/reply 评论
|
|
|
|
|
|
commentMoment(form).then(result => { |
|
|
commentMoment(form).then(result => { |
|
|
this.setData({ inputBottom: 0, focus: false, comment: '' }) |
|
|
this.setData({ inputBottom: 0, focus: false, comment: '' }) |
|
|
wx.hideLoading() |
|
|
wx.hideLoading() |
|
|
@ -159,7 +153,6 @@ Page({ |
|
|
util.showToast('请勿重复点赞') |
|
|
util.showToast('请勿重复点赞') |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
// /article-reply/like-or-cancel/reply 点赞评论
|
|
|
|
|
|
likeComment({replyId: item.id}).then(result => { |
|
|
likeComment({replyId: item.id}).then(result => { |
|
|
if(item.isLiked){ |
|
|
if(item.isLiked){ |
|
|
this.setData({ |
|
|
this.setData({ |
|
|
|