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: {
|
|
|
|
greenCode: false,
|
|
|
|
redCode: false,
|
|
|
|
msg: "请先输入手机号查询您的申请状态",
|
|
|
|
phone: ''
|
|
|
|
},
|
|
|
|
phoneInput: function (e) {
|
|
|
|
this.setData({
|
|
|
|
phone: e.detail.value
|
|
|
|
})
|
|
|
|
},
|
|
|
|
submit: function () {
|
|
|
|
var that = this;
|
|
|
|
if (this.data.phone == '') {
|
|
|
|
wx.showToast({
|
|
|
|
title: "请输入手机号",
|
|
|
|
icon: 'error',
|
|
|
|
duration: 2000
|
|
|
|
})
|
|
|
|
} else {
|
|
|
|
wx.request({
|
2022-11-05 16:45:52 +08:00
|
|
|
url: `${baseUrl}/visitor/showMyVisitor`,
|
2022-11-05 15:28:03 +08:00
|
|
|
data: {
|
|
|
|
phone: this.data.phone,
|
|
|
|
},
|
|
|
|
success: function (d) {
|
|
|
|
if (d.data == "审批通过") {
|
|
|
|
that.setData({
|
2022-11-05 16:45:52 +08:00
|
|
|
greenCode: true,
|
|
|
|
redCode: false,
|
|
|
|
msg: d.data
|
2022-11-05 15:28:03 +08:00
|
|
|
})
|
2022-11-05 16:45:52 +08:00
|
|
|
} else {
|
2022-11-05 15:28:03 +08:00
|
|
|
that.setData({
|
2022-11-05 16:45:52 +08:00
|
|
|
greenCode: false,
|
|
|
|
redCode: true,
|
|
|
|
msg: d.data
|
2022-11-05 15:28:03 +08:00
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|
|
|
|
},
|
|
|
|
/**
|
|
|
|
* 生命周期函数--监听页面加载
|
|
|
|
*/
|
|
|
|
onLoad: function () {
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 生命周期函数--监听页面初次渲染完成
|
|
|
|
*/
|
|
|
|
onReady: function () {
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 生命周期函数--监听页面显示
|
|
|
|
*/
|
|
|
|
onShow: function () {
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 生命周期函数--监听页面隐藏
|
|
|
|
*/
|
|
|
|
onHide: function () {
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 生命周期函数--监听页面卸载
|
|
|
|
*/
|
|
|
|
onUnload: function () {
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 页面相关事件处理函数--监听用户下拉动作
|
|
|
|
*/
|
|
|
|
onPullDownRefresh: function () {
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 页面上拉触底事件的处理函数
|
|
|
|
*/
|
|
|
|
onReachBottom: function () {
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 用户点击右上角分享
|
|
|
|
*/
|
|
|
|
onShareAppMessage: function () {
|
|
|
|
|
|
|
|
}
|
2022-11-05 16:45:52 +08:00
|
|
|
})
|