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
adedecb8
Commit
adedecb8
authored
Apr 04, 2023
by
hewenhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: update
parent
c5bdbe7b
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
24 additions
and
8 deletions
+24
-8
index.module.scss
src/custom-tab-bar/index.module.scss
+9
-1
index.tsx
src/custom-tab-bar/index.tsx
+3
-2
chapter.module.scss
src/pages/main/components/chapter.module.scss
+3
-1
constants.ts
src/pages/main/components/scene/constants.ts
+2
-2
short-cut.tsx
src/pages/main/components/short-cut.tsx
+7
-2
No files found.
src/custom-tab-bar/index.module.scss
View file @
adedecb8
...
@@ -30,14 +30,22 @@
...
@@ -30,14 +30,22 @@
}
}
.bg
{
.bg
{
width
:
100%
;
height
:
100%
;
height
:
100%
;
width
:
calc
(
100%
+
48px
);
position
:
absolute
;
position
:
absolute
;
left
:
0
;
left
:
0
;
top
:
0
;
top
:
0
;
bottom
:
0
;
bottom
:
0
;
right
:
0
;
right
:
0
;
z-index
:
1
;
z-index
:
1
;
&
.left
{
right
:
-48px
;
}
&
.right
{
left
:
-48px
;
}
}
}
.icon
{
.icon
{
...
...
src/custom-tab-bar/index.tsx
View file @
adedecb8
import
{
useState
,
useImperativeHandle
,
forwardRef
,
useCallback
,
type
ForwardRefRenderFunction
}
from
'react'
import
{
useState
,
useImperativeHandle
,
forwardRef
,
useCallback
,
type
ForwardRefRenderFunction
}
from
'react'
import
{
View
,
Image
}
from
'@tarojs/components'
import
{
View
,
Image
}
from
'@tarojs/components'
import
{
switchTab
}
from
'@tarojs/taro'
import
{
switchTab
}
from
'@tarojs/taro'
import
classNames
from
'classnames'
import
styles
from
'./index.module.scss'
import
styles
from
'./index.module.scss'
type
TabbarRef
=
{
type
TabbarRef
=
{
...
@@ -28,13 +29,13 @@ const Tabbar: ForwardRefRenderFunction<TabbarRef, {}> = (_, ref) => {
...
@@ -28,13 +29,13 @@ const Tabbar: ForwardRefRenderFunction<TabbarRef, {}> = (_, ref) => {
<
View
className=
{
styles
.
inner
}
>
<
View
className=
{
styles
.
inner
}
>
<
View
className=
{
styles
.
left
}
onClick=
{
()
=>
_switchTab
(
0
,
'/pages/main/main'
)
}
>
<
View
className=
{
styles
.
left
}
onClick=
{
()
=>
_switchTab
(
0
,
'/pages/main/main'
)
}
>
{
selected
===
0
&&
(
{
selected
===
0
&&
(
<
Image
src=
"/assets/tabbar/personal-bg.png"
className=
{
styles
.
bg
}
></
Image
>
<
Image
src=
"/assets/tabbar/personal-bg.png"
className=
{
classNames
(
styles
.
bg
,
styles
.
left
)
}
></
Image
>
)
}
)
}
<
Image
src=
"/assets/tabbar/personal-on.png"
className=
{
styles
.
icon
}
/>
<
Image
src=
"/assets/tabbar/personal-on.png"
className=
{
styles
.
icon
}
/>
</
View
>
</
View
>
<
View
className=
{
styles
.
right
}
onClick=
{
()
=>
_switchTab
(
1
,
'/pages/group/index'
)
}
>
<
View
className=
{
styles
.
right
}
onClick=
{
()
=>
_switchTab
(
1
,
'/pages/group/index'
)
}
>
{
selected
===
1
&&
(
{
selected
===
1
&&
(
<
Image
src=
"/assets/tabbar/group-bg.png"
className=
{
styles
.
bg
}
></
Image
>
<
Image
src=
"/assets/tabbar/group-bg.png"
className=
{
classNames
(
styles
.
bg
,
styles
.
right
)
}
></
Image
>
)
}
)
}
<
Image
src=
"/assets/tabbar/group-on.png"
className=
{
styles
.
icon
}
/>
<
Image
src=
"/assets/tabbar/group-on.png"
className=
{
styles
.
icon
}
/>
</
View
>
</
View
>
...
...
src/pages/main/components/chapter.module.scss
View file @
adedecb8
...
@@ -6,8 +6,10 @@
...
@@ -6,8 +6,10 @@
color
:
#FFFFFF
;
color
:
#FFFFFF
;
display
:
flex
;
display
:
flex
;
align-items
:
center
;
align-items
:
center
;
width
:
750px
;
box-sizing
:
border-box
;
box-sizing
:
border-box
;
position
:
relative
;
z-index
:
1
;
box-shadow
:
0
1px
14px
rgba
(
0
,
81
,
231
,
0
.1
);
}
}
.chapterContent
{
.chapterContent
{
...
...
src/pages/main/components/scene/constants.ts
View file @
adedecb8
...
@@ -54,12 +54,12 @@ export function stageToParts (stageList: Stage[]): Part[] {
...
@@ -54,12 +54,12 @@ export function stageToParts (stageList: Stage[]): Part[] {
const
ret
:
Part
[]
=
[]
const
ret
:
Part
[]
=
[]
stageList
.
forEach
(
item
=>
{
stageList
.
forEach
(
item
=>
{
const
last
=
ret
.
find
(
c
=>
c
.
number
===
(
item
.
part
||
0
)
)
const
last
=
ret
.
find
(
c
=>
c
.
number
===
(
item
.
part
??
1
)
-
1
)
if
(
last
)
{
if
(
last
)
{
last
.
stages
.
push
(
item
)
last
.
stages
.
push
(
item
)
}
else
{
}
else
{
ret
.
push
({
ret
.
push
({
number
:
item
.
part
??
0
,
number
:
(
item
.
part
??
1
)
-
1
,
stages
:
[
item
]
stages
:
[
item
]
})
})
}
}
...
...
src/pages/main/components/short-cut.tsx
View file @
adedecb8
...
@@ -3,7 +3,8 @@ import assets from '@/assets/oss/assets-main'
...
@@ -3,7 +3,8 @@ import assets from '@/assets/oss/assets-main'
import
{
useEffect
,
useState
,
useRef
}
from
'react'
import
{
useEffect
,
useState
,
useRef
}
from
'react'
import
{
usePageScroll
,
createIntersectionObserver
}
from
'@tarojs/taro'
import
{
usePageScroll
,
createIntersectionObserver
}
from
'@tarojs/taro'
import
classNames
from
'classnames'
import
classNames
from
'classnames'
import
{
CurrentRoundId
}
from
'./scene/constants'
import
{
useStoreState
}
from
'@/store/hooks'
import
{
CurrentRoundId
,
StageStatus
}
from
'./scene/constants'
import
styles
from
'./short-cut.module.scss'
import
styles
from
'./short-cut.module.scss'
...
@@ -16,12 +17,16 @@ const ShortCut = (props: ShortCutProps) => {
...
@@ -16,12 +17,16 @@ const ShortCut = (props: ShortCutProps) => {
const
[
isDown
,
setIsDown
]
=
useState
(
false
)
const
[
isDown
,
setIsDown
]
=
useState
(
false
)
const
scrollRef
=
useRef
(
0
)
const
scrollRef
=
useRef
(
0
)
const
lastEffectedScroll
=
useRef
(
0
)
const
lastEffectedScroll
=
useRef
(
0
)
const
stageList
=
useStoreState
(
state
=>
state
.
mainModel
.
stageList
)
usePageScroll
((
payload
)
=>
{
usePageScroll
((
payload
)
=>
{
scrollRef
.
current
=
payload
.
scrollTop
scrollRef
.
current
=
payload
.
scrollTop
})
})
useEffect
(()
=>
{
useEffect
(()
=>
{
if
(
!
stageList
.
some
(
c
=>
c
.
status
===
StageStatus
.
CURRENT
))
{
return
}
lastEffectedScroll
.
current
=
scrollRef
.
current
lastEffectedScroll
.
current
=
scrollRef
.
current
// @ts-ignore
// @ts-ignore
let
observer
=
createIntersectionObserver
()
let
observer
=
createIntersectionObserver
()
...
@@ -42,7 +47,7 @@ const ShortCut = (props: ShortCutProps) => {
...
@@ -42,7 +47,7 @@ const ShortCut = (props: ShortCutProps) => {
observer
=
null
!
observer
=
null
!
}
}
}
}
},
[])
},
[
stageList
])
return
(
return
(
<
View
className=
{
styles
.
shortcut
}
>
<
View
className=
{
styles
.
shortcut
}
>
...
...
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