Commit c29ea6c0 by hxx

我要送礼处理

parent 39ee4fab
...@@ -25,4 +25,8 @@ export default { ...@@ -25,4 +25,8 @@ export default {
save_pay_with_courtesy_integral(data) { save_pay_with_courtesy_integral(data) {
return requestPOST(`${process.env.OLSHOP_URL}/order/save_pay_with_courtesy_integral`, data) return requestPOST(`${process.env.OLSHOP_URL}/order/save_pay_with_courtesy_integral`, data)
}, },
// 查询送礼相关订单
getGiveGiftsOrderDetail(giveGiftsCode) {
return requestPOST(`${process.env.OLSHOP_URL}/order/getGiveGiftsOrderDetail?giveGiftsCode=${giveGiftsCode}`);
},
} }
...@@ -290,7 +290,7 @@ export default { ...@@ -290,7 +290,7 @@ export default {
} }
}, },
orderMsg() { orderMsg() {
order.orderDetail(this.query).then(res1 => { order.orderDetail(this.query).then(async (res1) => {
let res = res1.data; let res = res1.data;
if (res.code == 200) { if (res.code == 200) {
console.log("----------------------------------2") console.log("----------------------------------2")
...@@ -312,7 +312,15 @@ export default { ...@@ -312,7 +312,15 @@ export default {
this.goodsId = this.goodsId =
res.data.noShipmentOrderItems[0].terminalProductGoodsId; res.data.noShipmentOrderItems[0].terminalProductGoodsId;
} }
// 查询是否为我要送礼订单
let sendTotalPrice = 0;
if (res.data.giveGiftsCode) {
const response = await order.getGiveGiftsOrderDetail(res.data.giveGiftsCode);
if (response.data.code == 200) {
const result = response.data.data.filter(item => item.orderSn != res.data.orderSn);
if (result.length !== 0) sendTotalPrice = result[0].totalAmountPayable - 0;
}
}
//查询是否是分销员 //查询是否是分销员
getMiniProgram().then(res1 => { getMiniProgram().then(res1 => {
console.log(res1,'---------------------------res1143') console.log(res1,'---------------------------res1143')
...@@ -349,7 +357,7 @@ export default { ...@@ -349,7 +357,7 @@ export default {
} }
}); });
this.orderDetail = res.data; this.orderDetail = res.data;
this.totalMoney = Number(res.data.totalAmountPayable).toFixed(2); this.totalMoney = (Number(res.data.totalAmountPayable) + sendTotalPrice).toFixed(2);
console.log(Number(res.data.totalAmountPayable).toFixed(2),'--Number(res.data.totalAmountPayable).toFixed(2)') console.log(Number(res.data.totalAmountPayable).toFixed(2),'--Number(res.data.totalAmountPayable).toFixed(2)')
this.inviteelShow = true; this.inviteelShow = true;
}else { }else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment