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
61c653ff
Commit
61c653ff
authored
Apr 06, 2023
by
hewenhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: update
parent
df1661fb
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
34 additions
and
19 deletions
+34
-19
top-header.module.scss
src/pages/group/components/top-header.module.scss
+17
-7
top-header.tsx
src/pages/group/components/top-header.tsx
+7
-6
header.tsx
src/pages/main/components/header.tsx
+4
-3
main.tsx
src/pages/main/main.tsx
+6
-3
No files found.
src/pages/group/components/top-header.module.scss
View file @
61c653ff
...
...
@@ -22,32 +22,42 @@
font-weight
:
500
;
color
:
#FFFFFF
;
line-height
:
19
PX
;
gap
:
26
PX
;
}
.nickname
{
width
:
84
PX
;
margin-left
:
16
PX
;
@include
ellipsis
();
.avatar
{
flex
:
1
;
min-width
:
0
;
.name
{
overflow
:
hidden
;
text-overflow
:
ellipsis
;
white-space
:
nowrap
;
font-size
:
14
PX
;
font-weight
:
500
;
margin-left
:
16
PX
;
color
:
#FFFFFF
;
}
}
.score
{
display
:
flex
;
align-items
:
center
;
flex
:
1
;
.icon
{
width
:
32
PX
;
height
:
32
PX
;
margin-right
:
6
PX
;
margin-right
:
4
PX
;
}
}
.ph
{
display
:
flex
;
align-items
:
center
;
flex
:
1
;
.icon
{
width
:
32
PX
;
height
:
32
PX
;
margin-right
:
6
PX
;
margin-right
:
4
PX
;
}
}
src/pages/group/components/top-header.tsx
View file @
61c653ff
import
{
View
,
Text
,
Image
}
from
'@tarojs/components'
import
{
getMenuButtonBoundingClientRect
,
getSystemInfoSync
}
from
'@tarojs/taro'
import
{
useMemo
,
useState
}
from
'react'
import
{
useMemo
}
from
'react'
import
{
useStoreState
}
from
'@/store/hooks'
import
styles
from
'./top-header.module.scss'
const
TopHeader
=
()
=>
{
const
[
nav
]
=
useState
(
getMenuButtonBoundingClientRect
()
)
const
[
sys
]
=
useState
(
getSystemInfoSync
()
)
const
nav
=
useMemo
(
getMenuButtonBoundingClientRect
,
[]
)
const
sys
=
useMemo
(
getSystemInfoSync
,
[]
)
const
innerStyle
=
useMemo
(()
=>
{
return
{
height
:
`
${
nav
.
height
+
10
}
px`
,
...
...
@@ -17,6 +17,7 @@ const TopHeader = () => {
const
cardNum
=
useStoreState
(
state
=>
state
.
userModel
.
cardNum
)
const
point
=
useStoreState
(
state
=>
state
.
userModel
.
point
)
const
userInfo
=
useStoreState
(
state
=>
state
.
userModel
.
userInfo
)
return
(
<
View
className=
{
styles
.
header
}
>
...
...
@@ -28,9 +29,9 @@ const TopHeader = () => {
}
}
>
<
View
className=
{
styles
.
inner
}
style=
{
innerStyle
}
>
<
Text
className=
{
styles
.
nickname
}
>
昵称昵称昵昵称昵称昵昵称昵称
</
Text
>
<
View
className=
{
styles
.
avatar
}
>
<
Text
className=
{
styles
.
name
}
>
{
userInfo
?.
nickName
??
''
}
</
Text
>
</
View
>
<
View
className=
{
styles
.
score
}
>
<
Image
src=
{
require
(
'@/pages/main/assets/score.png'
)
}
className=
{
styles
.
icon
}
/>
<
Text
>
{
point
}
</
Text
>
...
...
src/pages/main/components/header.tsx
View file @
61c653ff
import
{
View
,
Text
,
Image
}
from
'@tarojs/components'
import
{
getMenuButtonBoundingClientRect
,
getSystemInfoSync
,
navigateTo
}
from
'@tarojs/taro'
import
{
useMemo
,
useState
}
from
'react'
import
{
useMemo
}
from
'react'
import
classNames
from
'classnames'
import
{
useStoreState
}
from
'@/store/hooks'
import
{
cs
}
from
'@/styles'
...
...
@@ -14,8 +14,9 @@ const goStore = () => {
}
const
MainHeader
=
()
=>
{
const
[
nav
]
=
useState
(
getMenuButtonBoundingClientRect
())
const
[
sys
]
=
useState
(
getSystemInfoSync
())
const
nav
=
useMemo
(
getMenuButtonBoundingClientRect
,
[])
const
sys
=
useMemo
(
getSystemInfoSync
,
[])
const
innerStyle
=
useMemo
(()
=>
{
return
{
height
:
`
${
nav
.
height
+
10
}
px`
,
...
...
src/pages/main/main.tsx
View file @
61c653ff
import
{
View
}
from
'@tarojs/components'
import
{
View
,
Button
}
from
'@tarojs/components'
import
{
useRouter
,
showToast
,
getMenuButtonBoundingClientRect
,
useDidShow
,
getCurrentInstance
,
getTabBar
,
pageScrollTo
,
getSystemInfoSync
,
showModal
,
...
...
@@ -24,7 +24,6 @@ const MainPage = () => {
const
fetchStage
=
useStoreActions
(
actions
=>
actions
.
mainModel
.
fetchStage
)
const
stageList
=
useStoreState
(
state
=>
state
.
mainModel
.
stageList
)
const
fetchAccount
=
useStoreActions
(
actions
=>
actions
.
userModel
.
fetchAccount
)
const
updateUserInfo
=
useStoreActions
(
actions
=>
actions
.
userModel
.
updateUserInfo
)
const
fetchTribeInfo
=
useStoreActions
(
actions
=>
actions
.
groupModel
.
fetchTribeInfo
)
const
[
nav
]
=
useState
(
getMenuButtonBoundingClientRect
())
const
router
=
useRouter
<
{
groupId
:
string
,
inviteId
:
string
}
>
()
...
...
@@ -41,7 +40,6 @@ const MainPage = () => {
useDidShow
(()
=>
{
fetchAccount
()
updateUserInfo
(
'曾牛逼'
)
const
tabbar
=
getTabBar
<
TabbarRef
>
(
page
)
tabbar
?.
setSelected
(
0
)
...
...
@@ -89,11 +87,16 @@ const MainPage = () => {
}
},
[
groupId
,
inviteId
,
userInfo
.
userId
])
const
handleClick
=
(
e
)
=>
{
console
.
log
(
e
)
}
return
(
<>
<
MainHeader
/>
<
View
className=
{
styles
.
body
}
style=
{
{
paddingTop
:
`${nav.height + nav.top + 5}px`
}
}
>
<
MainChapter
/>
{
/* <Button openType="getPhoneNumber" onGetPhoneNumber={handleClick}>shouji</Button> */
}
<
SceneContext
.
Provider
value=
{
{
ready
:
isReady
}
}
>
<
MainScene
stageList=
{
stageList
}
/>
</
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