From 0fecfb430cb0a6a7c670a6f96e1c67c92a80f673 Mon Sep 17 00:00:00 2001 From: BTMuli Date: Sat, 7 Feb 2026 18:26:03 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=B8=20=E5=A4=84=E7=90=86=E9=A2=9D?= =?UTF-8?q?=E5=A4=96=E5=A5=96=E5=8A=B1=E7=82=B9=E5=87=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/pageHome/ph-sign-item.vue | 31 +++++++++++++++--------- 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/src/components/pageHome/ph-sign-item.vue b/src/components/pageHome/ph-sign-item.vue index fa3d08f0..e9f2c2c9 100644 --- a/src/components/pageHome/ph-sign-item.vue +++ b/src/components/pageHome/ph-sign-item.vue @@ -43,6 +43,7 @@ :is-extra="true" :reward="reward" :state="getExtraRewardState(idx)" + @click="handleExtraRewardCellClick(idx)" /> @@ -239,29 +240,35 @@ function getRewardClickable(index: number): boolean { if (state === RewardState.NEXT_REWARD) { return true; } else if (state === RewardState.MISSED) { - // Only the first missed day is clickable for resign - // According to MiHoYo rules, you can only make up the first missed day const signedDays = signStat.value?.total_sign_day ?? 0; return index === signedDays; } return false; } -// Handle reward cell click -function handleRewardCellClick(index: number): void { - const state = getRewardState(index); +// Handle extra reward cell click +async function handleExtraRewardCellClick(index: number): Promise { + const state = getExtraRewardState(index); if (state === RewardState.NEXT_REWARD) { - // Click on next reward cell triggers sign-in - handleSign(); + await handleSign(); } else if (state === RewardState.MISSED) { - // Only allow clicking the first missed day for resign - // According to MiHoYo rules, you can only make up the first missed day const signedDays = signStat.value?.total_sign_day ?? 0; if (index === signedDays) { - // This is the first missed day, allow resign - handleResign(); + await handleResign(); + } + } +} + +// Handle reward cell click +async function handleRewardCellClick(index: number): Promise { + const state = getRewardState(index); + if (state === RewardState.NEXT_REWARD) { + await handleSign(); + } else if (state === RewardState.MISSED) { + const signedDays = signStat.value?.total_sign_day ?? 0; + if (index === signedDays) { + await handleResign(); } - // If it's not the first missed day, do nothing (clicking won't trigger resign) } }