feat(游戏王活动): 非阿语区展示不同的奖励政策图片
This commit is contained in:
parent
aca38e9029
commit
893b80ab64
@ -237,7 +237,7 @@
|
||||
<!-- 特殊奖励 -->
|
||||
<img
|
||||
v-smart-img
|
||||
:src="webpUrl(getImgName('specialRewards_20260520'))"
|
||||
:src="webpUrl(specialRewardsImageName)"
|
||||
alt=""
|
||||
style="display: block; width: 100%; object-fit: cover"
|
||||
/>
|
||||
@ -938,7 +938,7 @@
|
||||
<div v-show="dailyPopUpShow" @click.stop>
|
||||
<itemCenter
|
||||
style="min-height: 147.2vw"
|
||||
:imgUrl="webpUrl(getImgName('dailyPopUp_20260520'))"
|
||||
:imgUrl="webpUrl(dailyPopUpImageName)"
|
||||
:contentStyle="`z-index: 0;`"
|
||||
>
|
||||
<!-- 关闭按钮 -->
|
||||
@ -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() // 预加载其他图片
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user