From 906ce2b0f04e1c8a90b88d469d85858468da9719 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8C=83=E9=B9=8F?= Date: Sat, 7 Sep 2024 15:21:16 +0800 Subject: [PATCH 01/10] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=AF=86=E7=A0=81?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E9=A1=B5=E5=8D=B8=E8=BD=BD=E6=9C=AA=E6=B8=85?= =?UTF-8?q?=E7=A9=BA=E5=AF=86=E7=A0=81=E5=88=97=E8=A1=A8bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/passwordList/passwordList.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pages/passwordList/passwordList.vue b/pages/passwordList/passwordList.vue index a380201..3ed0ea8 100644 --- a/pages/passwordList/passwordList.vue +++ b/pages/passwordList/passwordList.vue @@ -95,7 +95,8 @@ export default { }, methods: { ...mapActions(useBasicStore, ['routeJump', 'getDeviceInfo', 'getNetworkType']), - ...mapActions(useLockStore, ['getPasswordList', 'updateCurrentPasswordInfo', 'updatePasswordSearch', 'getPasswordStatus']), + ...mapActions(useLockStore, ['getPasswordList', 'updateCurrentPasswordInfo', 'updatePasswordSearch', + 'getPasswordStatus', 'clearList']), ...mapActions(useBluetoothStore, ['resetLockPassword', 'setLockPassword', 'closeBluetoothConnection']), toPasswordDetail(password) { this.updateCurrentPasswordInfo(password) From a556de9f6e9051e43d670104588ae980e6a74223 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8C=83=E9=B9=8F?= Date: Sat, 7 Sep 2024 15:50:19 +0800 Subject: [PATCH 02/10] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AE=89=E5=85=A8?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E6=B7=BB=E5=8A=A0=E6=97=A0=E7=BD=91=E5=88=A4?= =?UTF-8?q?=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/safeQuestion/safeQuestion.vue | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pages/safeQuestion/safeQuestion.vue b/pages/safeQuestion/safeQuestion.vue index cc662c1..fc67494 100644 --- a/pages/safeQuestion/safeQuestion.vue +++ b/pages/safeQuestion/safeQuestion.vue @@ -45,7 +45,11 @@ export default { }) } }, - updateAnswer() { + async updateAnswer() { + const netWork = await this.getNetworkType() + if(!netWork) { + return + } this.routeJump({ type: 'redirectTo', name: 'updateSafeQuestion' From 32c7aa1a7b2dfe396a77b5dcf78e81c694395c15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8C=83=E9=B9=8F?= Date: Sat, 7 Sep 2024 17:28:39 +0800 Subject: [PATCH 03/10] =?UTF-8?q?=E8=AE=BE=E5=A4=87=E8=BF=9E=E6=8E=A5?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=B6=85=E6=97=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- stores/bluetooth.js | 1 + 1 file changed, 1 insertion(+) diff --git a/stores/bluetooth.js b/stores/bluetooth.js index c97d811..e28f2de 100644 --- a/stores/bluetooth.js +++ b/stores/bluetooth.js @@ -618,6 +618,7 @@ export const useBluetoothStore = defineStore('ble', { } uni.createBLEConnection({ deviceId: that.currentLockInfo.deviceId, + timeout: 10000, success(res) { console.log('连接成功', res) // 获取设备服务 From 638ffe18b770f24c07fdd4dcfbfef42dbc26b4b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8C=83=E9=B9=8F?= Date: Sat, 7 Sep 2024 17:36:45 +0800 Subject: [PATCH 04/10] =?UTF-8?q?=E6=89=93=E5=BC=80=E5=9C=B0=E5=9B=BE?= =?UTF-8?q?=E7=BC=A9=E6=94=BE=E5=92=8C=E6=8B=96=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/selectAddress/selectAddress.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/selectAddress/selectAddress.vue b/pages/selectAddress/selectAddress.vue index c9d4096..7f728e5 100644 --- a/pages/selectAddress/selectAddress.vue +++ b/pages/selectAddress/selectAddress.vue @@ -3,7 +3,7 @@ 地理位置 + :enable-zoom="true" :enable-scroll="true"> 检查以确保以下地址是正确的 From 9f8d96510a06114109aa222bd6d9cc629534ecd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8C=83=E9=B9=8F?= Date: Sat, 7 Sep 2024 18:01:20 +0800 Subject: [PATCH 05/10] v1.0.0+10 --- manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index 54b76d7..e9f0186 100644 --- a/manifest.json +++ b/manifest.json @@ -3,7 +3,7 @@ "appid" : "__UNI__933D519", "description" : "", "versionName" : "1.0.0", - "versionCode" : "9", + "versionCode" : "10", "transformPx" : false, /* 小程序特有相关 */ "mp-weixin" : { From 56a9837c9c09506f30e664183ce6b67ff51c59e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8C=83=E9=B9=8F?= Date: Sat, 7 Sep 2024 18:31:03 +0800 Subject: [PATCH 06/10] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=AE=9E=E5=90=8D?= =?UTF-8?q?=E8=AE=A4=E8=AF=81=E5=BC=95=E5=AF=BC=E5=8E=BBapp=E6=8F=90?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/lockDetail/lockDetail.vue | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pages/lockDetail/lockDetail.vue b/pages/lockDetail/lockDetail.vue index 2c14044..705d81e 100644 --- a/pages/lockDetail/lockDetail.vue +++ b/pages/lockDetail/lockDetail.vue @@ -137,6 +137,15 @@ export default { } }, async openDoorOperate(type) { + if(this.currentLockInfo.faceAuthentication === 1 && + this.currentLockInfo.nextFaceValidateTime <= new Date().getTime()) { + uni.showModal({ + title: '提示', + content: '开门前需进行实名认证,小程序暂不支持,请使用APP认证开门', + showCancel: false + }) + return + } if(this.pending) { return } From 2037d0d050417067a83b82a3f5851eba1d7c8f81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8C=83=E9=B9=8F?= Date: Sat, 7 Sep 2024 18:34:40 +0800 Subject: [PATCH 07/10] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=AE=9E=E5=90=8D?= =?UTF-8?q?=E8=AE=A4=E8=AF=81=E5=BC=95=E5=AF=BC=E5=8E=BBapp=E6=8F=90?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/lockDetail/lockDetail.vue | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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认证开门', From 3ab936b3194cb9ad24dfc9cabd06372d59667ebb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8C=83=E9=B9=8F?= Date: Sat, 7 Sep 2024 18:37:10 +0800 Subject: [PATCH 08/10] v1.0.0+11 --- manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index e9f0186..80e8637 100644 --- a/manifest.json +++ b/manifest.json @@ -3,7 +3,7 @@ "appid" : "__UNI__933D519", "description" : "", "versionName" : "1.0.0", - "versionCode" : "10", + "versionCode" : "11", "transformPx" : false, /* 小程序特有相关 */ "mp-weixin" : { From 46f537842fc62e7c58d01f7bbd72d32f54f71001 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8C=83=E9=B9=8F?= Date: Thu, 12 Sep 2024 13:52:23 +0800 Subject: [PATCH 09/10] =?UTF-8?q?1.=20=E8=BF=9E=E6=8E=A5=E8=AE=BE=E5=A4=87?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=85=9C=E5=BA=95=EF=BC=8C=E9=98=B2=E6=AD=A2?= =?UTF-8?q?loading=E6=97=A0=E6=B3=95=E5=85=B3=E9=97=AD=202.=20=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3=E4=BA=BA=E8=84=B8=E8=AE=A4=E8=AF=81=E7=9A=84=E5=88=A4?= =?UTF-8?q?=E6=96=AD=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- manifest.json | 2 +- pages/lockDetail/lockDetail.vue | 6 +- pages/searchDevice/searchDevice.vue | 86 ++++++++++++++++------------- 3 files changed, 50 insertions(+), 44 deletions(-) diff --git a/manifest.json b/manifest.json index 80e8637..49f5a2f 100644 --- a/manifest.json +++ b/manifest.json @@ -3,7 +3,7 @@ "appid" : "__UNI__933D519", "description" : "", "versionName" : "1.0.0", - "versionCode" : "11", + "versionCode" : "12", "transformPx" : false, /* 小程序特有相关 */ "mp-weixin" : { diff --git a/pages/lockDetail/lockDetail.vue b/pages/lockDetail/lockDetail.vue index 2d4988a..5f2203b 100644 --- a/pages/lockDetail/lockDetail.vue +++ b/pages/lockDetail/lockDetail.vue @@ -83,8 +83,7 @@ export default { onlineToken: '0', pending: false, show: false, - type: '', - serverTime: 0 + type: '' } }, computed: { @@ -134,13 +133,12 @@ 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 <= this.serverTime) { + this.currentLockInfo.nextFaceValidateTime <= new Date().getTime() + this.time * 1000) { uni.showModal({ title: '提示', content: '开门前需进行实名认证,小程序暂不支持,请使用APP认证开门', diff --git a/pages/searchDevice/searchDevice.vue b/pages/searchDevice/searchDevice.vue index a489930..b58d5da 100644 --- a/pages/searchDevice/searchDevice.vue +++ b/pages/searchDevice/searchDevice.vue @@ -66,51 +66,59 @@ export default { name: device.name, deviceId: device.deviceId }) - const result = await this.connectBluetoothDevice() - if(result) { - this.stopGetBluetoothDevices() - const { code: getPublicKeyCode } = await this.getPublicKey(this.currentLockInfo.name) - console.log('获取公钥返回', getPublicKeyCode, [...this.currentLockInfo.publicKey]) - if(getPublicKeyCode !== 0) { + try { + const result = await this.connectBluetoothDevice() + if(result) { + this.stopGetBluetoothDevices() + const { code: getPublicKeyCode } = await this.getPublicKey(this.currentLockInfo.name) + console.log('获取公钥返回', getPublicKeyCode, [...this.currentLockInfo.publicKey]) + if(getPublicKeyCode !== 0) { + uni.hideLoading() + uni.showToast({ + title: '连接失败,请靠近设备并保持设备处于唤醒状态', + icon: 'none' + }) + return + } + const { code: getCommKeyCode } = await this.getCommKey(this.currentLockInfo.name, this.keyId, + this.userInfo.uid.toString(), this.serverTimestamp) + console.log('获取私钥返回', getCommKeyCode) + if(getCommKeyCode !== 0) { + uni.hideLoading() + uni.showToast({ + title: '连接失败,请靠近设备并保持设备处于唤醒状态', + icon: 'none' + }) + return + } + const date = new Date() + const timestamp = parseInt(date.getTime() / 1000) - date.getTimezoneOffset() * 60 + const { code } = await this.getLockStatus({ + name: this.currentLockInfo.name, + uid: this.userInfo.uid, + nowTime: this.serverTimestamp, + localTime: timestamp + }) + if (code !== 0) { + uni.hideLoading() + uni.showToast({ + title: '连接失败,请靠近设备并保持设备处于唤醒状态', + icon: 'none' + }) + return + } + this.routeJump({ + type: 'redirectTo', + name: 'selectAddress' + }) + } else { uni.hideLoading() uni.showToast({ title: '连接失败,请靠近设备并保持设备处于唤醒状态', icon: 'none' }) - return } - const { code: getCommKeyCode } = await this.getCommKey(this.currentLockInfo.name, this.keyId, - this.userInfo.uid.toString(), this.serverTimestamp) - console.log('获取私钥返回', getCommKeyCode) - if(getCommKeyCode !== 0) { - uni.hideLoading() - uni.showToast({ - title: '连接失败,请靠近设备并保持设备处于唤醒状态', - icon: 'none' - }) - return - } - const date = new Date() - const timestamp = parseInt(date.getTime() / 1000) - date.getTimezoneOffset() * 60 - const { code } = await this.getLockStatus({ - name: this.currentLockInfo.name, - uid: this.userInfo.uid, - nowTime: this.serverTimestamp, - localTime: timestamp - }) - if (code !== 0) { - uni.hideLoading() - uni.showToast({ - title: '连接失败,请靠近设备并保持设备处于唤醒状态', - icon: 'none' - }) - return - } - this.routeJump({ - type: 'redirectTo', - name: 'selectAddress' - }) - } else { + } catch (res) { uni.hideLoading() uni.showToast({ title: '连接失败,请靠近设备并保持设备处于唤醒状态', From 373cbdbb358186f97866603724ceef3995057d7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8C=83=E9=B9=8F?= Date: Thu, 12 Sep 2024 14:16:22 +0800 Subject: [PATCH 10/10] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E4=BA=BA=E8=84=B8?= =?UTF-8?q?=E8=AE=A4=E8=AF=81=E7=9A=84=E5=88=A4=E6=96=AD=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/lockDetail/lockDetail.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pages/lockDetail/lockDetail.vue b/pages/lockDetail/lockDetail.vue index 5f2203b..42802ec 100644 --- a/pages/lockDetail/lockDetail.vue +++ b/pages/lockDetail/lockDetail.vue @@ -138,7 +138,8 @@ export default { }, async openDoorOperate(type) { if(this.currentLockInfo.faceAuthentication === 1 && - this.currentLockInfo.nextFaceValidateTime <= new Date().getTime() + this.time * 1000) { + ((this.currentLockInfo.nextFaceValidateTime <= new Date().getTime() + this.time * 1000) && + this.currentLockInfo.nextFaceValidateTime !== 0)) { uni.showModal({ title: '提示', content: '开门前需进行实名认证,小程序暂不支持,请使用APP认证开门',