Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
TianGongKaiWu-20251203
Project
Project
Details
Activity
Releases
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
SparkProjects
TianGongKaiWu-20251203
Commits
654fb812
Commit
654fb812
authored
Dec 16, 2025
by
天马流星拳
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor(HomePage): 重构排行榜按钮布局样式
将.span-4的样式重构为flex布局,并添加.span-4-1作为按钮容器 保持原有功能不变,提升布局灵活性和可维护性
parent
9bc17cd8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
9 deletions
+24
-9
HomePage.less
src/pages/HomePage/HomePage.less
+18
-7
HomePage.tsx
src/pages/HomePage/HomePage.tsx
+6
-2
No files found.
src/pages/HomePage/HomePage.less
View file @
654fb812
...
...
@@ -363,10 +363,16 @@
width: 25%;
}
.span-4{
width: 136px;
height: 47px;
width: 25%;
.sparkBg("homePage/top-btn2.png");
width: 25%;
display: flex;
align-items: center;
justify-content: center;
.span-4-1{
width: 136px;
height: 47px;
.sparkBg("homePage/top-btn2.png");
}
}
}
}
...
...
@@ -396,10 +402,15 @@
width: 25%;
}
.span-4{
width: 136px;
height: 47px;
width: 25%;
.sparkBg("homePage/top-btn2.png");
display: flex;
align-items: center;
justify-content: center;
.span-4-1{
width: 136px;
height: 47px;
.sparkBg("homePage/top-btn2.png");
}
}
}
}
...
...
src/pages/HomePage/HomePage.tsx
View file @
654fb812
...
...
@@ -220,7 +220,9 @@ class HomePage extends React.Component<any, any> {
<
span
className=
'span-1'
>
{
item
.
index
}
</
span
>
<
span
className=
'span-2'
>
{
item
.
userName
}
</
span
>
<
span
className=
'span-3'
>
{
item
.
score
>
0
?
`+${item.score}`
:
item
.
score
}
%
</
span
>
<
span
className=
'span-4'
onClick=
{
()
=>
this
.
viewDistribution
(
item
)
}
></
span
>
<
span
className=
'span-4'
onClick=
{
()
=>
this
.
viewDistribution
(
item
)
}
>
<
span
className=
'span-4-1'
></
span
>
</
span
>
</
div
>
))
}
...
...
@@ -230,7 +232,9 @@ class HomePage extends React.Component<any, any> {
<
span
className=
'span-1'
>
{
myRank
.
index
==
null
?
'未上榜'
:
myRank
.
index
>=
100
?
'99+'
:
myRank
.
index
}
</
span
>
<
span
className=
'span-2'
>
{
myRank
.
userName
}
(我)
</
span
>
<
span
className=
'span-3'
>
{
myRank
&&
myRank
.
score
!=
null
?
(
myRank
.
score
>
0
?
`+${myRank.score}`
:
myRank
.
score
)
:
'-'
}
%
</
span
>
<
span
className=
'span-4'
onClick=
{
()
=>
this
.
viewDistribution
(
myRank
)
}
></
span
>
<
span
className=
'span-4'
onClick=
{
()
=>
this
.
viewDistribution
(
myRank
)
}
>
<
span
className=
'span-4-1'
></
span
>
</
span
>
</
div
>
{
/* 展开 */
}
<
div
className=
'postRanking_expand'
>
...
...
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