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
104617a2
Commit
104617a2
authored
Apr 06, 2023
by
m
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://118.24.71.244/hewenhao/GeekLearnMathWeapp
parents
ea53d2ed
ec748e03
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
10 deletions
+21
-10
top-header.module.scss
src/pages/group/components/top-header.module.scss
+11
-0
top-header.tsx
src/pages/group/components/top-header.tsx
+4
-4
header.tsx
src/pages/main/components/header.tsx
+4
-3
main.tsx
src/pages/main/main.tsx
+2
-3
No files found.
src/pages/group/components/top-header.module.scss
View file @
104617a2
...
@@ -47,3 +47,14 @@
...
@@ -47,3 +47,14 @@
margin-right
:
4
PX
;
margin-right
:
4
PX
;
}
}
}
}
.ph
{
display
:
flex
;
align-items
:
center
;
flex
:
1
;
.icon
{
width
:
32
PX
;
height
:
32
PX
;
margin-right
:
4
PX
;
}
}
src/pages/group/components/top-header.tsx
View file @
104617a2
import
{
View
,
Text
,
Image
}
from
'@tarojs/components'
import
{
View
,
Text
,
Image
}
from
'@tarojs/components'
import
{
getMenuButtonBoundingClientRect
,
getSystemInfoSync
,
navigateTo
}
from
'@tarojs/taro'
import
{
getMenuButtonBoundingClientRect
,
getSystemInfoSync
,
navigateTo
}
from
'@tarojs/taro'
import
{
useMemo
,
useState
}
from
'react'
import
{
useMemo
}
from
'react'
import
{
useStoreState
}
from
'@/store/hooks'
import
{
useStoreState
}
from
'@/store/hooks'
import
styles
from
'./top-header.module.scss'
import
styles
from
'./top-header.module.scss'
...
@@ -12,8 +12,8 @@ const goStore = () => {
...
@@ -12,8 +12,8 @@ const goStore = () => {
}
}
const
TopHeader
=
()
=>
{
const
TopHeader
=
()
=>
{
const
[
nav
]
=
useState
(
getMenuButtonBoundingClientRect
()
)
const
nav
=
useMemo
(
getMenuButtonBoundingClientRect
,
[]
)
const
[
sys
]
=
useState
(
getSystemInfoSync
()
)
const
sys
=
useMemo
(
getSystemInfoSync
,
[]
)
const
innerStyle
=
useMemo
(()
=>
{
const
innerStyle
=
useMemo
(()
=>
{
return
{
return
{
height
:
`
${
nav
.
height
+
10
}
px`
,
height
:
`
${
nav
.
height
+
10
}
px`
,
...
@@ -42,7 +42,7 @@ const TopHeader = () => {
...
@@ -42,7 +42,7 @@ const TopHeader = () => {
<
Image
src=
{
require
(
'@/pages/main/assets/score.png'
)
}
className=
{
styles
.
icon
}
/>
<
Image
src=
{
require
(
'@/pages/main/assets/score.png'
)
}
className=
{
styles
.
icon
}
/>
<
Text
>
{
point
}
</
Text
>
<
Text
>
{
point
}
</
Text
>
</
View
>
</
View
>
<
View
className=
{
styles
.
score
}
onClick=
{
goStore
}
>
<
View
className=
{
styles
.
ph
}
onClick=
{
goStore
}
>
<
Image
src=
{
require
(
'@/pages/main/assets/ph.png'
)
}
className=
{
styles
.
icon
}
/>
<
Image
src=
{
require
(
'@/pages/main/assets/ph.png'
)
}
className=
{
styles
.
icon
}
/>
<
Text
>
{
cardNum
}
</
Text
>
<
Text
>
{
cardNum
}
</
Text
>
</
View
>
</
View
>
...
...
src/pages/main/components/header.tsx
View file @
104617a2
import
{
View
,
Text
,
Image
}
from
'@tarojs/components'
import
{
View
,
Text
,
Image
}
from
'@tarojs/components'
import
{
getMenuButtonBoundingClientRect
,
getSystemInfoSync
,
navigateTo
}
from
'@tarojs/taro'
import
{
getMenuButtonBoundingClientRect
,
getSystemInfoSync
,
navigateTo
}
from
'@tarojs/taro'
import
{
useMemo
,
useState
}
from
'react'
import
{
useMemo
}
from
'react'
import
classNames
from
'classnames'
import
classNames
from
'classnames'
import
{
useStoreState
}
from
'@/store/hooks'
import
{
useStoreState
}
from
'@/store/hooks'
import
{
cs
}
from
'@/styles'
import
{
cs
}
from
'@/styles'
...
@@ -14,8 +14,9 @@ const goStore = () => {
...
@@ -14,8 +14,9 @@ const goStore = () => {
}
}
const
MainHeader
=
()
=>
{
const
MainHeader
=
()
=>
{
const
[
nav
]
=
useState
(
getMenuButtonBoundingClientRect
())
const
nav
=
useMemo
(
getMenuButtonBoundingClientRect
,
[])
const
[
sys
]
=
useState
(
getSystemInfoSync
())
const
sys
=
useMemo
(
getSystemInfoSync
,
[])
const
innerStyle
=
useMemo
(()
=>
{
const
innerStyle
=
useMemo
(()
=>
{
return
{
return
{
height
:
`
${
nav
.
height
+
10
}
px`
,
height
:
`
${
nav
.
height
+
10
}
px`
,
...
...
src/pages/main/main.tsx
View file @
104617a2
...
@@ -24,8 +24,7 @@ const MainPage = () => {
...
@@ -24,8 +24,7 @@ const MainPage = () => {
const
fetchStage
=
useStoreActions
(
actions
=>
actions
.
mainModel
.
fetchStage
)
const
fetchStage
=
useStoreActions
(
actions
=>
actions
.
mainModel
.
fetchStage
)
const
stageList
=
useStoreState
(
state
=>
state
.
mainModel
.
stageList
)
const
stageList
=
useStoreState
(
state
=>
state
.
mainModel
.
stageList
)
const
fetchAccount
=
useStoreActions
(
actions
=>
actions
.
userModel
.
fetchAccount
)
const
fetchAccount
=
useStoreActions
(
actions
=>
actions
.
userModel
.
fetchAccount
)
const
updateUserInfo
=
useStoreActions
(
actions
=>
actions
.
userModel
.
updateUserInfo
)
const
nav
=
useMemo
(
getMenuButtonBoundingClientRect
,
[])
const
[
nav
]
=
useState
(
getMenuButtonBoundingClientRect
())
useShowShareModal
()
useShowShareModal
()
...
@@ -40,7 +39,6 @@ const MainPage = () => {
...
@@ -40,7 +39,6 @@ const MainPage = () => {
useDidShow
(()
=>
{
useDidShow
(()
=>
{
fetchAccount
()
fetchAccount
()
updateUserInfo
(
'曾牛逼'
)
const
tabbar
=
getTabBar
<
TabbarRef
>
(
page
)
const
tabbar
=
getTabBar
<
TabbarRef
>
(
page
)
tabbar
?.
setSelected
(
0
)
tabbar
?.
setSelected
(
0
)
...
@@ -63,6 +61,7 @@ const MainPage = () => {
...
@@ -63,6 +61,7 @@ const MainPage = () => {
<
MainHeader
/>
<
MainHeader
/>
<
View
className=
{
styles
.
body
}
style=
{
{
paddingTop
:
`${nav.height + nav.top + 5}px`
}
}
>
<
View
className=
{
styles
.
body
}
style=
{
{
paddingTop
:
`${nav.height + nav.top + 5}px`
}
}
>
<
MainChapter
/>
<
MainChapter
/>
{
/* <Button openType="getPhoneNumber" onGetPhoneNumber={handleClick}>shouji</Button> */
}
<
SceneContext
.
Provider
value=
{
{
ready
:
isReady
}
}
>
<
SceneContext
.
Provider
value=
{
{
ready
:
isReady
}
}
>
<
MainScene
stageList=
{
stageList
}
/>
<
MainScene
stageList=
{
stageList
}
/>
</
SceneContext
.
Provider
>
</
SceneContext
.
Provider
>
...
...
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