2022-11-05 15:28:03 +08:00
|
|
|
// pages/other/feedback.js
|
|
|
|
Page({
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 页面的初始数据
|
|
|
|
*/
|
|
|
|
data: {
|
2022-11-05 16:45:52 +08:00
|
|
|
feedbackList: '',
|
2022-11-05 15:28:03 +08:00
|
|
|
replay: [],
|
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 生命周期函数--监听页面加载
|
|
|
|
*/
|
|
|
|
onLoad: function (options) {
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 生命周期函数--监听页面初次渲染完成
|
|
|
|
*/
|
|
|
|
onReady: function () {
|
|
|
|
|
|
|
|
},
|
|
|
|
doReplay: function (e) {
|
|
|
|
this.setData({
|
|
|
|
replay: e.detail.value
|
|
|
|
})
|
|
|
|
},
|
|
|
|
/**
|
|
|
|
* 生命周期函数--监听页面显示
|
|
|
|
*/
|
|
|
|
onShow: function () {
|
|
|
|
var that = this;
|
|
|
|
wx.request({
|
2022-11-05 16:45:52 +08:00
|
|
|
url: `${baseUrl}/other/feedbackListNoReplay`,
|
2022-11-05 15:28:03 +08:00
|
|
|
data: {
|
2022-11-05 16:45:52 +08:00
|
|
|
id: wx.getStorageSync('id')
|
2022-11-05 15:28:03 +08:00
|
|
|
},
|
|
|
|
success: function (d) {
|
|
|
|
for (const iterator of d.data.data) {
|
2022-11-05 16:45:52 +08:00
|
|
|
if (!iterator.reply) {
|
2022-11-05 15:28:03 +08:00
|
|
|
iterator.reply = ""
|
|
|
|
}
|
|
|
|
}
|
|
|
|
that.setData({
|
|
|
|
feedbackList: d.data.data
|
|
|
|
})
|
|
|
|
}
|
|
|
|
})
|
|
|
|
},
|
|
|
|
|
|
|
|
replay: function (event) {
|
|
|
|
var that = this
|
|
|
|
console.log(event.target.dataset)
|
|
|
|
wx.request({
|
2022-11-05 16:45:52 +08:00
|
|
|
url: `${baseUrl}/other/feedbackReplay`,
|
2022-11-05 15:28:03 +08:00
|
|
|
data: {
|
2022-11-05 16:45:52 +08:00
|
|
|
id: event.target.dataset.id,
|
|
|
|
replay: event.target.dataset.replay
|
2022-11-05 15:28:03 +08:00
|
|
|
},
|
|
|
|
success: function (d) {
|
|
|
|
wx.showToast({
|
|
|
|
title: d.data.msg,
|
|
|
|
icon: 'success',
|
|
|
|
duration: 2000,
|
|
|
|
success: function () {
|
|
|
|
that.setData({
|
2022-11-05 16:45:52 +08:00
|
|
|
replay: ""
|
2022-11-05 15:28:03 +08:00
|
|
|
})
|
|
|
|
that.onShow()
|
|
|
|
}
|
|
|
|
})
|
2022-11-05 16:45:52 +08:00
|
|
|
|
2022-11-05 15:28:03 +08:00
|
|
|
}
|
|
|
|
})
|
|
|
|
},
|
|
|
|
/**
|
|
|
|
* 生命周期函数--监听页面隐藏
|
|
|
|
*/
|
|
|
|
onHide: function () {
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 生命周期函数--监听页面卸载
|
|
|
|
*/
|
|
|
|
onUnload: function () {
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 页面相关事件处理函数--监听用户下拉动作
|
|
|
|
*/
|
|
|
|
onPullDownRefresh: function () {
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 页面上拉触底事件的处理函数
|
|
|
|
*/
|
|
|
|
onReachBottom: function () {
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 用户点击右上角分享
|
|
|
|
*/
|
|
|
|
onShareAppMessage: function () {
|
|
|
|
|
|
|
|
}
|
2022-11-05 16:45:52 +08:00
|
|
|
})
|