feat: 我的店铺列表进度条数据变更
This commit is contained in:
@@ -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));
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user