diff --git a/pages/home/home.vue b/pages/home/home.vue index fa6c9dc..e8d25cb 100644 --- a/pages/home/home.vue +++ b/pages/home/home.vue @@ -24,10 +24,8 @@ + 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 {