Browse Source

接口拆分

integral
zhaoyongnian 5 years ago
parent
commit
ed335e90d1
  1. 53
      epdc-resident-mp-yushan/subpages/association/pages/replyOrRemark/replyOrRemark.js

53
epdc-resident-mp-yushan/subpages/association/pages/replyOrRemark/replyOrRemark.js

@ -1,4 +1,6 @@
import { remarkOrReply } from '../../utils/api' import { // remarkOrReply,
topicCom,
topicReply } from '../../utils/api'
Page({ Page({
data: { data: {
@ -44,17 +46,44 @@ Page({
wx.showLoading({ wx.showLoading({
title: '加载中' title: '加载中'
}) })
remarkOrReply(para).then(res => { if (this.data.faCommentId.length > 0) { // 对评论进行回复
wx.hideLoading() topicReply(para).then(res => {
console.log('评论或者回复', res) wx.hideLoading()
wx.showToast({ console.log("回复", res)
title: '评论成功', wx.showToast({
icon: 'none', title: "评论成功",
duration: 2000 icon: "none",
duration: 2000
})
wx.navigateBack()
}).catch(err => {
console.log(err)
}) })
wx.navigateBack() }else{
}).catch(err => { topicCom(para).then(res => {
console.log(err) wx.hideLoading()
}) console.log("评论", res)
wx.showToast({
title: "评论成功",
icon: "none",
duration: 2000
})
wx.navigateBack()
}).catch(err => {
console.log(err)
})
}
// remarkOrReply(para).then(res => {
// wx.hideLoading()
// console.log('评论或者回复', res)
// wx.showToast({
// title: '评论成功',
// icon: 'none',
// duration: 2000
// })
// wx.navigateBack()
// }).catch(err => {
// console.log(err)
// })
} }
}) })
Loading…
Cancel
Save