From 0ab46c12d34a5e4cbf51b9fc52d7ed1fbfdd213a Mon Sep 17 00:00:00 2001 From: hzj <1304805162@qq.com> Date: Mon, 2 Feb 2026 21:30:14 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E6=96=B0=E9=99=90=E6=97=B6=E6=B4=BB?= =?UTF-8?q?=E5=8A=A8=E9=A1=B5=E9=9D=A2):=20=E7=99=BB=E5=BD=95=E5=A5=96?= =?UTF-8?q?=E5=8A=B1=E9=A2=86=E5=8F=96=E5=8A=9F=E8=83=BD=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/Activities/LoginReward/index.vue | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/src/views/Activities/LoginReward/index.vue b/src/views/Activities/LoginReward/index.vue index 14ea3fa..9e7a2d2 100644 --- a/src/views/Activities/LoginReward/index.vue +++ b/src/views/Activities/LoginReward/index.vue @@ -42,7 +42,7 @@ >
{ } const rewardInfo = ref({}) // 奖池列表 -const currentDayIndex = ref(0) // 当前签到天数 +const currentDay = ref(0) // 当前天数 +const days = ref(0) // 当前签到天数 const todayReceived = ref(false) // 今日是否已领取 // 展示不同图片 const showImgUrl = (index) => { // 未领取状态 - if (index > currentDayIndex.value) { + if (index > currentDay.value - 1) { if (index < 6) { console.log(`imageUrl('itemLock')`, imageUrl('itemLock')) @@ -140,7 +141,7 @@ const showImgUrl = (index) => { } // 已领取状态 - else if (index < currentDayIndex.value) { + else if (index < currentDay.value - 1) { if (index < 6) { return imageUrl(getImgName('itemReceived')) } else { @@ -149,7 +150,7 @@ const showImgUrl = (index) => { } // 当天领取状态 - else if (todayReceived.value) { + else if (index == currentDay.value - 1 && todayReceived.value) { if (index < 6) { return imageUrl(getImgName('itemReceived')) } else { @@ -204,9 +205,15 @@ const getLoginRewards = async () => { const resLoginRewards = await apiGetLoginRewards('DAILY_REGISTER_AZIZI') if (resLoginRewards.status && resLoginRewards.body) { rewardInfo.value = resLoginRewards.body?.rewards?.[0] || {} - currentDayIndex.value = resLoginRewards.body?.days || 0 + days.value = resLoginRewards.body?.days || 0 + currentDay.value = resLoginRewards.body?.currentDay || 0 - getTodayLoginStatus() // 今日是否已签到 + console.log('currentDay.value:', currentDay.value) + if (days.value == currentDay.value) { + todayReceived.value = true + } else { + todayReceived.value = false + } } }