完善小程序权限未开启的引导

This commit is contained in:
范鹏 2024-09-02 10:06:36 +08:00
parent 21a587d9ad
commit 151328fd33
2 changed files with 31 additions and 4 deletions

View File

@ -88,7 +88,8 @@
title: '加载中',
mask: true
})
const accountInfo = wx.getAccountInfoSync()
const accountInfo = uni.getAccountInfoSync()
console.log(accountInfo)
getApp().globalData.appid = accountInfo.miniProgram.appId
getApp().globalData.envVersion = accountInfo.miniProgram.envVersion
this.deviceInfo = await this.getDeviceInfo()

View File

@ -160,6 +160,15 @@ export const useBluetoothStore = defineStore('ble', {
content: '蓝牙功能需要附近设备权限,请前往设置开启微信的附近设备权限后再试',
showCancel: false,
confirmText: '确定',
success(res) {
if (res.confirm) {
uni.openAppAuthorizeSetting({
success (res) {
console.log(res)
}
})
}
}
})
}
resolve(false)
@ -430,11 +439,15 @@ export const useBluetoothStore = defineStore('ble', {
title: '提示',
content: '安卓手机蓝牙功能需要定位权限,请前往设置开启微信的定位权限后再试',
showCancel: false,
confirmText: '重试',
success(res) {
if (res.confirm) {
that.getBluetoothDevices()
uni.openAppAuthorizeSetting({
success (res) {
console.log(res)
}
})
}
uni.navigateBack()
}
})
}
@ -464,6 +477,11 @@ export const useBluetoothStore = defineStore('ble', {
content: '长时间未搜索到任何设备,请确认微信的附近设备权限开启后再试',
showCancel: false,
success() {
uni.openAppAuthorizeSetting({
success (res) {
console.log(res)
}
})
uni.navigateBack()
}
})
@ -507,7 +525,15 @@ export const useBluetoothStore = defineStore('ble', {
title: '提示',
content: '蓝牙尚未打开,请先打开蓝牙',
showCancel: false,
confirmText: '确定',
success(res) {
if (res.confirm) {
wx.openSystemBluetoothSetting({
success (res) {
console.log(res)
}
})
}
}
})
} else if(this.bluetoothStatus === 2 || this.bluetoothStatus === 3) {
uni.showModal({