From c1d143acaa53f42b1e553f5ab49c8de5749ea611 Mon Sep 17 00:00:00 2001
From: hzj <1304805162@qq.com>
Date: Fri, 22 May 2026 21:02:21 +0800
Subject: [PATCH] =?UTF-8?q?feat(=E6=AF=8F=E6=97=A5=E5=85=85=E5=80=BC):=20?=
=?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=80=92=E8=AE=A1=E6=97=B6?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/views/Activities/DailyRecharge/index.vue | 74 ++++++++++++++++++++
1 file changed, 74 insertions(+)
diff --git a/src/views/Activities/DailyRecharge/index.vue b/src/views/Activities/DailyRecharge/index.vue
index 7eb3f96..85283d3 100644
--- a/src/views/Activities/DailyRecharge/index.vue
+++ b/src/views/Activities/DailyRecharge/index.vue
@@ -28,6 +28,26 @@
+
+
+
+
+
+
+
+
{
return currentLangType.value == 'en' ? filename : `${filename}_${currentLangType.value}`
}
+// 倒计时
+const Days = ref(0)
+const Hours = ref('00')
+const Minutes = ref('00')
+const Second = ref('00')
+const ACTIVITY_END_TIME = new Date('2026-05-30T05:00:00+08:00').getTime()
+let timer = null
+
+const formatCountdownTime = (value) => {
+ return value < 10 ? `0${value}` : `${value}`
+}
+
+const stopCountdown = () => {
+ if (timer) {
+ clearInterval(timer)
+ timer = null
+ }
+}
+
+const getCountdown = () => {
+ const now = Date.now()
+ const diff = Math.max(ACTIVITY_END_TIME - now, 0)
+
+ if (diff <= 0) {
+ Days.value = 0
+ Hours.value = '00'
+ Minutes.value = '00'
+ Second.value = '00'
+ stopCountdown()
+ return
+ }
+
+ const totalSeconds = Math.floor(diff / 1000)
+ Days.value = Math.floor(totalSeconds / (24 * 3600))
+ Hours.value = formatCountdownTime(Math.floor((totalSeconds % (24 * 3600)) / 3600))
+ Minutes.value = formatCountdownTime(Math.floor((totalSeconds % 3600) / 60))
+ Second.value = formatCountdownTime(Math.floor(totalSeconds % 60))
+}
+
+const startCountdown = () => {
+ getCountdown()
+ stopCountdown()
+ timer = setInterval(getCountdown, 1000)
+}
+
const ruleShow = ref(false)
const amountVisible = ref(false)
const claimingTask1Reward = ref(false)
@@ -1049,6 +1114,7 @@ const initData = async () => {
const preloadCriticalImages = async () => {
const chestImages = chestProgressList.value.map((chest) => imageUrl(getChestImageName(chest)))
const criticalImages = [
+ imageUrl('timeBg'),
imageUrl('bg2'),
imageUrl('bg'),
imageUrl('totalRewardBg'),
@@ -1111,6 +1177,7 @@ onMounted(() => {
window.__setDailyRechargeDevice = setSimulatedDeviceMode
window.__dailyRechargeDeviceMode = simulatedDeviceMode
}
+ startCountdown()
connectToAppHandler()
})
@@ -1119,6 +1186,7 @@ onBeforeUnmount(() => {
delete window.__setDailyRechargeDevice
delete window.__dailyRechargeDeviceMode
}
+ stopCountdown()
cleanupRewardVap()
})
@@ -1162,6 +1230,12 @@ onBeforeUnmount(() => {
isolation: isolate;
}
+.timeText {
+ color: #fff;
+ font-weight: 590;
+ font-size: 1.7em;
+}
+
.vap-background-layer {
width: 100vw;
height: auto;