fix(活动页): 修复可能会在周一00:00:00不刷新的问题

This commit is contained in:
hzj 2025-09-15 18:23:57 +08:00
parent 68fb65fca7
commit 4afbca8d96

View File

@ -816,15 +816,17 @@ const formatTime = (value) => {
return value < 10 ? `0${value}` : value
}
const targetTime = ref(getNextMonday()) // ()
//
const getCountdown = () => {
const now = Date.now()
const targetTime = getNextMonday()
let diff = targetTime - now
let diff = targetTime.value - now
if (diff <= 0) {
diff = getNextMonday() - now
updatePageData() //
targetTime.value += 7 * 86400000 // +7 ()
diff = targetTime.value - now
}
//