feat(新限时活动页面): 登录奖励领取功能调整

This commit is contained in:
hzj 2026-02-02 21:30:14 +08:00
parent 16160436a7
commit 0ab46c12d3

View File

@ -42,7 +42,7 @@
>
<div
style="position: absolute; inset: 0; z-index: 2"
v-if="index != currentDayIndex || (index == currentDayIndex && todayReceived)"
v-if="index != currentDay - 1 || (index == currentDay - 1 && todayReceived)"
@click.stop
>
<img
@ -123,13 +123,14 @@ const getImgName = (filename) => {
}
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
}
}
}