feat(新限时活动页面): 登录奖励领取功能调整
This commit is contained in:
parent
f628f5bde0
commit
f3d5b195d4
@ -42,12 +42,12 @@
|
||||
>
|
||||
<div
|
||||
style="position: absolute; inset: 0; z-index: 2"
|
||||
v-if="reward.sort > currentDayIndex || todayReceived"
|
||||
v-if="index != currentDayIndex || (index == currentDayIndex && todayReceived)"
|
||||
@click.stop
|
||||
>
|
||||
<img
|
||||
v-smart-img
|
||||
:src="showImgUrl(currentDayIndex, reward)"
|
||||
:src="showImgUrl(index)"
|
||||
alt=""
|
||||
style="width: 100%; height: 100%; display: block; object-fit: cover"
|
||||
/>
|
||||
@ -127,10 +127,10 @@ const currentDayIndex = ref(0) // 当前签到天数
|
||||
const todayReceived = ref(false) // 今日是否已领取
|
||||
|
||||
// 展示不同图片
|
||||
const showImgUrl = (currentDayIndex, reward) => {
|
||||
const showImgUrl = (index) => {
|
||||
// 未领取状态
|
||||
if (reward.sort > currentDayIndex) {
|
||||
if (reward.sort < 7) {
|
||||
if (index > currentDayIndex.value) {
|
||||
if (index < 6) {
|
||||
console.log(`imageUrl('itemLock')`, imageUrl('itemLock'))
|
||||
|
||||
return imageUrl('itemLock')
|
||||
@ -140,8 +140,17 @@ const showImgUrl = (currentDayIndex, reward) => {
|
||||
}
|
||||
|
||||
// 已领取状态
|
||||
else if (index < currentDayIndex.value) {
|
||||
if (index < 6) {
|
||||
return imageUrl(getImgName('itemReceived'))
|
||||
} else {
|
||||
return imageUrl(getImgName('itemBigReceived'))
|
||||
}
|
||||
}
|
||||
|
||||
// 当天领取状态
|
||||
else if (todayReceived.value) {
|
||||
if (reward.sort < 7) {
|
||||
if (index < 6) {
|
||||
return imageUrl(getImgName('itemReceived'))
|
||||
} else {
|
||||
return imageUrl(getImgName('itemBigReceived'))
|
||||
@ -203,7 +212,7 @@ const getLoginRewards = async () => {
|
||||
|
||||
// 今天是否已签到
|
||||
const getTodayLoginStatus = async () => {
|
||||
const resTodayLoginStatus = await apiGetTodayLoginStatus(currentDayIndex.value)
|
||||
const resTodayLoginStatus = await apiGetTodayLoginStatus('1')
|
||||
if (resTodayLoginStatus.status && resTodayLoginStatus.body) {
|
||||
todayReceived.value = resTodayLoginStatus.body
|
||||
}
|
||||
@ -214,7 +223,7 @@ const receiveTaskReward = async () => {
|
||||
let data = {
|
||||
id: rewardInfo.value.rule.id,
|
||||
resourceGroupId: rewardInfo.value.rule.resourceGroupId,
|
||||
dailyKey: currentDayIndex.value,
|
||||
dailyKey: '1',
|
||||
}
|
||||
try {
|
||||
const resReceive = await postReceiveLoginReward(data)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user