[AI Generated]: feat(device): 设备卡片整张可点击,波纹按状态播放,配网/OTA 日志与状态判断完善
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.7
parent
ea52c495f6
commit
b94ffb7995
@@ -118,7 +118,6 @@ Page({
|
||||
const raw = wx.getStorageSync('userInfo') as StorageUserInfo | null
|
||||
if (!raw?.userId) return
|
||||
|
||||
wx.showLoading({ title: '加载中...', mask: true })
|
||||
get<MeasureHistoryVO>('weighingScale/v3/getMeasureHistory', {
|
||||
userId: raw.userId,
|
||||
}, { loading: false })
|
||||
@@ -144,9 +143,6 @@ Page({
|
||||
}
|
||||
this.setData({ hasData: true, record })
|
||||
})
|
||||
.finally(() => {
|
||||
wx.hideLoading()
|
||||
})
|
||||
},
|
||||
|
||||
/** OTA 固件检测,连接成功后自动调用,有新版本直接升级,整个页面生命周期只触发一次 */
|
||||
@@ -154,22 +150,11 @@ Page({
|
||||
if (this._otaChecked) return
|
||||
this._otaChecked = true
|
||||
lefuService.checkAndUpgrade()
|
||||
.then(needUpdate => {
|
||||
if (!needUpdate) return
|
||||
.then(() => {
|
||||
wx.showLoading({ title: '固件升级中...', mask: true })
|
||||
lefuService.checkAndUpgrade()
|
||||
.then(() => {
|
||||
wx.hideLoading()
|
||||
wx.showModal({
|
||||
title: '升级完成',
|
||||
content: '固件升级成功,请重新开启设备',
|
||||
showCancel: false,
|
||||
})
|
||||
})
|
||||
.catch((err: Error) => {
|
||||
wx.hideLoading()
|
||||
wx.showToast({ title: err.message || '升级失败,请重试', icon: 'none' })
|
||||
})
|
||||
setTimeout(() => {
|
||||
wx.hideLoading()
|
||||
}, 15000)
|
||||
})
|
||||
.catch(() => {})
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user