Commit d910a240 authored by Xuguangxing's avatar Xuguangxing

fix: 进度条修改

parent 5003a0f2
...@@ -215,7 +215,7 @@ export default { ...@@ -215,7 +215,7 @@ export default {
this.groupId = +res.groupBuyInfo.groupId || ''; this.groupId = +res.groupBuyInfo.groupId || '';
} }
if (res.saleCount && res.activitySkuTotalCount) { if (res.saleCount && res.activitySkuTotalCount) {
const percentage = +res.activitySkuTotalCount - +res.saleCount / +res.activitySkuTotalCount; const percentage = +res.goodsCount / +res.activitySkuTotalCount;
if (isNaN(percentage)) { if (isNaN(percentage)) {
this.stockPercentage = 0; this.stockPercentage = 0;
} else { } else {
......
...@@ -81,11 +81,12 @@ export default { ...@@ -81,11 +81,12 @@ export default {
if (!item) return 0; if (!item) return 0;
let percentage = 0; let percentage = 0;
// saleCount / activitySkuTotalCount // saleCount / activitySkuTotalCount
const { saleCount, activitySkuTotalCount } = item; const { goodsCount, activitySkuTotalCount } = item;
percentage = +activitySkuTotalCount - +saleCount / +activitySkuTotalCount; percentage = +goodsCount / +activitySkuTotalCount;
if (isNaN(percentage)) { if (isNaN(percentage)) {
return 0; return 0;
} else { } else {
alert(Math.floor(percentage) >= 1 ? 100 : Math.floor(percentage * 100));
return Math.floor(percentage) >= 1 ? 100 : Math.floor(percentage * 100); return Math.floor(percentage) >= 1 ? 100 : Math.floor(percentage * 100);
} }
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment