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