fix: 操作更so设置提示更新失败,无网络、无蓝牙应有相应的提示
This commit is contained in:
parent
a7af767a21
commit
1e7adda734
@ -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,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user