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
|
|
|
|
2022-11-05 16:45:52 +08:00
|
|
|
Page({
|
2022-11-05 15:28:03 +08:00
|
|
|
/**
|
|
|
|
* 页面的初始数据
|
|
|
|
*/
|
|
|
|
data: {
|
2022-11-05 16:45:52 +08:00
|
|
|
date: '',
|
|
|
|
time: '',
|
|
|
|
phone: '',
|
|
|
|
issue: '',
|
|
|
|
meetName: ''
|
2022-11-05 15:28:03 +08:00
|
|
|
},
|
|
|
|
showMyVisitor: function () {
|
|
|
|
wx.navigateTo({
|
|
|
|
url: './showMyVisitor',
|
|
|
|
success: function () {}, //成功后的回调;
|
|
|
|
})
|
|
|
|
},
|
|
|
|
report: function () {
|
|
|
|
wx.request({
|
2022-11-05 16:45:52 +08:00
|
|
|
url: `${baseUrl}/visitor/visitorApply`,
|
2022-11-05 15:28:03 +08:00
|
|
|
data: {
|
|
|
|
phone: this.data.phone,
|
|
|
|
issue: this.data.issue,
|
|
|
|
meet_name: this.data.meetName,
|
2022-11-05 16:45:52 +08:00
|
|
|
time: this.data.date + " " + this.data.time
|
2022-11-05 15:28:03 +08:00
|
|
|
},
|
2022-11-05 16:45:52 +08:00
|
|
|
success: function (d) {
|
|
|
|
if (d.data == "您还有未审批的申请,不能重复申请") {
|
2022-11-05 15:28:03 +08:00
|
|
|
wx.showToast({
|
2022-11-05 16:45:52 +08:00
|
|
|
title: '不能重复申请',
|
2022-11-05 15:28:03 +08:00
|
|
|
icon: 'error',
|
|
|
|
duration: 2000
|
|
|
|
})
|
2022-11-05 16:45:52 +08:00
|
|
|
} else {
|
2022-11-05 15:28:03 +08:00
|
|
|
wx.showToast({
|
|
|
|
title: d.data,
|
|
|
|
icon: 'success',
|
|
|
|
duration: 2000
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
},
|
2022-11-05 16:45:52 +08:00
|
|
|
bindDateChange: function (e) {
|
2022-11-05 15:28:03 +08:00
|
|
|
this.setData({
|
|
|
|
date: e.detail.value
|
|
|
|
})
|
|
|
|
},
|
2022-11-05 16:45:52 +08:00
|
|
|
bindTimeChange: function (e) {
|
2022-11-05 15:28:03 +08:00
|
|
|
this.setData({
|
|
|
|
time: e.detail.value
|
|
|
|
})
|
|
|
|
},
|
2022-11-05 16:45:52 +08:00
|
|
|
phoneChange: function (e) {
|
2022-11-05 15:28:03 +08:00
|
|
|
this.setData({
|
|
|
|
phone: e.detail.value
|
|
|
|
})
|
|
|
|
},
|
2022-11-05 16:45:52 +08:00
|
|
|
issueChange: function (e) {
|
2022-11-05 15:28:03 +08:00
|
|
|
this.setData({
|
|
|
|
issue: e.detail.value
|
|
|
|
})
|
|
|
|
},
|
2022-11-05 16:45:52 +08:00
|
|
|
meetNameChange: function (e) {
|
2022-11-05 15:28:03 +08:00
|
|
|
this.setData({
|
|
|
|
meetName: e.detail.value
|
|
|
|
})
|
|
|
|
},
|
|
|
|
/**
|
|
|
|
* 生命周期函数--监听页面加载
|
|
|
|
*/
|
|
|
|
onLoad: function (options) {
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 生命周期函数--监听页面初次渲染完成
|
|
|
|
*/
|
|
|
|
onReady: function () {
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 生命周期函数--监听页面显示
|
|
|
|
*/
|
|
|
|
onShow: function () {
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 生命周期函数--监听页面隐藏
|
|
|
|
*/
|
|
|
|
onHide: function () {
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 生命周期函数--监听页面卸载
|
|
|
|
*/
|
|
|
|
onUnload: function () {
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 页面相关事件处理函数--监听用户下拉动作
|
|
|
|
*/
|
|
|
|
onPullDownRefresh: function () {
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 页面上拉触底事件的处理函数
|
|
|
|
*/
|
|
|
|
onReachBottom: function () {
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 用户点击右上角分享
|
|
|
|
*/
|
|
|
|
onShareAppMessage: function () {
|
|
|
|
|
|
|
|
}
|
2022-11-05 16:45:52 +08:00
|
|
|
})
|