Commit d8a8c63d by 张立顺

fix 自测bug

1 parent 870baa39
......@@ -1501,6 +1501,9 @@ Page({
let { subOrderList, packageGoodsList } = orderObj
let chooseList = []
if (packageGoodsList && packageGoodsList.length > 0) {
subOrderList = subOrderList?.filter(item => !item.packageName)
}
subOrderList = subOrderList?.concat(packageGoodsList)
if (subOrderList && subOrderList.length) {
......@@ -1569,6 +1572,28 @@ Page({
) {
g.minSellPrice = g.sellPrice
}
// 回显折扣信息
let basePrice = g.sellPrice || g.price
let finalPrice = basePrice
let discountType = g.discountType
let discountValue = g.discountValue
if (discountType == 1 && discountValue) {
if (discountValue > 0 && discountValue <= 10) {
finalPrice = NP.times(basePrice, NP.divide(discountValue, 10))
finalPrice = Math.round(finalPrice * 100) / 100
}
} else if (discountType == 2 && discountValue) {
finalPrice = NP.minus(basePrice, discountValue)
if (finalPrice < 0) finalPrice = 0
} else if (discountType == 4) {
finalPrice = 0
}
g.basePrice = basePrice
g.finalPrice = finalPrice
g.discountAmount = NP.minus(basePrice, finalPrice)
})
e.goodsList = e.packageGoodsOrderList
e.upgradePrice = e.goodsList.reduce((prev, cur) => {
......@@ -1679,10 +1704,35 @@ Page({
...temp,
resetOrder: item.resetOrder,
price: item.price,
sellPrice: item.price,
sellPrice: item.sellPrice || item.price,
goodsId: item.goodsId,
specificationStr: item.specificationData.replace(/;~;/g, '/')
specificationStr: item.specificationData.replace(/;~;/g, '/'),
discountType: item.discountType,
discountValue: item.discountValue
}
// 回显折扣信息
let basePrice = goodsInfo.sellPrice
let finalPrice = basePrice
let discountType = goodsInfo.discountType
let discountValue = goodsInfo.discountValue
if (discountType == 1 && discountValue) {
if (discountValue > 0 && discountValue <= 10) {
finalPrice = NP.times(basePrice, NP.divide(discountValue, 10))
finalPrice = Math.round(finalPrice * 100) / 100
}
} else if (discountType == 2 && discountValue) {
finalPrice = NP.minus(basePrice, discountValue)
if (finalPrice < 0) finalPrice = 0
} else if (discountType == 4) {
finalPrice = 0
}
goodsInfo.basePrice = basePrice
goodsInfo.finalPrice = finalPrice
goodsInfo.discountAmount = NP.minus(basePrice, finalPrice)
if (
goodsInfo.minSellPrice &&
goodsInfo.sellPrice &&
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!