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
e2ccd7a4
Commit
e2ccd7a4
authored
Apr 04, 2023
by
hewenhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: update
parent
763c3cd1
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
135 additions
and
1120 deletions
+135
-1120
auth.ts
src/api/auth.ts
+2
-15
game.ts
src/api/game.ts
+8
-0
index.js
src/native-components/count-up/index.js
+10
-3
count-up.tsx
src/pages/game/play/components/count-up.tsx
+14
-11
modal-continue.tsx
src/pages/game/play/components/modal-continue.tsx
+8
-0
index.ts
src/pages/game/play/model/index.ts
+63
-37
test-1.json
src/pages/game/play/model/test-1.json
+0
-112
test-2.json
src/pages/game/play/model/test-2.json
+0
-112
test-3.json
src/pages/game/play/model/test-3.json
+0
-112
test-4.json
src/pages/game/play/model/test-4.json
+0
-278
test.json
src/pages/game/play/model/test.json
+0
-413
utils.ts
src/pages/game/play/model/utils.ts
+2
-4
index.tsx
src/pages/prepare/index.tsx
+16
-2
user.ts
src/store/modules/user.ts
+4
-0
types.ts
src/types.ts
+3
-3
silent-login.ts
src/utils/silent-login.ts
+3
-6
storage.ts
src/utils/storage.ts
+2
-12
No files found.
src/api/auth.ts
View file @
e2ccd7a4
import
{
request
,
requestAfterSilentLogin
}
from
'@/utils/request'
import
{
request
,
requestAfterSilentLogin
}
from
'@/utils/request'
import
type
{
UserInfo
}
from
'@/types'
type
LoginResult
=
{
type
LoginResult
=
UserInfo
phone
?:
string
|
null
;
/** 用户openId */
openId
:
string
;
/** 用户昵称 */
nickname
?:
string
|
null
;
/** 用户头像 */
avatarUrl
?:
string
|
null
;
/** 登录token */
token
:
string
;
/** 用户ID */
userId
:
number
;
/** */
unionId
:
string
;
}
/** 静默登录 */
/** 静默登录 */
export
function
silentLoginApi
(
code
:
string
)
{
export
function
silentLoginApi
(
code
:
string
)
{
...
...
src/api/game.ts
View file @
e2ccd7a4
...
@@ -10,6 +10,14 @@ export const getQuestionList = (stageId: number) => {
...
@@ -10,6 +10,14 @@ export const getQuestionList = (stageId: number) => {
}))
}))
}
}
export
const
resumeGame
=
(
stageId
:
number
)
=>
{
return
requestAfterSilentLogin
<
null
,
{
stageId
:
number
,
userId
?:
number
}
>
(
userInfo
=>
({
method
:
'GET'
,
url
:
'/service-idea/stage/resumeStage'
,
data
:
{
stageId
,
userId
:
userInfo
?.
userId
}
}))
}
export
const
enum
StageStatus
{
export
const
enum
StageStatus
{
CURRENT
=
'CURRENT'
,
CURRENT
=
'CURRENT'
,
DISABLED
=
'DISABLED'
,
DISABLED
=
'DISABLED'
,
...
...
src/native-components/count-up/index.js
View file @
e2ccd7a4
...
@@ -43,7 +43,8 @@ Component({
...
@@ -43,7 +43,8 @@ Component({
},
},
attached
()
{
attached
()
{
this
.
startCount
()
this
.
_tick
=
this
.
data
.
startValue
this
.
start
()
console
.
log
(
this
)
console
.
log
(
this
)
},
},
...
@@ -53,9 +54,15 @@ Component({
...
@@ -53,9 +54,15 @@ Component({
clearInterval
(
this
.
_timer
)
clearInterval
(
this
.
_timer
)
}
}
},
},
startCount
()
{
getCount
()
{
if
(
this
.
data
.
isDown
)
{
return
this
.
data
.
startValue
-
this
.
_tick
}
return
this
.
_tick
},
start
()
{
this
.
stop
()
this
.
stop
()
this
.
_tick
=
this
.
data
.
startValue
this
.
_timer
=
setInterval
(()
=>
{
this
.
_timer
=
setInterval
(()
=>
{
console
.
log
(
this
.
data
)
console
.
log
(
this
.
data
)
const
isDown
=
this
.
data
.
isDown
const
isDown
=
this
.
data
.
isDown
...
...
src/pages/game/play/components/count-up.tsx
View file @
e2ccd7a4
...
@@ -2,7 +2,7 @@ import { View, Image } from '@tarojs/components'
...
@@ -2,7 +2,7 @@ import { View, Image } from '@tarojs/components'
import
{
useState
,
useEffect
,
useCallback
,
useMemo
,
useRef
}
from
'react'
import
{
useState
,
useEffect
,
useCallback
,
useMemo
,
useRef
}
from
'react'
import
{
createSelectorQuery
,
getCurrentInstance
}
from
'@tarojs/taro'
import
{
createSelectorQuery
,
getCurrentInstance
}
from
'@tarojs/taro'
import
classNames
from
'classnames'
import
classNames
from
'classnames'
import
{
useStoreState
}
from
'@/store/hooks'
import
{
useStoreState
,
useStoreActions
}
from
'@/store/hooks'
import
{
type
StageDetail
,
StageType
}
from
'@/api'
import
{
type
StageDetail
,
StageType
}
from
'@/api'
import
styles
from
'./count-up.module.scss'
import
styles
from
'./count-up.module.scss'
...
@@ -16,10 +16,11 @@ type CountUpProps = {
...
@@ -16,10 +16,11 @@ type CountUpProps = {
const
CountUp
=
(
props
:
CountUpProps
)
=>
{
const
CountUp
=
(
props
:
CountUpProps
)
=>
{
const
{
stageDetail
}
=
props
const
{
stageDetail
}
=
props
const
currentQuestionIndex
=
useStoreState
(
states
=>
states
.
gameModel
.
currentQuestionIndex
)
const
currentQuestionIndex
=
useStoreState
(
states
=>
states
.
gameModel
.
currentQuestionIndex
)
const
counterId
=
useStoreState
(
states
=>
states
.
gameModel
.
counterId
)
const
questionList
=
useStoreState
(
state
=>
state
.
gameModel
.
questionList
)
const
questionList
=
useStoreState
(
state
=>
state
.
gameModel
.
questionList
)
const
isSubmit
=
useStoreState
(
state
=>
state
.
gameModel
.
isSubmit
)
const
isSubmit
=
useStoreState
(
state
=>
state
.
gameModel
.
isSubmit
)
const
submit
=
useStoreActions
(
actions
=>
actions
.
gameModel
.
submit
)
const
[
width
,
setWidth
]
=
useState
(
0
)
const
[
width
,
setWidth
]
=
useState
(
0
)
const
countUp
=
useRef
<
any
>
(
null
)
const
questionLength
=
useMemo
(()
=>
{
const
questionLength
=
useMemo
(()
=>
{
return
questionList
.
length
return
questionList
.
length
...
@@ -54,13 +55,12 @@ const CountUp = (props: CountUpProps) => {
...
@@ -54,13 +55,12 @@ const CountUp = (props: CountUpProps) => {
}
}
},
[
width
,
stageDetail
.
bTime
])
},
[
width
,
stageDetail
.
bTime
])
useEffect
(()
=>
{
// useEffect(() => {
if
(
isSubmit
&&
countUp
.
current
?.
sid
)
{
// if (isSubmit) {
console
.
log
(
countUp
.
current
)
// const comp = getCurrentInstance()?.page?.selectComponent?.(`#${counterId}`) as any
const
comp
=
getCurrentInstance
()?.
page
?.
selectComponent
?.(
`#
${
countUp
.
current
.
sid
}
`
)
as
any
// comp?.stop?.()
comp
?.
stop
?.()
// }
}
// }, [isSubmit, counterId])
},
[
isSubmit
])
const
processInnerStyle
=
useMemo
(()
=>
{
const
processInnerStyle
=
useMemo
(()
=>
{
if
(
isSubmit
)
{
if
(
isSubmit
)
{
...
@@ -75,7 +75,10 @@ const CountUp = (props: CountUpProps) => {
...
@@ -75,7 +75,10 @@ const CountUp = (props: CountUpProps) => {
const
handleTimeUp
=
useCallback
(()
=>
{
const
handleTimeUp
=
useCallback
(()
=>
{
console
.
log
(
'upd1'
)
console
.
log
(
'upd1'
)
},
[])
if
(
isOneStop
)
{
submit
()
}
},
[
submit
,
isOneStop
])
return
(
return
(
<
View
className=
{
classNames
(
styles
.
count
,
isOneStop
&&
styles
.
is_stop
)
}
>
<
View
className=
{
classNames
(
styles
.
count
,
isOneStop
&&
styles
.
is_stop
)
}
>
...
@@ -91,7 +94,7 @@ const CountUp = (props: CountUpProps) => {
...
@@ -91,7 +94,7 @@ const CountUp = (props: CountUpProps) => {
</
View
>
</
View
>
<
View
className=
{
styles
.
time
}
>
<
View
className=
{
styles
.
time
}
>
<
Image
src=
{
require
(
'../assets/count-time.png'
)
}
className=
{
styles
.
icon
}
></
Image
>
<
Image
src=
{
require
(
'../assets/count-time.png'
)
}
className=
{
styles
.
icon
}
></
Image
>
<
count
-
up
-
time
maxValue=
{
60
*
60
}
startValue=
{
startTick
}
isDown=
{
isOneStop
}
onTimeup=
{
handleTimeUp
}
ref=
{
countUp
}
/>
<
count
-
up
-
time
maxValue=
{
60
*
60
}
startValue=
{
startTick
}
isDown=
{
isOneStop
}
onTimeup=
{
handleTimeUp
}
id=
{
counterId
}
/>
</
View
>
</
View
>
</
View
>
</
View
>
)
)
...
...
src/pages/game/play/components/modal-continue.tsx
View file @
e2ccd7a4
...
@@ -19,6 +19,8 @@ const ModalContinue = (props: ModalContinueProps) => {
...
@@ -19,6 +19,8 @@ const ModalContinue = (props: ModalContinueProps) => {
const
cardNum
=
useStoreState
(
state
=>
state
.
userModel
.
cardNum
)
const
cardNum
=
useStoreState
(
state
=>
state
.
userModel
.
cardNum
)
const
fetchAccount
=
useStoreActions
(
actions
=>
actions
.
userModel
.
fetchAccount
)
const
fetchAccount
=
useStoreActions
(
actions
=>
actions
.
userModel
.
fetchAccount
)
const
submit
=
useStoreActions
(
actions
=>
actions
.
gameModel
.
submit
)
const
reborn
=
useStoreActions
(
actions
=>
actions
.
gameModel
.
reborn
)
const
handleClick
=
useCallback
(()
=>
{
const
handleClick
=
useCallback
(()
=>
{
if
(
closeOnClickModal
)
{
if
(
closeOnClickModal
)
{
...
@@ -32,6 +34,10 @@ const ModalContinue = (props: ModalContinueProps) => {
...
@@ -32,6 +34,10 @@ const ModalContinue = (props: ModalContinueProps) => {
}
}
},
[
fetchAccount
,
modalContinueVisible
])
},
[
fetchAccount
,
modalContinueVisible
])
const
handleReborn
=
useCallback
(()
=>
{
reborn
()
},
[
reborn
])
return
(
return
(
<
RootPortal
>
<
RootPortal
>
<
View
className=
{
classNames
(
styles
.
mask
,
modalContinueVisible
&&
styles
.
is_show
)
}
onClick=
{
handleClick
}
>
<
View
className=
{
classNames
(
styles
.
mask
,
modalContinueVisible
&&
styles
.
is_show
)
}
onClick=
{
handleClick
}
>
...
@@ -43,12 +49,14 @@ const ModalContinue = (props: ModalContinueProps) => {
...
@@ -43,12 +49,14 @@ const ModalContinue = (props: ModalContinueProps) => {
<
View
<
View
className=
{
styles
.
btn_left
}
className=
{
styles
.
btn_left
}
hoverClass=
{
styles
.
is_active
}
hoverClass=
{
styles
.
is_active
}
onClick=
{
()
=>
submit
()
}
>
>
放弃
放弃
</
View
>
</
View
>
<
View
<
View
className=
{
classNames
(
styles
.
btn_right
,
!
canGoNext
&&
styles
.
disabled
)
}
className=
{
classNames
(
styles
.
btn_right
,
!
canGoNext
&&
styles
.
disabled
)
}
hoverClass=
{
canGoNext
?
styles
.
is_active
:
null
}
hoverClass=
{
canGoNext
?
styles
.
is_active
:
null
}
onClick=
{
handleReborn
}
>
>
<
Image
src=
{
require
(
'@/pages/main/assets/ph.png'
)
}
className=
{
styles
.
icon
}
></
Image
>
<
Image
src=
{
require
(
'@/pages/main/assets/ph.png'
)
}
className=
{
styles
.
icon
}
></
Image
>
<
Text
>
-1 继续
</
Text
>
<
Text
>
-1 继续
</
Text
>
...
...
src/pages/game/play/model/index.ts
View file @
e2ccd7a4
import
{
action
,
Action
,
computed
,
Computed
,
Thunk
,
thunk
}
from
'easy-peasy'
import
{
action
,
Action
,
computed
,
Computed
,
Thunk
,
thunk
}
from
'easy-peasy'
import
{
AppStoreModel
}
from
'@/store/store-model'
import
{
AppStoreModel
}
from
'@/store/store-model'
import
{
getQuestionList
,
type
StageDetail
,
getStageDetail
,
completeStage
,
StageType
,
type
CompleteStageOut
,
StageLevel
}
from
'@/api'
import
{
getQuestionList
,
type
StageDetail
,
getStageDetail
,
completeStage
,
StageType
,
type
CompleteStageOut
,
resumeGame
}
from
'@/api'
import
{
showLoading
,
hideLoading
,
showModal
,
redirectTo
,
vibrateShort
}
from
'@tarojs/taro'
import
{
showLoading
,
hideLoading
,
showModal
,
redirectTo
,
vibrateShort
,
getCurrentInstance
}
from
'@tarojs/taro'
import
{
import
{
QuestionType
,
QuestionType
,
QuestionAnswer
,
QuestionAnswer
,
...
@@ -10,13 +10,20 @@ import {
...
@@ -10,13 +10,20 @@ import {
}
from
'../types'
}
from
'../types'
import
{
buildCompleteStageParam
,
convertQuestion
,
determinQuestion
}
from
'./utils'
import
{
buildCompleteStageParam
,
convertQuestion
,
determinQuestion
}
from
'./utils'
import
questionListJson
from
'./test.json'
interface
CompleteStageDetail
extends
CompleteStageOut
{
interface
CompleteStageDetail
extends
CompleteStageOut
{
errNum
:
number
;
errNum
:
number
;
levelTime
:
number
;
levelTime
:
number
;
}
}
const
COUNTER_ID
=
'z__countdown__'
const
getCounter
=
()
=>
{
return
getCurrentInstance
()?.
page
?.
selectComponent
?.(
`#
${
COUNTER_ID
}
`
)
as
any
}
const
stopCounter
=
()
=>
getCounter
()?.
stop
()
const
startCounter
=
()
=>
getCounter
()?.
start
()
interface
GameModelState
{
interface
GameModelState
{
/** 题目列表 */
/** 题目列表 */
questionList
:
QuestionType
[];
questionList
:
QuestionType
[];
...
@@ -30,6 +37,11 @@ interface GameModelState {
...
@@ -30,6 +37,11 @@ interface GameModelState {
isSubmit
:
boolean
;
isSubmit
:
boolean
;
modalContinueVisible
:
boolean
;
modalContinueVisible
:
boolean
;
/** 是否复活过 */
isReborn
:
boolean
;
/** 计时器id */
counterId
:
string
;
}
}
export
interface
GameModel
extends
GameModelState
{
export
interface
GameModel
extends
GameModelState
{
...
@@ -58,28 +70,15 @@ export interface GameModel extends GameModelState {
...
@@ -58,28 +70,15 @@ export interface GameModel extends GameModelState {
handleGoNext
:
Thunk
<
GameModel
,
void
,
void
,
AppStoreModel
>
;
handleGoNext
:
Thunk
<
GameModel
,
void
,
void
,
AppStoreModel
>
;
submit
:
Thunk
<
GameModel
,
void
,
void
,
AppStoreModel
>
;
submit
:
Thunk
<
GameModel
,
void
,
void
,
AppStoreModel
>
;
reborn
:
Thunk
<
GameModel
,
void
,
void
,
AppStoreModel
>
;
}
}
const
gameModel
:
GameModel
=
{
const
gameModel
:
GameModel
=
{
questionList
:
questionListJson
as
QuestionType
[],
counterId
:
COUNTER_ID
,
gameResult
:
{
questionList
:
[],
/** 排名档位 */
gameResult
:
null
,
gear
:
10
,
isReborn
:
false
,
gearReward
:
10
,
levelBefore
:
StageLevel
.
B
,
levelReward
:
20
,
upGearReward
:
40
,
errNum
:
0
,
/** 成就等级:SAB */
level
:
StageLevel
.
B
,
levelTime
:
50
,
/** 排名 */
ranks
:
[],
/** 耗时 */
resultTime
:
60
,
/** 是否升档奖励 */
upGear
:
true
},
modalContinueVisible
:
false
,
modalContinueVisible
:
false
,
gameStartTime
:
0
,
gameStartTime
:
0
,
isSubmit
:
false
,
isSubmit
:
false
,
...
@@ -171,26 +170,49 @@ const gameModel: GameModel = {
...
@@ -171,26 +170,49 @@ const gameModel: GameModel = {
}),
}),
handleGoNext
:
thunk
(
async
(
actions
,
_
,
helpers
)
=>
{
handleGoNext
:
thunk
(
async
(
actions
,
_
,
helpers
)
=>
{
const
{
canGoNext
,
currentQuestionIndex
,
questionList
,
stageDetail
,
currentQuestion
}
=
helpers
.
getState
()
const
{
canGoNext
,
currentQuestionIndex
,
questionList
,
stageDetail
,
currentQuestion
,
isReborn
}
=
helpers
.
getState
()
if
(
!
canGoNext
)
return
if
(
!
canGoNext
)
return
if
(
questionList
.
length
===
currentQuestionIndex
+
1
)
{
console
.
log
(
'submit'
)
if
(
stageDetail
?.
type
===
StageType
.
OneStop
&&
currentQuestion
&&
!
determinQuestion
(
currentQuestion
))
{
actions
.
submit
()
const
cardNum
=
helpers
.
getStoreState
().
userModel
.
cardNum
/** 没有复活过并且有答题卡 */
if
(
!
isReborn
&&
cardNum
>
0
)
{
stopCounter
()
actions
.
updateState
({
modalContinueVisible
:
true
,
isReborn
:
true
})
}
else
{
actions
.
submit
()
}
return
return
}
}
if
(
stageDetail
?.
type
===
StageType
.
OneStop
)
{
if
(
questionList
.
length
===
currentQuestionIndex
+
1
)
{
if
(
currentQuestion
&&
!
determinQuestion
(
currentQuestion
))
{
actions
.
submit
()
actions
.
updateState
({
return
modalContinueVisible
:
true
,
})
return
}
}
}
actions
.
updateCurrentIndex
(
currentQuestionIndex
+
1
)
actions
.
updateCurrentIndex
(
currentQuestionIndex
+
1
)
}),
}),
reborn
:
thunk
(
async
(
actions
,
_
,
helpers
)
=>
{
const
{
stageDetail
}
=
helpers
.
getState
()
if
(
!
stageDetail
)
return
try
{
await
resumeGame
(
stageDetail
.
id
)
helpers
.
getStoreActions
().
userModel
.
fetchAccount
()
startCounter
()
actions
.
updateState
({
modalContinueVisible
:
false
})
}
catch
(
err
)
{
showModal
({
title
:
'提示'
,
showCancel
:
false
,
content
:
err
.
message
,
success
:
()
=>
{
actions
.
submit
()
}
})
}
}),
getStageDetail
:
thunk
(
async
(
actions
,
round
)
=>
{
getStageDetail
:
thunk
(
async
(
actions
,
round
)
=>
{
try
{
try
{
showLoading
()
showLoading
()
...
@@ -210,7 +232,7 @@ const gameModel: GameModel = {
...
@@ -210,7 +232,7 @@ const gameModel: GameModel = {
}
}
}),
}),
getQuestionList
:
thunk
(
async
(
actions
,
round
)
=>
{
getQuestionList
:
thunk
(
async
(
actions
,
round
,
helpers
)
=>
{
try
{
try
{
// showLoading()
// showLoading()
const
{
data
:
questionList
}
=
await
getQuestionList
(
round
)
const
{
data
:
questionList
}
=
await
getQuestionList
(
round
)
...
@@ -220,8 +242,11 @@ const gameModel: GameModel = {
...
@@ -220,8 +242,11 @@ const gameModel: GameModel = {
isSubmit
:
false
,
isSubmit
:
false
,
currentQuestionIndex
:
0
,
currentQuestionIndex
:
0
,
modalContinueVisible
:
false
,
modalContinueVisible
:
false
,
isReborn
:
false
,
gameStartTime
:
Date
.
now
(),
gameStartTime
:
Date
.
now
(),
})
})
/** 更新账户余额 */
helpers
.
getStoreActions
().
userModel
.
fetchAccount
()
// hideLoading()
// hideLoading()
}
catch
(
err
)
{
}
catch
(
err
)
{
// hideLoading()
// hideLoading()
...
@@ -245,8 +270,9 @@ const gameModel: GameModel = {
...
@@ -245,8 +270,9 @@ const gameModel: GameModel = {
title
:
'提交中'
title
:
'提交中'
})
})
actions
.
updateState
({
isSubmit
:
true
})
actions
.
updateState
({
isSubmit
:
true
})
const
{
questionList
,
gameStartTime
,
stageDetail
}
=
helpers
.
getState
()
stopCounter
()
const
params
=
buildCompleteStageParam
(
questionList
,
stageDetail
!
,
gameStartTime
)
const
{
questionList
,
stageDetail
}
=
helpers
.
getState
()
const
params
=
buildCompleteStageParam
(
questionList
,
stageDetail
!
,
getCounter
()?.
getCount
()
??
0
)
const
{
data
:
gameResult
}
=
await
completeStage
(
params
)
const
{
data
:
gameResult
}
=
await
completeStage
(
params
)
actions
.
updateState
({
actions
.
updateState
({
gameResult
:
{
gameResult
:
{
...
...
src/pages/game/play/model/test-1.json
deleted
100644 → 0
View file @
763c3cd1
[
{
"answers"
:
[{
"contentText"
:
"11"
,
"sort"
:
0
}],
"contentText"
:
"1<MathSymbol value=
\"
+
\"
/>10<MathSymbol value=
\"
=
\"
/><AnswerBlank index=
\"
0
\"
/>"
,
"questionItems"
:
[
{
"contentText"
:
"1"
,
"sort"
:
0
},
{
"contentText"
:
"10"
,
"sort"
:
1
},
{
"contentText"
:
"11"
,
"sort"
:
2
}
],
"questionType"
:
"随机填空"
,
"simpleType"
:
false
},
{
"answers"
:
[{
"contentText"
:
"11"
,
"sort"
:
0
}],
"contentText"
:
"1<MathSymbol value=
\"
+
\"
/>10<MathSymbol value=
\"
=
\"
/><AnswerBlank index=
\"
0
\"
/>"
,
"questionItems"
:
[
{
"contentText"
:
"1"
,
"sort"
:
0
},
{
"contentText"
:
"10"
,
"sort"
:
1
},
{
"contentText"
:
"11"
,
"sort"
:
2
}
],
"questionType"
:
"随机填空"
,
"simpleType"
:
false
},
{
"answers"
:
[{
"contentText"
:
"30"
,
"sort"
:
0
}],
"contentText"
:
"18<MathSymbol value=
\"
+
\"
/>12<MathSymbol value=
\"
=
\"
/><AnswerBlank index=
\"
0
\"
/>"
,
"questionItems"
:
[
{
"contentText"
:
"18"
,
"sort"
:
0
},
{
"contentText"
:
"12"
,
"sort"
:
1
},
{
"contentText"
:
"30"
,
"sort"
:
2
}
],
"questionType"
:
"随机填空"
,
"simpleType"
:
false
},
{
"answers"
:
[{
"contentText"
:
"39"
,
"sort"
:
0
}],
"contentText"
:
"34<MathSymbol value=
\"
+
\"
/>5<MathSymbol value=
\"
=
\"
/><AnswerBlank index=
\"
0
\"
/>"
,
"questionItems"
:
[
{
"contentText"
:
"34"
,
"sort"
:
0
},
{
"contentText"
:
"5"
,
"sort"
:
1
},
{
"contentText"
:
"39"
,
"sort"
:
2
}
],
"questionType"
:
"随机填空"
,
"simpleType"
:
false
},
{
"answers"
:
[{
"contentText"
:
"95"
,
"sort"
:
0
}],
"contentText"
:
"48<MathSymbol value=
\"
+
\"
/>47<MathSymbol value=
\"
=
\"
/><AnswerBlank index=
\"
0
\"
/>"
,
"questionItems"
:
[
{
"contentText"
:
"48"
,
"sort"
:
0
},
{
"contentText"
:
"47"
,
"sort"
:
1
},
{
"contentText"
:
"95"
,
"sort"
:
2
}
],
"questionType"
:
"随机填空"
,
"simpleType"
:
false
},
{
"answers"
:
[{
"contentText"
:
"65"
,
"sort"
:
0
}],
"contentText"
:
"22<MathSymbol value=
\"
+
\"
/>43<MathSymbol value=
\"
=
\"
/><AnswerBlank index=
\"
0
\"
/>"
,
"questionItems"
:
[
{
"contentText"
:
"22"
,
"sort"
:
0
},
{
"contentText"
:
"43"
,
"sort"
:
1
},
{
"contentText"
:
"65"
,
"sort"
:
2
}
],
"questionType"
:
"随机填空"
,
"simpleType"
:
false
},
{
"answers"
:
[{
"contentText"
:
"28"
,
"sort"
:
0
}],
"contentText"
:
"16<MathSymbol value=
\"
+
\"
/>12<MathSymbol value=
\"
=
\"
/><AnswerBlank index=
\"
0
\"
/>"
,
"questionItems"
:
[
{
"contentText"
:
"16"
,
"sort"
:
0
},
{
"contentText"
:
"12"
,
"sort"
:
1
},
{
"contentText"
:
"28"
,
"sort"
:
2
}
],
"questionType"
:
"随机填空"
,
"simpleType"
:
false
},
{
"answers"
:
[{
"contentText"
:
"50"
,
"sort"
:
0
}],
"contentText"
:
"2<MathSymbol value=
\"
+
\"
/>48<MathSymbol value=
\"
=
\"
/><AnswerBlank index=
\"
0
\"
/>"
,
"questionItems"
:
[
{
"contentText"
:
"2"
,
"sort"
:
0
},
{
"contentText"
:
"48"
,
"sort"
:
1
},
{
"contentText"
:
"50"
,
"sort"
:
2
}
],
"questionType"
:
"随机填空"
,
"simpleType"
:
false
},
{
"answers"
:
[{
"contentText"
:
"65"
,
"sort"
:
0
}],
"contentText"
:
"46<MathSymbol value=
\"
+
\"
/>19<MathSymbol value=
\"
=
\"
/><AnswerBlank index=
\"
0
\"
/>"
,
"questionItems"
:
[
{
"contentText"
:
"46"
,
"sort"
:
0
},
{
"contentText"
:
"19"
,
"sort"
:
1
},
{
"contentText"
:
"65"
,
"sort"
:
2
}
],
"questionType"
:
"随机填空"
,
"simpleType"
:
false
},
{
"answers"
:
[{
"contentText"
:
"84"
,
"sort"
:
0
}],
"contentText"
:
"48<MathSymbol value=
\"
+
\"
/>36<MathSymbol value=
\"
=
\"
/><AnswerBlank index=
\"
0
\"
/>"
,
"questionItems"
:
[
{
"contentText"
:
"48"
,
"sort"
:
0
},
{
"contentText"
:
"36"
,
"sort"
:
1
},
{
"contentText"
:
"84"
,
"sort"
:
2
}
],
"questionType"
:
"随机填空"
,
"simpleType"
:
false
}
]
src/pages/game/play/model/test-2.json
deleted
100644 → 0
View file @
763c3cd1
[
{
"answers"
:
[{
"contentText"
:
"32"
,
"sort"
:
0
}],
"contentText"
:
"48<MathSymbol value=
\"
+
\"
/><AnswerBlank index=
\"
0
\"
/><MathSymbol value=
\"
=
\"
/>80"
,
"questionItems"
:
[
{
"contentText"
:
"48"
,
"sort"
:
0
},
{
"contentText"
:
"32"
,
"sort"
:
1
},
{
"contentText"
:
"80"
,
"sort"
:
2
}
],
"questionType"
:
"随机填空"
,
"simpleType"
:
false
},
{
"answers"
:
[{
"contentText"
:
"53"
,
"sort"
:
0
}],
"contentText"
:
"14<MathSymbol value=
\"
+
\"
/>39<MathSymbol value=
\"
=
\"
/><AnswerBlank index=
\"
0
\"
/>"
,
"questionItems"
:
[
{
"contentText"
:
"14"
,
"sort"
:
0
},
{
"contentText"
:
"39"
,
"sort"
:
1
},
{
"contentText"
:
"53"
,
"sort"
:
2
}
],
"questionType"
:
"随机填空"
,
"simpleType"
:
false
},
{
"answers"
:
[{
"contentText"
:
"62"
,
"sort"
:
0
}],
"contentText"
:
"39<MathSymbol value=
\"
+
\"
/>23<MathSymbol value=
\"
=
\"
/><AnswerBlank index=
\"
0
\"
/>"
,
"questionItems"
:
[
{
"contentText"
:
"39"
,
"sort"
:
0
},
{
"contentText"
:
"23"
,
"sort"
:
1
},
{
"contentText"
:
"62"
,
"sort"
:
2
}
],
"questionType"
:
"随机填空"
,
"simpleType"
:
false
},
{
"answers"
:
[{
"contentText"
:
"83"
,
"sort"
:
0
}],
"contentText"
:
"49<MathSymbol value=
\"
+
\"
/>34<MathSymbol value=
\"
=
\"
/><AnswerBlank index=
\"
0
\"
/>"
,
"questionItems"
:
[
{
"contentText"
:
"49"
,
"sort"
:
0
},
{
"contentText"
:
"34"
,
"sort"
:
1
},
{
"contentText"
:
"83"
,
"sort"
:
2
}
],
"questionType"
:
"随机填空"
,
"simpleType"
:
false
},
{
"answers"
:
[{
"contentText"
:
"35"
,
"sort"
:
0
}],
"contentText"
:
"10<MathSymbol value=
\"
+
\"
/><AnswerBlank index=
\"
0
\"
/><MathSymbol value=
\"
=
\"
/>45"
,
"questionItems"
:
[
{
"contentText"
:
"10"
,
"sort"
:
0
},
{
"contentText"
:
"35"
,
"sort"
:
1
},
{
"contentText"
:
"45"
,
"sort"
:
2
}
],
"questionType"
:
"随机填空"
,
"simpleType"
:
false
},
{
"answers"
:
[{
"contentText"
:
"58"
,
"sort"
:
0
}],
"contentText"
:
"48<MathSymbol value=
\"
+
\"
/>10<MathSymbol value=
\"
=
\"
/><AnswerBlank index=
\"
0
\"
/>"
,
"questionItems"
:
[
{
"contentText"
:
"48"
,
"sort"
:
0
},
{
"contentText"
:
"10"
,
"sort"
:
1
},
{
"contentText"
:
"58"
,
"sort"
:
2
}
],
"questionType"
:
"随机填空"
,
"simpleType"
:
false
},
{
"answers"
:
[{
"contentText"
:
"18"
,
"sort"
:
0
}],
"contentText"
:
"4<MathSymbol value=
\"
+
\"
/>14<MathSymbol value=
\"
=
\"
/><AnswerBlank index=
\"
0
\"
/>"
,
"questionItems"
:
[
{
"contentText"
:
"4"
,
"sort"
:
0
},
{
"contentText"
:
"14"
,
"sort"
:
1
},
{
"contentText"
:
"18"
,
"sort"
:
2
}
],
"questionType"
:
"随机填空"
,
"simpleType"
:
false
},
{
"answers"
:
[{
"contentText"
:
"1"
,
"sort"
:
0
}],
"contentText"
:
"<AnswerBlank index=
\"
0
\"
/><MathSymbol value=
\"
+
\"
/>44<MathSymbol value=
\"
=
\"
/>45"
,
"questionItems"
:
[
{
"contentText"
:
"1"
,
"sort"
:
0
},
{
"contentText"
:
"44"
,
"sort"
:
1
},
{
"contentText"
:
"45"
,
"sort"
:
2
}
],
"questionType"
:
"随机填空"
,
"simpleType"
:
false
},
{
"answers"
:
[{
"contentText"
:
"0"
,
"sort"
:
0
}],
"contentText"
:
"9<MathSymbol value=
\"
+
\"
/><AnswerBlank index=
\"
0
\"
/><MathSymbol value=
\"
=
\"
/>9"
,
"questionItems"
:
[
{
"contentText"
:
"9"
,
"sort"
:
0
},
{
"contentText"
:
"0"
,
"sort"
:
1
},
{
"contentText"
:
"9"
,
"sort"
:
2
}
],
"questionType"
:
"随机填空"
,
"simpleType"
:
false
},
{
"answers"
:
[{
"contentText"
:
"6"
,
"sort"
:
0
}],
"contentText"
:
"<AnswerBlank index=
\"
0
\"
/><MathSymbol value=
\"
+
\"
/>44<MathSymbol value=
\"
=
\"
/>50"
,
"questionItems"
:
[
{
"contentText"
:
"6"
,
"sort"
:
0
},
{
"contentText"
:
"44"
,
"sort"
:
1
},
{
"contentText"
:
"50"
,
"sort"
:
2
}
],
"questionType"
:
"随机填空"
,
"simpleType"
:
false
}
]
src/pages/game/play/model/test-3.json
deleted
100644 → 0
View file @
763c3cd1
[
{
"answers"
:
[{
"contentText"
:
"20"
,
"sort"
:
0
}],
"contentText"
:
"<AnswerBlank index=
\"
0
\"
/>元钱可以买1元笔记本21本"
,
"questionItems"
:
[
{
"contentText"
:
"20"
,
"sort"
:
0
},
{
"contentText"
:
"1"
,
"sort"
:
1
},
{
"contentText"
:
"21"
,
"sort"
:
2
}
],
"questionType"
:
"随机填空"
,
"simpleType"
:
false
},
{
"answers"
:
[{
"contentText"
:
"74"
,
"sort"
:
0
}],
"contentText"
:
"48元钱可以买26元笔记本<AnswerBlank index=
\"
0
\"
/>本"
,
"questionItems"
:
[
{
"contentText"
:
"48"
,
"sort"
:
0
},
{
"contentText"
:
"26"
,
"sort"
:
1
},
{
"contentText"
:
"74"
,
"sort"
:
2
}
],
"questionType"
:
"随机填空"
,
"simpleType"
:
false
},
{
"answers"
:
[{
"contentText"
:
"32"
,
"sort"
:
0
}],
"contentText"
:
"<AnswerBlank index=
\"
0
\"
/>元钱可以买24元笔记本56本"
,
"questionItems"
:
[
{
"contentText"
:
"32"
,
"sort"
:
0
},
{
"contentText"
:
"24"
,
"sort"
:
1
},
{
"contentText"
:
"56"
,
"sort"
:
2
}
],
"questionType"
:
"随机填空"
,
"simpleType"
:
false
},
{
"answers"
:
[{
"contentText"
:
"19"
,
"sort"
:
0
}],
"contentText"
:
"9元钱可以买10元笔记本<AnswerBlank index=
\"
0
\"
/>本"
,
"questionItems"
:
[
{
"contentText"
:
"9"
,
"sort"
:
0
},
{
"contentText"
:
"10"
,
"sort"
:
1
},
{
"contentText"
:
"19"
,
"sort"
:
2
}
],
"questionType"
:
"随机填空"
,
"simpleType"
:
false
},
{
"answers"
:
[{
"contentText"
:
"12"
,
"sort"
:
0
}],
"contentText"
:
"11元钱可以买1元笔记本<AnswerBlank index=
\"
0
\"
/>本"
,
"questionItems"
:
[
{
"contentText"
:
"11"
,
"sort"
:
0
},
{
"contentText"
:
"1"
,
"sort"
:
1
},
{
"contentText"
:
"12"
,
"sort"
:
2
}
],
"questionType"
:
"随机填空"
,
"simpleType"
:
false
},
{
"answers"
:
[{
"contentText"
:
"66"
,
"sort"
:
0
}],
"contentText"
:
"30元钱可以买36元笔记本<AnswerBlank index=
\"
0
\"
/>本"
,
"questionItems"
:
[
{
"contentText"
:
"30"
,
"sort"
:
0
},
{
"contentText"
:
"36"
,
"sort"
:
1
},
{
"contentText"
:
"66"
,
"sort"
:
2
}
],
"questionType"
:
"随机填空"
,
"simpleType"
:
false
},
{
"answers"
:
[{
"contentText"
:
"2"
,
"sort"
:
0
}],
"contentText"
:
"<AnswerBlank index=
\"
0
\"
/>元钱可以买7元笔记本9本"
,
"questionItems"
:
[
{
"contentText"
:
"2"
,
"sort"
:
0
},
{
"contentText"
:
"7"
,
"sort"
:
1
},
{
"contentText"
:
"9"
,
"sort"
:
2
}
],
"questionType"
:
"随机填空"
,
"simpleType"
:
false
},
{
"answers"
:
[{
"contentText"
:
"3"
,
"sort"
:
0
}],
"contentText"
:
"<AnswerBlank index=
\"
0
\"
/>元钱可以买14元笔记本17本"
,
"questionItems"
:
[
{
"contentText"
:
"3"
,
"sort"
:
0
},
{
"contentText"
:
"14"
,
"sort"
:
1
},
{
"contentText"
:
"17"
,
"sort"
:
2
}
],
"questionType"
:
"随机填空"
,
"simpleType"
:
false
},
{
"answers"
:
[{
"contentText"
:
"16"
,
"sort"
:
0
}],
"contentText"
:
"27元钱可以买<AnswerBlank index=
\"
0
\"
/>元笔记本43本"
,
"questionItems"
:
[
{
"contentText"
:
"27"
,
"sort"
:
0
},
{
"contentText"
:
"16"
,
"sort"
:
1
},
{
"contentText"
:
"43"
,
"sort"
:
2
}
],
"questionType"
:
"随机填空"
,
"simpleType"
:
false
},
{
"answers"
:
[{
"contentText"
:
"13"
,
"sort"
:
0
}],
"contentText"
:
"6元钱可以买<AnswerBlank index=
\"
0
\"
/>元笔记本19本"
,
"questionItems"
:
[
{
"contentText"
:
"6"
,
"sort"
:
0
},
{
"contentText"
:
"13"
,
"sort"
:
1
},
{
"contentText"
:
"19"
,
"sort"
:
2
}
],
"questionType"
:
"随机填空"
,
"simpleType"
:
false
}
]
src/pages/game/play/model/test-4.json
deleted
100644 → 0
View file @
763c3cd1
[
{
"answers"
:
[
{
"contentText"
:
"69"
,
"sort"
:
0
}
],
"contentText"
:
"28<MathSymbol value=
\"
+
\"
/>41<MathSymbol value=
\"
=
\"
/><AnswerBlank index=
\"
0
\"
/>"
,
"questionItems"
:
[
{
"contentText"
:
"28"
,
"sort"
:
0
},
{
"contentText"
:
"41"
,
"sort"
:
1
},
{
"contentText"
:
"69"
,
"sort"
:
2
}
],
"questionType"
:
"随机填空"
,
"simpleType"
:
true
,
"sort"
:
11
},
{
"answers"
:
[
{
"contentText"
:
"44"
,
"sort"
:
0
}
],
"contentText"
:
"30元钱可以买<AnswerBlank index=
\"
0
\"
/>元笔记本74本"
,
"questionItems"
:
[
{
"contentText"
:
"30"
,
"sort"
:
0
},
{
"contentText"
:
"44"
,
"sort"
:
1
},
{
"contentText"
:
"74"
,
"sort"
:
2
}
],
"questionType"
:
"随机填空"
,
"simpleType"
:
false
,
"sort"
:
13
},
{
"answers"
:
[
{
"contentText"
:
"C"
,
"sort"
:
1
}
],
"contentText"
:
"爸爸把一盘糖果的一半给了弟弟,把剩下的糖果给了一半给姐姐,这时盘里还剩8块,请问盘里原来有几块糖?"
,
"options"
:
[
{
"answer"
:
false
,
"contentText"
:
"16块"
,
"index"
:
"A"
},
{
"answer"
:
false
,
"contentText"
:
"24块"
,
"index"
:
"B"
},
{
"answer"
:
true
,
"contentText"
:
"32块"
,
"index"
:
"C"
},
{
"answer"
:
false
,
"contentText"
:
"64块"
,
"index"
:
"D"
}
],
"questionType"
:
"选择题"
,
"simpleType"
:
false
,
"sort"
:
28
},
{
"answers"
:
[
{
"contentText"
:
"35"
,
"sort"
:
0
}
],
"contentText"
:
"22<MathSymbol value=
\"
+
\"
/>13<MathSymbol value=
\"
=
\"
/><AnswerBlank index=
\"
0
\"
/>"
,
"questionItems"
:
[
{
"contentText"
:
"22"
,
"sort"
:
0
},
{
"contentText"
:
"13"
,
"sort"
:
1
},
{
"contentText"
:
"35"
,
"sort"
:
2
}
],
"questionType"
:
"随机填空"
,
"simpleType"
:
true
,
"sort"
:
49
},
{
"answers"
:
[
{
"contentText"
:
"59"
,
"sort"
:
0
}
],
"contentText"
:
"43元钱可以买16元笔记本<AnswerBlank index=
\"
0
\"
/>本"
,
"questionItems"
:
[
{
"contentText"
:
"43"
,
"sort"
:
0
},
{
"contentText"
:
"16"
,
"sort"
:
1
},
{
"contentText"
:
"59"
,
"sort"
:
2
}
],
"questionType"
:
"随机填空"
,
"simpleType"
:
false
,
"sort"
:
51
},
{
"answers"
:
[
{
"contentText"
:
"13"
,
"sort"
:
0
}
],
"contentText"
:
"<AnswerBlank index=
\"
0
\"
/>元钱可以买21元笔记本34本"
,
"questionItems"
:
[
{
"contentText"
:
"13"
,
"sort"
:
0
},
{
"contentText"
:
"21"
,
"sort"
:
1
},
{
"contentText"
:
"34"
,
"sort"
:
2
}
],
"questionType"
:
"随机填空"
,
"simpleType"
:
false
,
"sort"
:
82
},
{
"answers"
:
[
{
"contentText"
:
"45"
,
"sort"
:
0
}
],
"contentText"
:
"33<MathSymbol value=
\"
+
\"
/>12<MathSymbol value=
\"
=
\"
/><AnswerBlank index=
\"
0
\"
/>"
,
"questionItems"
:
[
{
"contentText"
:
"33"
,
"sort"
:
0
},
{
"contentText"
:
"12"
,
"sort"
:
1
},
{
"contentText"
:
"45"
,
"sort"
:
2
}
],
"questionType"
:
"随机填空"
,
"simpleType"
:
true
,
"sort"
:
83
},
{
"answers"
:
[
{
"contentText"
:
"20"
,
"sort"
:
0
}
],
"contentText"
:
"8<MathSymbol value=
\"
+
\"
/>12<MathSymbol value=
\"
=
\"
/><AnswerBlank index=
\"
0
\"
/>"
,
"questionItems"
:
[
{
"contentText"
:
"8"
,
"sort"
:
0
},
{
"contentText"
:
"12"
,
"sort"
:
1
},
{
"contentText"
:
"20"
,
"sort"
:
2
}
],
"questionType"
:
"随机填空"
,
"simpleType"
:
true
,
"sort"
:
92
},
{
"answers"
:
[
{
"contentText"
:
"18"
,
"sort"
:
0
}
],
"contentText"
:
"7<MathSymbol value=
\"
+
\"
/>11<MathSymbol value=
\"
=
\"
/><AnswerBlank index=
\"
0
\"
/>"
,
"questionItems"
:
[
{
"contentText"
:
"7"
,
"sort"
:
0
},
{
"contentText"
:
"11"
,
"sort"
:
1
},
{
"contentText"
:
"18"
,
"sort"
:
2
}
],
"questionType"
:
"随机填空"
,
"simpleType"
:
true
,
"sort"
:
95
},
{
"answers"
:
[
{
"contentText"
:
"C"
,
"sort"
:
1
}
],
"contentText"
:
"《钢铁是怎样炼成的》是前苏联作家奥斯特洛夫斯基的自传体小说,小说的主人公是()?"
,
"options"
:
[
{
"answer"
:
false
,
"contentText"
:
"格列佛"
,
"index"
:
"A"
},
{
"answer"
:
false
,
"contentText"
:
"汤姆·索亚"
,
"index"
:
"B"
},
{
"answer"
:
true
,
"contentText"
:
"保尔·柯察金"
,
"index"
:
"C"
},
{
"answer"
:
false
,
"contentText"
:
"海伦"
,
"index"
:
"D"
}
],
"questionType"
:
"选择题"
,
"simpleType"
:
false
,
"sort"
:
98
}
]
src/pages/game/play/model/test.json
deleted
100644 → 0
View file @
763c3cd1
[
{
"answers"
:
[
{
"contentText"
:
"C"
,
"sort"
:
1
}
],
"contentText"
:
"爸爸把一盘糖果的一半给了弟弟,把剩下的糖果给了一半给姐姐,这时盘里还剩8块,请问盘里原来有几块糖?"
,
"options"
:
[
{
"answer"
:
false
,
"contentText"
:
"16块"
,
"index"
:
"A"
},
{
"answer"
:
false
,
"contentText"
:
"24块"
,
"index"
:
"B"
},
{
"answer"
:
true
,
"contentText"
:
"32块"
,
"index"
:
"C"
},
{
"answer"
:
false
,
"contentText"
:
"64块"
,
"index"
:
"D"
}
],
"questionType"
:
"选择题"
,
"simpleType"
:
false
},
{
"contentText"
:
"<p>某班50名学生在一次百米测试中,成绩全部介于13秒与19秒之间,将测试结果分成六组,得到频率分布直方图(如图).设成绩小于16秒的学生人数占全班总人数的百分比为<i>x</i>,成绩大于等于15秒且小于17秒的学生人数为<i>y</i>,则从频率分布直方图中可分析出<i>x</i>和<i>y</i>分别为( )</p><p><img src=
\"
https://profile-1257124244.cos.ap-chengdu.myqcloud.com/question/image/943c1ee2-ed62-42d7-b381-d0e3d31677a7.png
\"
style=
\"
max-width:90vw;max-height:62.005104vw
\"
alt=
\"\"
width=
\"
202.90031
\"
height=
\"
139.78728
\"
></p>"
,
"options"
:
[
{
"contentText"
:
"<p>0.56,35</p>"
,
"answer"
:
true
,
"index"
:
"A"
},
{
"contentText"
:
"<p>0.56,45</p>"
,
"answer"
:
false
,
"index"
:
"B"
},
{
"contentText"
:
"<p>0.44,35</p>"
,
"answer"
:
false
,
"index"
:
"C"
},
{
"contentText"
:
"<p>0.44,45</p>"
,
"answer"
:
false
,
"index"
:
"D"
}
],
"answers"
:
[
{
"contentText"
:
"C"
,
"sort"
:
1
}
],
"questionType"
:
"选择题"
,
"simpleType"
:
false
,
"sort"
:
98
},
{
"answers"
:
[
{
"contentText"
:
"C"
,
"sort"
:
1
}
],
"contentText"
:
"《钢铁是怎样炼成的》是前苏联作家奥斯特洛夫斯基的自传体小说,小说的主人公是()?"
,
"options"
:
[
{
"answer"
:
false
,
"contentText"
:
"格列佛"
,
"index"
:
"A"
},
{
"answer"
:
false
,
"contentText"
:
"汤姆·索亚"
,
"index"
:
"B"
},
{
"answer"
:
true
,
"contentText"
:
"保尔·柯察金"
,
"index"
:
"C"
},
{
"answer"
:
false
,
"contentText"
:
"海伦"
,
"index"
:
"D"
}
],
"questionType"
:
"选择题"
,
"simpleType"
:
false
,
"sort"
:
98
},
{
"answers"
:
[
{
"contentText"
:
"20"
,
"sort"
:
0
}
],
"contentText"
:
"<AnswerBlank index=
\"
0
\"
/>元钱可以买1元笔记本21本"
,
"questionItems"
:
[
{
"contentText"
:
"20"
,
"sort"
:
0
},
{
"contentText"
:
"1"
,
"sort"
:
1
},
{
"contentText"
:
"21"
,
"sort"
:
2
}
],
"questionType"
:
"随机填空"
,
"simpleType"
:
false
},
{
"contentText"
:
"7998<AnswerBlank index=
\"
0
\"
compare=
\"
1
\"
/>7988"
,
"questionType"
:
"选择题"
,
"answers"
:
[
{
"sort"
:
0
,
"contentText"
:
"C"
}
],
"simpleType"
:
true
,
"options"
:
[
{
"index"
:
"A"
,
"contentText"
:
"<b><</b>"
,
"answer"
:
false
},
{
"index"
:
"B"
,
"contentText"
:
"<b>=</b>"
,
"answer"
:
false
},
{
"index"
:
"C"
,
"contentText"
:
"<b>></b>"
,
"answer"
:
true
}
]
},
{
"questionItems"
:
[
{
"sort"
:
0
,
"contentText"
:
"57"
},
{
"sort"
:
1
,
"contentText"
:
"8"
}
],
"simpleType"
:
true
,
"questionType"
:
"竖式除法"
,
"answers"
:
[
{
"sort"
:
0
,
"contentText"
:
"A"
},
{
"sort"
:
1
,
"contentText"
:
"A"
},
{
"sort"
:
2
,
"contentText"
:
"A"
},
{
"sort"
:
3
,
"contentText"
:
"A"
}
]
},
{
"answers"
:
[
{
"contentText"
:
"28"
,
"sort"
:
0
}
],
"contentText"
:
"16<MathSymbol value=
\"
+
\"
/>12<MathSymbol value=
\"
=
\"
/><AnswerBlank index=
\"
0
\"
/>"
,
"questionItems"
:
[
{
"contentText"
:
"16"
,
"sort"
:
0
},
{
"contentText"
:
"12"
,
"sort"
:
1
},
{
"contentText"
:
"28"
,
"sort"
:
2
}
],
"questionType"
:
"随机填空"
,
"simpleType"
:
true
},
{
"answers"
:
[
{
"contentText"
:
"50"
,
"sort"
:
0
}
],
"contentText"
:
"2<MathSymbol value=
\"
+
\"
/>48<MathSymbol value=
\"
=
\"
/><AnswerBlank index=
\"
0
\"
/>"
,
"questionItems"
:
[
{
"contentText"
:
"2"
,
"sort"
:
0
},
{
"contentText"
:
"48"
,
"sort"
:
1
},
{
"contentText"
:
"50"
,
"sort"
:
2
}
],
"questionType"
:
"随机填空"
,
"simpleType"
:
true
},
{
"answers"
:
[
{
"contentText"
:
"32"
,
"sort"
:
0
}
],
"contentText"
:
"<AnswerBlank index=
\"
0
\"
/>元钱可以买24元笔记本56本"
,
"questionItems"
:
[
{
"contentText"
:
"32"
,
"sort"
:
0
},
{
"contentText"
:
"24"
,
"sort"
:
1
},
{
"contentText"
:
"56"
,
"sort"
:
2
}
],
"questionType"
:
"随机填空"
,
"simpleType"
:
false
},
{
"answers"
:
[
{
"contentText"
:
"53"
,
"sort"
:
0
}
],
"contentText"
:
"14<MathSymbol value=
\"
+
\"
/>39<MathSymbol value=
\"
=
\"
/><AnswerBlank index=
\"
0
\"
/>"
,
"questionItems"
:
[
{
"contentText"
:
"14"
,
"sort"
:
0
},
{
"contentText"
:
"39"
,
"sort"
:
1
},
{
"contentText"
:
"53"
,
"sort"
:
2
}
],
"questionType"
:
"随机填空"
,
"simpleType"
:
true
},
{
"answers"
:
[
{
"contentText"
:
"62"
,
"sort"
:
0
}
],
"contentText"
:
"39<MathSymbol value=
\"
+
\"
/>23<MathSymbol value=
\"
=
\"
/><AnswerBlank index=
\"
0
\"
/>"
,
"questionItems"
:
[
{
"contentText"
:
"39"
,
"sort"
:
0
},
{
"contentText"
:
"23"
,
"sort"
:
1
},
{
"contentText"
:
"62"
,
"sort"
:
2
}
],
"questionType"
:
"随机填空"
,
"simpleType"
:
true
},
{
"answers"
:
[
{
"contentText"
:
"83"
,
"sort"
:
0
}
],
"contentText"
:
"49<MathSymbol value=
\"
+
\"
/>34<MathSymbol value=
\"
=
\"
/><AnswerBlank index=
\"
0
\"
/>"
,
"questionItems"
:
[
{
"contentText"
:
"49"
,
"sort"
:
0
},
{
"contentText"
:
"34"
,
"sort"
:
1
},
{
"contentText"
:
"83"
,
"sort"
:
2
}
],
"questionType"
:
"随机填空"
,
"simpleType"
:
true
},
{
"answers"
:
[
{
"contentText"
:
"19"
,
"sort"
:
0
}
],
"contentText"
:
"9元钱可以买10元笔记本<AnswerBlank index=
\"
0
\"
/>本"
,
"questionItems"
:
[
{
"contentText"
:
"9"
,
"sort"
:
0
},
{
"contentText"
:
"10"
,
"sort"
:
1
},
{
"contentText"
:
"19"
,
"sort"
:
2
}
],
"questionType"
:
"随机填空"
,
"simpleType"
:
false
},
{
"answers"
:
[
{
"contentText"
:
"12"
,
"sort"
:
0
}
],
"contentText"
:
"11元钱可以买1元笔记本<AnswerBlank index=
\"
0
\"
/>本"
,
"questionItems"
:
[
{
"contentText"
:
"11"
,
"sort"
:
0
},
{
"contentText"
:
"1"
,
"sort"
:
1
},
{
"contentText"
:
"12"
,
"sort"
:
2
}
],
"questionType"
:
"随机填空"
,
"simpleType"
:
false
},
{
"answers"
:
[
{
"contentText"
:
"66"
,
"sort"
:
0
}
],
"contentText"
:
"30元钱可以买36元笔记本<AnswerBlank index=
\"
0
\"
/>本"
,
"questionItems"
:
[
{
"contentText"
:
"30"
,
"sort"
:
0
},
{
"contentText"
:
"36"
,
"sort"
:
1
},
{
"contentText"
:
"66"
,
"sort"
:
2
}
],
"questionType"
:
"随机填空"
,
"simpleType"
:
false
}
]
src/pages/game/play/model/utils.ts
View file @
e2ccd7a4
...
@@ -35,11 +35,9 @@ export function convertQuestion (question: QuestionType): QuestionType {
...
@@ -35,11 +35,9 @@ export function convertQuestion (question: QuestionType): QuestionType {
return
question
return
question
}
}
export
function
buildCompleteStageParam
(
questionList
:
QuestionType
[],
stageDetail
:
StageDetail
,
gameStar
tTime
:
number
):
CompleteStageParam
{
export
function
buildCompleteStageParam
(
questionList
:
QuestionType
[],
stageDetail
:
StageDetail
,
resul
tTime
:
number
):
CompleteStageParam
{
const
correctNum
=
questionList
.
map
(
c
=>
determinQuestion
(
c
)).
filter
(
Boolean
).
length
const
correctNum
=
questionList
.
map
(
c
=>
determinQuestion
(
c
)).
filter
(
Boolean
).
length
const
resultTime
=
Math
.
round
((
Date
.
now
()
-
gameStartTime
)
/
1000
)
const
{
sTime
,
aTime
,
bTime
}
=
stageDetail
const
{
sTime
,
aTime
,
bTime
}
=
stageDetail
let
level
:
StageLevel
|
null
=
null
let
level
:
StageLevel
|
null
=
null
...
@@ -67,7 +65,7 @@ export function buildCompleteStageParam (questionList: QuestionType[], stageDeta
...
@@ -67,7 +65,7 @@ export function buildCompleteStageParam (questionList: QuestionType[], stageDeta
stageId
:
stageDetail
.
id
,
stageId
:
stageDetail
.
id
,
questions
:
questionList
.
map
(
convert
),
questions
:
questionList
.
map
(
convert
),
num
,
num
,
resultTime
:
Math
.
round
((
Date
.
now
()
-
gameStartTime
)
/
1000
)
,
resultTime
,
}
}
}
}
...
...
src/pages/prepare/index.tsx
View file @
e2ccd7a4
import
{
View
,
Text
,
Image
}
from
'@tarojs/components'
import
{
View
,
Text
,
Image
}
from
'@tarojs/components'
import
{
useEffect
}
from
'react'
import
{
useEffect
}
from
'react'
import
{
useRouter
,
getMenuButtonBoundingClientRect
}
from
'@tarojs/taro'
import
{
useRouter
,
getMenuButtonBoundingClientRect
,
navigateTo
}
from
'@tarojs/taro'
import
{
useStoreState
,
useStoreActions
}
from
'@/store/hooks'
import
{
useStoreState
,
useStoreActions
}
from
'@/store/hooks'
import
{
useBoolean
}
from
'@/hooks'
import
{
useBoolean
}
from
'@/hooks'
...
@@ -44,6 +44,8 @@ const Prepare = () => {
...
@@ -44,6 +44,8 @@ const Prepare = () => {
const
stageDetail
=
useStoreState
(
state
=>
state
.
gameModel
.
stageDetail
)
const
stageDetail
=
useStoreState
(
state
=>
state
.
gameModel
.
stageDetail
)
const
getStageDetail
=
useStoreActions
(
actions
=>
actions
.
gameModel
.
getStageDetail
)
const
getStageDetail
=
useStoreActions
(
actions
=>
actions
.
gameModel
.
getStageDetail
)
const
getQuestionList
=
useStoreActions
(
actions
=>
actions
.
gameModel
.
getQuestionList
)
const
cardNum
=
useStoreState
(
state
=>
state
.
userModel
.
cardNum
)
const
router
=
useRouter
<
{
id
:
string
}
>
()
const
router
=
useRouter
<
{
id
:
string
}
>
()
...
@@ -51,6 +53,18 @@ const Prepare = () => {
...
@@ -51,6 +53,18 @@ const Prepare = () => {
getStageDetail
(
+
router
.
params
.
id
||
1
)
getStageDetail
(
+
router
.
params
.
id
||
1
)
},
[
router
,
getStageDetail
])
},
[
router
,
getStageDetail
])
const
handleClick
=
()
=>
{
if
(
cardNum
<
1
)
{
setTrue
()
}
else
{
getQuestionList
(
+
router
.
params
.
id
||
1
).
then
(()
=>
{
navigateTo
({
url
:
`/pages/game/play/index?id=
${
router
.
params
.
id
}
`
})
})
}
}
const
renderList
=
(
list
=
[])
=>
{
const
renderList
=
(
list
=
[])
=>
{
const
isEmpty
=
list
.
length
<
1
const
isEmpty
=
list
.
length
<
1
return
(
return
(
...
@@ -91,7 +105,7 @@ const Prepare = () => {
...
@@ -91,7 +105,7 @@ const Prepare = () => {
</
View
>
</
View
>
<
View
className=
{
styles
.
challenge
}
>
<
View
className=
{
styles
.
challenge
}
>
<
Button
type=
"custom"
size=
"large"
onClick=
{
setTrue
}
>
<
Button
type=
"custom"
size=
"large"
onClick=
{
handleClick
}
>
<
Text
className=
{
styles
.
challenge_text
}
>
开始闯关
</
Text
>
<
Text
className=
{
styles
.
challenge_text
}
>
开始闯关
</
Text
>
<
View
className=
{
styles
.
card
}
>
<
View
className=
{
styles
.
card
}
>
<
Image
className=
{
styles
.
card_icon
}
src=
{
require
(
'@/pages/main/assets/ph.png'
)
}
/>
<
Image
className=
{
styles
.
card_icon
}
src=
{
require
(
'@/pages/main/assets/ph.png'
)
}
/>
...
...
src/store/modules/user.ts
View file @
e2ccd7a4
...
@@ -12,12 +12,16 @@ export interface UserModel {
...
@@ -12,12 +12,16 @@ export interface UserModel {
point
:
number
;
point
:
number
;
updateState
:
Action
<
UserModel
,
{
cardNum
:
number
;
point
:
number
}
>
;
updateState
:
Action
<
UserModel
,
{
cardNum
:
number
;
point
:
number
}
>
;
fetchAccount
:
Thunk
<
UserModel
,
void
,
void
,
AppStoreModel
>
;
fetchAccount
:
Thunk
<
UserModel
,
void
,
void
,
AppStoreModel
>
;
updateUserInfo
:
Action
<
UserModel
,
UserInfo
>
;
}
}
const
userModel
:
UserModel
=
{
const
userModel
:
UserModel
=
{
userInfo
:
getStorage
(
StorageKeys
.
userInfo
)
!
,
userInfo
:
getStorage
(
StorageKeys
.
userInfo
)
!
,
cardNum
:
0
,
cardNum
:
0
,
point
:
0
,
point
:
0
,
updateUserInfo
:
action
((
state
,
user
)
=>
{
state
.
userInfo
=
user
}),
updateState
:
action
((
state
,
{
cardNum
,
point
})
=>
{
updateState
:
action
((
state
,
{
cardNum
,
point
})
=>
{
state
.
cardNum
=
cardNum
state
.
cardNum
=
cardNum
state
.
point
=
point
state
.
point
=
point
...
...
src/types.ts
View file @
e2ccd7a4
import
type
Taro
from
'@tarojs/taro'
import
type
Taro
from
'@tarojs/taro'
export
type
UserInfo
=
{
export
type
UserInfo
=
{
openId
:
string
;
userId
?:
number
;
userId
?:
number
;
phone
?:
string
|
null
;
city
?:
string
;
nickname
?:
string
|
null
;
nickname
?:
string
|
null
;
avatarUrl
?:
string
|
null
;
phone
?:
string
|
null
;
expire
?:
number
;
}
}
export
type
RequestResultPagingLike
<
T
>
=
RequestResult
<
PagingLike
<
T
>>
export
type
RequestResultPagingLike
<
T
>
=
RequestResult
<
PagingLike
<
T
>>
...
...
src/utils/silent-login.ts
View file @
e2ccd7a4
import
{
silentLoginApi
}
from
'@/api'
import
{
silentLoginApi
}
from
'@/api'
// import store from '@/store';
import
store
from
'@/store'
import
Taro
from
'@tarojs/taro'
import
Taro
from
'@tarojs/taro'
import
{
setProfile
}
from
'./skynet'
import
{
setProfile
}
from
'./skynet'
import
{
Deferred
}
from
'./deferred'
import
{
Deferred
}
from
'./deferred'
...
@@ -27,11 +27,8 @@ async function silentLogin () {
...
@@ -27,11 +27,8 @@ async function silentLogin () {
const { data } = await silentLoginApi(code)
const { data } = await silentLoginApi(code)
updateStorage(StorageKeys.openid, data.openId)
updateStorage(StorageKeys.openid, data.openId)
updateStorage(StorageKeys.unionid, data.unionId)
updateStorage(StorageKeys.userInfo, data)
updateStorage(StorageKeys.token, data.token)
store.getActions().userModel.updateUserInfo(data)
updateStorage(StorageKeys.userInfo, {
userId: data.userId,
})
setProfile(data.openId, `
$
{
data
.
userId
}
`)
setProfile(data.openId, `
$
{
data
.
userId
}
`)
} catch (silentLoginError) {
} catch (silentLoginError) {
...
...
src/utils/storage.ts
View file @
e2ccd7a4
...
@@ -6,19 +6,13 @@ const storagePrefix = `${process.env.TARO_STORAGE_KEY}`
...
@@ -6,19 +6,13 @@ const storagePrefix = `${process.env.TARO_STORAGE_KEY}`
export
enum
StorageKeys
{
export
enum
StorageKeys
{
/** 用户信息 */
/** 用户信息 */
userInfo
=
1
,
userInfo
=
1
,
/** token */
token
,
/** openid */
/** openid */
openid
,
openid
,
/** unionid */
unionid
,
}
}
type
Storage
=
{
type
Storage
=
{
[
StorageKeys
.
userInfo
]:
UserInfo
|
null
;
[
StorageKeys
.
userInfo
]:
UserInfo
|
null
;
[
StorageKeys
.
token
]:
string
|
null
;
[
StorageKeys
.
openid
]:
string
|
null
|
undefined
[
StorageKeys
.
openid
]:
string
|
null
;
[
StorageKeys
.
unionid
]:
string
|
null
;
}
}
const
store
:
Storage
=
{}
as
Storage
const
store
:
Storage
=
{}
as
Storage
...
@@ -32,9 +26,7 @@ export function reloadStore () {
...
@@ -32,9 +26,7 @@ export function reloadStore () {
try
{
try
{
[
[
StorageKeys
.
openid
,
StorageKeys
.
openid
,
StorageKeys
.
userInfo
,
StorageKeys
.
userInfo
StorageKeys
.
token
,
StorageKeys
.
unionid
].
forEach
((
element
)
=>
{
].
forEach
((
element
)
=>
{
updateStorage
(
element
,
Taro
.
getStorageSync
(
`
${
storagePrefix
}${
element
}
`
)
??
null
)
updateStorage
(
element
,
Taro
.
getStorageSync
(
`
${
storagePrefix
}${
element
}
`
)
??
null
)
})
})
...
@@ -45,8 +37,6 @@ export function reloadStore () {
...
@@ -45,8 +37,6 @@ export function reloadStore () {
reloadStore
()
reloadStore
()
console
.
log
(
store
,
1111111
)
export
function
getStorage
<
T
extends
StorageKeys
>
(
key
:
T
):
Storage
[
T
]
|
null
{
export
function
getStorage
<
T
extends
StorageKeys
>
(
key
:
T
):
Storage
[
T
]
|
null
{
return
store
[
key
]
return
store
[
key
]
}
}
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