Commit 49109537 by 张立顺

商品价格问题

1 parent 59621a71
...@@ -96,7 +96,7 @@ export default { ...@@ -96,7 +96,7 @@ export default {
this.productList = res.list this.productList = res.list
this.productList.forEach(function (item) { this.productList.forEach(function (item) {
item.saleAmount = item.goodsStatistics.saleAmount item.saleAmount = item.goodsStatistics.saleAmount
if (item.specificationDetailList.length > 1) { if (item.specificationDetailList && item.specificationDetailList.length > 1) {
let retailPriceList = item.specificationDetailList.sort(function (a, b) { let retailPriceList = item.specificationDetailList.sort(function (a, b) {
return a.retailPrice - b.retailPrice return a.retailPrice - b.retailPrice
}) })
...@@ -110,12 +110,13 @@ export default { ...@@ -110,12 +110,13 @@ export default {
item.retailPrice = minRatilPrice == maxRatilPrice ? minRatilPrice.toFixed(2) : minRatilPrice.toFixed(2) + '-' + maxRatilPrice.toFixed(2) item.retailPrice = minRatilPrice == maxRatilPrice ? minRatilPrice.toFixed(2) : minRatilPrice.toFixed(2) + '-' + maxRatilPrice.toFixed(2)
item.minRatilPrice = minRatilPrice.toFixed(2) item.minRatilPrice = minRatilPrice.toFixed(2)
item.goodsStock = minStock == maxStock ? minStock : minStock + '-' + maxStock item.goodsStock = minStock == maxStock ? minStock : minStock + '-' + maxStock
} else if (item.specificationDetailList.length == 1) { } else if (item.specificationDetailList && item.specificationDetailList.length == 1) {
item.retailPrice = (item.specificationDetailList[0].retailPrice / 100).toFixed(2) item.retailPrice = (item.specificationDetailList[0].retailPrice / 100).toFixed(2)
item.minRatilPrice = item.retailPrice item.minRatilPrice = item.retailPrice
item.goodsStock = item.specificationDetailList[0].stock item.goodsStock = item.specificationDetailList[0].stock
} else { } else {
item.retailPrice = (item.retailPrice / 100).toFixed(2) item.retailPrice = (item.retailPrice / 100).toFixed(2)
console.log(item.retailPrice)
item.minRatilPrice = item.retailPrice item.minRatilPrice = item.retailPrice
} }
}) })
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!