feat: 进度条添加百分比展示

This commit is contained in:
2026-06-05 10:26:19 +08:00
parent d657df4ba3
commit 7fd6871e3c
2 changed files with 31 additions and 0 deletions
+15
View File
@@ -18,6 +18,7 @@
class="progress"
:style="{ width: `${calcProgressPercent(v)}%` }"
></view>
<view class="progress-percent">{{ Math.round(calcProgressPercent(v)) }}%</view>
</view>
</view>
<view class="first-time"
@@ -186,6 +187,7 @@
}
.progress-bar {
position: relative;
height: 15rpx;
border-radius: 999rpx;
background: linear-gradient(90deg, #2c63ff 0%, #ff3b30 100%);
@@ -199,6 +201,19 @@
background: rgba(255, 255, 255, 0.92);
}
.progress-percent {
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
font-size: 18rpx;
font-weight: 600;
color: rgba(27, 43, 75, 0.92);
line-height: 1;
pointer-events: none;
text-shadow: 0 0 6rpx rgba(255, 255, 255, 0.9);
}
.stats {
margin-top: 20rpx;
}