Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
fc-minigame
Project
Project
Details
Activity
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
陈冲
fc-minigame
Commits
a5b770c0
Commit
a5b770c0
authored
Jun 27, 2026
by
陈冲
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 修复game3排行榜
parent
a55524f5
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
0 deletions
+20
-0
Game3.vue
frontend-h5/src/pages/game3/Game3.vue
+20
-0
No files found.
frontend-h5/src/pages/game3/Game3.vue
View file @
a5b770c0
...
...
@@ -153,6 +153,18 @@ function startGameCountdown(seconds = 60) {
gameCountdownTimer
=
window
.
setTimeout
(
tickCountdown
,
1000
)
}
function
syncGameCountdown
(
seconds
:
number
)
{
const
syncedSeconds
=
Math
.
max
(
0
,
Math
.
floor
(
seconds
))
if
(
countdownInterval
.
value
-
syncedSeconds
<=
1
)
return
if
(
syncedSeconds
===
0
)
{
countdownInterval
.
value
=
0
return
}
startGameCountdown
(
syncedSeconds
)
}
function
resetToLoadingView
()
{
stopGameCountdown
()
if
(
guFrameTimer
)
{
...
...
@@ -232,10 +244,18 @@ if (wechat) {
},
onScoreSubmitted
:
(
is_save
,
data
)
=>
{
if
(
!
is_save
)
{
//非保存状态下
const
nextScore
=
Number
(
typeof
data
===
'object'
?
data
?.
score
:
NaN
)
const
nextRank
=
Number
(
typeof
data
===
'object'
?
data
?.
rank
:
data
)
const
remainingSeconds
=
Number
(
typeof
data
===
'object'
?
data
?.
remainingSeconds
:
NaN
)
if
(
Number
.
isFinite
(
nextScore
)
&&
nextScore
>=
0
)
{
score
.
value
=
nextScore
}
if
(
Number
.
isFinite
(
nextRank
)
&&
nextRank
>
0
)
{
rank
.
value
=
nextRank
}
if
(
Number
.
isFinite
(
remainingSeconds
)
&&
remainingSeconds
>=
0
)
{
syncGameCountdown
(
remainingSeconds
)
}
}
else
if
(
typeof
data
===
'object'
&&
data
)
{
if
(
Array
.
isArray
(
data
.
list
))
{
rankList
.
value
=
data
.
list
.
map
((
item
:
any
,
index
:
number
)
=>
({
...
...
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