优化蓝牙订阅在首页的弹窗

This commit is contained in:
liub
2026-04-06 14:02:00 +08:00
parent 1e51023c00
commit 2b7ae4ebaa
5 changed files with 232 additions and 208 deletions

View File

@ -22,9 +22,6 @@ const serviceDic = [ //合作供应商的蓝牙主服务
class BleHelper {
constructor() {
this.StorageKey = "linkedDevices";
recei = receivTool.getBleReceive();
this.init();
}
init() {
@ -41,16 +38,12 @@ class BleHelper {
if (!v) return false;
v.Linked = false;
v.notifyState = false;
return !!v.device;
return v.device;
});
}
const systemInfo = uni.getSystemInfoSync();
this.data = {
isOpenBlue: false, //蓝牙模块是否开启
available: false, //蓝牙状态是否可用
@ -71,17 +64,7 @@ class BleHelper {
stateRecoveryCallback: [], //蓝牙适配器恢复可用事件
stateBreakCallback: [] //蓝牙适配器不可用事件
}
//蓝牙模块不再订阅,改到首页订阅
// this.addReceiveCallback((receive, f, path, recArr) => {
// recei.ReceiveData(receive, f, path, recArr);
// }, "BleReceiveData");
// setTimeout(() => {
// this.OpenBlue().then(() => {
// this.linkAllDevices();
// });
// }, 10);
this.dic = {
errRemarks: [{