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
14cd9484
Commit
14cd9484
authored
Apr 03, 2023
by
666
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: update ui
parent
990471e1
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
203 additions
and
74 deletions
+203
-74
group.ts
src/api/group.ts
+6
-5
close-dark.png
src/components/Modal/assets/close-dark.png
+0
-0
main-header.module.scss
src/pages/prepare/components/main-header.module.scss
+1
-0
tabs.module.scss
src/pages/prepare/components/tabs.module.scss
+17
-9
tabs.tsx
src/pages/prepare/components/tabs.tsx
+0
-2
thead.module.scss
src/pages/prepare/components/thead.module.scss
+35
-0
thead.tsx
src/pages/prepare/components/thead.tsx
+15
-0
index.module.scss
src/pages/prepare/index.module.scss
+80
-22
index.tsx
src/pages/prepare/index.tsx
+49
-9
renderItem.tsx
src/pages/prepare/renderItem.tsx
+0
-27
No files found.
src/api/group.ts
View file @
14cd9484
...
...
@@ -56,11 +56,12 @@ export const queryTribePoint = () => {
}
export
type
MemberItem
=
{
groupId
:
number
;
memberId
:
number
;
memberName
:
number
,
schoolName
:
number
,
stageNum
:
number
;
groupId
?:
number
;
memberId
?:
number
;
memberName
?:
number
,
schoolName
?:
number
,
stageNum
?:
number
;
identity
?:
string
;
}
export
interface
TribeInfo
{
id
?:
number
;
...
...
src/components/Modal/assets/close-dark.png
0 → 100644
View file @
14cd9484
321 Bytes
src/pages/prepare/components/main-header.module.scss
View file @
14cd9484
...
...
@@ -89,6 +89,7 @@
.center
{
@include
flexLayout
(
row
,
center
);
gap
:
4
PX
;
font-size
:
12
PX
;
}
}
...
...
src/pages/prepare/components/tabs.module.scss
View file @
14cd9484
...
...
@@ -10,13 +10,14 @@
display
:
flex
;
border-bottom
:
1px
solid
#ccc
;
height
:
176px
;
background-size
:
cover
;
&
.active_1
{
background
:
url('../assets/tab-1.png')
no-repeat
;
background
-image
:
url('../assets/tab-1.png')
;
}
&
.active_2
{
background
:
url('../assets/tab-2.png')
no-repeat
;
background
-image
:
url('../assets/tab-2.png')
;
}
}
...
...
@@ -48,19 +49,26 @@
}
.tabPanes
{
position
:
relative
;
display
:
grid
;
grid-template-columns
:
repeat
(
auto-fit
,
minmax
(
100%
,
1fr
));
grid-auto-rows
:
min-content
;
grid-auto-flow
:
column
;
overflow
:
hidden
;
min-height
:
400px
;
/* 根据需要设置最小高度 */
background-color
:
#fff
;
position
:
relative
;
top
:
-40
PX
;
height
:
100%
;
margin-bottom
:
-40
PX
;
.tabPane
{
position
:
absolute
;
top
:
0
;
left
:
0
;
width
:
100%
;
grid-row
:
1
;
grid-column
:
1
;
transition
:
transform
0
.3s
ease-in-out
;
will-change
:
transform
;
pointer-events
:
none
;
&
.active
{
display
:
block
;
pointer-events
:
auto
;
}
}
}
...
...
src/pages/prepare/components/tabs.tsx
View file @
14cd9484
...
...
@@ -14,8 +14,6 @@ export interface TabItem {
interface
TabsProps
{
items
:
TabItem
[];
initialIndex
?:
number
;
tabBarGutter
?:
number
;
tabBarStyle
?:
CSSProperties
;
tabPanesStyle
?:
CSSProperties
;
onChange
?:
(
index
:
number
)
=>
void
;
}
...
...
src/pages/prepare/components/thead.module.scss
0 → 100644
View file @
14cd9484
.thead
{
height
:
40
PX
;
background
:
#F7F9FC
;
display
:
flex
;
align-items
:
center
;
font-size
:
12
PX
;
padding
:
0
32px
;
color
:
rgba
(
70
,
81
,
100
,
0
.5
);
&
_index
{
width
:
30
PX
;
padding-left
:
3
PX
;
margin-right
:
23
PX
;
}
&
_username
{
flex
:
1
;
}
&
_result
{
display
:
flex
;
align-items
:
center
;
font-size
:
12
PX
;
font-weight
:
400
;
gap
:
6
PX
;
color
:
rgba
(
70
,
81
,
100
,
0
.7
);
&
_best
{
font-size
:
14
PX
;
font-weight
:
600
;
color
:
#FE9B45
;
}
}
}
\ No newline at end of file
src/pages/prepare/components/thead.tsx
0 → 100644
View file @
14cd9484
import
{
View
,
Text
}
from
'@tarojs/components'
import
styles
from
'./thead.module.scss'
export
default
()
=>
(
<
View
className=
{
styles
.
thead
}
>
<
Text
className=
{
styles
.
thead_index
}
>
名次
</
Text
>
<
Text
className=
{
styles
.
thead_username
}
>
用户名
</
Text
>
<
View
className=
{
styles
.
thead_result
}
>
<
Text
className=
{
styles
.
thead_result_first
}
>
首次
</
Text
>
<
Text
>
|
</
Text
>
<
Text
className=
{
styles
.
thead_result_best
}
>
最佳
</
Text
>
</
View
>
</
View
>
)
src/pages/prepare/index.module.scss
View file @
14cd9484
@import
'@/styles/mixins.scss'
;
.wrapper
{
}
.breakthrough
{
@include
flexLayout
(
_
,
center
,
space-around
);
}
.start
{
position
:
fixed
;
bottom
:
32
PX
;
left
:
16
PX
;
right
:
16
PX
;
height
:
100px
;
z-index
:
999
;
.text
{
font-size
:
40px
;
letter-spacing
:
2
PX
;
font-weight
:
600
;
padding-bottom
:
80
PX
;
.tribe
{
&
_title
{
@include
flexLayout
(
row
,
center
,
center
);
height
:
40
PX
;
font-size
:
16
PX
;
letter-spacing
:
1
PX
;
font-weight
:
600
;
color
:
#465164
;
}
}
.item
{
display
:
flex
;
padding
:
28px
32px
26px
;
align-items
:
center
;
&
_rank
{
margin-right
:
40px
;
@include
flexLayout
(
row
,
center
);
&
_icon
{
width
:
30
PX
;
height
:
30
PX
;
}
&
_index
{
display
:
block
;
text-align
:
center
;
width
:
30
PX
;
font-size
:
36px
;
font-weight
:
500
;
color
:
rgba
(
70
,
81
,
100
,
0
.5
);
}
}
&
_username
{
display
:
flex
;
flex
:
1
;
flex-direction
:
column
;
gap
:
4
PX
;
@include
flexLayout
(
row
,
center
);
&
_text
{
font-size
:
14
PX
;
font-weight
:
600
;
color
:
#465164
;
}
&
_crown
{
width
:
36px
;
height
:
36px
;
}
}
&
_result
{
@include
flexLayout
(
row
,
center
,
center
);
font-size
:
12
PX
;
font-weight
:
400
;
gap
:
6
PX
;
color
:
rgba
(
70
,
81
,
100
,
0
.7
);
&
_best
{
font-size
:
16
PX
;
font-weight
:
600
;
color
:
#FE9B45
;
}
}
}
}
@supports
(
bottom
:
constant
(
safe-area-inset-bottom
))
or
(
bottom
:
env
(
safe-area-inset-bottom
))
{
.start
{
bottom
:
calc
(
32
PX
+
constant
(
safe-area-inset-bottom
));
bottom
:
calc
(
32
PX
+
env
(
safe-area-inset-bottom
));
.challenge
{
position
:
fixed
;
bottom
:
60px
;
left
:
16
PX
;
right
:
16
PX
;
height
:
100px
;
z-index
:
999
;
&
_text
{
font-size
:
40px
;
letter-spacing
:
2
PX
;
font-weight
:
600
;
}
}
}
\ No newline at end of file
src/pages/prepare/index.tsx
View file @
14cd9484
import
{
View
,
Text
}
from
'@tarojs/components'
import
{
View
,
Text
,
Image
}
from
'@tarojs/components'
import
{
useEffect
}
from
'react'
import
{
useStoreState
,
useStoreActions
}
from
'@/store/hooks'
import
{
useRouter
,
getMenuButtonBoundingClientRect
}
from
'@tarojs/taro'
import
{
type
StageRank
}
from
'@/api/game'
import
Button
from
'@/components/Button'
import
Tabs
,
{
type
TabItem
}
from
'./components/tabs'
import
TopBar
from
'./components/top-bar'
import
MainHeader
from
'./components/main-header'
import
ScrollRankList
from
'./components/rank-list/index'
import
StudyLeagueRank
from
'./components/study-league-rank'
import
Thead
from
'./components/thead'
import
styles
from
'./index.module.scss'
const
Prepare
:
React
.
FC
=
()
=>
{
const
renderItem
=
(
item
:
StageRank
,
index
:
number
)
=>
{
return
(
<
View
key=
{
item
.
userId
}
className=
{
styles
.
item
}
>
<
View
className=
{
styles
.
item_rank
}
>
{
[
0
,
1
,
2
].
includes
(
index
)
?
<
Image
className=
{
styles
.
item_rank_icon
}
src=
{
require
(
`@/pages/group/assets/icons/rank-${index + 1}.png`
)
}
/>
:
<
Text
className=
{
styles
.
item_rank_index
}
>
{
index
}
</
Text
>
}
</
View
>
<
View
className=
{
styles
.
item_username
}
>
<
Text
className=
{
styles
.
item_username_text
}
>
{
item
.
nickName
||
'-'
}
</
Text
>
<
Image
className=
{
styles
.
item_username_crown
}
src=
{
require
(
'@/pages/group/assets/icons/crown-small.png'
)
}
/>
</
View
>
<
View
className=
{
styles
.
item_result
}
>
<
Text
className=
{
styles
.
item_result_first
}
>
{
65.23
}
s
</
Text
>
<
Text
>
|
</
Text
>
<
Text
className=
{
styles
.
item_result_best
}
>
{
34.23
}
s
</
Text
>
</
View
>
</
View
>
)
}
const
Prepare
=
()
=>
{
const
nav
=
getMenuButtonBoundingClientRect
()
const
stageDetail
=
useStoreState
(
state
=>
state
.
gameModel
.
stageDetail
)
...
...
@@ -25,8 +48,25 @@ const Prepare: React.FC = () => {
},
[
router
,
getStageDetail
])
const
tabs
:
TabItem
[]
=
[
{
label
:
'成都排行榜'
,
children
:
<
ScrollRankList
users=
{
stageDetail
?.
ranks
!
}
/>
},
{
label
:
'学习部落排行榜'
,
children
:
<
StudyLeagueRank
users=
{
stageDetail
?.
ranks
!
}
/>
}
{
label
:
'成都排行榜'
,
children
:
(
<>
<
Thead
/>
{
[].
map
(
renderItem
)
}
</>
)
},
{
label
:
'学习部落排行榜'
,
children
:
(
<
View
className=
{
styles
.
tribe
}
>
<
Text
className=
{
styles
.
tribe_title
}
>
极客学霸俱乐部
</
Text
>
<
Thead
/>
{
[].
map
(
renderItem
)
}
</
View
>
)
}
]
return
(
...
...
@@ -35,12 +75,12 @@ const Prepare: React.FC = () => {
<
View
style=
{
{
paddingTop
:
`${nav.height + nav.top + 5}px`
}
}
>
<
MainHeader
/>
<
Tabs
items=
{
tabs
}
/>
<
Tabs
i
nitialIndex=
{
1
}
i
tems=
{
tabs
}
/>
</
View
>
<
View
className=
{
styles
.
start
}
>
<
View
className=
{
styles
.
challenge
}
>
<
Button
type=
"custom"
size=
"large"
>
<
Text
className=
{
styles
.
text
}
>
开始闯关
</
Text
>
<
Text
className=
{
styles
.
challenge_
text
}
>
开始闯关
</
Text
>
</
Button
>
</
View
>
</
View
>
...
...
src/pages/prepare/renderItem.tsx
deleted
100644 → 0
View file @
990471e1
import
{
Image
,
View
,
Text
}
from
'@tarojs/components'
import
{
type
MemberItem
}
from
'@/api/group'
import
styles
from
'./index.module.scss'
const
renderItem
=
(
item
:
MemberItem
,
index
:
number
)
=>
{
return
(
<
View
key=
{
item
.
memberId
}
className=
{
styles
.
item
}
>
<
View
className=
{
styles
.
item_rank
}
>
{
[
0
,
1
,
2
].
includes
(
index
)
?
<
Image
className=
{
styles
.
item_rank_icon
}
src=
{
require
(
`@/pages/group/assets/icons/rank-${index + 1}.png`
)
}
/>
:
<
Text
className=
{
styles
.
item_rank_index
}
>
4
{
index
}
</
Text
>
}
</
View
>
<
View
className=
{
styles
.
item_username
}
>
<
View
className=
{
styles
.
avatar
}
>
<
Text
className=
{
styles
.
nickname
}
>
{
item
.
memberName
||
'-'
}
</
Text
>
<
Image
className=
{
styles
.
crown
}
src=
{
require
(
'@/pages/group/assets/icons/crown-small.png'
)
}
/>
</
View
>
<
Text
className=
{
styles
.
schoolName
}
>
{
item
.
schoolName
}
</
Text
>
</
View
>
<
Text
className=
{
styles
.
item_role
}
>
CTO
</
Text
>
<
Text
className=
{
styles
.
item_count
}
>
{
item
.
stageNum
}
</
Text
>
</
View
>
)
}
export
default
renderItem
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