From 95782739068dbed385303541b63f58ae32ffa2fd Mon Sep 17 00:00:00 2001 From: cnliucheng Date: Wed, 24 Jun 2026 12:30:51 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=A7=BB=E9=99=A4=E6=A6=9C=E5=8D=95?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5toast=EF=BC=8C=E9=81=BF=E5=85=8D=E6=97=A0?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=97=B6=E8=AF=AF=E5=AF=BC=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E4=BB=A5=E4=B8=BA=E4=BA=91=E7=AB=AF=E6=95=85=E9=9A=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 日榜无数据是正常业务场景(用户当天未训练),弹toast会 让用户误解为系统故障。本地fallback已提供足够的降级体验。 Co-Authored-By: Claude --- pages/leaderboard/leaderboard.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/pages/leaderboard/leaderboard.js b/pages/leaderboard/leaderboard.js index 2df1620..5c9afc5 100644 --- a/pages/leaderboard/leaderboard.js +++ b/pages/leaderboard/leaderboard.js @@ -66,14 +66,11 @@ Page({ if (cb) cb() }).catch((err) => { // Cloud function not deployed or network error — fall back to - // local data. Only show a toast if we have nothing to display - // yet (avoid confusing toast when a retry already has data). + // local data silently. No toast here: empty day-leaderboard is + // normal (user didn't train today), and a toast would mislead + // them into thinking the cloud is broken. console.warn('[leaderboard] cloud function failed, using local fallback:', err) - const hadData = this.data.rankedList && this.data.rankedList.length > 0 this._applyLocal() - if (!hadData && (!this.data.rankedList || this.data.rankedList.length === 0)) { - wx.showToast({ title: '云端榜单暂不可用', icon: 'none', duration: 2000 }) - } if (cb) cb() }) },