feat(游戏王活动): 非阿语区展示不同的奖励政策图片
This commit is contained in:
parent
bd6900bb1d
commit
1d0e180036
@ -1102,7 +1102,13 @@ const Days = ref(0)
|
|||||||
// 获取用户所在的区域信息
|
// 获取用户所在的区域信息
|
||||||
const apiGetRegionByUserId = async () => {
|
const apiGetRegionByUserId = async () => {
|
||||||
try {
|
try {
|
||||||
const response = await getRegionByUserId(getUserId())
|
const userId = getUserId()
|
||||||
|
if (!userId) {
|
||||||
|
console.warn('用户ID为空,跳过用户区域获取')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
const response = await getRegionByUserId(userId)
|
||||||
if (response.status) {
|
if (response.status) {
|
||||||
userRegion.value = response.body
|
userRegion.value = response.body
|
||||||
}
|
}
|
||||||
@ -1411,20 +1417,17 @@ const preloadOtherImages = async () => {
|
|||||||
|
|
||||||
// 使用工具函数连接APP
|
// 使用工具函数连接APP
|
||||||
const connectToAppHandler = async () => {
|
const connectToAppHandler = async () => {
|
||||||
await connectToApp(() => {
|
await connectToApp(async () => {
|
||||||
// 连接成功回调
|
await apiGetRegionByUserId()
|
||||||
completePreloading() // 完成预加载
|
await completePreloading()
|
||||||
|
preloadOtherImages()
|
||||||
|
checkShow()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 组件挂载时检测环境
|
// 组件挂载时检测环境
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
await apiGetRegionByUserId()
|
|
||||||
connectToAppHandler()
|
connectToAppHandler()
|
||||||
preloadOtherImages() // 预加载其他图片
|
|
||||||
|
|
||||||
checkShow() // 检查是否展示每日弹窗
|
|
||||||
|
|
||||||
getCountdown()
|
getCountdown()
|
||||||
timer = setInterval(getCountdown, 1000) //倒计时每秒更新
|
timer = setInterval(getCountdown, 1000) //倒计时每秒更新
|
||||||
})
|
})
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user