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
df5f52d7
Commit
df5f52d7
authored
Apr 07, 2023
by
hewenhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: update
parent
d67c8931
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
37 additions
and
17 deletions
+37
-17
question-blank.module.scss
.../game/play/components/question/question-blank.module.scss
+2
-2
question-selection.module.scss
...e/play/components/question/question-selection.module.scss
+2
-2
stage-tag.tsx
src/pages/main/components/scene/stage-tag.tsx
+0
-1
count-up.tsx
src/pages/main/guide/components/count-up.tsx
+3
-1
index.tsx
src/pages/main/guide/index.tsx
+3
-2
scene-3.tsx
src/pages/main/guide/scene-3.tsx
+11
-6
scene-4.tsx
src/pages/main/guide/scene-4.tsx
+7
-3
main.tsx
src/pages/main/main.tsx
+9
-0
No files found.
src/pages/game/play/components/question/question-blank.module.scss
View file @
df5f52d7
...
@@ -2,10 +2,10 @@
...
@@ -2,10 +2,10 @@
font-weight
:
500
;
font-weight
:
500
;
color
:
#465164
;
color
:
#465164
;
min-height
:
100%
;
min-height
:
100%
;
font-size
:
32
px
;
font-size
:
40
px
;
font-weight
:
500
;
font-weight
:
500
;
color
:
#465164
;
color
:
#465164
;
line-height
:
56
px
;
line-height
:
60
px
;
padding
:
32px
32px
0
32px
;
padding
:
32px
32px
0
32px
;
box-sizing
:
border-box
;
box-sizing
:
border-box
;
...
...
src/pages/game/play/components/question/question-selection.module.scss
View file @
df5f52d7
.content
{
.content
{
font-size
:
32
px
;
font-size
:
40
px
;
font-weight
:
500
;
font-weight
:
500
;
color
:
#465164
;
color
:
#465164
;
line-height
:
58
px
;
line-height
:
60
px
;
flex
:
1
;
flex
:
1
;
&
.is_sample
{
&
.is_sample
{
...
...
src/pages/main/components/scene/stage-tag.tsx
View file @
df5f52d7
...
@@ -31,7 +31,6 @@ const StageTag = (props: StageTagProps) => {
...
@@ -31,7 +31,6 @@ const StageTag = (props: StageTagProps) => {
useEffect
(()
=>
{
useEffect
(()
=>
{
let
observer
:
IntersectionObserver
|
null
=
null
let
observer
:
IntersectionObserver
|
null
=
null
console
.
log
(
ready
,
111111111
,
isFocus
)
const
fn
=
()
=>
{
const
fn
=
()
=>
{
if
(
ready
&&
isFocus
)
{
if
(
ready
&&
isFocus
)
{
const
navVal
=
nav
.
current
const
navVal
=
nav
.
current
...
...
src/pages/main/guide/components/count-up.tsx
View file @
df5f52d7
...
@@ -7,12 +7,13 @@ import styles from './count-up.module.scss'
...
@@ -7,12 +7,13 @@ import styles from './count-up.module.scss'
type
CountUpProps
=
{
type
CountUpProps
=
{
isSubmit
:
boolean
;
isSubmit
:
boolean
;
currentIndex
:
number
;
currentIndex
:
number
;
id
:
string
;
}
}
const
questionLength
=
3
const
questionLength
=
3
const
CountUp
=
(
props
:
CountUpProps
)
=>
{
const
CountUp
=
(
props
:
CountUpProps
)
=>
{
const
{
isSubmit
,
currentIndex
}
=
props
const
{
isSubmit
,
currentIndex
,
id
}
=
props
const
processInnerStyle
=
useMemo
(()
=>
{
const
processInnerStyle
=
useMemo
(()
=>
{
if
(
isSubmit
)
{
if
(
isSubmit
)
{
...
@@ -34,6 +35,7 @@ const CountUp = (props: CountUpProps) => {
...
@@ -34,6 +35,7 @@ const CountUp = (props: CountUpProps) => {
<
Image
src=
{
require
(
'@/pages/game/play/assets/count-time.png'
)
}
className=
{
styles
.
icon
}
></
Image
>
<
Image
src=
{
require
(
'@/pages/game/play/assets/count-time.png'
)
}
className=
{
styles
.
icon
}
></
Image
>
<
count
-
up
-
time
<
count
-
up
-
time
exceedTime=
{
20
}
exceedTime=
{
20
}
id=
{
id
}
startValue=
{
0
}
startValue=
{
0
}
isDown=
{
false
}
isDown=
{
false
}
/>
/>
...
...
src/pages/main/guide/index.tsx
View file @
df5f52d7
...
@@ -15,6 +15,7 @@ const Guide = (props: GuideProps) => {
...
@@ -15,6 +15,7 @@ const Guide = (props: GuideProps) => {
const
{
onDone
}
=
props
const
{
onDone
}
=
props
const
[
step
,
setStep
]
=
useState
(
0
)
const
[
step
,
setStep
]
=
useState
(
0
)
const
nav
=
useMemo
(
getMenuButtonBoundingClientRect
,
[])
const
nav
=
useMemo
(
getMenuButtonBoundingClientRect
,
[])
const
[
time
,
setTime
]
=
useState
(
0
)
const
spriteTop
=
useMemo
(()
=>
{
const
spriteTop
=
useMemo
(()
=>
{
if
(
step
>
0
)
{
if
(
step
>
0
)
{
...
@@ -32,10 +33,10 @@ const Guide = (props: GuideProps) => {
...
@@ -32,10 +33,10 @@ const Guide = (props: GuideProps) => {
<
Scene2
spriteTop=
{
spriteTop
}
onNext=
{
()
=>
setStep
(
2
)
}
/>
<
Scene2
spriteTop=
{
spriteTop
}
onNext=
{
()
=>
setStep
(
2
)
}
/>
)
}
)
}
{
step
===
2
&&
(
{
step
===
2
&&
(
<
Scene3
spriteTop=
{
spriteTop
}
onNext=
{
(
)
=>
setStep
(
3
)
}
/>
<
Scene3
spriteTop=
{
spriteTop
}
onNext=
{
(
val
:
number
)
=>
{
setStep
(
3
);
setTime
(
val
)
}
}
/>
)
}
)
}
{
step
===
3
&&
(
{
step
===
3
&&
(
<
Scene4
spriteTop=
{
spriteTop
}
onNext=
{
()
=>
setStep
(
4
)
}
/>
<
Scene4
spriteTop=
{
spriteTop
}
onNext=
{
()
=>
setStep
(
4
)
}
time=
{
time
}
/>
)
}
)
}
{
step
===
4
&&
(
{
step
===
4
&&
(
<
Scene5
spriteTop=
{
spriteTop
}
onNext=
{
()
=>
setStep
(
5
)
}
/>
<
Scene5
spriteTop=
{
spriteTop
}
onNext=
{
()
=>
setStep
(
5
)
}
/>
...
...
src/pages/main/guide/scene-3.tsx
View file @
df5f52d7
...
@@ -2,8 +2,7 @@ import { View, Text, Image, ScrollView } from '@tarojs/components'
...
@@ -2,8 +2,7 @@ import { View, Text, Image, ScrollView } from '@tarojs/components'
import
{
useLocalStore
,
action
,
Action
,
Thunk
,
thunk
,
State
}
from
'easy-peasy'
import
{
useLocalStore
,
action
,
Action
,
Thunk
,
thunk
,
State
}
from
'easy-peasy'
import
classNames
from
'classnames'
import
classNames
from
'classnames'
import
{
useMemo
}
from
'react'
import
{
useMemo
}
from
'react'
import
assets
from
'@/assets/oss/assets-guide'
import
{
getCurrentInstance
}
from
'@tarojs/taro'
import
{
useBoolean
}
from
'@/hooks'
import
NumberKeyboard
from
'@/pages/game/play/components/number-keyboard'
import
NumberKeyboard
from
'@/pages/game/play/components/number-keyboard'
import
MathSymbol
from
'@/pages/game/play/components/math-symbol'
import
MathSymbol
from
'@/pages/game/play/components/math-symbol'
import
PageFooter
from
'@/pages/game/play/components/page-footer'
import
PageFooter
from
'@/pages/game/play/components/page-footer'
...
@@ -14,7 +13,7 @@ import CountUp from './components/count-up'
...
@@ -14,7 +13,7 @@ import CountUp from './components/count-up'
type
Scene3Props
=
{
type
Scene3Props
=
{
spriteTop
:
number
;
spriteTop
:
number
;
onNext
:
()
=>
void
;
onNext
:
(
val
:
number
)
=>
void
;
}
}
type
QuestionModel
=
{
type
QuestionModel
=
{
...
@@ -24,12 +23,17 @@ type QuestionModel = {
...
@@ -24,12 +23,17 @@ type QuestionModel = {
isSubmit
:
boolean
;
isSubmit
:
boolean
;
updateState
:
Action
<
QuestionModel
,
Partial
<
State
<
QuestionModel
>>>
;
updateState
:
Action
<
QuestionModel
,
Partial
<
State
<
QuestionModel
>>>
;
updateAnswer
:
Action
<
QuestionModel
,
string
>
;
updateAnswer
:
Action
<
QuestionModel
,
string
>
;
goNext
:
Thunk
<
QuestionModel
,
(()
=>
void
)
|
void
>
;
goNext
:
Thunk
<
QuestionModel
,
((
val
:
number
)
=>
void
)
|
void
>
;
clearUserAnswers
:
Action
<
QuestionModel
>
;
clearUserAnswers
:
Action
<
QuestionModel
>
;
updateWrong
:
Action
<
QuestionModel
,
boolean
>
;
updateWrong
:
Action
<
QuestionModel
,
boolean
>
;
}
}
const
rightAnswers
=
[
'15'
,
'5'
,
'18'
]
const
rightAnswers
=
[
'15'
,
'5'
,
'18'
]
const
countupId
=
'__count_up_'
const
getCounter
=
()
=>
{
return
getCurrentInstance
()?.
page
?.
selectComponent
?.(
`#
${
countupId
}
`
)
as
any
}
const
Scene3
=
(
props
:
Scene3Props
)
=>
{
const
Scene3
=
(
props
:
Scene3Props
)
=>
{
const
{
spriteTop
,
onNext
}
=
props
const
{
spriteTop
,
onNext
}
=
props
...
@@ -59,7 +63,8 @@ const Scene3 = (props: Scene3Props) => {
...
@@ -59,7 +63,8 @@ const Scene3 = (props: Scene3Props) => {
_act
.
updateState
({
wrong
:
false
})
_act
.
updateState
({
wrong
:
false
})
},
1000
)
},
1000
)
}
else
if
(
current
===
2
)
{
}
else
if
(
current
===
2
)
{
cb
?.()
const
counter
=
getCounter
()?.
getCount
()
??
0
cb
?.(
counter
)
}
else
{
}
else
{
_act
.
updateState
({
current
:
current
+
1
})
_act
.
updateState
({
current
:
current
+
1
})
}
}
...
@@ -117,7 +122,7 @@ const Scene3 = (props: Scene3Props) => {
...
@@ -117,7 +122,7 @@ const Scene3 = (props: Scene3Props) => {
</
View
>
</
View
>
<
View
className=
{
styles
.
question
}
>
<
View
className=
{
styles
.
question
}
>
<
CountUp
currentIndex=
{
state
.
current
}
isSubmit=
{
state
.
isSubmit
}
></
CountUp
>
<
CountUp
currentIndex=
{
state
.
current
}
isSubmit=
{
state
.
isSubmit
}
id=
{
countupId
}
></
CountUp
>
<
View
className=
{
styles
.
item
}
>
<
View
className=
{
styles
.
item
}
>
{
questionList
[
state
.
current
].
content
}
{
questionList
[
state
.
current
].
content
}
</
View
>
</
View
>
...
...
src/pages/main/guide/scene-4.tsx
View file @
df5f52d7
import
{
View
,
Text
,
Image
,
ScrollView
}
from
'@tarojs/components'
import
{
View
,
Text
,
Image
,
ScrollView
}
from
'@tarojs/components'
import
classNames
from
'classnames'
import
classNames
from
'classnames'
import
{
useFormatTick
}
from
'@/hooks'
import
assets
from
'@/assets/oss/assets-guide'
import
assets
from
'@/assets/oss/assets-guide'
import
{
useBoolean
}
from
'@/hooks'
import
cs
from
'./index.module.scss'
import
cs
from
'./index.module.scss'
import
styles
from
'./scene-4.module.scss'
import
styles
from
'./scene-4.module.scss'
type
Scene4Props
=
{
type
Scene4Props
=
{
spriteTop
:
number
;
spriteTop
:
number
;
time
:
number
;
onNext
:
()
=>
void
;
onNext
:
()
=>
void
;
}
}
const
Scene4
=
(
props
:
Scene4Props
)
=>
{
const
Scene4
=
(
props
:
Scene4Props
)
=>
{
const
{
spriteTop
,
onNext
}
=
props
const
{
spriteTop
,
onNext
,
time
}
=
props
const
isActive
=
true
const
isActive
=
true
const
timeFmt
=
useFormatTick
(
time
*
1000
)
return
(
return
(
<
View
className=
{
cs
.
viewport
}
>
<
View
className=
{
cs
.
viewport
}
>
<
View
className=
{
cs
.
viewport_body
}
>
<
View
className=
{
cs
.
viewport_body
}
>
...
@@ -32,7 +36,7 @@ const Scene4 = (props: Scene4Props) => {
...
@@ -32,7 +36,7 @@ const Scene4 = (props: Scene4Props) => {
</
View
>
</
View
>
<
View
className=
{
styles
.
tag_item
}
>
<
View
className=
{
styles
.
tag_item
}
>
<
Image
src=
{
assets
[
'time-count.png'
].
u
}
className=
{
styles
.
tag_icon
}
></
Image
>
<
Image
src=
{
assets
[
'time-count.png'
].
u
}
className=
{
styles
.
tag_icon
}
></
Image
>
<
View
className=
{
styles
.
tag_text
}
>
全对
</
View
>
<
View
className=
{
styles
.
tag_text
}
>
{
timeFmt
.
minutes
}
:
{
timeFmt
.
seconds
}
</
View
>
</
View
>
</
View
>
</
View
>
</
View
>
<
View
>
<
View
>
...
...
src/pages/main/main.tsx
View file @
df5f52d7
...
@@ -2,6 +2,7 @@ import { useEffect, useState, useCallback } from 'react'
...
@@ -2,6 +2,7 @@ import { useEffect, useState, useCallback } from 'react'
import
{
View
}
from
'@tarojs/components'
import
{
View
}
from
'@tarojs/components'
import
{
getStorage
,
StorageKeys
}
from
'@/utils/storage'
import
{
getStorage
,
StorageKeys
}
from
'@/utils/storage'
import
{
silentLoginDeferred
}
from
'@/utils/silent-login'
import
{
silentLoginDeferred
}
from
'@/utils/silent-login'
import
{
setNavigationBarColor
}
from
'@tarojs/taro'
import
Loading
from
'@/components/Loading'
import
Loading
from
'@/components/Loading'
import
styles
from
'./main.module.scss'
import
styles
from
'./main.module.scss'
import
MainComponent
from
'./components/main-component'
import
MainComponent
from
'./components/main-component'
...
@@ -25,6 +26,14 @@ const MainPage = () => {
...
@@ -25,6 +26,14 @@ const MainPage = () => {
})
})
},
[])
},
[])
useEffect
(()
=>
{
if
(
isDone
)
{
setNavigationBarColor
({
frontColor
:
'#ffffff'
,
backgroundColor
:
'#000000'
})
}
else
{
setNavigationBarColor
({
frontColor
:
'#000000'
,
backgroundColor
:
'#000000'
})
}
},
[
isDone
])
if
(
!
isReady
)
{
if
(
!
isReady
)
{
return
(
return
(
<
View
className=
{
styles
.
loading
}
>
<
View
className=
{
styles
.
loading
}
>
...
...
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