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
d5613eed
Commit
d5613eed
authored
Jun 20, 2023
by
hewenhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: update
parent
341d45f2
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
22 deletions
+23
-22
model.ts
src/pages/battles/model.ts
+1
-1
utils.ts
src/pages/game/play/model/utils.ts
+19
-19
constants.ts
src/pages/main/main-underground/scene/constants.ts
+3
-2
No files found.
src/pages/battles/model.ts
View file @
d5613eed
...
...
@@ -15,7 +15,7 @@ interface BattlesModel {
const
battlesModel
:
BattlesModel
=
{
details
:
null
,
summary
:
null
,
modalIsVisible
:
tru
e
,
modalIsVisible
:
fals
e
,
setModalIsVisible
:
action
((
state
,
payload
)
=>
{
state
.
modalIsVisible
=
payload
...
...
src/pages/game/play/model/utils.ts
View file @
d5613eed
...
...
@@ -2,7 +2,7 @@ import { type CompleteStageParam, type StageDetail, StageLevel, type CompleteQue
import
{
getLogManager
}
from
'@tarojs/taro'
import
{
getStorage
,
StorageKeys
}
from
'@/utils/storage'
import
{
UserInfo
}
from
'@/types'
import
{
type
QuestionType
,
isBlankQuestion
,
isVerticalDivisionQuestion
,
isSelectionQuestion
}
from
'../types'
import
{
type
QuestionType
,
isBlankQuestion
,
isVerticalDivisionQuestion
,
isSelectionQuestion
,
isFractionAddMinusQuestion
,
isVerticalAddMinusQuestion
}
from
'../types'
const
logger
=
getLogManager
({
level
:
1
})
...
...
@@ -99,13 +99,6 @@ export function buildCompleteStageParam (questionList: QuestionType[], stageDeta
}
function
convert
(
inQuestion
:
QuestionType
):
CompleteQuestion
{
if
(
isBlankQuestion
(
inQuestion
))
{
return
{
...
inQuestion
,
userAnswers
:
inQuestion
.
answers
.
map
(
c
=>
c
.
userAnswer
!
),
}
}
if
(
isSelectionQuestion
(
inQuestion
))
{
return
{
...
inQuestion
,
...
...
@@ -113,7 +106,12 @@ function convert (inQuestion: QuestionType): CompleteQuestion {
}
}
if
(
isVerticalDivisionQuestion
(
inQuestion
))
{
if
(
isVerticalDivisionQuestion
(
inQuestion
)
||
isBlankQuestion
(
inQuestion
)
||
isFractionAddMinusQuestion
(
inQuestion
)
||
isVerticalAddMinusQuestion
(
inQuestion
)
)
{
return
{
...
inQuestion
,
userAnswers
:
inQuestion
.
answers
.
map
(
c
=>
c
.
userAnswer
!
),
...
...
@@ -125,15 +123,16 @@ function convert (inQuestion: QuestionType): CompleteQuestion {
/** 已答题目 */
export
function
answeredQuestion
(
question
:
QuestionType
)
{
if
(
isBlankQuestion
(
question
))
{
return
question
.
answers
.
every
(
c
=>
c
.
userAnswer
)
}
if
(
isSelectionQuestion
(
question
))
{
return
question
.
options
.
some
(
c
=>
c
.
userAnswer
)
}
if
(
isVerticalDivisionQuestion
(
question
))
{
if
(
isBlankQuestion
(
question
)
||
isVerticalDivisionQuestion
(
question
)
||
isFractionAddMinusQuestion
(
question
)
||
isVerticalAddMinusQuestion
(
question
)
)
{
return
question
.
answers
.
every
(
c
=>
c
.
userAnswer
)
}
...
...
@@ -142,15 +141,16 @@ export function answeredQuestion (question: QuestionType) {
/** 判题 */
export
function
determinQuestion
(
question
:
QuestionType
)
{
if
(
isBlankQuestion
(
question
))
{
return
question
.
answers
.
every
(
c
=>
c
.
userAnswer
===
c
.
contentText
)
}
if
(
isSelectionQuestion
(
question
))
{
return
question
.
options
.
every
(
c
=>
c
.
answer
===
c
.
userAnswer
)
}
if
(
isVerticalDivisionQuestion
(
question
))
{
if
(
isBlankQuestion
(
question
)
||
isVerticalDivisionQuestion
(
question
)
||
isFractionAddMinusQuestion
(
question
)
||
isVerticalAddMinusQuestion
(
question
)
)
{
return
question
.
answers
.
every
(
c
=>
c
.
userAnswer
===
c
.
contentText
)
}
...
...
src/pages/main/main-underground/scene/constants.ts
View file @
d5613eed
...
...
@@ -23,6 +23,7 @@ preloadImage([
])
export
{
StageStatus
,
StageLevel
,
Stage
,
StageType
}
const
isProduction
=
process
.
env
.
SERVER_ENDPOINT
===
'https://geek.jkwljy.com'
export
const
CurrentRoundId
=
'__current_round__'
...
...
@@ -51,10 +52,10 @@ function stageToStageNext (stageList: Stage[]): {nextList: StageNext[]; showList
const
currentIndex
=
newList
.
findIndex
(
c
=>
c
.
status
===
StageStatus
.
CURRENT
)
let
showList
:
Stage
[]
=
[]
if
(
currentIndex
===
-
1
)
{
if
(
currentIndex
===
-
1
||
!
isProduction
)
{
showList
=
newList
}
else
{
showList
=
newList
.
slice
(
0
,
Math
.
max
(
currentIndex
+
3
0
,
5
))
showList
=
newList
.
slice
(
0
,
Math
.
max
(
currentIndex
+
3
,
5
))
}
/** 设置pk历史页面返回后引导 */
if
(
showList
[
currentIndex
-
1
])
{
...
...
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