Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
eslotsys-game-nuxt
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
毛线
eslotsys-game-nuxt
Commits
34d13590
Commit
34d13590
authored
Jul 02, 2023
by
毛线
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化loading显示逻辑
parent
65d63ec2
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
4 deletions
+27
-4
index.vue
pages/loading/index.vue
+27
-4
No files found.
pages/loading/index.vue
View file @
34d13590
...
@@ -35,6 +35,12 @@ export default {
...
@@ -35,6 +35,12 @@ export default {
downloadImage
:
0
,
// 完成加载的总数
downloadImage
:
0
,
// 完成加载的总数
downloadAudio
:
0
,
// 完成加载的总数
downloadAudio
:
0
,
// 完成加载的总数
logo
:
'https://app-main.eslotsys-ptn1.com/resource/assets/Textures/loading/screen_logo.png'
,
logo
:
'https://app-main.eslotsys-ptn1.com/resource/assets/Textures/loading/screen_logo.png'
,
loadPageImg
:
[
// 加载页面的图片
'https://kuawai.s3.ap-east-1.amazonaws.com/resource/assets/Textures/loading/macot.png'
,
'https://kuawai.s3.ap-east-1.amazonaws.com/resource/assets/Textures/loading/loading%20bar%20bg.png'
,
'https://kuawai.s3.ap-east-1.amazonaws.com/resource/assets/Textures/loading/filled.png'
,
],
loadPageImgComplete
:
0
,
// 加载页的图片加载情况
}
}
},
},
computed
:
{
computed
:
{
...
@@ -75,17 +81,34 @@ export default {
...
@@ -75,17 +81,34 @@ export default {
this
.
toGame
()
this
.
toGame
()
}
}
},
},
},
loadPageImgComplete
(
value
)
{
mounted
()
{
if
(
value
===
this
.
loadPageImg
.
length
)
{
// 图片加载完成
setTimeout
(()
=>
{
setTimeout
(()
=>
{
this
.
showLoading
=
true
// logo
显示1秒
this
.
showLoading
=
true
// logo至少
显示1秒
this
.
loadResources
()
this
.
loadResources
()
},
1000
)
},
1000
)
}
},
},
mounted
()
{
},
},
methods
:
{
methods
:
{
...
mapActions
([
...
mapActions
([
'GetBaseInfo'
,
'GetBaseInfo'
,
]),
]),
loadPageImgState
()
{
this
.
loadPageImg
.
forEach
(
src
=>
{
const
img
=
new
Image
()
img
.
src
=
src
if
(
img
.
complete
)
{
this
.
loadPageImgComplete
++
}
else
{
img
.
onload
=
()
=>
{
this
.
loadPageImgComplete
++
}
}
})
},
toGame
()
{
toGame
()
{
const
token
=
getToken
()
const
token
=
getToken
()
if
(
token
)
{
if
(
token
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment