feat: 进度条百分比保留两位小数

This commit is contained in:
2026-06-12 09:51:42 +08:00
parent 6dee56e17f
commit 795de5ff62
3 changed files with 15 additions and 5 deletions
+3 -3
View File
@@ -15,15 +15,15 @@ SHOPRO_VERSION=v2.4.1
#SHOPRO_DEV_BASE_URL=http://192.168.101.58:48090
# 服务器
SHOPRO_DEV_BASE_URL=http://www.qflyqzy.net:48090
# SHOPRO_DEV_BASE_URL=http://www.qflyqzy.net:48090
#SHOPRO_DEV_BASE_URL=https://www.qflyqzy.net/yg-api
# 伟伟
# SHOPRO_DEV_BASE_URL=http://192.168.1.7:48080
# SHOPRO_DEV_BASE_URL=http://192.168.3.1:48090
# 测试环境
# SHOPRO_DEV_BASE_URL=https://yougoutest.api.riananyoumu.com
SHOPRO_DEV_BASE_URL=https://yougoutest.api.riananyoumu.com
# 本地
# SHOPRO_DEV_BASE_URL=http://8.136.55.200:48090
+5 -1
View File
@@ -18,7 +18,7 @@
class="progress"
:style="{ width: `${calcProgressPercent(v)}%` }"
></view>
<view class="progress-percent">{{ Math.round(calcProgressPercent(v)) }}%</view>
<view class="progress-percent">{{ formatProgressPercent(v) }}%</view>
</view>
</view>
<view class="first-time"
@@ -75,6 +75,10 @@
return Math.max(0, Math.min(100, pct));
};
const formatProgressPercent = (item) => {
return calcProgressPercent(item).toFixed(2);
};
const toListRecord = (item) => {
const skuId = item?.skuId ?? '';
const url =
+7 -1
View File
@@ -18,7 +18,7 @@
<view class="record-progress">
<view class="progress-bar">
<view class="progress" :style="{ width: `${item.progress}%` }"></view>
<view class="progress-percent">{{ Math.round(Number(item.progress) || 0) }}%</view>
<view class="progress-percent">{{ formatPercent(item.progress) }}%</view>
</view>
</view>
@@ -78,6 +78,12 @@
return num.toFixed(2);
};
const formatPercent = (value) => {
const num = Number(value);
if (!Number.isFinite(num)) return '0.00';
return num.toFixed(2);
};
const mapOrderToRecord = (order) => {
const items = Array.isArray(order?.items) ? order.items : [];
const firstItem = items[0] || {};