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
c9bbc44f
Commit
c9bbc44f
authored
Apr 13, 2023
by
hewenhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 优化
parent
583aed3c
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
5 deletions
+33
-5
top-bar.module.scss
src/pages/prepare/components/top-bar.module.scss
+21
-3
top-bar.tsx
src/pages/prepare/components/top-bar.tsx
+12
-2
No files found.
src/pages/prepare/components/top-bar.module.scss
View file @
c9bbc44f
...
@@ -25,20 +25,23 @@
...
@@ -25,20 +25,23 @@
font-weight
:
500
;
font-weight
:
500
;
color
:
#FFFFFF
;
color
:
#FFFFFF
;
padding
:
0
10
PX
;
padding
:
0
10
PX
;
width
:
100vw
;
box-sizing
:
border-box
;
.back_icon
{
.back_icon
{
position
:
relativ
e
;
position
:
absolut
e
;
z-index
:
10
;
z-index
:
10
;
width
:
30
PX
;
width
:
30
PX
;
width
:
30
PX
;
width
:
30
PX
;
left
:
10
PX
;
}
}
}
}
}
}
.score
{
.score
{
display
:
flex
;
display
:
flex
;
align-items
:
center
;
align-items
:
center
;
margin-right
:
40
PX
;
margin-right
:
12
PX
;
margin-left
:
58
PX
;
margin-left
:
-10px
;
.icon
{
.icon
{
width
:
32
PX
;
width
:
32
PX
;
...
@@ -47,6 +50,21 @@
...
@@ -47,6 +50,21 @@
}
}
}
}
.right
{
flex-shrink
:
0
;
}
.left
{
flex-shrink
:
1
;
}
.main
{
flex
:
1
;
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
}
.ph
{
.ph
{
display
:
flex
;
display
:
flex
;
align-items
:
center
;
align-items
:
center
;
...
...
src/pages/prepare/components/top-bar.tsx
View file @
c9bbc44f
...
@@ -13,21 +13,29 @@ const goStore = () => {
...
@@ -13,21 +13,29 @@ const goStore = () => {
export
default
()
=>
{
export
default
()
=>
{
const
nav
=
useMemo
(
getMenuButtonBoundingClientRect
,
[])
const
nav
=
useMemo
(
getMenuButtonBoundingClientRect
,
[])
const
sys
=
useMemo
(
getSystemInfoSync
,
[])
const
cardNum
=
useStoreState
(
state
=>
state
.
userModel
.
cardNum
)
const
cardNum
=
useStoreState
(
state
=>
state
.
userModel
.
cardNum
)
const
point
=
useStoreState
(
state
=>
state
.
userModel
.
point
)
const
point
=
useStoreState
(
state
=>
state
.
userModel
.
point
)
const
sys
=
useMemo
(
getSystemInfoSync
,
[])
const
rightStyle
=
useMemo
(()
=>
{
return
{
width
:
`
${
nav
.
width
+
(
sys
.
windowWidth
-
nav
.
right
)
*
2
}
px`
}
},
[
sys
,
nav
])
const
topBarStyle
=
useMemo
(()
=>
{
const
topBarStyle
=
useMemo
(()
=>
{
return
{
return
{
height
:
`
${
nav
.
height
+
10
}
px`
,
height
:
`
${
nav
.
height
+
10
}
px`
,
paddingTop
:
`
${
nav
.
top
-
5
}
px`
paddingTop
:
`
${
nav
.
top
-
5
}
px`
}
}
},
[
sys
,
nav
])
},
[
nav
])
return
(
return
(
<
View
className=
{
styles
.
topBar
}
style=
{
topBarStyle
}
>
<
View
className=
{
styles
.
topBar
}
style=
{
topBarStyle
}
>
<
View
className=
{
styles
.
inner
}
>
<
View
className=
{
styles
.
inner
}
>
<
Image
className=
{
styles
.
back_icon
}
src=
{
require
(
'../assets/back.png'
)
}
mode=
"widthFix"
onClick=
{
()
=>
navigateBack
()
}
/>
<
Image
className=
{
styles
.
back_icon
}
src=
{
require
(
'../assets/back.png'
)
}
mode=
"widthFix"
onClick=
{
()
=>
navigateBack
()
}
/>
<
View
style=
{
rightStyle
}
className=
{
styles
.
left
}
></
View
>
<
View
className=
{
styles
.
main
}
>
<
View
className=
{
styles
.
score
}
onClick=
{
goStore
}
>
<
View
className=
{
styles
.
score
}
onClick=
{
goStore
}
>
<
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
>
...
@@ -37,6 +45,8 @@ export default () => {
...
@@ -37,6 +45,8 @@ export default () => {
<
Text
>
{
cardNum
}
</
Text
>
<
Text
>
{
cardNum
}
</
Text
>
</
View
>
</
View
>
</
View
>
</
View
>
<
View
style=
{
rightStyle
}
className=
{
styles
.
right
}
></
View
>
</
View
>
</
View
>
</
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