From 4afbca8d9653d590faf4d9d5513f6461b463d8f1 Mon Sep 17 00:00:00 2001 From: hzj <1304805162@qq.com> Date: Mon, 15 Sep 2025 18:23:57 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=B4=BB=E5=8A=A8=E9=A1=B5):=20=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E5=8F=AF=E8=83=BD=E4=BC=9A=E5=9C=A8=E5=91=A8=E4=B8=80?= =?UTF-8?q?00=EF=BC=9A00=EF=BC=9A00=E4=B8=8D=E5=88=B7=E6=96=B0=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/TopList/TopList.vue | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/views/TopList/TopList.vue b/src/views/TopList/TopList.vue index bd3739d..63933af 100644 --- a/src/views/TopList/TopList.vue +++ b/src/views/TopList/TopList.vue @@ -816,15 +816,17 @@ const formatTime = (value) => { return value < 10 ? `0${value}` : value } +const targetTime = ref(getNextMonday()) // 闭包保存目标时间 (核心修正) + // 更新倒计时 const getCountdown = () => { const now = Date.now() - const targetTime = getNextMonday() - let diff = targetTime - now + let diff = targetTime.value - now if (diff <= 0) { - diff = getNextMonday() - now updatePageData() // 刷新页面数据 + targetTime.value += 7 * 86400000 // +7天 (更新闭包变量) + diff = targetTime.value - now } // 计算时间单位