|
@@ -5,6 +5,7 @@ Page({
|
|
|
data: {
|
|
data: {
|
|
|
showAuthorizedDialog: false,
|
|
showAuthorizedDialog: false,
|
|
|
hasAuth: false,
|
|
hasAuth: false,
|
|
|
|
|
+ showTipsA: false,
|
|
|
activeIcon: "/subpages/icons/ic_selected_radio.svg",
|
|
activeIcon: "/subpages/icons/ic_selected_radio.svg",
|
|
|
normalIcon: "/subpages/icons/ic_radio.svg",
|
|
normalIcon: "/subpages/icons/ic_radio.svg",
|
|
|
logs: [],
|
|
logs: [],
|
|
@@ -26,8 +27,14 @@ Page({
|
|
|
checkedPrivacy: check
|
|
checkedPrivacy: check
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
|
|
+ onCloseTipsDialog() {
|
|
|
|
|
+ this.setData({
|
|
|
|
|
+ showTipsA: false,
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
//扫码
|
|
//扫码
|
|
|
tapScan() {
|
|
tapScan() {
|
|
|
|
|
+ const that = this;
|
|
|
if (!this.data.hasAuth) {
|
|
if (!this.data.hasAuth) {
|
|
|
this.showDialog();
|
|
this.showDialog();
|
|
|
return;
|
|
return;
|
|
@@ -48,19 +55,19 @@ Page({
|
|
|
let hotelcodeTemp = res.result.split('|')[0];
|
|
let hotelcodeTemp = res.result.split('|')[0];
|
|
|
let roomcodeTemp = res.result.split('|')[1];
|
|
let roomcodeTemp = res.result.split('|')[1];
|
|
|
// wx.clearStorage();
|
|
// wx.clearStorage();
|
|
|
- var userInfo = wx.getStorageSync("userInfo") || {};
|
|
|
|
|
- // if (hotelcodeTemp == userInfo.hotel && roomcodeTemp == userInfo.room) {
|
|
|
|
|
|
|
+ var hotelEmpower = wx.getStorageSync("hotelEmpower");
|
|
|
|
|
+ var roomEmpower = wx.getStorageSync("roomEmpower");
|
|
|
|
|
+ if (hotelcodeTemp == hotelEmpower && roomcodeTemp == roomEmpower) {
|
|
|
wx.setStorageSync('res', res);
|
|
wx.setStorageSync('res', res);
|
|
|
wx.setStorageSync('scanResultExpiresAt', Date.now() + 2 * 60 * 60 * 1000); // 超时时间戳,例如设置为2小时后过期
|
|
wx.setStorageSync('scanResultExpiresAt', Date.now() + 2 * 60 * 60 * 1000); // 超时时间戳,例如设置为2小时后过期
|
|
|
wx.reLaunch({
|
|
wx.reLaunch({
|
|
|
- url: '/pages/index/index?res=' + res,//传res
|
|
|
|
|
|
|
+ url: '/subpages/main/main?res=' + res,//传res
|
|
|
|
|
+ })
|
|
|
|
|
+ } else {
|
|
|
|
|
+ that.setData({
|
|
|
|
|
+ showTipsA: true
|
|
|
})
|
|
})
|
|
|
- // } else {
|
|
|
|
|
- // wx.showToast({
|
|
|
|
|
- // title: '暂无权限,请先办理入住',
|
|
|
|
|
- // icon: 'none'
|
|
|
|
|
- // });
|
|
|
|
|
- // }
|
|
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|