bugfix
This commit is contained in:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user