扫描二维码时效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: {
venueId: undefined,
canOpen: true,
venue: {
},
isGoHome: false,
showDeleteDialog: false,
canOpen: true
showDeleteDialog: false
},
/**
@@ -23,11 +23,14 @@ Page({
app.$api.scanCodeInitVenue({
deviceId : this.data.venueId
}).then(res => {
var that = this;
if (res.venueInit){
this.setData({
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() {
this.setData({
@@ -97,13 +106,6 @@ Page({
})
},
// 取消开门
canOpenDoor() {
this.setData({
canOpen: false
})
},
confirmEnterDialog(){
this.setData({
showDeleteDialog: false
@@ -119,11 +121,11 @@ Page({
title: '请入场!'
});
}else {
canOpenDoor();
wx.showToast({
title: res.err_msg
});
}
this.setData({canOpen : false});
});
}

View File

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

View File

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