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
39726ce6
Commit
39726ce6
authored
Apr 20, 2023
by
hewenhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: update
parent
e88426fd
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
87 additions
and
66 deletions
+87
-66
index.module.scss
src/components/UserGuideView/index.module.scss
+1
-2
index.tsx
src/components/UserGuideView/index.tsx
+13
-10
index.module.scss
src/pages/game/wrong/index.module.scss
+0
-0
index.tsx
src/pages/game/wrong/index.tsx
+10
-0
stage.module.scss
src/pages/main/components/scene/stage.module.scss
+5
-0
stage.tsx
src/pages/main/components/scene/stage.tsx
+15
-10
scene-1.module.scss
src/pages/main/guide/scene-1.module.scss
+20
-20
scene-1.tsx
src/pages/main/guide/scene-1.tsx
+23
-24
No files found.
src/components/UserGuideView/index.module.scss
View file @
39726ce6
.contentWrap
{
border-radius
:
16px
;
position
:
absolute
;
z-index
:
9999998
;
opacity
:
1
;
box-shadow
:
rgb
(
33
33
33
/
50%
)
0px
0px
0px
5000
PX
;
box-shadow
:
rgb
a
(
0
,
0
,
0
,
.6
)
0px
0px
0px
5000
PX
;
}
.content
{
...
...
src/components/UserGuideView/index.tsx
View file @
39726ce6
import
{
View
,
type
ViewProps
,
RootPortal
}
from
'@tarojs/components'
import
{
type
PropsWithChildren
,
useState
,
useMemo
,
useRef
,
useEffect
,
type
ReactNod
e
}
from
'react'
import
{
View
,
RootPortal
}
from
'@tarojs/components'
import
{
useState
,
useMemo
,
useRef
,
useEffect
,
type
ReactNode
,
type
ComponentTyp
e
}
from
'react'
import
{
createSelectorQuery
,
usePageScroll
}
from
'@tarojs/taro'
import
classNames
from
'classnames'
import
styles
from
'./index.module.scss'
type
UserGuideProps
=
{
type
GetProps
<
T
>
=
T
extends
ComponentType
<
infer
P
>
?
P
:
{}
type
UserGuideProps
<
T
extends
ComponentType
<
any
>>
=
{
onFinish
?:
()
=>
void
;
isActive
?:
boolean
;
compnent
?:
T
;
onClickConent
?:
()
=>
void
;
verticalPadding
?:
number
;
horizonPadding
?:
number
;
guideContent
?:
ReactNode
;
}
wrapClass
?:
string
;
}
&
GetProps
<
T
>
const
UserGuideView
=
(
props
:
PropsWithChildren
<
UserGuideProps
&
ViewProps
>
)
=>
{
const
{
isActive
,
children
,
guideContent
,
verticalPadding
=
0
,
horizonPadding
=
0
,
onClickConent
,
...
rest
}
=
props
function
UserGuideView
<
T
extends
ComponentType
<
any
>
=
typeof
View
>
(
props
:
UserGuideProps
<
T
>
)
{
const
{
isActive
,
wrapClass
,
guideContent
,
verticalPadding
=
0
,
horizonPadding
=
0
,
onFinish
,
onClickConent
,
compnent
:
Comp
=
View
,
...
rest
}
=
props
const
[
rect
,
setRect
]
=
useState
({
width
:
80
,
height
:
80
,
top
:
0
,
left
:
0
})
const
[
_isActive
,
setIsActive
]
=
useState
(
false
)
const
scrollRef
=
useRef
(
0
)
...
...
@@ -53,12 +58,10 @@ const UserGuideView = (props: PropsWithChildren<UserGuideProps & ViewProps>) =>
return
(
<>
<
View
{
...
rest
}
ref=
{
domRef
}
>
{
children
}
</
View
>
<
Comp
{
...
(
rest
as
GetProps
<
T
>
)} ref=
{
domRef
}
/
>
{
_isActive
&&
(
<
RootPortal
>
<
View
className=
{
styles
.
contentWrap
}
catchMove
style=
{
style
}
>
<
View
className=
{
classNames
(
styles
.
contentWrap
,
wrapClass
)
}
catchMove
style=
{
style
}
>
<
View
className=
{
styles
.
content
}
onClick=
{
onClickConent
}
>
</
View
>
{
guideContent
}
...
...
src/pages/game/wrong/index.module.scss
0 → 100644
View file @
39726ce6
src/pages/game/wrong/index.tsx
0 → 100644
View file @
39726ce6
import
{
View
}
from
'@tarojs/components'
import
styles
from
'./index.module.scss'
const
Wrong
=
()
=>
{
return
(
<
View
>
123123
</
View
>
)
}
export
default
Wrong
src/pages/main/components/scene/stage.module.scss
View file @
39726ce6
...
...
@@ -7,6 +7,11 @@
}
}
.guide_wrap
{
border-radius
:
50%
;
border
:
2px
dashed
#fff
;
}
.clear
{
position
:
relative
;
...
...
src/pages/main/components/scene/stage.tsx
View file @
39726ce6
import
{
View
,
Image
}
from
'@tarojs/components'
import
{
View
,
Image
,
ViewProps
}
from
'@tarojs/components'
import
assets
from
'@/assets/oss/assets-round'
import
classNames
from
'classnames'
import
{
cs
}
from
'@/styles'
...
...
@@ -118,7 +118,18 @@ const StageComp = (props: StageProps) => {
case
StageStatus
.
CURRENT
:
{
return
(
<
Image
src=
{
getUnlockedIcon
(
stage
.
type
).
u
}
className=
{
getIconClassNames
(
stage
.
type
)
}
/>
<
UserGuideView
src=
{
getUnlockedIcon
(
stage
.
type
).
u
}
compnent=
{
Image
}
className=
{
getIconClassNames
(
stage
.
type
)
}
isActive=
{
stage
.
status
===
StageStatus
.
CURRENT
}
verticalPadding=
{
4
}
horizonPadding=
{
4
}
wrapClass=
{
styles
.
guide_wrap
}
guideContent=
{
(
<
View
style=
{
{
color
:
'#ffffff'
}
}
>
123123123234234234sdfsdf sdfsdfsdf sdf sdf sdf sdf sdfsd fsd
</
View
>
)
}
></
UserGuideView
>
)
}
...
...
@@ -155,21 +166,15 @@ const StageComp = (props: StageProps) => {
}
return
(
<
UserGuide
View
<
View
className=
{
classNames
(
props
.
className
,
cs
.
bounce_btn
)
}
hoverClass=
{
cs
.
bounce_btn_hover
}
id=
{
stage
.
status
===
StageStatus
.
CURRENT
?
CurrentRoundId
:
undefined
}
onClick=
{
handleClick
}
isActive=
{
stage
.
status
===
StageStatus
.
CURRENT
}
verticalPadding=
{
15
}
horizonPadding=
{
15
}
guideContent=
{
(
<
View
style=
{
{
color
:
'#ffffff'
}
}
>
123123123234234234sdfsdf sdfsdfsdf sdf sdf sdf sdf sdfsd fsd
</
View
>
)
}
>
{
renderRound
(
isReady
)
}
<
View
className=
{
styles
.
roundName
}
>
{
stage
.
name
}
</
View
>
</
UserGuide
View
>
</
View
>
)
}
...
...
src/pages/main/guide/scene-1.module.scss
View file @
39726ce6
...
...
@@ -43,24 +43,24 @@
padding
:
28px
;
}
.modal_2
{
position
:
absolute
;
top
:
-260px
;
width
:
500px
;
height
:
260px
;
background-image
:
url(https://cdn.jkwljy.com/pk-math/2tGxMZeki8g2zJdm36HkhuqnvpMS/500x260)
;
background-size
:
100%
100%
;
box-sizing
:
border-box
;
padding
:
32px
28px
;
}
//
.modal_2 {
//
position: absolute;
//
top: -260px;
//
width: 500px;
//
height: 260px;
//
background-image: url(https://cdn.jkwljy.com/pk-math/2tGxMZeki8g2zJdm36HkhuqnvpMS/500x260);
//
background-size: 100% 100%;
//
box-sizing: border-box;
//
padding: 32px 28px;
//
}
.modal_1
{
position
:
absolute
;
top
:
-180px
;
width
:
500px
;
height
:
180px
;
background-image
:
url(https://cdn.jkwljy.com/pk-math/eFWwoxVC4mzX1hZZojv23VEh9hz/500x180)
;
background-size
:
100%
100%
;
box-sizing
:
border-box
;
padding
:
48px
28px
;
}
//
.modal_1 {
//
position: absolute;
//
top: -180px;
//
width: 500px;
//
height: 180px;
//
background-image: url(https://cdn.jkwljy.com/pk-math/eFWwoxVC4mzX1hZZojv23VEh9hz/500x180);
//
background-size: 100% 100%;
//
box-sizing: border-box;
//
padding: 48px 28px;
//
}
src/pages/main/guide/scene-1.tsx
View file @
39726ce6
...
...
@@ -9,23 +9,22 @@ import styles from './scene-1.module.scss'
const
Text1
=
[
{
text
:
'嗨,'
},
{
text
:
'你好!'
},
{
text
:
'我是高斯。'
},
{
text
:
'我是帮助很多同学们爱上数学的阿喵老师。'
},
]
const
Text2
=
[
{
text
:
'别看我是一只猫,'
},
{
text
:
'我可是一名远近闻名的数学大师呢。'
},
]
// text="我已经帮助很多同学,喜欢上数学,提升数学能力了。"
const
Text3
=
[
{
text
:
'我已经帮助很多同学'
},
{
text
:
'喜欢上数学,'
},
{
text
:
'提升数学能力了。'
},
]
//
const Text2 = [
//
{ text: '别看我是一只猫,' },
//
{ text: '我可是一名远近闻名的数学大师呢。' },
//
]
//
//
text="我已经帮助很多同学,喜欢上数学,提升数学能力了。"
//
const Text3 = [
//
{ text: '我已经帮助很多同学' },
//
{ text: '喜欢上数学,' },
//
{ text: '提升数学能力了。' },
//
]
// text="在开始前,我可以问几个问题互相了解一下吗?"
const
Text
4
=
[
const
Text
2
=
[
{
text
:
'在开始前,'
},
{
text
:
'我可以问几个问题,'
},
{
text
:
'互相了解一下吗?'
},
...
...
@@ -59,13 +58,13 @@ const Scene1 = ({ onNext }: Scene1Props) => {
handleEnd
(
1
)
},
[
handleEnd
])
const
fn2
=
useCallback
(()
=>
{
handleEnd
(
2
)
},
[
handleEnd
])
//
const fn2 = useCallback(() => {
//
handleEnd(2)
//
}, [handleEnd])
const
fn3
=
useCallback
(()
=>
{
handleEnd
(
3
)
},
[
handleEnd
])
//
const fn3 = useCallback(() => {
//
handleEnd(3)
//
}, [handleEnd])
return
(
<
View
className=
{
cs
.
viewport
}
>
...
...
@@ -80,11 +79,11 @@ const Scene1 = ({ onNext }: Scene1Props) => {
</
View
>
<
View
className=
{
styles
.
dialog
}
>
{
current
===
0
&&
(
<
View
className=
{
styles
.
modal_
1
}
>
<
View
className=
{
styles
.
modal_
3
}
>
<
TextPrinter
textList=
{
Text1
}
onEnd=
{
fn1
}
></
TextPrinter
>
</
View
>
)
}
{
current
===
1
&&
(
{
/* {
current === 1 && (
<View className={styles.modal_2}>
<TextPrinter textList={Text2} onEnd={fn2} />
</View>
...
...
@@ -96,11 +95,11 @@ const Scene1 = ({ onNext }: Scene1Props) => {
onEnd={fn3}
/>
</View>
)
}
{
current
===
3
&&
(
)}
*/
}
{
current
===
1
&&
(
<
View
className=
{
styles
.
modal_3
}
>
<
TextPrinter
textList=
{
Text
4
}
textList=
{
Text
2
}
onEnd=
{
fn
}
/>
</
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