From aaa0b07891770b93dfcb97c0c6c86f0f9b3175b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8C=83=E9=B9=8F?= Date: Tue, 4 Mar 2025 10:17:17 +0800 Subject: [PATCH] fix bug --- pages/autoLock/autoLock.vue | 3 +++ pages/lockUser/lockUser.vue | 1 + pages/noticeDetail/noticeDetail.vue | 7 ++++--- pages/noticeWay/noticeWay.vue | 12 ++++++++---- pages/openDirection/openDirection.vue | 9 +++++++++ 5 files changed, 25 insertions(+), 7 deletions(-) diff --git a/pages/autoLock/autoLock.vue b/pages/autoLock/autoLock.vue index 1e49fe2..e3f958c 100644 --- a/pages/autoLock/autoLock.vue +++ b/pages/autoLock/autoLock.vue @@ -34,6 +34,9 @@ 经过以上设定的时间,锁会自动关闭。开启或修改设置后,请先开一次锁,使时间生效。 + + 注:设定时间过短可能导致锁寿命缩短,建议设定时间不低于10秒。 + { uni.showModal({ - title: '提示', - content: '确定删除吗?', + title: '是否删除家人?', + content: '删除家人后,你将不会收到他到家的消息', + confirmText: '删除', success: async res => { if (res.confirm) { if (pending.value) return diff --git a/pages/noticeWay/noticeWay.vue b/pages/noticeWay/noticeWay.vue index 37ba193..d7372e2 100644 --- a/pages/noticeWay/noticeWay.vue +++ b/pages/noticeWay/noticeWay.vue @@ -114,7 +114,7 @@ const confirm = () => { for (let i = 0; i < emailList.value.length; i++) { - if (test.email(emailList.value[i].account) === false) { + if (test.email(emailList.value[i].account) === false && emailList.value[i].account !== '') { uni.showToast({ title: '含不符合规范的邮箱', icon: 'none' @@ -123,7 +123,7 @@ } } for (let i = 0; i < smsList.value.length; i++) { - if (test.mobile(smsList.value[i].account) === false) { + if (test.mobile(smsList.value[i].account) === false && smsList.value[i].account !== '') { uni.showToast({ title: '含不符合规范的手机号', icon: 'none' @@ -131,10 +131,14 @@ return } } + + const email = emailList.value.filter(item => item.account !== '') + const sms = smsList.value.filter(item => item.account !== '') + eventChannel.emit('confirm', { noticeWay: [ - { type: 'mail', accounts: emailList.value }, - { type: 'sms', accounts: smsList.value } + { type: 'mail', accounts: email }, + { type: 'sms', accounts: sms } ] }) } diff --git a/pages/openDirection/openDirection.vue b/pages/openDirection/openDirection.vue index a159a80..37e4b19 100644 --- a/pages/openDirection/openDirection.vue +++ b/pages/openDirection/openDirection.vue @@ -49,9 +49,11 @@ import { updateLockSettingRequest } from '@/api/setting' import { useBluetoothStore } from '@/stores/bluetooth' import { useUserStore } from '@/stores/user' + import { useBasicStore } from '@/stores/basic' const $bluetooth = useBluetoothStore() const $user = useUserStore() + const $basic = useBasicStore() const value = ref(0) @@ -63,6 +65,10 @@ const updateValue = async val => { if (pending.value || value.value === val) return + const netWork = await $basic.getNetworkType() + if (!netWork) { + return + } pending.value = true uni.showLoading({ title: '更新中' @@ -102,6 +108,9 @@ icon: 'none' }) } + } else if (code === -21) { + pending.value = false + uni.hideLoading() } else { pending.value = false uni.hideLoading()