Commit 3e46efdb by 前端

更新样式

1 parent 16c4ecc2
...@@ -4,7 +4,10 @@ ...@@ -4,7 +4,10 @@
<div class="avatar male"></div> <div class="avatar male"></div>
<span>男</span> <span>男</span>
<div class="progress"> <div class="progress">
<div class="fill male" :style="{ width: malePercentage==0? 50: malePercentage+ '%' }">{{ <div class="fill male" :style="{ width: malePercentage==0? 50: malePercentage+ '%','min-width':'40%',
'max-width':'50%',
'margin-left':(40 <malePercentage && malePercentage < 50 ? malePercentage/2:0 <malePercentage && malePercentage < 40?
malePercentage*2 : malePercentage/4) + '%' }">{{
malePercentage || 0 malePercentage || 0
}}% }}%
</div> </div>
...@@ -15,7 +18,7 @@ ...@@ -15,7 +18,7 @@
<div class="avatar female"></div> <div class="avatar female"></div>
<span>女</span> <span>女</span>
<div class="progress"> <div class="progress">
<div class="fill female" :style="{ width: femalePercentage== 0?50:femalePercentage + '%' }"> <div class="fill female" :style="{ width: femalePercentage== 0?50:femalePercentage + '%','min-width':'30%'}">
{{ femalePercentage || 0 }}% {{ femalePercentage || 0 }}%
</div> </div>
</div> </div>
...@@ -46,9 +49,9 @@ export default { ...@@ -46,9 +49,9 @@ export default {
}, },
femalePercentage() { femalePercentage() {
if (this.maleCount + this.femaleCount == 0){ if (this.maleCount + this.femaleCount == 0) {
return 0 return 0
}else { } else {
return (100 - this.malePercentage).toFixed(2); return (100 - this.malePercentage).toFixed(2);
} }
...@@ -87,7 +90,7 @@ export default { ...@@ -87,7 +90,7 @@ export default {
.progress { .progress {
justify-content: center; justify-content: center;
width: 10vw; width: 8vw;
height: 2.5vh; height: 2.5vh;
margin: 10px 0; margin: 10px 0;
...@@ -98,8 +101,8 @@ export default { ...@@ -98,8 +101,8 @@ export default {
font-size: 14px; font-size: 14px;
&.male { &.male {
margin-left: 3.5vw; padding-right: 15px;
padding-left: 10px; padding-left: 15px;
text-align: left; text-align: left;
background: #5A64FF; background: #5A64FF;
border-top-left-radius: 25px; // 左上角圆角 border-top-left-radius: 25px; // 左上角圆角
...@@ -108,7 +111,8 @@ export default { ...@@ -108,7 +111,8 @@ export default {
} }
&.female { &.female {
padding-right: 10px; padding-right: 18px;
padding-left: 10px;
text-align: right; text-align: right;
background: #FF5A92; background: #FF5A92;
border-top-right-radius: 25px; border-top-right-radius: 25px;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!