feat(游戏王活动): 非阿语区展示不同的奖励政策图片
This commit is contained in:
parent
aca38e9029
commit
893b80ab64
@ -237,7 +237,7 @@
|
|||||||
<!-- 特殊奖励 -->
|
<!-- 特殊奖励 -->
|
||||||
<img
|
<img
|
||||||
v-smart-img
|
v-smart-img
|
||||||
:src="webpUrl(getImgName('specialRewards_20260520'))"
|
:src="webpUrl(specialRewardsImageName)"
|
||||||
alt=""
|
alt=""
|
||||||
style="display: block; width: 100%; object-fit: cover"
|
style="display: block; width: 100%; object-fit: cover"
|
||||||
/>
|
/>
|
||||||
@ -938,7 +938,7 @@
|
|||||||
<div v-show="dailyPopUpShow" @click.stop>
|
<div v-show="dailyPopUpShow" @click.stop>
|
||||||
<itemCenter
|
<itemCenter
|
||||||
style="min-height: 147.2vw"
|
style="min-height: 147.2vw"
|
||||||
:imgUrl="webpUrl(getImgName('dailyPopUp_20260520'))"
|
:imgUrl="webpUrl(dailyPopUpImageName)"
|
||||||
:contentStyle="`z-index: 0;`"
|
:contentStyle="`z-index: 0;`"
|
||||||
>
|
>
|
||||||
<!-- 关闭按钮 -->
|
<!-- 关闭按钮 -->
|
||||||
@ -981,6 +981,7 @@ import { computed, onMounted, onUnmounted, ref } from 'vue'
|
|||||||
import { closePage, viewUserInfo } from '@/utils/appBridge.js'
|
import { closePage, viewUserInfo } from '@/utils/appBridge.js'
|
||||||
import { connectToApp } from '@/utils/appConnector.js'
|
import { connectToApp } from '@/utils/appConnector.js'
|
||||||
import { useLangStore } from '@/stores/lang'
|
import { useLangStore } from '@/stores/lang'
|
||||||
|
import { getUserId } from '@/utils/userStore.js'
|
||||||
import { getPngUrl, getWebpUrl } from '@/config/imagePaths.js'
|
import { getPngUrl, getWebpUrl } from '@/config/imagePaths.js'
|
||||||
import { preloadImages, preloadImagesIdle } from '@/utils/image/imagePreloader.js'
|
import { preloadImages, preloadImagesIdle } from '@/utils/image/imagePreloader.js'
|
||||||
import { handleAvatarImageError, handleRewardImageError } from '@/utils/image/imageHandler.js'
|
import { handleAvatarImageError, handleRewardImageError } from '@/utils/image/imageHandler.js'
|
||||||
@ -993,6 +994,7 @@ import {
|
|||||||
getRankingListAndMyRanking, // 获取排行榜和我的排名
|
getRankingListAndMyRanking, // 获取排行榜和我的排名
|
||||||
getHistoryTopOne, // 获取历史榜首
|
getHistoryTopOne, // 获取历史榜首
|
||||||
} from '@/api/activity.js'
|
} from '@/api/activity.js'
|
||||||
|
import { getRegionByUserId } from '@/api/wallet.js'
|
||||||
|
|
||||||
import BackgroundLayer from '@/components/BackgroundLayer.vue'
|
import BackgroundLayer from '@/components/BackgroundLayer.vue'
|
||||||
import itemCenter from '@/components/itemCenter.vue'
|
import itemCenter from '@/components/itemCenter.vue'
|
||||||
@ -1022,6 +1024,20 @@ const getImgName = (filename) => {
|
|||||||
return currentLangType.value === 'ar' ? `${filename}_ar` : 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 {
|
const {
|
||||||
checkDate, // 对应周几
|
checkDate, // 对应周几
|
||||||
checkStatus, // 是否已看过
|
checkStatus, // 是否已看过
|
||||||
@ -1083,6 +1099,18 @@ const checkShow = () => {
|
|||||||
|
|
||||||
// 倒计时
|
// 倒计时
|
||||||
const Days = ref(0)
|
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 Hours = ref(0)
|
||||||
const Minutes = ref(0)
|
const Minutes = ref(0)
|
||||||
const Second = ref(0)
|
const Second = ref(0)
|
||||||
@ -1321,7 +1349,7 @@ const preloadCriticalImages = async () => {
|
|||||||
webpUrl('bg'),
|
webpUrl('bg'),
|
||||||
webpUrl('bg2'),
|
webpUrl('bg2'),
|
||||||
webpUrl('closeBt'),
|
webpUrl('closeBt'),
|
||||||
webpUrl(getImgName('dailyPopUp_20260520')),
|
webpUrl(dailyPopUpImageName.value),
|
||||||
webpUrl('helpBt'),
|
webpUrl('helpBt'),
|
||||||
webpUrl(getImgName('helpInfo')),
|
webpUrl(getImgName('helpInfo')),
|
||||||
webpUrl(getImgName('historyBtActive')),
|
webpUrl(getImgName('historyBtActive')),
|
||||||
@ -1371,7 +1399,7 @@ const preloadOtherImages = async () => {
|
|||||||
const criticalImages = [
|
const criticalImages = [
|
||||||
webpUrl(getImgName('historyTopBg')),
|
webpUrl(getImgName('historyTopBg')),
|
||||||
webpUrl('historyTopFrame'),
|
webpUrl('historyTopFrame'),
|
||||||
webpUrl(getImgName('specialRewards_20260520')),
|
webpUrl(specialRewardsImageName.value),
|
||||||
webpUrl('top1RewardBg_20260515'),
|
webpUrl('top1RewardBg_20260515'),
|
||||||
webpUrl('top2_4RewardBg'),
|
webpUrl('top2_4RewardBg'),
|
||||||
webpUrl('top5_7RewardBg'),
|
webpUrl('top5_7RewardBg'),
|
||||||
@ -1390,7 +1418,8 @@ const connectToAppHandler = async () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 组件挂载时检测环境
|
// 组件挂载时检测环境
|
||||||
onMounted(() => {
|
onMounted(async () => {
|
||||||
|
await apiGetRegionByUserId()
|
||||||
connectToAppHandler()
|
connectToAppHandler()
|
||||||
preloadOtherImages() // 预加载其他图片
|
preloadOtherImages() // 预加载其他图片
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user