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
d82cb786
Commit
d82cb786
authored
Jun 17, 2026
by
陈冲
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修复
parent
5e0ea925
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
52 additions
and
48 deletions
+52
-48
socket_io.rs
backend/src/protocols/socket_io.rs
+4
-0
Game.vue
frontend-h5/src/pages/game2/Game.vue
+8
-1
PlayingView.vue
frontend-h5/src/pages/game2/views/PlayingView.vue
+1
-1
Game3.vue
frontend-h5/src/pages/game3/Game3.vue
+10
-3
Game4.vue
frontend-h5/src/pages/game4/Game4.vue
+18
-38
ScoreView.vue
frontend-h5/src/pages/game4/views/ScoreView.vue
+2
-1
Game5.vue
frontend-h5/src/pages/game5/Game5.vue
+8
-2
Game.vue
frontend-h5/src/pages/game6/Game.vue
+1
-1
PlayingView.vue
frontend-h5/src/pages/game6/views/PlayingView.vue
+0
-1
No files found.
backend/src/protocols/socket_io.rs
View file @
d82cb786
...
...
@@ -827,6 +827,10 @@ async fn handle_room_command(
round_id
,
GAME_START_COUNTDOWN_SECS
+
GAME_RUNNING_SECS
+
GAME_RESULT_WAIT_SECS
,
);
// broadcast_msgpack_all_player(evt, &ok_resp(Some(json!({
// "index":game_index,
// ""
// }))));
broadcast_msgpack_all_player
(
evt
,
&
ok_resp
(
Some
(
json!
(
game_index
))));
//通知管理员
emit_msgpack
(
&
socket
,
evt
,
&
ok_resp
(
Some
(
json!
(
game_index
))));
...
...
frontend-h5/src/pages/game2/Game.vue
View file @
d82cb786
...
...
@@ -2,7 +2,7 @@
import
{
computed
,
onBeforeUnmount
,
onMounted
,
ref
}
from
'vue'
import
{
cssAssetUrl
}
from
'@/commons/assets.ts'
import
MobileStage
from
'@/components/MobileStage.vue'
import
{
useGameSocket
,
sendGameMessage
,
userJoinStatus
,
joinSharedRoom
}
from
'@/composables/useGameSocket'
import
{
useGameSocket
,
sendGameMessage
,
userJoinStatus
,
userTop10RankStatus
,
joinSharedRoom
}
from
'@/composables/useGameSocket'
import
LoadingView
from
'./views/LoadingView.vue'
import
PlayingView
from
'./views/PlayingView.vue'
import
{
$format_str
,
$getWechat
,
$toast
}
from
'@/commons/utils.ts'
...
...
@@ -116,9 +116,16 @@ function startGameCountdown(seconds = 60) {
if
(
countdownInterval
.
value
<=
0
)
{
countdownInterval
.
value
=
0
gameCountdownTimer
=
undefined
currentView
.
value
===
'loading'
if
(
userTop10RankStatus
.
value
)
{
userJoinStatus
.
value
=
false
;
showGameRank
.
value
=
false
;
$toast
(
'一人只能上榜领奖一次,您的福利已到手,把机会留给其他玩家吧'
,
30000
)
}
else
{
setDivDescVisible
(
false
)
submitScore
(
true
)
showGameOverRank
()
}
return
}
...
...
frontend-h5/src/pages/game2/views/PlayingView.vue
View file @
d82cb786
...
...
@@ -6,7 +6,7 @@ defineProps<{
countdownInterval
:
number
isDivDescVisible
:
boolean
tick
:
number
rank
:
number
rank
:
number
,
// currentGu: string
}
>
()
...
...
frontend-h5/src/pages/game3/Game3.vue
View file @
d82cb786
...
...
@@ -2,7 +2,7 @@
import
{
computed
,
onBeforeUnmount
,
onMounted
,
ref
}
from
'vue'
import
{
cssAssetUrl
}
from
'@/commons/assets.ts'
import
MobileStage
from
'@/components/MobileStage.vue'
import
{
useGameSocket
,
joinSharedRoom
,
sendGameMessage
,
userJoinStatus
}
from
'@/composables/useGameSocket'
import
{
useGameSocket
,
joinSharedRoom
,
sendGameMessage
,
userJoinStatus
,
userTop10RankStatus
}
from
'@/composables/useGameSocket'
import
LoadingView
from
'./views/LoadingView.vue'
import
PlayingView
from
'./views/PlayingView.vue'
import
{
$getWechat
,
$toast
,
$is_run_local
}
from
'@/commons/utils.ts'
...
...
@@ -134,9 +134,16 @@ function startGameCountdown(seconds = 60) {
if
(
countdownInterval
.
value
<=
0
)
{
countdownInterval
.
value
=
0
gameCountdownTimer
=
undefined
currentView
.
value
===
'loading'
if
(
userTop10RankStatus
.
value
)
{
userJoinStatus
.
value
=
false
;
showGameRank
.
value
=
false
;
$toast
(
'一人只能上榜领奖一次,您的福利已到手,把机会留给其他玩家吧'
,
30000
)
}
else
{
setDivDescVisible
(
false
)
submitScore
(
true
)
showGameOverRank
()
}
return
}
...
...
@@ -321,8 +328,8 @@ const rankCloseHandler = () => {
</
script
>
<
template
>
<MobileStage
v-if=
"token || isLocalMode"
:showGameRule=
"showGameRule"
:showGameRank=
"showGameRank"
ref=
"mobileStageRef"
:background=
"`$
{renderBG()}`">
<MobileStage
v-if=
"token || isLocalMode"
:showGameRule=
"showGameRule"
:showGameRank=
"showGameRank"
ref=
"mobileStageRef"
:background=
"`$
{renderBG()}`">
<template
#
gameRule
>
<div
class=
"rule-container"
>
<div
class=
"rule-txt-container"
>
...
...
frontend-h5/src/pages/game4/Game4.vue
View file @
d82cb786
...
...
@@ -7,6 +7,7 @@ import {
sendGameMessage
,
userJoinStatus
,
joinSharedRoom
,
userTop10RankStatus
,
}
from
"@/composables/useGameSocket"
;
import
LoadingView
from
"./views/LoadingView.vue"
;
import
PlayingView
from
"./views/PlayingView.vue"
;
...
...
@@ -111,9 +112,15 @@ function startGameCountdown(seconds = 60) {
if
(
countdownInterval
.
value
<=
0
)
{
countdownInterval
.
value
=
0
;
gameCountdownTimer
=
undefined
;
if
(
userTop10RankStatus
.
value
)
{
userJoinStatus
.
value
=
false
;
// showGameRank.value = false;
$toast
(
'一人只能上榜领奖一次,您的福利已到手,把机会留给其他玩家吧'
,
30000
)
}
else
{
setDivDescVisible
(
false
);
submitScore
(
true
);
showScoreView
();
}
return
;
}
...
...
@@ -173,9 +180,9 @@ function replayGame() {
startGameView
();
}
function
backToWaiting
()
{}
function
backToWaiting
()
{
}
function
handleRoomBack
()
{}
function
handleRoomBack
()
{
}
const
touchHandler
=
()
=>
{
tick
.
value
+=
5
;
...
...
@@ -257,12 +264,7 @@ onBeforeUnmount(() => {
</
script
>
<
template
>
<MobileStage
v-if=
"token"
:showGameRule=
"showGameRule"
ref=
"mobileStageRef"
:background=
"stageBackground"
>
<MobileStage
v-if=
"token"
:showGameRule=
"showGameRule"
ref=
"mobileStageRef"
:background=
"stageBackground"
>
<template
#
gameRule
>
<div
class=
"rule-container"
>
<div
class=
"rule-txt-container"
>
...
...
@@ -280,43 +282,21 @@ onBeforeUnmount(() => {
</div>
</div>
</
template
>
<LoadingView
v-if=
"currentView === 'loading'"
:image-urls=
"imageUrls"
:user-join-status=
"userJoinStatus"
@
touchGameRule=
"showGameRuleHandler"
/>
<LoadingView
v-if=
"currentView === 'loading'"
:image-urls=
"imageUrls"
:user-join-status=
"userJoinStatus"
@
touchGameRule=
"showGameRuleHandler"
/>
<!-- <PlayingView v-else :image-urls="imageUrls" :tick="tick" :rank="rank" -->
<PlayingView
v-else-if=
"currentView === 'playing'"
:image-urls=
"imageUrls"
:tick=
"tick"
:rank=
"rank"
:currentHorse=
"currentHorse"
:currentYaoyiyao=
"currentYaoyiyao"
:countdown-interval=
"countdownInterval"
:is-div-desc-visible=
"isDivDescVisible"
@
touch=
"touchHandler"
/>
<ScoreView
v-else
:image-urls=
"imageUrls"
:tick=
"tick"
:level=
"rank"
@
replay=
"replayGame"
@
back=
"backToWaiting"
/>
<PlayingView
v-else-if=
"currentView === 'playing'"
:image-urls=
"imageUrls"
:tick=
"tick"
:rank=
"rank"
:currentHorse=
"currentHorse"
:currentYaoyiyao=
"currentYaoyiyao"
:countdown-interval=
"countdownInterval"
:is-div-desc-visible=
"isDivDescVisible"
@
touch=
"touchHandler"
/>
<ScoreView
v-else
:image-urls=
"imageUrls"
:tick=
"tick"
:level=
"rank"
@
replay=
"replayGame"
@
back=
"backToWaiting"
/>
</MobileStage>
<div
v-else
style=
"
<div
v-else
style=
"
text-align: center;
width: 100vw;
height: 100vh;
line-height: 30;
font-size: 20px;
"
>
"
>
请使用微信扫码进入游戏
</div>
</template>
...
...
frontend-h5/src/pages/game4/views/ScoreView.vue
View file @
d82cb786
...
...
@@ -34,7 +34,8 @@ onMounted(() => {
<div></div>
<div>
{{
tick
}}
</div>
<div>
最终排名
</div>
<div>
第
<label>
{{
level
}}
</label>
名
</div>
<div
v-if=
"level>0"
>
第
<label>
{{
level
}}
</label>
名
</div>
<div
v-else
>
未上榜
</div>
</div>
</div>
<!--
<div
class=
"btn-group"
>
...
...
frontend-h5/src/pages/game5/Game5.vue
View file @
d82cb786
...
...
@@ -2,7 +2,7 @@
import
{
computed
,
onBeforeUnmount
,
onMounted
,
ref
}
from
'vue'
import
{
assetUrl
,
cssAssetUrl
}
from
'@/commons/assets.ts'
import
MobileStage
from
'@/components/MobileStage.vue'
import
{
useGameSocket
,
sendGameMessage
,
userJoinStatus
,
joinSharedRoom
}
from
'@/composables/useGameSocket'
import
{
useGameSocket
,
sendGameMessage
,
userJoinStatus
,
joinSharedRoom
,
userTop10RankStatus
}
from
'@/composables/useGameSocket'
import
LoadingView
from
'./views/LoadingView.vue'
import
PlayingView
from
'./views/PlayingView.vue'
import
ScoreView
from
'./views/ScoreView.vue'
...
...
@@ -162,9 +162,15 @@ function startGameCountdown(seconds = 60) {
if
(
countdownInterval
.
value
<=
0
)
{
countdownInterval
.
value
=
0
gameCountdownTimer
=
undefined
if
(
userTop10RankStatus
.
value
)
{
userJoinStatus
.
value
=
false
;
// showGameRank.value = false;
$toast
(
'一人只能上榜领奖一次,您的福利已到手,把机会留给其他玩家吧'
,
30000
)
}
else
{
setDivDescVisible
(
false
)
submitScore
(
true
)
showGameOverRank
()
}
return
}
...
...
@@ -363,7 +369,7 @@ const rankCloseHandler = () => {
<div
class=
"row row-3"
>
<div
class=
"col-1"
>
{{
rank
>
0
?
rank
:
'未上榜'
}}
</div>
<div
class=
"col-2"
>
<div
class=
"avatar"
:style=
"
{ backgroundImage: `url(${avatar})`,top: '27px' }">
</div>
<div
class=
"avatar"
:style=
"
{ backgroundImage: `url(${avatar})`,
top: '27px' }">
</div>
<div>
{{
nickname
}}
</div>
</div>
<div
class=
"col-3"
>
{{
tick
}}
</div>
...
...
frontend-h5/src/pages/game6/Game.vue
View file @
d82cb786
...
...
@@ -370,7 +370,7 @@ const rankCloseHandler = () => {
<LoadingView
v-if=
"currentView === 'loading'"
:image-urls=
"imageUrls"
:user-join-status=
"userJoinStatus"
@
touchGameRule=
"showGameRuleHandler"
/>
<PlayingView
v-else
:image-urls=
"imageUrls"
:tick=
"score"
:rank=
"rank"
:countdown-interval=
"countdownInterval"
:is-div-desc-visible=
"isDivDescVisible"
@
touch=
"touchHandler"
:userTop10RankStatus=
"userTop10RankStatus"
/>
:is-div-desc-visible=
"isDivDescVisible"
@
touch=
"touchHandler"
/>
</MobileStage>
<div
v-else
style=
"text-align: center; width: 100vw; height: 100vh; line-height: 30; font-size: 20px;"
>
请使用微信扫码进入游戏
...
...
frontend-h5/src/pages/game6/views/PlayingView.vue
View file @
d82cb786
...
...
@@ -7,7 +7,6 @@ defineProps<{
isDivDescVisible
:
boolean
tick
:
number
rank
:
number
userTop10RankStatus
:
boolean
}
>
()
const
emit
=
defineEmits
<
{
...
...
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