Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
RB-studyChina-20250617
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
SparkProjects
RB-studyChina-20250617
Commits
cc98c03e
Commit
cc98c03e
authored
Jun 23, 2025
by
jtwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
6
parent
2314a1ee
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
32 additions
and
16 deletions
+32
-16
cities_sp_landmark1.png
src/assets/victoryPopup/cities_sp_landmark1.png
+0
-0
cities_sp_landmark2.png
src/assets/victoryPopup/cities_sp_landmark2.png
+0
-0
cities_sp_landmark3.png
src/assets/victoryPopup/cities_sp_landmark3.png
+0
-0
cities_sp_landmark4.png
src/assets/victoryPopup/cities_sp_landmark4.png
+0
-0
cities_sp_landmark5.png
src/assets/victoryPopup/cities_sp_landmark5.png
+0
-0
GamePage.module.less
src/pages/GamePage/GamePage.module.less
+1
-1
GamePage.tsx
src/pages/GamePage/GamePage.tsx
+8
-6
index.jsx
src/panels/FailPopup/index.jsx
+8
-4
index.jsx
src/panels/VictoryPopup/index.jsx
+14
-5
gameStore.ts
src/store/gameStore.ts
+1
-0
No files found.
src/assets/victoryPopup/
beijing
.png
→
src/assets/victoryPopup/
cities_sp_landmark1
.png
View file @
cc98c03e
File moved
src/assets/victoryPopup/
shanxi
.png
→
src/assets/victoryPopup/
cities_sp_landmark2
.png
View file @
cc98c03e
File moved
src/assets/victoryPopup/
shanghai
.png
→
src/assets/victoryPopup/
cities_sp_landmark3
.png
View file @
cc98c03e
File moved
src/assets/victoryPopup/
hangzhou
.png
→
src/assets/victoryPopup/
cities_sp_landmark4
.png
View file @
cc98c03e
File moved
src/assets/victoryPopup/c
hengdu
.png
→
src/assets/victoryPopup/c
ities_sp_landmark5
.png
View file @
cc98c03e
File moved
src/pages/GamePage/GamePage.module.less
View file @
cc98c03e
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
left: 0;
left: 0;
top: 50%;
top: 50%;
width: 750px;
width: 750px;
height: 1
624px
;
height: 1
00vh
;
//touch-action: auto !important;
//touch-action: auto !important;
transform: translateY(-50%);
transform: translateY(-50%);
}
}
...
...
src/pages/GamePage/GamePage.tsx
View file @
cc98c03e
...
@@ -23,6 +23,7 @@ import { LOG_KEY, pageView, sensorLog } from "@/utils/sensors";
...
@@ -23,6 +23,7 @@ import { LOG_KEY, pageView, sensorLog } from "@/utils/sensors";
import
"./js/output"
;
import
"./js/output"
;
import
API
from
'@/api'
;
import
API
from
'@/api'
;
import
{
handleLogClick
,
handleLogExposure
}
from
'@/MD'
;
import
{
handleLogClick
,
handleLogExposure
}
from
'@/MD'
;
import
Homepage
from
'../HomePage/HomePage'
;
declare
const
Game
:
any
;
declare
const
Game
:
any
;
...
@@ -80,14 +81,15 @@ class GamePage extends React.Component<any, any> {
...
@@ -80,14 +81,15 @@ class GamePage extends React.Component<any, any> {
// }
// }
}
}
})
})
//退出游戏
store
.
game
.
addGlobalEvent
(
"exitGame"
,
(
e
)
=>
{
store
.
game
.
addGlobalEvent
(
"exitGame"
,
(
e
)
=>
{
//自行切换,游戏有需要就销毁
//自行切换,游戏有需要就销毁
store
.
game
.
destroy
()
store
.
game
.
destroy
()
PageCtrl
.
changePage
(
Homepage
)
})
})
// store.game.addGlobalEvent("pauseGame", (e) => {
store
.
game
.
addGlobalEvent
(
"pauseGame"
,
(
e
)
=>
{
// console.log('暂停游戏')
console
.
log
(
123123123
)
// })
})
//派发事件,比如倒计时暂停,pauseGame|continueGame|restartGame
//派发事件,比如倒计时暂停,pauseGame|continueGame|restartGame
...
@@ -96,12 +98,12 @@ class GamePage extends React.Component<any, any> {
...
@@ -96,12 +98,12 @@ class GamePage extends React.Component<any, any> {
//继续游戏
//继续游戏
// store.game.dispatchGlobalEvent("continueGame")
// store.game.dispatchGlobalEvent("continueGame")
//重玩游戏
//重玩游戏
store
.
game
.
dispatchGlobalEvent
(
"restartGame"
,
{
targetStudy
:
1
,
targetTravel
:
1
,
time
:
120
})
//
store.game.dispatchGlobalEvent("restartGame", { targetStudy: 1, targetTravel: 1, time: 120 })
}
}
componentWillUnmount
()
{
componentWillUnmount
()
{
store
.
game
.
destroy
()
}
}
render
()
{
render
()
{
...
...
src/panels/FailPopup/index.jsx
View file @
cc98c03e
...
@@ -6,6 +6,7 @@ import './index.less';
...
@@ -6,6 +6,7 @@ import './index.less';
import
{
_asyncThrottle
,
_throttle
}
from
'../../utils/utils.ts'
;
import
{
_asyncThrottle
,
_throttle
}
from
'../../utils/utils.ts'
;
import
{
ModalCtrl
}
from
'@/core/ctrls/ModalCtrl'
;
import
{
ModalCtrl
}
from
'@/core/ctrls/ModalCtrl'
;
import
store
from
"@/store/store.js"
;
import
store
from
"@/store/store.js"
;
import
gameStore
from
"@/store/gameStore.js"
;
import
{
PageCtrl
}
from
"@/core/ctrls/PageCtrl"
;
import
{
PageCtrl
}
from
"@/core/ctrls/PageCtrl"
;
import
HomePage
from
'@/pages/HomePage/HomePage.tsx'
;
import
HomePage
from
'@/pages/HomePage/HomePage.tsx'
;
...
@@ -29,13 +30,16 @@ class FailPopup extends React.Component {
...
@@ -29,13 +30,16 @@ class FailPopup extends React.Component {
//再玩一次
//再玩一次
onReceive
=
()
=>
{
onReceive
=
()
=>
{
ModalCtrl
.
closeModal
();
ModalCtrl
.
closeModal
();
PageCtrl
.
changePage
(
HomePage
);
//回到首页
// PageCtrl.changePage(HomePage);//回到首页
/*
//重玩游戏
//重玩游戏
if
(
store
.
game
)
{
if
(
store
.
game
)
{
store.game.dispatchGlobalEvent("restartGame", { targetStudy: 1, targetTravel: 1, time: 120 })
const
d
=
{
targetStudy
:
gameStore
.
gameInfo
.
targetConfig
.
target1
,
targetTravel
:
gameStore
.
gameInfo
.
targetConfig
.
target2
,
time
:
gameStore
.
gameInfo
.
countdownSeconds
}
store
.
game
.
dispatchGlobalEvent
(
"restartGame"
,
d
)
}
}
*/
}
}
render
()
{
render
()
{
...
...
src/panels/VictoryPopup/index.jsx
View file @
cc98c03e
...
@@ -18,6 +18,13 @@ import { PageCtrl } from "@/core/ctrls/PageCtrl";
...
@@ -18,6 +18,13 @@ import { PageCtrl } from "@/core/ctrls/PageCtrl";
import
HomePage
from
'@/pages/HomePage/HomePage.tsx'
;
import
HomePage
from
'@/pages/HomePage/HomePage.tsx'
;
import
GiftPackPopup
from
'@/panels/GiftPackPopup/index.jsx'
;
import
GiftPackPopup
from
'@/panels/GiftPackPopup/index.jsx'
;
const
cities
=
[
{
spId
:
'sp_landmark1'
,
name
:
'北京'
,
icon
:
'../src/assets/victoryPopup/cities_sp_landmark1.png'
},
{
spId
:
'sp_landmark2'
,
name
:
'西安'
,
icon
:
'../src/assets/victoryPopup/cities_sp_landmark2.png'
},
{
spId
:
'sp_landmark3'
,
name
:
'上海'
,
icon
:
'../src/assets/victoryPopup/cities_sp_landmark3.png'
},
{
spId
:
'sp_landmark4'
,
name
:
'杭州'
,
icon
:
'../src/assets/victoryPopup/cities_sp_landmark4.png'
},
{
spId
:
'sp_landmark5'
,
name
:
'成都'
,
icon
:
'../src/assets/victoryPopup/cities_sp_landmark5.png'
}
];
@
observer
@
observer
class
VictoryPopup
extends
React
.
Component
{
class
VictoryPopup
extends
React
.
Component
{
constructor
(
props
)
{
constructor
(
props
)
{
...
@@ -32,24 +39,26 @@ class VictoryPopup extends React.Component {
...
@@ -32,24 +39,26 @@ class VictoryPopup extends React.Component {
}
}
//抽奖
//抽奖
onDraw
=
()
=>
{
onDraw
=
async
()
=>
{
ModalCtrl
.
closeModal
();
ModalCtrl
.
closeModal
();
// ModalCtrl.showModal(GiftPackPopup);
// ModalCtrl.showModal(GiftPackPopup);
await
store
.
getDrawInfo
();
store
.
doLotttery
();
store
.
doLotttery
();
}
}
render
()
{
render
()
{
const
{
gotSpInfo
,
rewardDrawTimes
}
=
this
.
state
;
return
(
return
(
<
div
className=
"VictoryPopup"
>
<
div
className=
"VictoryPopup"
>
<
div
className=
"vp_mask"
></
div
>
<
div
className=
"vp_mask"
></
div
>
<
div
className=
'vp_title'
></
div
>
<
div
className=
'vp_title'
></
div
>
<
div
className=
'vp_ditu_txt'
>
{
this
.
state
?.
gotSpInfo
.
name
}
地图
</
div
>
<
div
className=
'vp_ditu_txt'
>
{
gotSpInfo
.
name
}
地图
</
div
>
<
div
className=
'vp_guang'
></
div
>
<
div
className=
'vp_guang'
></
div
>
<
div
className=
'vp_xz_icon'
style=
{
{
backgroundImage
:
`url(${this.state?.gotSpInfo.icon})`
}
}
></
div
>
<
div
className=
'vp_xz_icon'
style=
{
{
backgroundImage
:
`url(${cities.find(city => city.spId === gotSpInfo.spId).icon})`
}
}
></
div
>
<
div
className=
'vp_cjjh_tips'
>
<
div
className=
'vp_cjjh_tips'
>
<
div
>
抽奖机会+
{
this
.
state
?.
rewardDrawTimes
}
</
div
>
<
div
>
抽奖机会+
{
rewardDrawTimes
}
</
div
>
</
div
>
</
div
>
<
div
className=
'vp_btn'
onClick=
{
()
=>
this
.
onDraw
()
}
></
div
>
<
div
className=
'vp_btn'
onClick=
{
()
=>
this
.
onDraw
()
}
></
div
>
<
div
className=
'vp_close'
onClick=
{
()
=>
this
.
onClose
()
}
></
div
>
<
div
className=
'vp_close'
onClick=
{
()
=>
this
.
onClose
()
}
></
div
>
</
div
>
</
div
>
);
);
...
...
src/store/gameStore.ts
View file @
cc98c03e
...
@@ -69,6 +69,7 @@ class GameStore {
...
@@ -69,6 +69,7 @@ class GameStore {
const
param
=
AESEncrypt
(
JSON
.
stringify
(
d
),
"4fe20bdefdd4804f"
,
"cDOiBC1n2QrkAY2P"
);
const
param
=
AESEncrypt
(
JSON
.
stringify
(
d
),
"4fe20bdefdd4804f"
,
"cDOiBC1n2QrkAY2P"
);
const
{
success
,
data
}
=
await
API
.
submit
({
param
});
const
{
success
,
data
}
=
await
API
.
submit
({
param
});
this
.
gameInfo
.
isSubmit
=
true
;
if
(
!
success
)
{
if
(
!
success
)
{
PageCtrl
.
changePage
(
HomePage
);
PageCtrl
.
changePage
(
HomePage
);
return
success
;
return
success
;
...
...
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