From 3fd9995e05f93e0366b3eca6ca5038e9087870a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8C=83=E9=B9=8F?= Date: Tue, 3 Sep 2024 14:21:40 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8E=88=E6=9D=83=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E5=91=98=E5=88=A0=E9=99=A4=E9=92=A5=E5=8C=99=E6=B5=81?= =?UTF-8?q?=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/setting/setting.vue | 67 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 66 insertions(+), 1 deletion(-) 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); +}