feat(游戏王打榜): 调整图片预加载流程
This commit is contained in:
parent
04aeed9340
commit
4b2faa227b
@ -141,6 +141,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 模块 -->
|
||||
<div>
|
||||
<!-- history -->
|
||||
<div
|
||||
@ -581,10 +582,11 @@
|
||||
</div>
|
||||
|
||||
<!-- 我的排名占位 -->
|
||||
<div style="height: 25vw"></div>
|
||||
<div v-if="rankingShow" style="height: 22vw"></div>
|
||||
|
||||
<!-- 我的排名 -->
|
||||
<itemCenter
|
||||
v-if="rankingShow"
|
||||
style="position: fixed; bottom: 0; z-index: 3"
|
||||
:imgUrl="imageUrl('myRankingBg')"
|
||||
:contentStyle="`padding: 0 8%`"
|
||||
@ -919,26 +921,20 @@ const preloadCriticalImages = async () => {
|
||||
imageUrl('bg2'),
|
||||
imageUrl('helpBt'),
|
||||
imageUrl('helpInfo'),
|
||||
imageUrl('historyBt'),
|
||||
imageUrl('historyBtActive'),
|
||||
imageUrl('historyTopBg'),
|
||||
imageUrl('historyTopFrame'),
|
||||
imageUrl('specialRewardsBg'),
|
||||
imageUrl('myRankingBg'),
|
||||
imageUrl('RankingBottomBorder'),
|
||||
imageUrl('rankingBt'),
|
||||
imageUrl('rankingBtActive'),
|
||||
imageUrl('RankingCenterBg'),
|
||||
imageUrl('RankingItem'),
|
||||
imageUrl('RankingMain'),
|
||||
imageUrl('rewardBtActive'),
|
||||
imageUrl('rewardsBt'),
|
||||
imageUrl('timeBg'),
|
||||
imageUrl('top1RewardBg'),
|
||||
imageUrl('top2_4RewardBg'),
|
||||
imageUrl('top5_7RewardBg'),
|
||||
imageUrl('top8_10RewardBg'),
|
||||
imageUrl('topBackBt'),
|
||||
imageUrl('topNextBt'),
|
||||
imageUrl('top1'),
|
||||
imageUrl('top2'),
|
||||
imageUrl('top3'),
|
||||
imageUrl('top4'),
|
||||
imageUrl('top5_7'),
|
||||
imageUrl('top8_10'),
|
||||
]
|
||||
|
||||
const criticalImages_ar = [
|
||||
@ -946,26 +942,20 @@ const preloadCriticalImages = async () => {
|
||||
imageUrl('bg2'),
|
||||
imageUrl('helpBt'),
|
||||
imageUrl('helpInfo_ar'),
|
||||
imageUrl('historyBt_ar'),
|
||||
imageUrl('historyBtActive_ar'),
|
||||
imageUrl('historyTopBg_ar'),
|
||||
imageUrl('historyTopFrame'),
|
||||
imageUrl('specialRewardsBg_ar'),
|
||||
imageUrl('myRankingBg'),
|
||||
imageUrl('RankingBottomBorder'),
|
||||
imageUrl('rankingBt_ar'),
|
||||
imageUrl('rankingBtActive_ar'),
|
||||
imageUrl('RankingCenterBg'),
|
||||
imageUrl('RankingItem'),
|
||||
imageUrl('RankingMain_ar'),
|
||||
imageUrl('rewardBtActive_ar'),
|
||||
imageUrl('rewardsBt_ar'),
|
||||
imageUrl('timeBg'),
|
||||
imageUrl('top1RewardBg'),
|
||||
imageUrl('top2_4RewardBg'),
|
||||
imageUrl('top5_7RewardBg'),
|
||||
imageUrl('top8_10RewardBg'),
|
||||
imageUrl('topBackBt'),
|
||||
imageUrl('topNextBt'),
|
||||
imageUrl('top1'),
|
||||
imageUrl('top2'),
|
||||
imageUrl('top3'),
|
||||
imageUrl('top4'),
|
||||
imageUrl('top5_7'),
|
||||
imageUrl('top8_10'),
|
||||
]
|
||||
|
||||
if (currentLangType.value == 'en') {
|
||||
@ -988,6 +978,47 @@ const completePreloading = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
// 预加载其他图片
|
||||
const preloadOtherImages = async () => {
|
||||
const criticalImages = [
|
||||
imageUrl('RankingBottomBorder'),
|
||||
imageUrl('RankingCenterBg'),
|
||||
imageUrl('RankingItem'),
|
||||
imageUrl('RankingMain'),
|
||||
imageUrl('top1RewardBg'),
|
||||
imageUrl('top2_4RewardBg'),
|
||||
imageUrl('top5_7RewardBg'),
|
||||
imageUrl('top8_10RewardBg'),
|
||||
imageUrl('top2'),
|
||||
imageUrl('top3'),
|
||||
imageUrl('top4'),
|
||||
imageUrl('top5_7'),
|
||||
imageUrl('top8_10'),
|
||||
]
|
||||
|
||||
const criticalImages_ar = [
|
||||
imageUrl('RankingBottomBorder'),
|
||||
imageUrl('RankingCenterBg'),
|
||||
imageUrl('RankingItem'),
|
||||
imageUrl('RankingMain_ar'),
|
||||
imageUrl('top1RewardBg'),
|
||||
imageUrl('top2_4RewardBg'),
|
||||
imageUrl('top5_7RewardBg'),
|
||||
imageUrl('top8_10RewardBg'),
|
||||
imageUrl('top2'),
|
||||
imageUrl('top3'),
|
||||
imageUrl('top4'),
|
||||
imageUrl('top5_7'),
|
||||
imageUrl('top8_10'),
|
||||
]
|
||||
|
||||
if (currentLangType.value == 'en') {
|
||||
await preloadImages(criticalImages)
|
||||
} else if (currentLangType.value == 'ar') {
|
||||
await preloadImages(criticalImages_ar)
|
||||
}
|
||||
}
|
||||
|
||||
// 使用工具函数连接APP
|
||||
const connectToAppHandler = async () => {
|
||||
await connectToApp(() => {
|
||||
@ -999,6 +1030,7 @@ const connectToAppHandler = async () => {
|
||||
// 组件挂载时检测环境
|
||||
onMounted(() => {
|
||||
connectToAppHandler()
|
||||
preloadOtherImages() // 预加载其他图片
|
||||
isInAppEnvironment.value = isInApp()
|
||||
|
||||
getCountdown()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user