feat: 我的店铺列表进度条数据变更

This commit is contained in:
2026-06-05 09:46:13 +08:00
parent 9fa063f695
commit d657df4ba3
2 changed files with 6 additions and 9 deletions
+4 -8
View File
@@ -55,10 +55,6 @@
type: Array,
default: () => [],
},
totalEarnings: {
type: [Number, String],
default: 0,
},
source: {
type: Number,
default: 1,
@@ -70,10 +66,10 @@
const renderList = computed(() => (Array.isArray(props.list) ? props.list : []));
const calcProgressPercent = (item) => {
const total = Number(props.totalEarnings) || 0;
const cur = Number(item?.earnings) || 0;
if (total <= 0 || cur <= 0) return 0;
const pct = (cur / total) * 100;
const totalRevenue = Number(item?.totalRevenue ?? item?.earnings) || 0;
const userPayPrice = Number(item?.userPayPrice) || 0;
if (userPayPrice <= 0 || totalRevenue <= 0) return 0;
const pct = (totalRevenue / userPayPrice) * 100;
if (!Number.isFinite(pct)) return 0;
return Math.max(0, Math.min(100, pct));
};