扫描二维码时效fix

This commit is contained in:
limqhz
2020-08-30 21:31:11 +08:00
parent 4d11ab9c79
commit 798893e65d
3 changed files with 14 additions and 2 deletions

View File

@@ -1,4 +1,7 @@
// pages/home/index.js
import {
getCurrentPageUrl
} from './../../utils/util.js'
const app = getApp();
let s = '';
let m = 0;
@@ -206,6 +209,13 @@ Page({
//扫描二维码
sacnQRCode() {
if (!wx.getStorageSync('accessToken')) {
wx.setStorageSync('history', getCurrentPageUrl());
wx.redirectTo({
url: '/pages/login/index',
})
return
}
wx.scanCode({
success (res) {
// wx.showToast({

View File

@@ -31,6 +31,8 @@ Page({
setTimeout(function() {
that.setData({canOpen : false});
},60000);
}else if (res.InitError){
venue: res.InitError
}
});
},

View File

@@ -6,7 +6,7 @@
<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 class='container' wx:if="{{!venue.venueInit}}">
<rich-text class='info' nodes="{{venue.InitError}}"></rich-text>
</view>
<confirm-dialog title="{{'提示'}}" message="{{'确认开门'}}" bindcancelselect="cancelDialog" bindconfirmselect="confirmEnterDialog" wx:if="{{showDeleteDialog}}"></confirm-dialog>