扫描二维码时效fix

This commit is contained in:
limqhz
2020-08-30 18:40:18 +08:00
parent 311055815a
commit 4d11ab9c79
3 changed files with 16 additions and 15 deletions

View File

@@ -7,12 +7,12 @@ Page({
*/ */
data: { data: {
venueId: undefined, venueId: undefined,
canOpen: true,
venue: { venue: {
}, },
isGoHome: false, isGoHome: false,
showDeleteDialog: false, showDeleteDialog: false
canOpen: true
}, },
/** /**
@@ -23,11 +23,14 @@ Page({
app.$api.scanCodeInitVenue({ app.$api.scanCodeInitVenue({
deviceId : this.data.venueId deviceId : this.data.venueId
}).then(res => { }).then(res => {
var that = this;
if (res.venueInit){ if (res.venueInit){
this.setData({ this.setData({
venue: res.venueInit venue: res.venueInit
}) }),
setTimeout(canOpenDoor,60000); setTimeout(function() {
that.setData({canOpen : false});
},60000);
} }
}); });
}, },
@@ -90,6 +93,12 @@ Page({
}) })
}, },
backClick : function(){
wx.redirectTo({
url: '/pages/home/index',
})
},
// 取消弹框 // 取消弹框
cancelDialog() { cancelDialog() {
this.setData({ this.setData({
@@ -97,13 +106,6 @@ Page({
}) })
}, },
// 取消开门
canOpenDoor() {
this.setData({
canOpen: false
})
},
confirmEnterDialog(){ confirmEnterDialog(){
this.setData({ this.setData({
showDeleteDialog: false showDeleteDialog: false
@@ -119,11 +121,11 @@ Page({
title: '请入场!' title: '请入场!'
}); });
}else { }else {
canOpenDoor();
wx.showToast({ wx.showToast({
title: res.err_msg title: res.err_msg
}); });
} }
this.setData({canOpen : false});
}); });
} }

View File

@@ -3,8 +3,8 @@
<view class='container' wx:if="{{venue.name}}"> <view class='container' wx:if="{{venue.name}}">
<image class='logo' src='{{venue.listImage}}' mode='widthFix'></image> <image class='logo' src='{{venue.listImage}}' mode='widthFix'></image>
<rich-text class='info' nodes="[{{venue.name}}] 欢迎您!请在60秒内操作开门"></rich-text> <rich-text class='info' nodes="[{{venue.name}}] 欢迎您!请在60秒内操作开门"></rich-text>
<view wx:if="{{canOpen}}" class='footer-btn' bindtap='enterClick'>开门</view> <view wx:if="{{canOpen==true}}" class='footer-btn' bindtap='enterClick'>开门</view>
<view wx:if="{{!canOpen}}" class='footer-btn' bindtap='enterClick'>返回</view> <view wx:if="{{canOpen==false}}" class='footer-btn' bindtap='backClick'>返回</view>
</view> </view>
<view class='container' wx:if="{{!venue.name}}"> <view class='container' wx:if="{{!venue.name}}">
<rich-text class='info' nodes="门禁设备连接异常,请联系管理员!"></rich-text> <rich-text class='info' nodes="门禁设备连接异常,请联系管理员!"></rich-text>

View File

@@ -1,6 +1,5 @@
//testURL //testURL
const BASE_URL = 'https://lmqhznn.goho.co'; const BASE_URL = 'https://lmqhznn.goho.co';
// const BASE_URL = 'http://120.27.209.4:8093';
//prodURL //prodURL
// const BASE_URL = 'https://api.hongyutiyu.top'; // const BASE_URL = 'https://api.hongyutiyu.top';
// const platformId = 1; // const platformId = 1;