Commit 25948fe8 authored by Xuguangxing's avatar Xuguangxing

feat: 更改库存进度条

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