1. 连接设备添加兜底,防止loading无法关闭
2. 修正人脸认证的判断时间
This commit is contained in:
parent
3ab936b319
commit
46f537842f
@ -3,7 +3,7 @@
|
|||||||
"appid" : "__UNI__933D519",
|
"appid" : "__UNI__933D519",
|
||||||
"description" : "",
|
"description" : "",
|
||||||
"versionName" : "1.0.0",
|
"versionName" : "1.0.0",
|
||||||
"versionCode" : "11",
|
"versionCode" : "12",
|
||||||
"transformPx" : false,
|
"transformPx" : false,
|
||||||
/* 小程序特有相关 */
|
/* 小程序特有相关 */
|
||||||
"mp-weixin" : {
|
"mp-weixin" : {
|
||||||
|
|||||||
@ -83,8 +83,7 @@ export default {
|
|||||||
onlineToken: '0',
|
onlineToken: '0',
|
||||||
pending: false,
|
pending: false,
|
||||||
show: false,
|
show: false,
|
||||||
type: '',
|
type: ''
|
||||||
serverTime: 0
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@ -134,13 +133,12 @@ export default {
|
|||||||
async getServeTime() {
|
async getServeTime() {
|
||||||
const { code, data } = await this.updateServerTimestamp()
|
const { code, data } = await this.updateServerTimestamp()
|
||||||
if(code === 0) {
|
if(code === 0) {
|
||||||
this.serverTime = data.date
|
|
||||||
this.time = parseInt((data.date - new Date().getTime()) / 1000)
|
this.time = parseInt((data.date - new Date().getTime()) / 1000)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async openDoorOperate(type) {
|
async openDoorOperate(type) {
|
||||||
if(this.currentLockInfo.faceAuthentication === 1 &&
|
if(this.currentLockInfo.faceAuthentication === 1 &&
|
||||||
this.currentLockInfo.nextFaceValidateTime <= this.serverTime) {
|
this.currentLockInfo.nextFaceValidateTime <= new Date().getTime() + this.time * 1000) {
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
title: '提示',
|
title: '提示',
|
||||||
content: '开门前需进行实名认证,小程序暂不支持,请使用APP认证开门',
|
content: '开门前需进行实名认证,小程序暂不支持,请使用APP认证开门',
|
||||||
|
|||||||
@ -66,6 +66,7 @@ export default {
|
|||||||
name: device.name,
|
name: device.name,
|
||||||
deviceId: device.deviceId
|
deviceId: device.deviceId
|
||||||
})
|
})
|
||||||
|
try {
|
||||||
const result = await this.connectBluetoothDevice()
|
const result = await this.connectBluetoothDevice()
|
||||||
if(result) {
|
if(result) {
|
||||||
this.stopGetBluetoothDevices()
|
this.stopGetBluetoothDevices()
|
||||||
@ -117,6 +118,13 @@ export default {
|
|||||||
icon: 'none'
|
icon: 'none'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
} catch (res) {
|
||||||
|
uni.hideLoading()
|
||||||
|
uni.showToast({
|
||||||
|
title: '连接失败,请靠近设备并保持设备处于唤醒状态',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user