[AI Generated]: refactor(*): 重构蓝牙生命周期管理,修复最小化后重连与进度跳步问题
- app.js: 提取 registerBusListeners 方法,新增自动重连机制(3次上限) - configureDevice: bus 订阅迁移至 onShow,deviceConnect 按步骤区分处理逻辑 - configureDevice_2: setUserInfo 兼容 WIFISUCCESS 状态,WXML 覆盖六态 - configureDevice_3: 新增 reInitWifi 方法,最小化后重置 WiFi 列表 - replaceNetwork: 订阅迁移至 onShow,修复 selectComponent 空指针 - replaceNetwork_3: 修复 domain1 配网参数引用错误 - userInfo: 订阅迁移至 onShow,setUserInfo 兼容 WIFISUCCESS - searchDevice: 移除 onLoad 重复初始化,统一由 onShow 处理 - 所有 BLE 页面统一 onHide/onUnload 清理:resetReconnectCount + setGlobalData(null) + stop() Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
6924a1ff5b
commit
81f9301c64
@@ -36,11 +36,11 @@ Component({
|
||||
if (version === 'domain1') {
|
||||
app.globalData.ppScale.activeProtocol.dataConfigNetWork({
|
||||
domain: app.globalData.ppScale.domain1,
|
||||
ssid: this.data.selectWifi.ssid,
|
||||
password: this.data.selectWifiPWD
|
||||
ssid: ssid,
|
||||
password: password
|
||||
}, (res) => {
|
||||
console.log("setNetwork.js dataConfigNetWork 1", res);
|
||||
|
||||
|
||||
this.netWorkCallBack(res);
|
||||
})
|
||||
}
|
||||
@@ -53,7 +53,7 @@ Component({
|
||||
userPassword: "3acebb95eb49577e9c2a2082589b9bd6"
|
||||
}, (res) => {
|
||||
console.log("setNetwork.js dataConfigUserNetWork 2", res);
|
||||
|
||||
|
||||
this.netWorkCallBack(res);
|
||||
})
|
||||
}
|
||||
@@ -61,14 +61,14 @@ Component({
|
||||
|
||||
netWorkCallBack(res) {
|
||||
if(res === 23) {
|
||||
app.globalData.ppScale.wifi.ssid = ssid;
|
||||
app.globalData.ppScale.wifi.password = password;
|
||||
app.globalData.ppScale.wifi.ssid = this.properties.ssid;
|
||||
app.globalData.ppScale.wifi.password = this.properties.password;
|
||||
|
||||
let scaleDeviceId = app.globalData.ppScale.device.mac.replace(/:/g, '');
|
||||
if(scaleDeviceId) {
|
||||
let params = {
|
||||
equipmentCode: scaleDeviceId,
|
||||
wifiName: ssid
|
||||
wifiName: this.properties.ssid
|
||||
};
|
||||
$.ajax("weighingScale/edit/device", params, "POST").then((res) => {
|
||||
this.triggerEvent('wifiEvent', {
|
||||
|
||||
Reference in New Issue
Block a user