2022-11-05 16:45:52 +08:00
|
|
|
const app = getApp()
|
|
|
|
const baseUrl = app.globalData.baseUrl
|
|
|
|
// console.log("baseUrl", baseUrl)
|
|
|
|
|
2022-11-05 15:28:03 +08:00
|
|
|
Page({
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 页面的初始数据
|
|
|
|
*/
|
|
|
|
data: {
|
2022-11-05 16:45:52 +08:00
|
|
|
List: '',
|
2022-11-05 15:28:03 +08:00
|
|
|
replay: [],
|
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 生命周期函数--监听页面加载
|
|
|
|
*/
|
|
|
|
onLoad: function (options) {
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 生命周期函数--监听页面初次渲染完成
|
|
|
|
*/
|
|
|
|
onReady: function () {
|
|
|
|
|
|
|
|
},
|
|
|
|
doReplay: function (e) {
|
|
|
|
this.setData({
|
|
|
|
replay: e.detail.value
|
|
|
|
})
|
|
|
|
},
|
2022-11-05 16:45:52 +08:00
|
|
|
agree: function (event) {
|
2022-11-05 15:28:03 +08:00
|
|
|
var that = this
|
|
|
|
wx.request({
|
2022-11-05 16:45:52 +08:00
|
|
|
url: `${baseUrl}/apply/applyReplay`,
|
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
|
|
|
reasonId: 99
|
|
|
|
},
|
|
|
|
success: function (d) {
|
2022-11-05 16:45:52 +08:00
|
|
|
if (d.data.msg == "成功") {
|
2022-11-05 15:28:03 +08:00
|
|
|
that.onshow();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
},
|
2022-11-05 16:45:52 +08:00
|
|
|
disagree: function (event) {
|
2022-11-05 15:28:03 +08:00
|
|
|
var that = this
|
|
|
|
wx.showActionSheet({
|
2022-11-05 16:45:52 +08:00
|
|
|
itemList: ['格式错误', '出行地点不允许', '时间填写错误'],
|
|
|
|
success: function (res) {
|
|
|
|
if (!res.cancel) {
|
2022-11-05 15:28:03 +08:00
|
|
|
wx.request({
|
2022-11-05 16:45:52 +08:00
|
|
|
url: `${baseUrl}/apply/applyReplay`,
|
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,
|
|
|
|
reasonId: res.tapIndex,
|
2022-11-05 15:28:03 +08:00
|
|
|
},
|
|
|
|
success: function (d) {
|
2022-11-05 16:45:52 +08:00
|
|
|
if (d.data.msg == "成功") {
|
2022-11-05 15:28:03 +08:00
|
|
|
that.onShow();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
},
|
|
|
|
/**
|
|
|
|
* 生命周期函数--监听页面显示
|
|
|
|
*/
|
|
|
|
onShow: function () {
|
|
|
|
var that = this;
|
|
|
|
wx.request({
|
2022-11-05 16:45:52 +08:00
|
|
|
url: `${baseUrl}/apply/myApply`,
|
|
|
|
data: {
|
|
|
|
id: wx.getStorageSync('id')
|
|
|
|
},
|
2022-11-05 15:28:03 +08:00
|
|
|
success: function (d) {
|
|
|
|
that.setData({
|
|
|
|
List: d.data.data
|
|
|
|
})
|
|
|
|
}
|
|
|
|
})
|
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 生命周期函数--监听页面隐藏
|
|
|
|
*/
|
|
|
|
onHide: function () {
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 生命周期函数--监听页面卸载
|
|
|
|
*/
|
|
|
|
onUnload: function () {
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 页面相关事件处理函数--监听用户下拉动作
|
|
|
|
*/
|
|
|
|
onPullDownRefresh: function () {
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 页面上拉触底事件的处理函数
|
|
|
|
*/
|
|
|
|
onReachBottom: function () {
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 用户点击右上角分享
|
|
|
|
*/
|
|
|
|
onShareAppMessage: function () {
|
|
|
|
|
|
|
|
}
|
2022-11-05 16:45:52 +08:00
|
|
|
})
|