2 Commits
Author SHA1 Message Date
17792275749 3551fb332a 删除隐私协议 2026-05-13 11:21:20 +08:00
17792275749 6e3ccd73a8 处理固件调用时机的问题 2026-05-13 10:59:59 +08:00
4 changed files with 37 additions and 41 deletions
+1
View File
@@ -138,6 +138,7 @@ App({
mac: null, // 选中的设备mac地址/SN码 mac: null, // 选中的设备mac地址/SN码
connection: null, // 默认选中连接的设备 connection: null, // 默认选中连接的设备
connectState: null, // 当前连接设备的状态 connectState: null, // 当前连接设备的状态
version: null, // 当前连接设备的固件版本
}, },
reconnect: { reconnect: {
count: 0, // 当前已重连次数 count: 0, // 当前已重连次数
@@ -19,13 +19,11 @@ Component({
return; return;
} }
ppScale.plugin.bus.subscribe("deviceInfo", (res) => { const res = ppScale.device.version;
console.log("===》deviceInfo", res);
// 解析固件版本号:格式 "006.005.004.305" → [mcu, ble, wifi, res] // 解析固件版本号:格式 "006.005.004.305" → [mcu, ble, wifi, res]
const [mcuVer, bleVer, wifiVer, resVer] = (res.firmwareRevision || "").split("."); const [mcuVer, bleVer, wifiVer, resVer] = (res.firmwareRevision || "").split(".");
$.ajax("weighingScale/v2/select/user", { $.ajax("weighingScale/v2/firmware/version", {
type: res.modelNumber type: res.modelNumber
}, "GET", false, "").then(serverRes => { }, "GET", false, "").then(serverRes => {
if (serverRes.result) { if (serverRes.result) {
@@ -55,7 +53,6 @@ Component({
}).catch(() => { }).catch(() => {
wx.showToast({ title: '获取最新版本失败', icon: 'none' }); wx.showToast({ title: '获取最新版本失败', icon: 'none' });
}); });
});
} }
} }
}); });
+5
View File
@@ -123,6 +123,11 @@ Page({
device: device device: device
}) })
ppScale.plugin.Blue.createBLEConnection(device); ppScale.plugin.Blue.createBLEConnection(device);
ppScale.plugin.bus.subscribe("deviceInfo", (res) => {
console.log("===》deviceInfo", res);
ppScale.device.version = res;
})
} }
}, },
-7
View File
@@ -20,13 +20,6 @@
<view>更换网络</view> <view>更换网络</view>
<view></view> <view></view>
</view> </view>
<view class="list arrowAfter">
<view>
<image src="/images/my/3.png" />
</view>
<view>隐私协议</view>
<view></view>
</view>
</view> </view>
</view> </view>