fix: 操作更so设置提示更新失败,无网络、无蓝牙应有相应的提示
This commit is contained in:
parent
a7af767a21
commit
1e7adda734
@ -54,7 +54,9 @@
|
|||||||
import { updateLockSettingRequest } from '@/api/setting'
|
import { updateLockSettingRequest } from '@/api/setting'
|
||||||
import { useBluetoothStore } from '@/stores/bluetooth'
|
import { useBluetoothStore } from '@/stores/bluetooth'
|
||||||
import { useUserStore } from '@/stores/user'
|
import { useUserStore } from '@/stores/user'
|
||||||
|
import { useBasicStore } from '../../stores/basic'
|
||||||
|
|
||||||
|
const $basic = useBasicStore()
|
||||||
const $bluetooth = useBluetoothStore()
|
const $bluetooth = useBluetoothStore()
|
||||||
const $user = useUserStore()
|
const $user = useUserStore()
|
||||||
|
|
||||||
@ -67,6 +69,10 @@
|
|||||||
})
|
})
|
||||||
|
|
||||||
const updateValue = async val => {
|
const updateValue = async val => {
|
||||||
|
const netWork = await $basic.getNetworkType()
|
||||||
|
if (!netWork) {
|
||||||
|
return
|
||||||
|
}
|
||||||
if (pending.value || value.value === val) return
|
if (pending.value || value.value === val) return
|
||||||
pending.value = true
|
pending.value = true
|
||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
@ -81,6 +87,7 @@
|
|||||||
withParams: true
|
withParams: true
|
||||||
})
|
})
|
||||||
$bluetooth.closeBluetoothConnection()
|
$bluetooth.closeBluetoothConnection()
|
||||||
|
console.log('code-', code)
|
||||||
if (code === 0) {
|
if (code === 0) {
|
||||||
const { code, message } = await updateLockSettingRequest({
|
const { code, message } = await updateLockSettingRequest({
|
||||||
lockId: $bluetooth.currentLockInfo.lockId,
|
lockId: $bluetooth.currentLockInfo.lockId,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user