diff --git a/pages/lockDetail/lockDetail.vue b/pages/lockDetail/lockDetail.vue index 4f5d080..a1d5db4 100644 --- a/pages/lockDetail/lockDetail.vue +++ b/pages/lockDetail/lockDetail.vue @@ -153,6 +153,19 @@ export default { title: `${type === 'close' ? '关' : '开'}锁成功`, icon: 'none' }) + if(this.currentLockInfo.keyType === 3) { + const { code: deleteKeyCode } = await deleteKeyRequest({ + keyId: this.keyId + }) + if(deleteKeyCode === 0) { + this.updateLockSearch({ + ...this.lockSearch, + pageNo: 1 + }) + this.getLockList(this.lockSearch) + this.backAndToast('单次钥匙已在被使用后删除', 1) + } + } } else if(code === 13) { uni.showToast({ title: `只能在循环时间内操作门锁`, @@ -164,19 +177,6 @@ export default { icon: 'none' }) } - if(this.currentLockInfo.keyType === 3) { - const { code: deleteKeyCode } = await deleteKeyRequest({ - keyId: this.keyId - }) - if(deleteKeyCode === 0) { - this.updateLockSearch({ - ...this.lockSearch, - pageNo: 1 - }) - this.getLockList(this.lockSearch) - this.backAndToast('单次钥匙已在被使用后删除', 1) - } - } this.$refs.loading.close() this.pending = false }