Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
GeekLearnMathWeapp
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
frontend
GeekLearnMathWeapp
Commits
8e2d9dae
Commit
8e2d9dae
authored
Apr 11, 2023
by
hewenhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: update
parent
a751e545
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
index.ts
src/pages/game/play/model/index.ts
+8
-2
No files found.
src/pages/game/play/model/index.ts
View file @
8e2d9dae
...
@@ -37,6 +37,7 @@ const startCounter = () => getCounter()?.start()
...
@@ -37,6 +37,7 @@ const startCounter = () => getCounter()?.start()
interface
GameModelState
{
interface
GameModelState
{
/** 题目列表 */
/** 题目列表 */
questionList
:
QuestionType
[];
questionList
:
QuestionType
[];
stageDetailPre
:
StageDetail
|
null
;
stageDetail
:
StageDetail
|
null
;
stageDetail
:
StageDetail
|
null
;
gameResult
:
CompleteStageDetail
|
null
;
gameResult
:
CompleteStageDetail
|
null
;
gameStartTime
:
number
;
gameStartTime
:
number
;
...
@@ -97,6 +98,7 @@ const gameModel: GameModel = {
...
@@ -97,6 +98,7 @@ const gameModel: GameModel = {
rightIcon
:
null
,
rightIcon
:
null
,
stageDetail
:
null
,
stageDetail
:
null
,
stageDetailPre
:
null
,
updateState
:
action
((
state
,
obj
)
=>
{
updateState
:
action
((
state
,
obj
)
=>
{
for
(
const
key
in
obj
)
{
for
(
const
key
in
obj
)
{
...
@@ -237,11 +239,15 @@ const gameModel: GameModel = {
...
@@ -237,11 +239,15 @@ const gameModel: GameModel = {
}
}
}),
}),
getStageDetail
:
thunk
(
async
(
actions
,
round
)
=>
{
getStageDetail
:
thunk
(
async
(
actions
,
round
,
helpers
)
=>
{
try
{
try
{
showLoading
()
showLoading
()
let
{
stageDetail
:
pre
}
=
helpers
.
getState
()
const
{
data
:
stageDetail
}
=
await
getStageDetail
(
round
)
const
{
data
:
stageDetail
}
=
await
getStageDetail
(
round
)
actions
.
updateState
({
stageDetail
})
if
(
pre
?.
id
!==
stageDetail
?.
id
)
{
pre
=
null
}
actions
.
updateState
({
stageDetail
,
stageDetailPre
:
pre
})
hideLoading
()
hideLoading
()
}
catch
(
err
)
{
}
catch
(
err
)
{
hideLoading
()
hideLoading
()
...
...
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