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
cfb790aa
Commit
cfb790aa
authored
Apr 05, 2023
by
m
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: update
parent
14f990d9
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
29 deletions
+32
-29
complete-achieve.tsx
src/pages/game/complete/components/complete-achieve.tsx
+1
-1
index.module.scss
src/pages/prepare/index.module.scss
+3
-5
index.tsx
src/pages/prepare/index.tsx
+28
-23
No files found.
src/pages/game/complete/components/complete-achieve.tsx
View file @
cfb790aa
...
@@ -80,7 +80,7 @@ const GameCompleteAchieve = () => {
...
@@ -80,7 +80,7 @@ const GameCompleteAchieve = () => {
hoverClass=
{
styles
.
is_active
}
hoverClass=
{
styles
.
is_active
}
onClick=
{
handleContinue
}
onClick=
{
handleContinue
}
>
>
继续
22
继续
</
View
>
</
View
>
</
View
>
</
View
>
)
)
...
...
src/pages/prepare/index.module.scss
View file @
cfb790aa
...
@@ -140,11 +140,12 @@
...
@@ -140,11 +140,12 @@
@include
flexLayout
(
row
,
center
,
center
);
@include
flexLayout
(
row
,
center
,
center
);
gap
:
13
PX
;
gap
:
13
PX
;
&
.image
{
.image
{
flex
:
1
;
background-image
:
url('https://cdn.jkwljy.com/pk-math/gMAFXFRRH3frGsM2wCpyLUCdiNT/343x56')
;
background-image
:
url('https://cdn.jkwljy.com/pk-math/gMAFXFRRH3frGsM2wCpyLUCdiNT/343x56')
;
}
}
&
.hover_image
{
.hover_image
{
background-image
:
url('https://cdn.jkwljy.com/pk-math/3UiwFgrVHVQEcaPdxdf1XinBb64o/343x56')
;
background-image
:
url('https://cdn.jkwljy.com/pk-math/3UiwFgrVHVQEcaPdxdf1XinBb64o/343x56')
;
}
}
...
@@ -159,9 +160,6 @@
...
@@ -159,9 +160,6 @@
.long_image
{
.long_image
{
flex
:
1
;
flex
:
1
;
padding-left
:
60px
;
gap
:
24px
;
@include
flexLayout
(
row
);
background-image
:
url('https://cdn.jkwljy.com/pk-math/3dPDWGQGwQFH3jksyqJZdzF3g9kF/400x112')
;
background-image
:
url('https://cdn.jkwljy.com/pk-math/3dPDWGQGwQFH3jksyqJZdzF3g9kF/400x112')
;
}
}
...
...
src/pages/prepare/index.tsx
View file @
cfb790aa
import
{
View
,
Text
,
Image
}
from
'@tarojs/components'
import
{
View
,
Text
,
Image
}
from
'@tarojs/components'
import
{
useMemo
,
useState
,
useEffect
}
from
'react'
import
{
useMemo
,
useState
,
useEffect
,
useCallback
}
from
'react'
import
{
useRouter
,
redirectTo
,
useDidShow
,
getMenuButtonBoundingClientRect
,
useShareAppMessage
,
navigateTo
}
from
'@tarojs/taro'
import
{
useRouter
,
redirectTo
,
useDidShow
,
getMenuButtonBoundingClientRect
,
useShareAppMessage
,
navigateTo
}
from
'@tarojs/taro'
import
classNames
from
'classnames'
import
classNames
from
'classnames'
...
@@ -33,7 +33,6 @@ const Prepare = () => {
...
@@ -33,7 +33,6 @@ const Prepare = () => {
const
userInfo
=
useStoreState
(
state
=>
state
.
userModel
.
userInfo
)
const
userInfo
=
useStoreState
(
state
=>
state
.
userModel
.
userInfo
)
const
isSubmit
=
useStoreState
(
state
=>
state
.
gameModel
.
isSubmit
)
const
isSubmit
=
useStoreState
(
state
=>
state
.
gameModel
.
isSubmit
)
const
tribeInfo
=
useStoreState
(
state
=>
state
.
groupModel
.
tribeInfo
)
const
tribeInfo
=
useStoreState
(
state
=>
state
.
groupModel
.
tribeInfo
)
const
questionList
=
useStoreState
(
state
=>
state
.
gameModel
.
questionList
)
const
stageList
=
useStoreState
(
state
=>
state
.
mainModel
.
stageList
)
const
stageList
=
useStoreState
(
state
=>
state
.
mainModel
.
stageList
)
const
getStageDetail
=
useStoreActions
(
actions
=>
actions
.
gameModel
.
getStageDetail
)
const
getStageDetail
=
useStoreActions
(
actions
=>
actions
.
gameModel
.
getStageDetail
)
const
getQuestionList
=
useStoreActions
(
actions
=>
actions
.
gameModel
.
getQuestionList
)
const
getQuestionList
=
useStoreActions
(
actions
=>
actions
.
gameModel
.
getQuestionList
)
...
@@ -98,7 +97,6 @@ const Prepare = () => {
...
@@ -98,7 +97,6 @@ const Prepare = () => {
setTrue()
setTrue()
} else {
} else {
getQuestionList(+router.params.id || 1).then(() => {
getQuestionList(+router.params.id || 1).then(() => {
console.log('questionList', questionList)
navigateTo({
navigateTo({
url: `
/
pages
/
game
/
play
/
index
?
id
=
$
{
router
.
params
.
id
}
`
url: `
/
pages
/
game
/
play
/
index
?
id
=
$
{
router
.
params
.
id
}
`
})
})
...
@@ -106,35 +104,42 @@ const Prepare = () => {
...
@@ -106,35 +104,42 @@ const Prepare = () => {
}
}
}
}
const onNext = () => {
const onNext =
useCallback(
() => {
const index = stageList.findIndex(item => item.id === stageDetail?.id)
const index = stageList.findIndex(item => item.id === stageDetail?.id)
const
nextI
d = stageList[index + 1].id
const
i
d = stageList[index + 1].id
if (
nextI
d) {
if (
i
d) {
navigateTo({ url: `
/
pages
/
prepare
/
index
?
id
=
$
{
nextI
d
}
` })
navigateTo({ url: `
/
pages
/
prepare
/
index
?
id
=
$
{
i
d
}
` })
updateState({ isSubmit: false })
updateState({ isSubmit: false })
}
}
}
}
, [stageList, stageDetail?.id])
const renderFisrtActions = () => (
const renderFisrtActions = () => (
<Button size="large" onClick={handleClick} className={styles.challenge} image={styles.image} hoverImage={styles.hover_image}>
<View className={styles.challenge}>
<Text className={styles.challenge_text}>开始闯关</Text>
<Button size="large" onClick={handleClick} image={styles.image} hoverImage={styles.hover_image}>
<View className={styles.card} style={{ position: 'absolute', right: 50 }}>
<Text className={styles.challenge_text}>开始闯关</Text>
<Image className={styles.card_icon} src={require('@/pages/main/assets/ph.png')} />
<View className={styles.card} style={{ position: 'absolute', right: 50 }}>
<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>
{stageDetail?.firstTime && <View className={styles.tip}>
</View>
<Text className={styles.tip_text}>首次免答题卡</Text>
{stageDetail?.firstTime && <View className={styles.tip}>
</View>}
<Text className={styles.tip_text}>首次免答题卡</Text>
</Button>
</View>}
</Button>
</View>
)
)
const renderAgainActions = () => (
const renderAgainActions = () => (
<View className={styles.challenge}>
<View className={styles.challenge}>
<Button onClick={onNext} size="large" image={styles.short_image} hoverImage={styles.short_hover_image}>
{stageDetail?.level &&
<Button onClick={onNext} size="large" image={styles.short_image} hoverImage={styles.short_hover_image}>
下一关
下一关
</Button>
</Button>}
<Button size="large" onClick={handleClick} image={styles.long_image} hoverImage={styles.long_hover_image}>
<Button
<View className={styles.card}>
size="large"
onClick={handleClick}
image={classNames(!stageDetail?.level ? styles.image : styles.long_image)}
hoverImage={classNames(!stageDetail?.level ? styles.hover_image : styles.long_hover_image)}
>
<View className={styles.card} style={{ marginRight: 12 }}>
<Image className={styles.card_icon} src={require('@/pages/main/assets/ph.png')} />
<Image className={styles.card_icon} src={require('@/pages/main/assets/ph.png')} />
<Text className={styles.card_text}>-1</Text>
<Text className={styles.card_text}>-1</Text>
</View>
</View>
...
@@ -159,7 +164,7 @@ const Prepare = () => {
...
@@ -159,7 +164,7 @@ const Prepare = () => {
</View>
</View>
</ShareView>}
</ShareView>}
{
!
isSubmit ? renderFisrtActions() : renderAgainActions()}
{isSubmit ? renderFisrtActions() : renderAgainActions()}
</View>
</View>
<AnswerCardModal isVisible={isVisible} onClose={setFalse}>
<AnswerCardModal isVisible={isVisible} onClose={setFalse}>
...
...
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