[AI Generated]: fix(Comp): 新增codeClearDeviceData 15秒超时保护防止loading无法关闭
This commit is contained in:
@@ -207,8 +207,14 @@ Component({
|
|||||||
|
|
||||||
wx.showLoading({ title: "正在同步用户数据...", mask: true });
|
wx.showLoading({ title: "正在同步用户数据...", mask: true });
|
||||||
|
|
||||||
// 第一步:清除秤上所有用户信息
|
// 第一步:清除秤上所有用户信息(15秒超时保护)
|
||||||
|
let clearTimer = setTimeout(() => {
|
||||||
|
wx.hideLoading();
|
||||||
|
wx.showToast({ title: "清除设备数据超时,请重试", icon: "none" });
|
||||||
|
}, 15000);
|
||||||
|
|
||||||
app.globalData.ppScale.activeProtocol.codeClearDeviceData("01", (clearRes) => {
|
app.globalData.ppScale.activeProtocol.codeClearDeviceData("01", (clearRes) => {
|
||||||
|
clearTimeout(clearTimer);
|
||||||
console.log("codeClearDeviceData res", clearRes);
|
console.log("codeClearDeviceData res", clearRes);
|
||||||
if (clearRes !== 0x00) {
|
if (clearRes !== 0x00) {
|
||||||
wx.hideLoading();
|
wx.hideLoading();
|
||||||
|
|||||||
Reference in New Issue
Block a user