feat: 训练完成后首页 streak 卡片高亮 3 秒

timer 记录保存时写 _last_train_at 时间戳,index onShow 检测
< 10s 的标记则触发 just-completed class,卡片脉冲 2 次 + 主题色
边框 + 阴影,3 秒后自动淡出。让'完成训练'的反馈在首页也可见。
This commit is contained in:
2026-07-08 14:13:50 +08:00
parent c0f7ca612c
commit f052327276
4 changed files with 43 additions and 1 deletions
+4
View File
@@ -292,6 +292,10 @@ Page({
})
storage.updateStreak(today)
// Flag the just-completed training so the index page can briefly
// highlight the "今日已完成" badge when the user lands back there.
try { wx.setStorageSync('_last_train_at', Date.now()) } catch (e) {}
wx.showToast({ title: `已记录 ${elapsed}`, icon: 'none', duration: 1500 })
setTimeout(() => { wx.navigateBack() }, 1500)
}