diff --git a/pages/home/home.vue b/pages/home/home.vue index 85217a7..1426b33 100644 --- a/pages/home/home.vue +++ b/pages/home/home.vue @@ -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() diff --git a/stores/bluetooth.js b/stores/bluetooth.js index ff42448..5e65a82 100644 --- a/stores/bluetooth.js +++ b/stores/bluetooth.js @@ -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({