diff --git a/src/views/Activities/DailyRecharge/index.vue b/src/views/Activities/DailyRecharge/index.vue index 76e61e0..88108a9 100644 --- a/src/views/Activities/DailyRecharge/index.vue +++ b/src/views/Activities/DailyRecharge/index.vue @@ -165,14 +165,14 @@ justify-content: flex-start; /> -
+
{{ t('active_game_task2_detail', { progress: task2ProgressText, }) }} { 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