修改价格计算,总价格包含赠送商品价格,最后结果为总价格-赠送商品-会员优惠

This commit is contained in:
YeMingfei666 2024-11-06 15:20:20 +08:00
parent ef8cd6da3a
commit 8528341101
2 changed files with 32 additions and 36 deletions

View File

@ -365,19 +365,20 @@ text {
.filter-gray { .filter-gray {
filter: grayscale(1); filter: grayscale(1);
} }
.youhui-tips{ .youhui-tips.el-tooltip__popper {
background: #fff; background: #fff;
min-width: 150px; min-width: 150px;
border-radius: 4px; border-radius: 4px;
border: 1px solid #ebeef5!important; border: 1px solid #ebeef5 !important;
padding: 12px; padding: 12px;
color: #606266; color: #606266;
line-height: 1.4; line-height: 1.4;
text-align: justify; text-align: justify;
font-size: 14px; font-size: 14px;
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, .1); box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
word-break: break-all; word-break: break-all;
} }
::v-deep .youhui-tips .popper__arrow{ .youhui-tips.el-tooltip__popper[x-placement^="top"] .popper__arrow:after,
border-top-color: #ebeef5; .youhui-tips.el-tooltip__popper[x-placement^="top"] .popper__arrow {
} border-top-color: #fff;
}

View File

@ -390,10 +390,18 @@
<div class="w-full bottom"> <div class="w-full bottom">
<div class="border-top"> <div class="border-top">
<div class="flex row-right youhui" v-if="youhuiAllPrice > 0"> <div class="flex row-right youhui" v-if="youhuiAllPrice > 0">
<el-tooltip placement="top" effect="light" popper-class="youhui-tips"> <el-tooltip
placement="top"
effect="light"
popper-class="youhui-tips"
:popper-options="{
'background-color': '#fff',
}"
>
<div slot="content"> <div slot="content">
<div class="u-flex"> <div class="u-flex color-000 u-font-14 u-row-between">
<span>会员优惠{{ vipDiscountPrice }} </span> <span class="font-bold">会员优惠 </span>
<span class="">{{ vipDiscountPrice }} </span>
</div> </div>
</div> </div>
<span> 已优惠{{ youhuiAllPrice }} </span> <span> 已优惠{{ youhuiAllPrice }} </span>
@ -1747,14 +1755,14 @@ export default {
allPrice() { allPrice() {
const oldPrice = this.order.old.list.reduce((a, b) => { const oldPrice = this.order.old.list.reduce((a, b) => {
const bTotal = b.info const bTotal = b.info
.filter((v) => v.isGift !== "true" && v.status !== "return") .filter((v) => v.status !== "return")
.reduce((prve, cur) => { .reduce((prve, cur) => {
return prve + cur.number * cur.salePrice; return prve + cur.number * cur.salePrice;
}, 0); }, 0);
return a + bTotal; return a + bTotal;
}, 0); }, 0);
const price = this.order.list const price = this.order.list
.filter((v) => v.isGift !== "true") .filter((v) => v.isGift !== "return")
.reduce((a, b) => { .reduce((a, b) => {
return a + b.number * b.salePrice; return a + b.number * b.salePrice;
}, 0); }, 0);
@ -3726,6 +3734,8 @@ export default {
totalAmount: res.seatAmount || 0, totalAmount: res.seatAmount || 0,
status: "", status: "",
}; };
console.log(' this.order.seatFee')
console.log( this.order.seatFee)
this.order.old.list = Object.entries(goodsMap).map(([key, value]) => ({ this.order.old.list = Object.entries(goodsMap).map(([key, value]) => ({
info: value.map((v) => { info: value.map((v) => {
return { return {
@ -3786,22 +3796,7 @@ export default {
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.youhui-tips{
background: #fff;
min-width: 150px;
border-radius: 4px;
border: 1px solid #ebeef5;
padding: 12px;
color: #606266;
line-height: 1.4;
text-align: justify;
font-size: 14px;
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, .1);
word-break: break-all;
}
::v-deep .youhui-tips .popper__arrow{
border-top-color: #ebeef5;
}
.selQuan { .selQuan {
border: 1px solid #d9d9d9; border: 1px solid #d9d9d9;
border-radius: 4px; border-radius: 4px;