From 86c398b754d324cd7b49a8e8b1e965b6442cba6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8C=83=E9=B9=8F?= Date: Thu, 29 Aug 2024 16:18:49 +0800 Subject: [PATCH] =?UTF-8?q?1.=20=E4=BF=AE=E5=A4=8D=E5=AE=89=E5=8D=93?= =?UTF-8?q?=E6=89=8B=E6=9C=BA=E8=93=9D=E7=89=99=E6=90=9C=E7=B4=A2=E9=9C=80?= =?UTF-8?q?=E8=A6=81=E5=AE=9A=E4=BD=8D=E6=9D=83=E9=99=90=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98=202.=20=E5=88=A0=E9=99=A4=E4=BB=A5=E5=89=8D=E7=9A=84?= =?UTF-8?q?=E8=93=9D=E7=89=99=E6=93=8D=E4=BD=9Cdemo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages.json | 3 - pages/index/index.vue | 205 ------------------------------------------ stores/bluetooth.js | 17 ++++ 3 files changed, 17 insertions(+), 208 deletions(-) delete mode 100644 pages/index/index.vue diff --git a/pages.json b/pages.json index e51e3c5..c8331f0 100644 --- a/pages.json +++ b/pages.json @@ -21,9 +21,6 @@ { "path": "pages/mine/mine" }, - { - "path": "pages/index/index" - }, { "path": "pages/userInfo/userInfo", "style": { diff --git a/pages/index/index.vue b/pages/index/index.vue deleted file mode 100644 index dc0afa9..0000000 --- a/pages/index/index.vue +++ /dev/null @@ -1,205 +0,0 @@ - - - - - diff --git a/stores/bluetooth.js b/stores/bluetooth.js index 9bbf236..33a66f1 100644 --- a/stores/bluetooth.js +++ b/stores/bluetooth.js @@ -373,6 +373,19 @@ export const useBluetoothStore = defineStore('ble', { }, fail: async function (res) { console.log('开始搜索失败', res) + if(res.errno === 1509008) { + uni.showModal({ + title: '提示', + content: '安卓手机蓝牙功能需要定位权限,请前往设置开启微信的定位权限后再试', + showCancel: false, + confirmText: '重试', + success(res) { + if (res.confirm) { + that.getBluetoothDevices() + } + } + }) + } if(res.errCode === 10000) { // 重新初始化蓝牙适配器 await that.initBluetooth() @@ -550,6 +563,10 @@ export const useBluetoothStore = defineStore('ble', { }) }, fail(res) { + if(res.errno === 1509007) { + resolve(true) + return + } uni.showToast({ title: '连接失败,请靠近设备并保持设备处于唤醒状态', icon: 'none'