diff --git a/pages/main/lockDetail.vue b/pages/main/lockDetail.vue
index 3cc70b9..f68c6be 100644
--- a/pages/main/lockDetail.vue
+++ b/pages/main/lockDetail.vue
@@ -78,7 +78,10 @@
@@ -91,7 +94,8 @@
监控
@@ -217,7 +229,10 @@
门锁记录
@@ -240,7 +255,11 @@
-
+
设置
+ 删除
+
{
+ const netWork = await $basic.getNetworkType()
+ if (!netWork) {
+ return
+ }
+
+ const message = '删除锁后,所有信息都会一起删除,确定删除锁吗?'
+
+ uni.showModal({
+ title: '提示',
+ content: message,
+ async success(res) {
+ if (res.confirm) {
+ uni.showLoading({
+ title: '删除中'
+ })
+ const { code: resetDeviceCode } = await $bluetooth.resetDevice({
+ name: $bluetooth.currentLockInfo.name,
+ authUid: $user.userInfo.uid.toString(),
+ keyId: $bluetooth.keyId.toString()
+ })
+ if (resetDeviceCode === 0 || resetDeviceCode === -2) {
+ const { code, message } = await deleteLockRequest({
+ lockId: $bluetooth.currentLockInfo.lockId
+ })
+ if (code === 0) {
+ uni.hideLoading()
+ $lock.updateLockSearch({
+ ...$lock.lockSearch,
+ pageNo: 1
+ })
+ $lock.getLockList($lock.lockSearch)
+ $basic.backAndToast('删除成功', 1)
+ } else {
+ uni.hideLoading()
+ uni.showToast({
+ title: message,
+ icon: 'none'
+ })
+ }
+ } else if (resetDeviceCode === -1) {
+ uni.hideLoading()
+ uni.showToast({
+ title: '删除失败,请保持在锁附近',
+ icon: 'none'
+ })
+ }
+ }
+ }
+ })
+ }