diff --git a/src/views/tool/Instead/components/order.vue b/src/views/tool/Instead/components/order.vue index f282037..eb4a1a8 100644 --- a/src/views/tool/Instead/components/order.vue +++ b/src/views/tool/Instead/components/order.vue @@ -186,7 +186,7 @@
整单改价 - -¥{{ discountAmount }} + -¥{{ discountAmount }}
积分抵扣 @@ -284,6 +284,10 @@ function refCouponConfirm(e, goodsPayPriceMap, goodsList) { score.sel = -1; quansSelArr.value = e; $goodsPayPriceMap = goodsPayPriceMap; + checkOrderPay.discountAmount = 0; + checkOrderPay.discount = 0; + score.sel = -1; + usePointsNumber.value = 0; } function delQuan(row) { const index = quansSelArr.value.findIndex((v) => v.id == row.id); @@ -307,6 +311,9 @@ function discountConfirm(e) { } else { checkOrderPay.discount = 0; } + + score.sel = -1; + usePointsNumber.value = 0; } function discountShow(e) { refDiscount.value.open({ @@ -356,6 +363,7 @@ watch( } } ); + watch( () => props.orderInfo.id, (newval) => { diff --git a/src/views/tool/Instead/quan_util.js b/src/views/tool/Instead/quan_util.js index d80e437..4aca99f 100644 --- a/src/views/tool/Instead/quan_util.js +++ b/src/views/tool/Instead/quan_util.js @@ -12,6 +12,10 @@ export function returnProductCouponPrice(coup, goodsArr, vipUser) { if (!item) { return 0; } + const discountSaleAmount = item.discountSaleAmount * 1; + if (discountSaleAmount > 0) { + return discountSaleAmount * coup.num; + } const memberPrice = item.memberPrice ? item.memberPrice : item.price; const price = item ? (isUseVipPrice(vipUser, item) ? memberPrice : item.price) : 0; return price * coup.num; @@ -55,8 +59,10 @@ export function returnProductCoupon(coup, goodsArr, vipUser, selCoupArr = []) { use: false, }; } + const discountSaleAmount = item.discountSaleAmount * 1; const memberPrice = item.memberPrice ? item.memberPrice : item.price; - const price = item ? (isUseVipPrice(vipUser, item) ? memberPrice : item.price) : 0; + let price = item ? (isUseVipPrice(vipUser, item) ? memberPrice : item.price) : 0; + price = discountSaleAmount > 0 ? discountSaleAmount : price; const discountAmount = (price * coup.num).toFixed(2); // const canUse = !coup.use ? false : (discountAmount > 0 && returnCoupCanUse(goodsArr, coup, selCoupArr)) // const canUse=discountAmount>0 @@ -83,8 +89,12 @@ export function returnProductAllCoup(coupArr, goodsArr, vipUser) { } //返回商品实际支付价格 export function returnProductPayPrice(goods, vipUser) { + const discountSaleAmount = goods.discountSaleAmount * 1; const memberPrice = goods.memberPrice ? goods.memberPrice : goods.price; const price = isUseVipPrice(vipUser, goods) ? memberPrice : goods.price; + if (discountSaleAmount) { + return discountSaleAmount; + } return price; } //返回商品券抵扣的商品价格 @@ -93,7 +103,11 @@ export function returnProductCoupAllPrice(productPriceArr, startIndex, num = 1, return productPriceArr.slice(startIndex, startIndex + num).reduce((prve, cur) => { let curPrice = 0; if (typeof cur === "object") { - curPrice = isVip ? cur.memberPrice * 1 : cur.price; + if (cur.discountSaleAmount * 1 > 0) { + curPrice = cur.discountSaleAmount * 1; + } else { + curPrice = isVip ? cur.memberPrice * 1 : cur.price; + } } else { curPrice = cur * 1; } @@ -132,6 +146,7 @@ export function returnGoodsPayPriceMap(goodsArr) { return { memberPrice: v.memberPrice ? v.memberPrice : v.price, price: v.price, + discountSaleAmount: v.discountSaleAmount * 1, }; }); prve[cur.productId].push(...arr);