diff --git a/pages/lockDetail/lockDetail.vue b/pages/lockDetail/lockDetail.vue index 705d81e..2d4988a 100644 --- a/pages/lockDetail/lockDetail.vue +++ b/pages/lockDetail/lockDetail.vue @@ -83,7 +83,8 @@ export default { onlineToken: '0', pending: false, show: false, - type: '' + type: '', + serverTime: 0 } }, computed: { @@ -133,12 +134,13 @@ export default { async getServeTime() { const { code, data } = await this.updateServerTimestamp() if(code === 0) { + this.serverTime = data.date this.time = parseInt((data.date - new Date().getTime()) / 1000) } }, async openDoorOperate(type) { if(this.currentLockInfo.faceAuthentication === 1 && - this.currentLockInfo.nextFaceValidateTime <= new Date().getTime()) { + this.currentLockInfo.nextFaceValidateTime <= this.serverTime) { uni.showModal({ title: '提示', content: '开门前需进行实名认证,小程序暂不支持,请使用APP认证开门',