diff --git a/pages/setting/setting.vue b/pages/setting/setting.vue
index ef1f186..bcf9222 100644
--- a/pages/setting/setting.vue
+++ b/pages/setting/setting.vue
@@ -38,6 +38,15 @@
删除
+
+
+
+
+ 同时删除其发送的所有钥匙,钥匙删除后不能恢复
+
+
+
@@ -54,7 +63,9 @@ import { useBasicStore } from '@/stores/basic'
export default {
data () {
return {
- unlockApp: 0
+ unlockApp: 0,
+ showModal: false,
+ checked: false
}
},
computed: {
@@ -69,6 +80,39 @@ export default {
...mapActions(useBluetoothStore, ['resetDevice', 'updateCurrentLockInfo']),
...mapActions(useLockStore, ['getLockList', 'updateLockSearch']),
...mapActions(useBasicStore, ['backAndToast']),
+ changeRadio() {
+ this.checked = !this.checked
+ },
+ cancelModal() {
+ this.showModal = false
+ this.checked = false
+ },
+ async confirmModal() {
+ uni.showLoading({
+ title: '删除中',
+ mask: true
+ })
+ const that = this
+ const { code } = await deleteKeyRequest({
+ keyId: that.keyId,
+ includeUnderlings: that.checked ? 1 : 0
+ })
+ if(code === 0) {
+ uni.hideLoading()
+ that.updateLockSearch({
+ ...that.lockSearch,
+ pageNo: 1
+ })
+ that.getLockList(that.lockSearch)
+ that.backAndToast('删除成功', 2)
+ } else {
+ uni.hideLoading()
+ uni.showToast({
+ title: 'message',
+ icon: 'none'
+ })
+ }
+ },
async changeUnlockApp(value) {
uni.showLoading({
title: '更新中',
@@ -98,6 +142,10 @@ export default {
},
deleteLock() {
const that = this
+ if(this.currentLockInfo.userType !== 110301 && this.currentLockInfo.keyRight === 1) {
+ this.showModal = true
+ return
+ }
const message = that.currentLockInfo.userType === 110301 ? '删除锁后,所有信息都会一起删除,确定删除锁吗?' : '确定删除该钥匙吗?'
uni.showModal({
title: '提示',
@@ -215,4 +263,21 @@ page {
height: 3rpx;
background: #EBEBEB;
}
+
+
+radio .wx-radio-input.wx-radio-input-checked {
+ border: none;
+ background: #c1885a;
+}
+radio .wx-radio-input.wx-radio-input-checked::before {
+ border-radius: 50%; /* 圆角 */
+ width: 28rpx; /* 选中后对勾大小,不要超过背景的尺寸 */
+ height: 28rpx; /* 选中后对勾大小,不要超过背景的尺寸 */
+ line-height: 28rpx;
+ text-align: center;
+ font-size: 20rpx; /* 对勾大小 30rpx */
+ color: #fff; /* 对勾颜色 白色 */
+ background: #c1885a;
+ transform: translate(-50%, -50%) scale(1);
+}