fix: 缓存击穿/play竞态/onUnload泄漏/清除数据UI/统计NaN

- leaderboard 云函数: _fetchLatestByOpenid 加 in-flight promise,并发请求复用同一次扫描,防缓存击穿
- voice: play 加序列号,丢弃过期播放,避免旧语音截断新语音
- timer: onUnload 补取消 _completionCountUp,系统返回手势不再泄漏动画定时器
- settings: 清除数据 setData 补 voiceGender/vibrateIntensity 重置,避免 UI 与存储不一致
- storage: getTotalStats 对 r.duration 防御(Number||0),避免脏数据产生 NaN 传染

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
liucheng
2026-07-25 15:01:51 +08:00
parent 41aa81083f
commit 983ae1b9cb
5 changed files with 19 additions and 2 deletions
+2
View File
@@ -371,6 +371,8 @@ Page({
currentPlanId: 'beginner',
voiceGuide: true,
vibrate: true,
voiceGender: 'female',
vibrateIntensity: 'heavy',
currentThemeId: 'orange',
nickName: '',
avatarUrl: ''
+4
View File
@@ -292,6 +292,10 @@ Page({
this._countUpTask.cancel()
this._countUpTask = null
}
if (this._completionCountUp) {
this._completionCountUp.cancel()
this._completionCountUp = null
}
},
onStart() {