fix: 增加订单支付各种优惠时的其他优惠重置
This commit is contained in:
@@ -186,7 +186,7 @@
|
|||||||
|
|
||||||
<div class="u-flex u-m-b-10 u-row-between">
|
<div class="u-flex u-m-b-10 u-row-between">
|
||||||
<span class="title">整单改价</span>
|
<span class="title">整单改价</span>
|
||||||
<span class="u-m-l-10 value">-¥{{ discountAmount }}</span>
|
<span class="u-m-l-10 value color-red">-¥{{ discountAmount }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="u-flex u-m-b-10 u-row-between">
|
<div class="u-flex u-m-b-10 u-row-between">
|
||||||
<span class="title">积分抵扣</span>
|
<span class="title">积分抵扣</span>
|
||||||
@@ -284,6 +284,10 @@ function refCouponConfirm(e, goodsPayPriceMap, goodsList) {
|
|||||||
score.sel = -1;
|
score.sel = -1;
|
||||||
quansSelArr.value = e;
|
quansSelArr.value = e;
|
||||||
$goodsPayPriceMap = goodsPayPriceMap;
|
$goodsPayPriceMap = goodsPayPriceMap;
|
||||||
|
checkOrderPay.discountAmount = 0;
|
||||||
|
checkOrderPay.discount = 0;
|
||||||
|
score.sel = -1;
|
||||||
|
usePointsNumber.value = 0;
|
||||||
}
|
}
|
||||||
function delQuan(row) {
|
function delQuan(row) {
|
||||||
const index = quansSelArr.value.findIndex((v) => v.id == row.id);
|
const index = quansSelArr.value.findIndex((v) => v.id == row.id);
|
||||||
@@ -307,6 +311,9 @@ function discountConfirm(e) {
|
|||||||
} else {
|
} else {
|
||||||
checkOrderPay.discount = 0;
|
checkOrderPay.discount = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
score.sel = -1;
|
||||||
|
usePointsNumber.value = 0;
|
||||||
}
|
}
|
||||||
function discountShow(e) {
|
function discountShow(e) {
|
||||||
refDiscount.value.open({
|
refDiscount.value.open({
|
||||||
@@ -356,6 +363,7 @@ watch(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => props.orderInfo.id,
|
() => props.orderInfo.id,
|
||||||
(newval) => {
|
(newval) => {
|
||||||
|
|||||||
@@ -12,6 +12,10 @@ export function returnProductCouponPrice(coup, goodsArr, vipUser) {
|
|||||||
if (!item) {
|
if (!item) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
const discountSaleAmount = item.discountSaleAmount * 1;
|
||||||
|
if (discountSaleAmount > 0) {
|
||||||
|
return discountSaleAmount * coup.num;
|
||||||
|
}
|
||||||
const memberPrice = item.memberPrice ? item.memberPrice : item.price;
|
const memberPrice = item.memberPrice ? item.memberPrice : item.price;
|
||||||
const price = item ? (isUseVipPrice(vipUser, item) ? memberPrice : item.price) : 0;
|
const price = item ? (isUseVipPrice(vipUser, item) ? memberPrice : item.price) : 0;
|
||||||
return price * coup.num;
|
return price * coup.num;
|
||||||
@@ -55,8 +59,10 @@ export function returnProductCoupon(coup, goodsArr, vipUser, selCoupArr = []) {
|
|||||||
use: false,
|
use: false,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
const discountSaleAmount = item.discountSaleAmount * 1;
|
||||||
const memberPrice = item.memberPrice ? item.memberPrice : item.price;
|
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 discountAmount = (price * coup.num).toFixed(2);
|
||||||
// const canUse = !coup.use ? false : (discountAmount > 0 && returnCoupCanUse(goodsArr, coup, selCoupArr))
|
// const canUse = !coup.use ? false : (discountAmount > 0 && returnCoupCanUse(goodsArr, coup, selCoupArr))
|
||||||
// const canUse=discountAmount>0
|
// const canUse=discountAmount>0
|
||||||
@@ -83,8 +89,12 @@ export function returnProductAllCoup(coupArr, goodsArr, vipUser) {
|
|||||||
}
|
}
|
||||||
//返回商品实际支付价格
|
//返回商品实际支付价格
|
||||||
export function returnProductPayPrice(goods, vipUser) {
|
export function returnProductPayPrice(goods, vipUser) {
|
||||||
|
const discountSaleAmount = goods.discountSaleAmount * 1;
|
||||||
const memberPrice = goods.memberPrice ? goods.memberPrice : goods.price;
|
const memberPrice = goods.memberPrice ? goods.memberPrice : goods.price;
|
||||||
const price = isUseVipPrice(vipUser, goods) ? memberPrice : goods.price;
|
const price = isUseVipPrice(vipUser, goods) ? memberPrice : goods.price;
|
||||||
|
if (discountSaleAmount) {
|
||||||
|
return discountSaleAmount;
|
||||||
|
}
|
||||||
return price;
|
return price;
|
||||||
}
|
}
|
||||||
//返回商品券抵扣的商品价格
|
//返回商品券抵扣的商品价格
|
||||||
@@ -93,7 +103,11 @@ export function returnProductCoupAllPrice(productPriceArr, startIndex, num = 1,
|
|||||||
return productPriceArr.slice(startIndex, startIndex + num).reduce((prve, cur) => {
|
return productPriceArr.slice(startIndex, startIndex + num).reduce((prve, cur) => {
|
||||||
let curPrice = 0;
|
let curPrice = 0;
|
||||||
if (typeof cur === "object") {
|
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 {
|
} else {
|
||||||
curPrice = cur * 1;
|
curPrice = cur * 1;
|
||||||
}
|
}
|
||||||
@@ -132,6 +146,7 @@ export function returnGoodsPayPriceMap(goodsArr) {
|
|||||||
return {
|
return {
|
||||||
memberPrice: v.memberPrice ? v.memberPrice : v.price,
|
memberPrice: v.memberPrice ? v.memberPrice : v.price,
|
||||||
price: v.price,
|
price: v.price,
|
||||||
|
discountSaleAmount: v.discountSaleAmount * 1,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
prve[cur.productId].push(...arr);
|
prve[cur.productId].push(...arr);
|
||||||
|
|||||||
Reference in New Issue
Block a user