feat: 进度条百分比保留两位小数
This commit is contained in:
@@ -15,15 +15,15 @@ SHOPRO_VERSION=v2.4.1
|
|||||||
#SHOPRO_DEV_BASE_URL=http://192.168.101.58:48090
|
#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=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
|
# SHOPRO_DEV_BASE_URL=http://8.136.55.200:48090
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
class="progress"
|
class="progress"
|
||||||
:style="{ width: `${calcProgressPercent(v)}%` }"
|
:style="{ width: `${calcProgressPercent(v)}%` }"
|
||||||
></view>
|
></view>
|
||||||
<view class="progress-percent">{{ Math.round(calcProgressPercent(v)) }}%</view>
|
<view class="progress-percent">{{ formatProgressPercent(v) }}%</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="first-time"
|
<view class="first-time"
|
||||||
@@ -75,6 +75,10 @@
|
|||||||
return Math.max(0, Math.min(100, pct));
|
return Math.max(0, Math.min(100, pct));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const formatProgressPercent = (item) => {
|
||||||
|
return calcProgressPercent(item).toFixed(2);
|
||||||
|
};
|
||||||
|
|
||||||
const toListRecord = (item) => {
|
const toListRecord = (item) => {
|
||||||
const skuId = item?.skuId ?? '';
|
const skuId = item?.skuId ?? '';
|
||||||
const url =
|
const url =
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
<view class="record-progress">
|
<view class="record-progress">
|
||||||
<view class="progress-bar">
|
<view class="progress-bar">
|
||||||
<view class="progress" :style="{ width: `${item.progress}%` }"></view>
|
<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>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
@@ -78,6 +78,12 @@
|
|||||||
return num.toFixed(2);
|
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 mapOrderToRecord = (order) => {
|
||||||
const items = Array.isArray(order?.items) ? order.items : [];
|
const items = Array.isArray(order?.items) ? order.items : [];
|
||||||
const firstItem = items[0] || {};
|
const firstItem = items[0] || {};
|
||||||
|
|||||||
Reference in New Issue
Block a user