fix: 操作更so设置提示更新失败,无网络、无蓝牙应有相应的提示

This commit is contained in:
Liuyf 2025-03-27 13:54:19 +08:00
parent a7af767a21
commit 1e7adda734

View File

@ -54,7 +54,9 @@
import { updateLockSettingRequest } from '@/api/setting'
import { useBluetoothStore } from '@/stores/bluetooth'
import { useUserStore } from '@/stores/user'
import { useBasicStore } from '../../stores/basic'
const $basic = useBasicStore()
const $bluetooth = useBluetoothStore()
const $user = useUserStore()
@ -67,6 +69,10 @@
})
const updateValue = async val => {
const netWork = await $basic.getNetworkType()
if (!netWork) {
return
}
if (pending.value || value.value === val) return
pending.value = true
uni.showLoading({
@ -81,6 +87,7 @@
withParams: true
})
$bluetooth.closeBluetoothConnection()
console.log('code-', code)
if (code === 0) {
const { code, message } = await updateLockSettingRequest({
lockId: $bluetooth.currentLockInfo.lockId,