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
+ }
}
}