From 06ebc96086e3d48efaf9761274cb8c2aab2e8e6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8C=83=E9=B9=8F?= Date: Fri, 16 May 2025 14:23:41 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=9C=A8=E5=A4=9A=E4=B8=AA=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E4=B8=AD=E6=B7=BB=E5=8A=A0=E5=B0=8F=E7=A8=8B=E5=BA=8F?= =?UTF-8?q?=E7=8E=AF=E5=A2=83=E4=B8=8B=E7=9A=84=E8=B4=A6=E5=8F=B7=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E8=8E=B7=E5=8F=96=E5=92=8C=E8=93=9D=E7=89=99=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App.vue | 7 ++++--- pages/main/customBox.vue | 2 ++ pages/main/home.vue | 8 ++++++++ pages/main/lockDetail.vue | 10 +++++++++- stores/bluetooth.js | 3 +++ 5 files changed, 26 insertions(+), 4 deletions(-) diff --git a/App.vue b/App.vue index 068b41e..092e580 100644 --- a/App.vue +++ b/App.vue @@ -39,11 +39,12 @@ // #ifdef MP-WEIXIN // 检查强制升级 this.updateMiniProgram() - // #endif - // 监听蓝牙开关状态 - this.onBluetoothState() // 设置voip配置 this.setVoipConfig() + // #endif + + // 监听蓝牙开关状态 + this.onBluetoothState() // 检查蓝牙权限 const checkResult = await this.checkSetting() console.log(checkResult) diff --git a/pages/main/customBox.vue b/pages/main/customBox.vue index c616fe2..50031ff 100644 --- a/pages/main/customBox.vue +++ b/pages/main/customBox.vue @@ -38,9 +38,11 @@ const time = ref(0) onMounted(async () => { + // #ifdef MP-WEIXIN const accountInfo = uni.getAccountInfoSync() getApp().globalData.appid = accountInfo.miniProgram.appId getApp().globalData.envVersion = accountInfo.miniProgram.envVersion + // #endif const result = await passthrough({ request_method: 'POST', diff --git a/pages/main/home.vue b/pages/main/home.vue index 93cdf65..9fe1cd9 100644 --- a/pages/main/home.vue +++ b/pages/main/home.vue @@ -218,9 +218,11 @@ title: '加载中', mask: true }) + // #ifdef MP-WEIXIN const accountInfo = uni.getAccountInfoSync() getApp().globalData.appid = accountInfo.miniProgram.appId getApp().globalData.envVersion = accountInfo.miniProgram.envVersion + // #endif this.deviceInfo = await this.getDeviceInfo() const token = getStorage('token') if (token) { @@ -243,9 +245,12 @@ await this.homeLogin() this.pending = false uni.hideLoading() + console.log('登录成功') } + // #ifdef MP-WEIXIN const _data = JSON.parse(JSON.stringify(data)) this.shareJump(_data) + // #endif }, methods: { timeFormat, @@ -403,6 +408,7 @@ homeLogin() { const that = this return new Promise(resolve => { + // #ifdef MP-WEIXIN uni.login({ provider: 'weixin', async success(loginRes) { @@ -437,6 +443,8 @@ resolve(false) } }) + // #endif + resolve(false) }) }, changeRadio() { diff --git a/pages/main/lockDetail.vue b/pages/main/lockDetail.vue index fd85034..71ec3d1 100644 --- a/pages/main/lockDetail.vue +++ b/pages/main/lockDetail.vue @@ -172,7 +172,11 @@ > 掌静脉 - + 授权管理员 @@ -201,6 +206,7 @@ 操作记录 @@ -223,6 +229,7 @@ { + // #ifdef MP-WEIXIN uni.getSetting({ async success(res) { const bluetooth = res.authSetting['scope.bluetooth'] @@ -924,6 +925,8 @@ export const useBluetoothStore = defineStore('ble', { resolve(false) } }) + // #endif + resolve(false) }) }, // 连接蓝牙设备+获取设备服务+获取设备特征值