This commit is contained in:
2026-09-13 02:35:32 +08:00
parent 42f9530a59
commit e65d4f5189
4 changed files with 32 additions and 2 deletions
+9 -2
View File
@@ -45,10 +45,17 @@ Page({
redirectToLogin()
return
}
// 跨天回到本页时旧数据仍是昨天的,需重新拉取
// 首帧渲染未结束就 setData 会触发「Expected updated data but get first rendering data」,
// 整个 webview 渲染失败,用户视觉上仍看到上一个页面。首次 onShow 的数据拉取延迟到下一帧
const stale =
!this.data.horoscope || Number(this.data.horoscope.stat_date) !== todayStatDate()
if (stale) this.fetchHoroscope(0)
if (!stale) return
if (!(this as any).firstShown) {
;(this as any).firstShown = true
wx.nextTick(() => this.fetchHoroscope(0))
return
}
this.fetchHoroscope(0)
},
syncTabBar() {