feat(每日充值活动页面): 任务二完成情况状态调整、进度条宽度计算方式调整成只看当前任务等级

This commit is contained in:
hzj 2026-04-30 18:31:53 +08:00
parent 5bb4d836ac
commit 8d5e535b05

View File

@ -165,14 +165,14 @@ justify-content: flex-start;
/>
</div>
<!-- 任务二 -->
<div :style="{ color: taskInfo.task2Completed ? '#1AFF00' : '#fff' }">
<div :style="{ color: task2Completed ? '#1AFF00' : '#fff' }">
{{
t('active_game_task2_detail', {
progress: task2ProgressText,
})
}}
<img
v-if="taskInfo.task2Completed"
v-if="task2Completed"
v-smart-img
:src="imageUrl('done')"
alt=""
@ -595,7 +595,7 @@ const currentTask2RewardTop = computed(() => {
const canClaimTask2Reward = computed(() => {
return (
!currentTask2Claimed.value &&
taskInfo.value.task2Completed &&
task2Completed.value &&
Boolean(currentTask2RewardTop.value?.rule?.id) &&
!claimingTask2Reward.value
)
@ -617,17 +617,11 @@ const chestProgressList = computed(() => {
})
})
const progressBarWidth = computed(() => {
const completedLevelCount = Math.min(Math.max(currentLevel.value - 1, 0), 9)
const completedWidth =
completedLevelCount === 0
const targetLevel = Math.min(Math.max(Number(currentLevel.value) || 0, 0), 10)
const progressWidth =
targetLevel === 0
? 0
: CHEST_PROGRESS_FIRST_CENTER_VW + (completedLevelCount - 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)
: CHEST_PROGRESS_FIRST_CENTER_VW + (targetLevel - 1) * CHEST_PROGRESS_CENTER_STEP_VW
return `${progressWidth}vw`
})
@ -654,6 +648,11 @@ const currentTask1TargetCoins = computed(() => {
const currentTask2TargetAmount = computed(() => {
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(() => {
return currentLevelInfo.value.rewardCoins || taskInfo.value.task1TodayRewardCoins || 0
})
@ -796,7 +795,7 @@ const isChestConditionReached = (level) => {
}
if (chestLevel === currentLevel.value) {
return task1Completed.value && taskInfo.value.task2Completed
return task1Completed.value && task2Completed.value
}
return false