From 893b80ab647ca33a35e3cfd2056a8c20fb532657 Mon Sep 17 00:00:00 2001 From: hzj <1304805162@qq.com> Date: Tue, 26 May 2026 18:01:18 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E6=B8=B8=E6=88=8F=E7=8E=8B=E6=B4=BB?= =?UTF-8?q?=E5=8A=A8):=20=E9=9D=9E=E9=98=BF=E8=AF=AD=E5=8C=BA=E5=B1=95?= =?UTF-8?q?=E7=A4=BA=E4=B8=8D=E5=90=8C=E7=9A=84=E5=A5=96=E5=8A=B1=E6=94=BF?= =?UTF-8?q?=E7=AD=96=E5=9B=BE=E7=89=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/Ranking/GamesKing/index.vue | 39 +++++++++++++++++++++++---- 1 file changed, 34 insertions(+), 5 deletions(-) diff --git a/src/views/Ranking/GamesKing/index.vue b/src/views/Ranking/GamesKing/index.vue index 2c77d40..3b89ca9 100644 --- a/src/views/Ranking/GamesKing/index.vue +++ b/src/views/Ranking/GamesKing/index.vue @@ -237,7 +237,7 @@ @@ -938,7 +938,7 @@
@@ -981,6 +981,7 @@ import { computed, onMounted, onUnmounted, ref } from 'vue' import { closePage, viewUserInfo } from '@/utils/appBridge.js' import { connectToApp } from '@/utils/appConnector.js' import { useLangStore } from '@/stores/lang' +import { getUserId } from '@/utils/userStore.js' import { getPngUrl, getWebpUrl } from '@/config/imagePaths.js' import { preloadImages, preloadImagesIdle } from '@/utils/image/imagePreloader.js' import { handleAvatarImageError, handleRewardImageError } from '@/utils/image/imageHandler.js' @@ -993,6 +994,7 @@ import { getRankingListAndMyRanking, // 获取排行榜和我的排名 getHistoryTopOne, // 获取历史榜首 } from '@/api/activity.js' +import { getRegionByUserId } from '@/api/wallet.js' import BackgroundLayer from '@/components/BackgroundLayer.vue' import itemCenter from '@/components/itemCenter.vue' @@ -1022,6 +1024,20 @@ const getImgName = (filename) => { return currentLangType.value === 'ar' ? `${filename}_ar` : filename } +const userRegion = ref(null) +const isNotArabicRegion = computed(() => { + return Boolean(userRegion.value?.regionCode && userRegion.value.regionCode !== 'AR') +}) +const getRegionImgName = (defaultFilename, notArabicFilename) => { + return getImgName(isNotArabicRegion.value ? notArabicFilename : defaultFilename) +} +const dailyPopUpImageName = computed(() => { + return getRegionImgName('dailyPopUp_20260520', 'dailyPopUp_NOT_AR') +}) +const specialRewardsImageName = computed(() => { + return getRegionImgName('specialRewards_20260520', 'specialRewards_NOT_AR') +}) + const { checkDate, // 对应周几 checkStatus, // 是否已看过 @@ -1083,6 +1099,18 @@ const checkShow = () => { // 倒计时 const Days = ref(0) +// 获取用户所在的区域信息 +const apiGetRegionByUserId = async () => { + try { + const response = await getRegionByUserId(getUserId()) + if (response.status) { + userRegion.value = response.body + } + } catch (error) { + console.error('获取用户区域失败:', error) + } +} + const Hours = ref(0) const Minutes = ref(0) const Second = ref(0) @@ -1321,7 +1349,7 @@ const preloadCriticalImages = async () => { webpUrl('bg'), webpUrl('bg2'), webpUrl('closeBt'), - webpUrl(getImgName('dailyPopUp_20260520')), + webpUrl(dailyPopUpImageName.value), webpUrl('helpBt'), webpUrl(getImgName('helpInfo')), webpUrl(getImgName('historyBtActive')), @@ -1371,7 +1399,7 @@ const preloadOtherImages = async () => { const criticalImages = [ webpUrl(getImgName('historyTopBg')), webpUrl('historyTopFrame'), - webpUrl(getImgName('specialRewards_20260520')), + webpUrl(specialRewardsImageName.value), webpUrl('top1RewardBg_20260515'), webpUrl('top2_4RewardBg'), webpUrl('top5_7RewardBg'), @@ -1390,7 +1418,8 @@ const connectToAppHandler = async () => { } // 组件挂载时检测环境 -onMounted(() => { +onMounted(async () => { + await apiGetRegionByUserId() connectToAppHandler() preloadOtherImages() // 预加载其他图片