1
0
Code Issues Pull Requests Packages Projects Releases Wiki Activity GitHub Gitee

129 lines
2.2 KiB
JavaScript
Raw Normal View History

const app = getApp()
const baseUrl = app.globalData.baseUrl
// console.log("baseUrl", baseUrl)
2022-11-05 15:28:03 +08:00
Page({
2022-11-05 15:28:03 +08:00
/**
* 页面的初始数据
*/
data: {
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({
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,
time: this.data.date + " " + this.data.time
2022-11-05 15:28:03 +08:00
},
success: function (d) {
if (d.data == "您还有未审批的申请,不能重复申请") {
2022-11-05 15:28:03 +08:00
wx.showToast({
title: '不能重复申请',
2022-11-05 15:28:03 +08:00
icon: 'error',
duration: 2000
})
} else {
2022-11-05 15:28:03 +08:00
wx.showToast({
title: d.data,
icon: 'success',
duration: 2000
})
}
}
})
},
bindDateChange: function (e) {
2022-11-05 15:28:03 +08:00
this.setData({
date: e.detail.value
})
},
bindTimeChange: function (e) {
2022-11-05 15:28:03 +08:00
this.setData({
time: e.detail.value
})
},
phoneChange: function (e) {
2022-11-05 15:28:03 +08:00
this.setData({
phone: e.detail.value
})
},
issueChange: function (e) {
2022-11-05 15:28:03 +08:00
this.setData({
issue: e.detail.value
})
},
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 () {
}
})