Commit 25948fe8 authored by Xuguangxing's avatar Xuguangxing

feat: 更改库存进度条

parent 3c6c5160
......@@ -37,8 +37,8 @@
<cr-progress
class="group-item-progress"
stroke-width="5"
color="#F7F8F9"
track-color="#EC1500"
color="#EC1500"
track-color="#F7F8F9"
:show-pivot="false"
:percentage="stockPercentage"
/>
......@@ -215,7 +215,7 @@ export default {
this.groupId = +res.groupBuyInfo.groupId || '';
}
if (res.saleCount && res.activitySkuTotalCount) {
const percentage = +res.saleCount / +res.activitySkuTotalCount;
const percentage = +res.activitySkuTotalCount - +res.saleCount / +res.activitySkuTotalCount;
if (isNaN(percentage)) {
this.stockPercentage = 0;
} else {
......
......@@ -10,8 +10,8 @@
<cr-progress
class="group-item-progress"
stroke-width="5"
color="#F7F8F9"
track-color="#EC1500"
color="#EC1500"
track-color="#F7F8F9"
:show-pivot="false"
:percentage="handleProgressByStatus(goodsItem)"
/>
......@@ -82,10 +82,12 @@ export default {
let percentage = 0;
// saleCount / activitySkuTotalCount
const { saleCount, activitySkuTotalCount } = item;
percentage = (saleCount / activitySkuTotalCount) * 100;
percentage = percentage < 0 ? 0 : percentage;
percentage = this.btnByStatus.d ? 0 : percentage;
return Math.round(percentage * 100) / 100;
percentage = +activitySkuTotalCount - +saleCount / +activitySkuTotalCount;
if (isNaN(percentage)) {
return 0;
} else {
return Math.floor(percentage) >= 1 ? 100 : Math.floor(percentage * 100);
}
},
onButtonClick() {
try {
......
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