[AI Generated]: fix(Comp): 新增codeClearDeviceData 15秒超时保护防止loading无法关闭

This commit is contained in:
17792275749
2026-04-16 11:21:33 +08:00
parent eb16621b5f
commit 2a24dc0d4d
@@ -207,8 +207,14 @@ Component({
wx.showLoading({ title: "正在同步用户数据...", mask: true });
// 第一步:清除秤上所有用户信息
// 第一步:清除秤上所有用户信息15秒超时保护)
let clearTimer = setTimeout(() => {
wx.hideLoading();
wx.showToast({ title: "清除设备数据超时,请重试", icon: "none" });
}, 15000);
app.globalData.ppScale.activeProtocol.codeClearDeviceData("01", (clearRes) => {
clearTimeout(clearTimer);
console.log("codeClearDeviceData res", clearRes);
if (clearRes !== 0x00) {
wx.hideLoading();