From 78c3c43f7b244fa82e682f7ccbff2e15549ce25c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8C=83=E9=B9=8F?= Date: Wed, 4 Sep 2024 14:45:19 +0800 Subject: [PATCH 01/21] =?UTF-8?q?build=EF=BC=9A1=E3=80=820.0+3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index a223d22..812e46b 100644 --- a/manifest.json +++ b/manifest.json @@ -3,7 +3,7 @@ "appid" : "__UNI__933D519", "description" : "", "versionName" : "1.0.0", - "versionCode" : "2", + "versionCode" : "3", "transformPx" : false, /* 小程序特有相关 */ "mp-weixin" : { From 1c79f736a3c2db474952c2074c9eb237add30176 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8C=83=E9=B9=8F?= Date: Wed, 4 Sep 2024 17:38:58 +0800 Subject: [PATCH 02/21] =?UTF-8?q?1.=20=E5=9C=A8=E9=83=A8=E5=88=86=E8=93=9D?= =?UTF-8?q?=E7=89=99=E6=93=8D=E4=BD=9C=E5=90=8E=E6=96=AD=E5=BC=80=E8=93=9D?= =?UTF-8?q?=E7=89=99=E8=BF=9E=E6=8E=A5=202.=20=E7=BB=91=E5=AE=9A=E8=AE=BE?= =?UTF-8?q?=E5=A4=87=E6=88=90=E5=8A=9F=E5=90=8E=E5=BB=B6=E8=BF=9F1?= =?UTF-8?q?=E7=A7=92=E9=80=80=E5=9B=9E=E9=A6=96=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/bindLock/bindLock.vue | 9 ++++++--- pages/lockDetail/lockDetail.vue | 3 ++- pages/passwordDetail/passwordDetail.vue | 3 ++- pages/passwordList/passwordList.vue | 4 +++- pages/setting/setting.vue | 2 +- stores/bluetooth.js | 1 + 6 files changed, 15 insertions(+), 7 deletions(-) diff --git a/pages/bindLock/bindLock.vue b/pages/bindLock/bindLock.vue index df25b3a..03f3160 100644 --- a/pages/bindLock/bindLock.vue +++ b/pages/bindLock/bindLock.vue @@ -33,7 +33,7 @@ export default { console.log(this.name) }, methods: { - ...mapActions(useBluetoothStore, ['addLockUser']), + ...mapActions(useBluetoothStore, ['addLockUser', 'closeBluetoothConnection']), ...mapActions(useLockStore, ['getLockList', 'updateLockSearch']), ...mapActions(useBasicStore, ['backAndToast']), uopdateName(data) { @@ -73,6 +73,7 @@ export default { password }) if(addUserCode === 0) { + this.closeBluetoothConnection() } else if(addUserCode === -1) { uni.hideLoading() this.backAndToast('添加失败,请重试') @@ -120,8 +121,10 @@ export default { pageNo: 1 }) this.getLockList(this.lockSearch) - uni.hideLoading() - this.backAndToast('添加成功') + setTimeout(() => { + uni.hideLoading() + this.backAndToast('添加成功') + }, 1000) } else { uni.hideLoading() uni.showToast({ diff --git a/pages/lockDetail/lockDetail.vue b/pages/lockDetail/lockDetail.vue index d4befbc..a63e467 100644 --- a/pages/lockDetail/lockDetail.vue +++ b/pages/lockDetail/lockDetail.vue @@ -86,7 +86,7 @@ export default { }, methods: { ...mapActions(useLockStore, ['getRole', 'updateLockSearch', 'getLockList', 'getPowerIcon']), - ...mapActions(useBluetoothStore, ['openDoor', 'updateServerTimestamp']), + ...mapActions(useBluetoothStore, ['openDoor', 'updateServerTimestamp', 'closeBluetoothConnection']), ...mapActions(useBasicStore, ['routeJump', 'backAndToast']), powerTip() { const that = this @@ -152,6 +152,7 @@ export default { onlineToken: this.onlineToken }) if(code === 0) { + this.closeBluetoothConnection() uni.showToast({ title: `${type === 'close' ? '关' : '开'}锁成功`, icon: 'none' diff --git a/pages/passwordDetail/passwordDetail.vue b/pages/passwordDetail/passwordDetail.vue index be596f9..6b0c72b 100644 --- a/pages/passwordDetail/passwordDetail.vue +++ b/pages/passwordDetail/passwordDetail.vue @@ -52,7 +52,7 @@ export default { }, methods: { timeFormat, - ...mapActions(useBluetoothStore, ['setLockPassword']), + ...mapActions(useBluetoothStore, ['setLockPassword', 'closeBluetoothConnection']), ...mapActions(useLockStore, ['updatePasswordSearch', 'getPasswordList']), ...mapActions(useBasicStore, ['backAndToast']), async deletePassword () { @@ -79,6 +79,7 @@ export default { endTime: timestamp }) if(code === 0) { + that.closeBluetoothConnection() const { code: requestCode, message } = await deletePsaawordRequest({ lockId: that.currentLockInfo.lockId, keyboardPwdId: that.currentPasswordInfo.keyboardPwdId, diff --git a/pages/passwordList/passwordList.vue b/pages/passwordList/passwordList.vue index bcf00a1..4917852 100644 --- a/pages/passwordList/passwordList.vue +++ b/pages/passwordList/passwordList.vue @@ -87,7 +87,7 @@ export default { methods: { ...mapActions(useBasicStore, ['routeJump', 'getDeviceInfo']), ...mapActions(useLockStore, ['getPasswordList', 'updateCurrentPasswordInfo', 'updatePasswordSearch', 'getPasswordStatus']), - ...mapActions(useBluetoothStore, ['resetLockPassword', 'setLockPassword']), + ...mapActions(useBluetoothStore, ['resetLockPassword', 'setLockPassword', 'closeBluetoothConnection']), toPasswordDetail(password) { this.updateCurrentPasswordInfo(password) this.routeJump({ @@ -121,6 +121,7 @@ export default { endTime: timestamp }) if(code === 0) { + that.closeBluetoothConnection() const { code: requestCode, message } = await deletePsaawordRequest({ lockId: that.currentLockInfo.lockId, keyboardPwdId: password.keyboardPwdId, @@ -180,6 +181,7 @@ export default { keyId: that.currentLockInfo.keyId.toString() }) if(code === 0) { + that.closeBluetoothConnection() const { code: requestCode, message } = await resetPsaawordListRequest({ lockId: that.currentLockInfo.lockId, passwordKey: that.currentLockInfo.bluetooth.passwordKey diff --git a/pages/setting/setting.vue b/pages/setting/setting.vue index 5ebb714..b9af61f 100644 --- a/pages/setting/setting.vue +++ b/pages/setting/setting.vue @@ -220,7 +220,7 @@ export default { icon: 'none' }) } - } else if(code === -1) { + } else if(resetDeviceCode === -1) { uni.hideLoading() uni.showToast({ title: '删除失败,请保持在锁附近', diff --git a/stores/bluetooth.js b/stores/bluetooth.js index 3b111ff..a9e79b2 100644 --- a/stores/bluetooth.js +++ b/stores/bluetooth.js @@ -746,6 +746,7 @@ export const useBluetoothStore = defineStore('ble', { for(let i = 0; i < deviceList.length; i++) { if(deviceList[i]?.name === that.currentLockInfo.name) { const uuid = deviceList[i]?.advertisServiceUUIDs[0] + console.log('设备UUID', uuid, uuid.slice(2,8), uuid.slice(30,32)) if(uuid && uuid.slice(2,8)==='758824' && uuid.slice(30,32)==='01') { uni.stopBluetoothDevicesDiscovery() clearTimeout(timer2) From 123e606edbd54b73a06b2bca8617e17c95b82f5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8C=83=E9=B9=8F?= Date: Wed, 4 Sep 2024 18:29:02 +0800 Subject: [PATCH 03/21] v1.0.0+4 --- manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index 812e46b..1664376 100644 --- a/manifest.json +++ b/manifest.json @@ -3,7 +3,7 @@ "appid" : "__UNI__933D519", "description" : "", "versionName" : "1.0.0", - "versionCode" : "3", + "versionCode" : "4", "transformPx" : false, /* 小程序特有相关 */ "mp-weixin" : { From 0ae79f843923c05df5bd7ef60be9c8d414b6bfd4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8C=83=E9=B9=8F?= Date: Thu, 5 Sep 2024 09:20:12 +0800 Subject: [PATCH 04/21] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E9=A1=B5=E9=9D=A2=E6=98=B5=E7=A7=B0=E5=92=8C?= =?UTF-8?q?=E6=89=8B=E6=9C=BA=E5=8F=B7=E5=AD=97=E5=8F=B7=E5=A4=A7=E5=B0=8F?= =?UTF-8?q?=E4=B8=8D=E4=B8=80=E8=87=B4=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/userInfo/userInfo.vue | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pages/userInfo/userInfo.vue b/pages/userInfo/userInfo.vue index 8d3d8c7..98926e7 100644 --- a/pages/userInfo/userInfo.vue +++ b/pages/userInfo/userInfo.vue @@ -266,9 +266,8 @@ page { .name-info { line-height: 40rpx; - font-size: 30rpx; text-align: right; - width: 500rpx; + width: 520rpx; overflow: hidden; word-break: break-all; margin-right: 20rpx; From 1a24dacfb37d4ce56c995930a6ec9997593ee768 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8C=83=E9=B9=8F?= Date: Thu, 5 Sep 2024 10:21:40 +0800 Subject: [PATCH 05/21] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=BC=80=E5=85=B3?= =?UTF-8?q?=E9=94=81=E6=8F=90=E7=A4=BA=E6=96=87=E6=A1=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/lockDetail/lockDetail.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/lockDetail/lockDetail.vue b/pages/lockDetail/lockDetail.vue index a63e467..89369ac 100644 --- a/pages/lockDetail/lockDetail.vue +++ b/pages/lockDetail/lockDetail.vue @@ -127,7 +127,7 @@ export default { this.pending = true this.$refs.loading.open() uni.showToast({ - title: `正在尝试${type === 'close' ? '关' : '开'}锁……`, + title: `正在尝试${type === 'close' ? '闭' : '开'}锁……`, icon: 'none' }) if(this.currentLockInfo.lockSetting.appUnlockOnline) { From 8bd91e5b77ab38f978229cc553fcc3f64795ddbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8C=83=E9=B9=8F?= Date: Thu, 5 Sep 2024 10:42:27 +0800 Subject: [PATCH 06/21] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=A6=96=E9=A1=B5?= =?UTF-8?q?=E5=88=97=E8=A1=A8UI=20bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/home/home.vue | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pages/home/home.vue b/pages/home/home.vue index 627264a..b2d8f98 100644 --- a/pages/home/home.vue +++ b/pages/home/home.vue @@ -22,7 +22,7 @@ {{group.groupName}} - + + lockIndex) in group.lockList" :key="lock.lockId" :threshold="50" @click="deleteLock(lock, + grounIndex, lockIndex)"> @@ -50,7 +48,8 @@ {{ getTimeLimit(lock.keyType) }} @@ -613,6 +612,7 @@ page { } .lock-status { + margin-top: 5rpx; margin-left: 24rpx; color: #FFFFFF; border-radius: 8rpx; diff --git a/pages/lockDetail/lockDetail.vue b/pages/lockDetail/lockDetail.vue index 89369ac..df39cc7 100644 --- a/pages/lockDetail/lockDetail.vue +++ b/pages/lockDetail/lockDetail.vue @@ -51,6 +51,17 @@ 设置 + + + + + {{ currentLockInfo.lockAlias }} + {{ timeFormat('', 'mm/dd h:M') }} + + + @@ -70,7 +81,9 @@ export default { return { time: 0, onlineToken: '0', - pending: false + pending: false, + show: false, + type: '' } }, computed: { @@ -85,9 +98,13 @@ export default { this.getServeTime() }, methods: { + timeFormat, ...mapActions(useLockStore, ['getRole', 'updateLockSearch', 'getLockList', 'getPowerIcon']), ...mapActions(useBluetoothStore, ['openDoor', 'updateServerTimestamp', 'closeBluetoothConnection']), ...mapActions(useBasicStore, ['routeJump', 'backAndToast']), + closePopup() { + this.show = false + }, powerTip() { const that = this const time = timeFormat(that.currentLockInfo.electricQuantityDate, 'yyyy-mm-dd h:M') @@ -126,10 +143,12 @@ export default { uni.vibrateLong() this.pending = true this.$refs.loading.open() - uni.showToast({ - title: `正在尝试${type === 'close' ? '闭' : '开'}锁……`, - icon: 'none' - }) + if(type === 'close') { + uni.showToast({ + title: `正在尝试闭锁……`, + icon: 'none' + }) + } if(this.currentLockInfo.lockSetting.appUnlockOnline) { const result = await this.getNetToken() if(!result) { @@ -153,10 +172,11 @@ export default { }) if(code === 0) { this.closeBluetoothConnection() - uni.showToast({ - title: `${type === 'close' ? '关' : '开'}锁成功`, - icon: 'none' - }) + this.show = true + this.type = type + setTimeout(() => { + this.show = false + }, 3000) if(this.currentLockInfo.keyType === 3) { const { code: deleteKeyCode } = await deleteKeyRequest({ keyId: this.keyId @@ -189,6 +209,45 @@ export default {