feat(周星、国王皇后榜): 调整倒计时、更新帮助弹窗图源

This commit is contained in:
hzj 2026-02-09 19:23:49 +08:00
parent a73cbe3928
commit 83abdf7db0
4 changed files with 104 additions and 40 deletions

View File

@ -41,10 +41,7 @@ app.use(pinia)
const langStore = useLangStore() // 直接使用 import 的函数
//排行榜
const RankingPage = [
'/top-list', //排行榜
'/weekly-star', //每周明星
]
const RankingPage = []
// 活动页面
const ACTIVITIES = [
@ -99,11 +96,14 @@ app.mount('#app')
// 定时检查是否更新
if (versionChecker.enableCheck) {
setInterval(async () => {
const versionResult = await versionChecker.checkServerVersion()
if (versionResult.shouldUpdate) {
// 自动处理更新,不需要用户交互
await versionChecker.handleVersionUpdate(versionResult.versionType)
}
}, 5 * 60 * 1000)
setInterval(
async () => {
const versionResult = await versionChecker.checkServerVersion()
if (versionResult.shouldUpdate) {
// 自动处理更新,不需要用户交互
await versionChecker.handleVersionUpdate(versionResult.versionType)
}
},
5 * 60 * 1000,
)
}

View File

@ -336,19 +336,19 @@ const router = createRouter({
name: 'couple',
component: () => import('../views/Ranking/Couple/index.vue'),
meta: { requiresAuth: true },
}, //北京时间每周一早上5点刷新
}, // 沙特每周一早上0点北京时间5点刷新
{
path: '/top-list',
name: 'top-list',
component: () => import('../views/Ranking/KingAndQueen/TopList.vue'),
meta: { requiresAuth: true },
}, //沙特下周一当天早上6点北京时间3点)刷新
}, // 沙特每周一早上0点北京时间5点)刷新
{
path: '/weekly-star',
name: 'weekly-star',
component: () => import('../views/Ranking/WeeklyStar/WeeklyStar.vue'),
meta: { requiresAuth: true },
}, //沙特下周一当天早上6点北京时间3点)刷新
}, // 沙特每周一早上0点北京时间5点)刷新
{
path: '/ranking',
name: 'ranking',

View File

@ -348,7 +348,7 @@
>
<img
v-smart-img
:src="imageUrl('helpInfo')"
:src="imageUrl(getImgName('helpInfo'))"
alt=""
style="width: 108vw; position: relative; left: -4vw; display: block"
/>
@ -775,6 +775,7 @@
<script setup>
import { computed, onMounted, onUnmounted, ref } from 'vue'
import { isInApp, viewUserInfo } from '@/utils/appBridge.js'
import { useLangStore } from '@/stores/lang'
import { useThrottle } from '@/utils/useDebounce'
import { connectToApp } from '@/utils/appConnector.js'
import { getPngUrl } from '@/config/imagePaths.js'
@ -794,11 +795,21 @@ import borderImg from './components/borderImg.vue'
import itemCenter from '@/components/itemCenter.vue'
import maskLayer from '@/components/MaskLayer.vue'
const langStore = useLangStore()
//
const currentLangType = computed(() => {
return langStore.selectedLang?.type || 'en'
})
//
const isLoading = ref(true)
// OSSURL
const imageUrl = (filename) => getPngUrl('Ranking/KingQueen/', filename)
//
const getImgName = (filename) => {
return currentLangType.value === 'ar' ? `${filename}_ar` : filename
}
// 使APP
const connectToAppHandler = async () => {
@ -922,27 +933,47 @@ const Minutes = ref(0)
const Second = ref(0)
let timer = null
//
const getNextMondayInSaudi = () => {
//
const getNextMondayInBeijing = () => {
const now = new Date()
const utcDay = now.getUTCDay() //UTC0()-6()
const targetDate = new Date(now.getTime()) //
//
const daysToAdd = utcDay === 1 ? 7 : (1 + 7 - utcDay) % 7
const nextMondayUTC = new Date(now) //UTC
//
const utcTime = now.getTime() + now.getTimezoneOffset() * 60000
const beijingTime = new Date(utcTime + 8 * 3600000) // UTC+8
nextMondayUTC.setUTCDate(now.getUTCDate() + daysToAdd) //
nextMondayUTC.setUTCHours(3, 0, 0, 0) // 63
return nextMondayUTC.getTime() //00:00:00.000
const beijingDay = beijingTime.getDay() // 0=, 1=, ..., 6=
const beijingHour = beijingTime.getHours()
// 0=, 1=, ..., 6=
const normalizedDay = beijingDay === 0 ? 6 : beijingDay - 1
let daysToAdd
if (normalizedDay === 0) {
//
if (beijingHour >= 5) {
daysToAdd = 7 // 5
} else {
daysToAdd = 0 //
}
} else {
daysToAdd = 7 - normalizedDay //
}
//
targetDate.setDate(targetDate.getDate() + daysToAdd) //
targetDate.setHours(5, 0, 0, 0) // 5
return targetDate.getTime()
}
// 2
const targetTime = ref(getNextMondayInBeijing()) // ()
//
const formatTime = (value) => {
return value < 10 ? `0${value}` : value
}
const targetTime = ref(getNextMondayInSaudi()) // ()
//
const getCountdown = () => {
const now = Date.now()
@ -1097,7 +1128,7 @@ const preloadCriticalImages = async () => {
imageUrl('queenBt'),
imageUrl('kingBt'),
imageUrl('queenBtActive'),
imageUrl('helpInfo'),
imageUrl(getImgName('helpInfo')),
imageUrl('timeBack'),
imageUrl('timeNext'),
imageUrl('cancel'),
@ -1156,6 +1187,7 @@ onUnmounted(() => {
background-color: rgba(77, 30, 22, 1);
min-height: 100vh;
position: relative;
direction: ltr;
}
.bg {

View File

@ -572,7 +572,7 @@
<maskLayer :maskLayerShow="maskLayerShow" @click="closedPopup">
<!-- help弹窗 -->
<div v-show="helpInfoShow" style="margin: 20% 0" @click.stop>
<img v-smart-img :src="imageUrl('helpInfo')" alt="" style="width: 100%" />
<img v-smart-img :src="imageUrl(getImgName('helpInfo'))" alt="" style="width: 100%" />
</div>
<!-- history弹窗 -->
@ -837,6 +837,7 @@
<script setup>
import { computed, onMounted, onUnmounted, ref } from 'vue'
import { isInApp, viewUserInfo } from '@/utils/appBridge.js'
import { useLangStore } from '@/stores/lang'
import { connectToApp } from '@/utils/appConnector.js'
import { useThrottle } from '@/utils/useDebounce'
import { showWarning } from '@/utils/toast.js'
@ -861,11 +862,21 @@ import itemCenter from '@/components/itemCenter.vue'
import maskLayer from '@/components/MaskLayer.vue'
import TopUser from './components/topUser.vue'
const langStore = useLangStore()
//
const currentLangType = computed(() => {
return langStore.selectedLang?.type || 'en'
})
//
const isLoading = ref(true)
// OSSURL
const imageUrl = (filename) => getPngUrl('Ranking/WeeklyStar/', filename)
//
const getImgName = (filename) => {
return currentLangType.value === 'ar' ? `${filename}_ar` : filename
}
// 使APP
const connectToAppHandler = async () => {
@ -995,21 +1006,41 @@ const handleBt = (type) => {
exchargeShow.value = type == 'Exchange' ? true : false
}
//
const getNextMondayInSaudi = () => {
//
const getNextMondayInBeijing = () => {
const now = new Date()
const utcDay = now.getUTCDay() //UTC0()-6()
const targetDate = new Date(now.getTime()) //
//
const daysToAdd = utcDay === 1 ? 7 : (1 + 7 - utcDay) % 7
const nextMondayUTC = new Date(now) //UTC
//
const utcTime = now.getTime() + now.getTimezoneOffset() * 60000
const beijingTime = new Date(utcTime + 8 * 3600000) // UTC+8
nextMondayUTC.setUTCDate(now.getUTCDate() + daysToAdd) //
nextMondayUTC.setUTCHours(3, 0, 0, 0) // 63
return nextMondayUTC.getTime() //00:00:00.000
const beijingDay = beijingTime.getDay() // 0=, 1=, ..., 6=
const beijingHour = beijingTime.getHours()
// 0=, 1=, ..., 6=
const normalizedDay = beijingDay === 0 ? 6 : beijingDay - 1
let daysToAdd
if (normalizedDay === 0) {
//
if (beijingHour >= 5) {
daysToAdd = 7 // 5
} else {
daysToAdd = 0 //
}
} else {
daysToAdd = 7 - normalizedDay //
}
//
targetDate.setDate(targetDate.getDate() + daysToAdd) //
targetDate.setHours(5, 0, 0, 0) // 5
return targetDate.getTime()
}
const targetTime = ref(getNextMondayInSaudi()) // ()
const targetTime = ref(getNextMondayInBeijing()) // ()
//
const formatTime = (value) => {
@ -1189,7 +1220,7 @@ const preloadCriticalImages = async () => {
imageUrl('longBg'),
imageUrl('debris'),
imageUrl('myRankingBg'),
imageUrl('helpInfo'),
imageUrl(getImgName('helpInfo')),
imageUrl('mediumBg'),
imageUrl('topOneHistory'),
imageUrl('nameBg'),
@ -1259,6 +1290,7 @@ onUnmounted(() => {
min-height: 100vh;
background-color: #311300;
position: relative;
direction: ltr;
}
.timeText {