Commit 654fb812 authored by 天马流星拳's avatar 天马流星拳

refactor(HomePage): 重构排行榜按钮布局样式

将.span-4的样式重构为flex布局,并添加.span-4-1作为按钮容器
保持原有功能不变,提升布局灵活性和可维护性
parent 9bc17cd8
......@@ -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");
}
}
}
}
......
......@@ -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'>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment