修改价格计算公式

This commit is contained in:
YeMingfei666 2024-11-06 15:26:52 +08:00
parent 8528341101
commit 3ad1407173
1 changed files with 7 additions and 7 deletions

View File

@ -1683,7 +1683,7 @@ export default {
const oldPrice = this.order.old.list.reduce((a, b) => {
const total = b.info
.filter((v) => v.isGift === "true")
.filter((v) => v.isGift === "true"||v.status === "return")
.reduce((prve, cur) => {
return prve + cur.number * cur.salePrice;
}, 0);
@ -1715,9 +1715,9 @@ export default {
return total;
},
giftLen() {
const nowlen = this.order.list.filter((v) => v.isGift === "true").length;
const nowlen = this.order.list.filter((v) => v.isGift === "true"||v.status === "return").length;
const oldlen = this.order.old.list.reduce((prve, cur) => {
const arr = cur.info.filter((v) => v.isGift === "true");
const arr = cur.info.filter((v) => v.isGift === "true"||v.status === "return");
prve.push(...arr);
return prve;
}, []).length;
@ -1755,14 +1755,14 @@ export default {
allPrice() {
const oldPrice = this.order.old.list.reduce((a, b) => {
const bTotal = b.info
.filter((v) => v.status !== "return")
.filter((v) => v)
.reduce((prve, cur) => {
return prve + cur.number * cur.salePrice;
}, 0);
return a + bTotal;
}, 0);
const price = this.order.list
.filter((v) => v.isGift !== "return")
.filter((v) => v)
.reduce((a, b) => {
return a + b.number * b.salePrice;
}, 0);
@ -1787,7 +1787,7 @@ export default {
const bTotal = b.info
.filter(
(v) =>
v.isGift !== "true" &&
v.isGift !== "true" && v.status !== "return"&&
v.memberPrice &&
v.memberPrice != v.salePrice
)
@ -1799,7 +1799,7 @@ export default {
const nowMemberprice = this.order.list
.filter(
(v) =>
v.isGift !== "true" && v.memberPrice && v.memberPrice != v.salePrice
v.isGift !== "true" && v.status !== "return" && v.memberPrice && v.memberPrice != v.salePrice
)
.reduce((a, b) => {
return a + b.number * (b.salePrice - b.memberPrice);