From 46738dd7cdd6c9c269a38d1ae3b7f67fc95e8a58 Mon Sep 17 00:00:00 2001 From: cnliucheng Date: Wed, 24 Jun 2026 12:29:33 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=A6=9C=E5=8D=95=E4=BA=91=E5=87=BD?= =?UTF-8?q?=E6=95=B0=E5=A4=B1=E8=B4=A5=E6=97=B6=E4=BB=85=E6=97=A0=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E6=89=8D=E6=8F=90=E7=A4=BAtoast=EF=BC=8C=E9=81=BF?= =?UTF-8?q?=E5=85=8D=E5=B7=B2=E6=9C=89=E6=95=B0=E6=8D=AE=E6=97=B6=E8=AF=AF?= =?UTF-8?q?=E5=BC=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude --- config.js | 2 +- pages/leaderboard/leaderboard.js | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/config.js b/config.js index adbc7ff..2dc516b 100644 --- a/config.js +++ b/config.js @@ -4,7 +4,7 @@ */ module.exports = { /** 应用版本号,外显在设置页「关于」 */ - version: 'v1.5', + version: 'v2.0', /** 最后更新日期,外显在设置页「关于」 */ updatedAt: '2026-06-24', diff --git a/pages/leaderboard/leaderboard.js b/pages/leaderboard/leaderboard.js index e7061b8..2df1620 100644 --- a/pages/leaderboard/leaderboard.js +++ b/pages/leaderboard/leaderboard.js @@ -66,10 +66,14 @@ Page({ if (cb) cb() }).catch((err) => { // Cloud function not deployed or network error — fall back to - // local data but let the user know the leaderboard is degraded. + // local data. Only show a toast if we have nothing to display + // yet (avoid confusing toast when a retry already has data). console.warn('[leaderboard] cloud function failed, using local fallback:', err) - wx.showToast({ title: '云端榜单暂不可用', icon: 'none', duration: 2000 }) + 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() }) },