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
df1661fb
Commit
df1661fb
authored
Apr 05, 2023
by
hewenhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: update
parent
05e10b46
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
16 deletions
+21
-16
index.module.scss
src/components/Button/index.module.scss
+4
-5
index.tsx
src/pages/game/play/index.tsx
+7
-1
index.ts
src/pages/game/play/model/index.ts
+0
-1
index.tsx
src/pages/prepare/index.tsx
+10
-9
No files found.
src/components/Button/index.module.scss
View file @
df1661fb
...
...
@@ -2,7 +2,7 @@
border
:
none
;
outline
:
none
;
user-select
:
none
;
transition
:
all
0
.3s
;
//
transition: all 0.3s;
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
...
...
@@ -11,7 +11,7 @@
// width: 100%;
background-size
:
100%
100%
;
color
:
#FFFFFF
;
&
.default
{
flex
:
1
;
border
:
4rpx
solid
rgba
(
70
,
81
,
100
,
0
.3
);
...
...
@@ -24,7 +24,7 @@
border-radius
:
36px
;
background-color
:
#1786F7
;
}
&
.disabled
{
background-image
:
none
;
background-color
:
#E2E6ED
;
...
...
@@ -61,4 +61,4 @@
.spin
{
margin-right
:
12
PX
;
}
}
\ No newline at end of file
}
src/pages/game/play/index.tsx
View file @
df1661fb
import
{
View
,
ScrollView
}
from
'@tarojs/components'
import
{
useStoreState
}
from
'@/store/hooks'
import
{
useStoreState
,
useStoreActions
}
from
'@/store/hooks'
import
{
preloadImage
}
from
'@/utils/preload-image'
import
{
useEffect
}
from
'react'
import
{
useDidShow
}
from
'@tarojs/taro'
import
assets
from
'@/assets/oss/assets-complete'
import
ModalContinue
from
'./components/modal-continue'
...
...
@@ -27,11 +28,16 @@ const preloadCompleteImages = () => {
const
GamePlay
=
()
=>
{
const
currentQuestion
=
useStoreState
(
states
=>
states
.
gameModel
.
currentQuestion
)
const
stageDetail
=
useStoreState
(
state
=>
state
.
gameModel
.
stageDetail
)
const
updateState
=
useStoreActions
(
actions
=>
actions
.
gameModel
.
updateState
)
useEffect
(()
=>
{
preloadCompleteImages
()
},
[])
useDidShow
(()
=>
{
updateState
({
isSubmit
:
false
})
})
return
(
<>
<
View
className=
{
styles
.
viewport
}
>
...
...
src/pages/game/play/model/index.ts
View file @
df1661fb
...
...
@@ -240,7 +240,6 @@ const gameModel: GameModel = {
actions
.
updateState
({
questionList
:
questionList
.
map
(
convertQuestion
),
currentInputIndex
:
0
,
isSubmit
:
false
,
currentQuestionIndex
:
0
,
modalContinueVisible
:
false
,
isReborn
:
false
,
...
...
src/pages/prepare/index.tsx
View file @
df1661fb
...
...
@@ -9,7 +9,6 @@ import ShareView from '@/pages/group/components/share-view'
import
{
useStoreState
,
useStoreActions
}
from
'@/store/hooks'
import
{
useBoolean
,
useRequest
}
from
'@/hooks'
import
{
pointToCard
}
from
'@/api/account'
import
{
StageStatus
}
from
'@/api/game'
import
assets
from
'@/assets/oss/assets-prepare'
import
assetsGroup
from
'@/assets/oss/assets-group'
...
...
@@ -105,16 +104,14 @@ const Prepare = () => {
}
const isLast = useMemo(() => {
const len = stageList.length
const index = stageList.findIndex(c => c.id === stageDetail?.id)
return len - 1 === index
return stageList.length - 1 === stageList.findIndex(c => c.id === stageDetail?.id)
}, [stageList, stageDetail])
const onNext = useCallback(() => {
const index = stageList.findIndex(item => item.id === stageDetail?.id)
const id = stageList[index + 1].id
const id = stageList[index + 1]
?
.id
if (id) {
navigate
To({ url: `
/
pages
/
prepare
/
index
?
id
=
$
{
id
}
` })
redirect
To({ url: `
/
pages
/
prepare
/
index
?
id
=
$
{
id
}
` })
updateState({ isSubmit: false })
}
}, [stageList, stageDetail?.id, updateState])
...
...
@@ -134,9 +131,13 @@ const Prepare = () => {
</View>
)
const hasNextBtn = useMemo(() => {
return stageDetail?.level && isSubmit && !isLast
}, [stageDetail, isSubmit, isLast])
const renderAgainActions = () => (
<View className={styles.challenge}>
{
stageDetail?.level && isSubmit && !isLast
&& (
{
hasNextBtn
&& (
<Button onClick={onNext} size="large" image={styles.short_image} hoverImage={styles.short_hover_image}>
下一关
</Button>
...
...
@@ -144,8 +145,8 @@ const Prepare = () => {
<Button
size="large"
onClick={handleClick}
image={classNames(!
stageDetail?.level
? styles.image : styles.long_image)}
hoverImage={classNames(!
stageDetail?.level
? styles.hover_image : styles.long_hover_image)}
image={classNames(!
hasNextBtn
? styles.image : styles.long_image)}
hoverImage={classNames(!
hasNextBtn
? 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')} />
...
...
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