feat(新限时活动页面): 登录奖励领取功能调整
This commit is contained in:
parent
16160436a7
commit
0ab46c12d3
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user