feat(每日充值活动页面): 任务二完成情况状态调整、进度条宽度计算方式调整成只看当前任务等级
This commit is contained in:
parent
5bb4d836ac
commit
8d5e535b05
@ -165,14 +165,14 @@ justify-content: flex-start;
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<!-- 任务二 -->
|
<!-- 任务二 -->
|
||||||
<div :style="{ color: taskInfo.task2Completed ? '#1AFF00' : '#fff' }">
|
<div :style="{ color: task2Completed ? '#1AFF00' : '#fff' }">
|
||||||
{{
|
{{
|
||||||
t('active_game_task2_detail', {
|
t('active_game_task2_detail', {
|
||||||
progress: task2ProgressText,
|
progress: task2ProgressText,
|
||||||
})
|
})
|
||||||
}}
|
}}
|
||||||
<img
|
<img
|
||||||
v-if="taskInfo.task2Completed"
|
v-if="task2Completed"
|
||||||
v-smart-img
|
v-smart-img
|
||||||
:src="imageUrl('done')"
|
:src="imageUrl('done')"
|
||||||
alt=""
|
alt=""
|
||||||
@ -595,7 +595,7 @@ const currentTask2RewardTop = computed(() => {
|
|||||||
const canClaimTask2Reward = computed(() => {
|
const canClaimTask2Reward = computed(() => {
|
||||||
return (
|
return (
|
||||||
!currentTask2Claimed.value &&
|
!currentTask2Claimed.value &&
|
||||||
taskInfo.value.task2Completed &&
|
task2Completed.value &&
|
||||||
Boolean(currentTask2RewardTop.value?.rule?.id) &&
|
Boolean(currentTask2RewardTop.value?.rule?.id) &&
|
||||||
!claimingTask2Reward.value
|
!claimingTask2Reward.value
|
||||||
)
|
)
|
||||||
@ -617,17 +617,11 @@ const chestProgressList = computed(() => {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
const progressBarWidth = computed(() => {
|
const progressBarWidth = computed(() => {
|
||||||
const completedLevelCount = Math.min(Math.max(currentLevel.value - 1, 0), 9)
|
const targetLevel = Math.min(Math.max(Number(currentLevel.value) || 0, 0), 10)
|
||||||
const completedWidth =
|
const progressWidth =
|
||||||
completedLevelCount === 0
|
targetLevel === 0
|
||||||
? 0
|
? 0
|
||||||
: CHEST_PROGRESS_FIRST_CENTER_VW + (completedLevelCount - 1) * CHEST_PROGRESS_CENTER_STEP_VW
|
: CHEST_PROGRESS_FIRST_CENTER_VW + (targetLevel - 1) * CHEST_PROGRESS_CENTER_STEP_VW
|
||||||
const currentLevelTaskCount =
|
|
||||||
(task1Completed.value ? 1 : 0) + (taskInfo.value.task2Completed ? 1 : 0)
|
|
||||||
const currentLevelProgressDistance =
|
|
||||||
completedLevelCount === 0 ? CHEST_PROGRESS_FIRST_CENTER_VW : CHEST_PROGRESS_CENTER_STEP_VW
|
|
||||||
const currentLevelWidth = (currentLevelProgressDistance * currentLevelTaskCount) / 2
|
|
||||||
const progressWidth = Math.min(completedWidth + currentLevelWidth, CHEST_PROGRESS_TRACK_WIDTH_VW)
|
|
||||||
|
|
||||||
return `${progressWidth}vw`
|
return `${progressWidth}vw`
|
||||||
})
|
})
|
||||||
@ -654,6 +648,11 @@ const currentTask1TargetCoins = computed(() => {
|
|||||||
const currentTask2TargetAmount = computed(() => {
|
const currentTask2TargetAmount = computed(() => {
|
||||||
return currentLevelInfo.value.rechargeTarget || 0
|
return currentLevelInfo.value.rechargeTarget || 0
|
||||||
})
|
})
|
||||||
|
const task2Completed = computed(() => {
|
||||||
|
const rechargeAmount = Number(taskInfo.value.task2RechargeAmount) || 0
|
||||||
|
const targetAmount = Number(currentTask2TargetAmount.value) || 0
|
||||||
|
return targetAmount > 0 && rechargeAmount >= targetAmount
|
||||||
|
})
|
||||||
const currentTask1RewardCoins = computed(() => {
|
const currentTask1RewardCoins = computed(() => {
|
||||||
return currentLevelInfo.value.rewardCoins || taskInfo.value.task1TodayRewardCoins || 0
|
return currentLevelInfo.value.rewardCoins || taskInfo.value.task1TodayRewardCoins || 0
|
||||||
})
|
})
|
||||||
@ -796,7 +795,7 @@ const isChestConditionReached = (level) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (chestLevel === currentLevel.value) {
|
if (chestLevel === currentLevel.value) {
|
||||||
return task1Completed.value && taskInfo.value.task2Completed
|
return task1Completed.value && task2Completed.value
|
||||||
}
|
}
|
||||||
|
|
||||||
return false
|
return false
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user