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
37a83ece
Commit
37a83ece
authored
Apr 23, 2023
by
hewenhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: update
parent
0becbf0b
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
11 deletions
+24
-11
game.ts
src/api/game.ts
+2
-2
index.ts
src/pages/game/play/model/index.ts
+5
-1
index.module.scss
src/pages/market/index.module.scss
+3
-2
index.tsx
src/pages/prepare/index.tsx
+14
-6
No files found.
src/api/game.ts
View file @
37a83ece
...
@@ -2,11 +2,11 @@
...
@@ -2,11 +2,11 @@
import
{
requestAfterSilentLogin
}
from
'@/utils/request'
import
{
requestAfterSilentLogin
}
from
'@/utils/request'
import
{
QuestionItem
,
type
QuestionType
}
from
'@/pages/game/play/types'
import
{
QuestionItem
,
type
QuestionType
}
from
'@/pages/game/play/types'
export
const
getQuestionList
=
(
stageId
:
number
)
=>
{
export
const
getQuestionList
=
(
stageId
:
number
,
normal
:
boolean
=
true
)
=>
{
return
requestAfterSilentLogin
<
QuestionType
[],
{
stageId
:
number
,
userId
?:
number
}
>
(
userInfo
=>
({
return
requestAfterSilentLogin
<
QuestionType
[],
{
stageId
:
number
,
userId
?:
number
}
>
(
userInfo
=>
({
url
:
'/service-idea/stage/startStage'
,
url
:
'/service-idea/stage/startStage'
,
method
:
'GET'
,
method
:
'GET'
,
data
:
{
stageId
,
userId
:
userInfo
?.
userId
}
data
:
{
stageId
,
userId
:
userInfo
?.
userId
,
normal
}
}))
}))
}
}
...
...
src/pages/game/play/model/index.ts
View file @
37a83ece
...
@@ -286,7 +286,11 @@ const gameModel: GameModel = {
...
@@ -286,7 +286,11 @@ const gameModel: GameModel = {
getQuestionList
:
thunk
(
async
(
actions
,
round
,
helpers
)
=>
{
getQuestionList
:
thunk
(
async
(
actions
,
round
,
helpers
)
=>
{
try
{
try
{
// showLoading()
// showLoading()
const
{
data
:
questionList
}
=
await
getQuestionList
(
round
)
const
stageList
=
helpers
.
getStoreState
().
mainModel
.
stageList
const
isFirstStage
=
stageList
.
findIndex
(
c
=>
String
(
c
.
id
)
===
String
(
round
))
===
0
const
stageDetail
=
helpers
.
getState
().
stageDetail
const
isNormal
=
!
isFirstStage
||
!!
stageDetail
?.
level
const
{
data
:
questionList
}
=
await
getQuestionList
(
round
,
isNormal
)
actions
.
updateState
({
actions
.
updateState
({
questionList
:
questionList
.
map
(
convertQuestion
),
questionList
:
questionList
.
map
(
convertQuestion
),
currentInputIndex
:
0
,
currentInputIndex
:
0
,
...
...
src/pages/market/index.module.scss
View file @
37a83ece
...
@@ -67,11 +67,12 @@
...
@@ -67,11 +67,12 @@
.guide_content
{
.guide_content
{
position
:
absolute
;
position
:
absolute
;
top
:
0
;
top
:
16px
;
left
:
0
;
left
:
0
;
right
:
0
;
right
:
0
;
transform
:
translateY
(
-100%
);
transform
:
translateY
(
-100%
);
display
:
flex
;
display
:
flex
;
z-index
:
1
;
}
}
.card-body
{
.card-body
{
...
@@ -94,7 +95,7 @@
...
@@ -94,7 +95,7 @@
right
:
-8px
;
right
:
-8px
;
bottom
:
-8px
;
bottom
:
-8px
;
border-radius
:
32px
;
border-radius
:
32px
;
border
:
4
px
dashed
#FFFFFF
;
border
:
8
px
dashed
#FFFFFF
;
}
}
}
}
}
}
...
...
src/pages/prepare/index.tsx
View file @
37a83ece
...
@@ -106,6 +106,12 @@ const Prepare = () => {
...
@@ -106,6 +106,12 @@ const Prepare = () => {
const completeGuide = useStoreActions(actions => actions.prepareModel.completeGuide)
const completeGuide = useStoreActions(actions => actions.prepareModel.completeGuide)
const completeFailGuide = useStoreActions(actions => actions.prepareModel.completeFailGuide)
const completeFailGuide = useStoreActions(actions => actions.prepareModel.completeFailGuide)
const isNormal = useMemo(() => {
const isFirstStage = stageList.findIndex(stage => stage.id === +router.params.id) === 0
const isPassed = !!stageDetail?.level
return !isFirstStage || isPassed
}, [stageDetail, stageList, router])
const handleClick = async () => {
const handleClick = async () => {
/** 首次闯关引导完成 */
/** 首次闯关引导完成 */
!guideComplete && await completeGuide()
!guideComplete && await completeGuide()
...
@@ -113,7 +119,7 @@ const Prepare = () => {
...
@@ -113,7 +119,7 @@ const Prepare = () => {
/** 首次闯关失败引导完成 */
/** 首次闯关失败引导完成 */
isSubmit && !failGuideComplete && await completeFailGuide()
isSubmit && !failGuideComplete && await completeFailGuide()
if (cardNum < 1 && !stageDetail?.firstTime) {
if (cardNum < 1 && !stageDetail?.firstTime
&& isNormal
) {
setTrue()
setTrue()
} else {
} else {
if (isClickRef.current) return
if (isClickRef.current) return
...
@@ -150,7 +156,7 @@ const Prepare = () => {
...
@@ -150,7 +156,7 @@ const Prepare = () => {
<Text className={styles.challenge_text}>开始闯关</Text>
<Text className={styles.challenge_text}>开始闯关</Text>
<View className={styles.card} style={{ position: 'absolute', right: 60 }}>
<View className={styles.card} style={{ position: 'absolute', right: 60 }}>
<Image className={styles.card_icon} src={require('@/pages/main/assets/ph.png')} />
<Image className={styles.card_icon} src={require('@/pages/main/assets/ph.png')} />
{!stageDetail?.firstTime && <Text className={styles.card_text}>-1</Text>}
{!stageDetail?.firstTime &&
isNormal &&
<Text className={styles.card_text}>-1</Text>}
</View>
</View>
{stageDetail?.firstTime && <View className={styles.tip}>
{stageDetail?.firstTime && <View className={styles.tip}>
<Text className={styles.tip_text}>首次免答题卡</Text>
<Text className={styles.tip_text}>首次免答题卡</Text>
...
@@ -219,10 +225,12 @@ const Prepare = () => {
...
@@ -219,10 +225,12 @@ const Prepare = () => {
image={classNames(!hasNextBtn ? styles.image : styles.long_image)}
image={classNames(!hasNextBtn ? styles.image : styles.long_image)}
hoverImage={classNames(!hasNextBtn ? styles.hover_image : styles.long_hover_image)}
hoverImage={classNames(!hasNextBtn ? styles.hover_image : styles.long_hover_image)}
>
>
<View className={styles.card} style={{ marginRight: 12 }}>
{isNormal && (
<Image className={styles.card_icon} src={require('@/pages/main/assets/ph.png')} />
<View className={styles.card} style={{ marginRight: 12 }}>
<Text className={styles.card_text}>-1</Text>
<Image className={styles.card_icon} src={require('@/pages/main/assets/ph.png')} />
</View>
<Text className={styles.card_text}>-1</Text>
</View>
)}
<Text className={styles.challenge_text}>再次提升</Text>
<Text className={styles.challenge_text}>再次提升</Text>
</Button>
</Button>
</View>
</View>
...
...
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