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