feat: 企业优惠
This commit is contained in:
@@ -39,6 +39,8 @@ export function updateGoodsNum(data) {
|
|||||||
data,
|
data,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// 查询结算列表
|
// 查询结算列表
|
||||||
export function getSettleList(data) {
|
export function getSettleList(data) {
|
||||||
// return request.post('/common/getSmsCode',qs.stringify(params));
|
// return request.post('/common/getSmsCode',qs.stringify(params));
|
||||||
|
|||||||
@@ -268,12 +268,16 @@
|
|||||||
<view class="price-view">
|
<view class="price-view">
|
||||||
<text class="text-32 text-zu">商品总价</text>
|
<text class="text-32 text-zu">商品总价</text>
|
||||||
<text class="text-32 text-zu text-bold"
|
<text class="text-32 text-zu text-bold"
|
||||||
>¥{{ orderInfo.amount - orderInfo.postage }}</text
|
>¥{{ orderInfo.amount - orderInfo.postage + (orderInfo.enterpriseAmount || 0) }}</text
|
||||||
>
|
>
|
||||||
</view>
|
</view>
|
||||||
<view class="price-view">
|
<view class="price-view">
|
||||||
<text class="text-32 text-zu">运费</text>
|
<text class="text-32 text-zu">运费</text>
|
||||||
<text class="text-32 text-zu text-bold">¥{{ orderInfo.postage }}</text>
|
<text class="text-32 text-zu text-bold">¥{{ orderInfo.postage }}</text>
|
||||||
|
</view>
|
||||||
|
<view class="price-view" v-if="user.isEnterpriseUser">
|
||||||
|
<text class="text-32 text-zu">企业用户优惠</text>
|
||||||
|
<text class="text-32 text-zu text-bold">¥{{ orderInfo.enterpriseAmount }}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="price-line"></view>
|
<view class="price-line"></view>
|
||||||
<view class="price-view-two">
|
<view class="price-view-two">
|
||||||
@@ -424,7 +428,7 @@ import {
|
|||||||
getSettleList,
|
getSettleList,
|
||||||
settle,
|
settle,
|
||||||
settlementOrder,
|
settlementOrder,
|
||||||
updateGoodsNum,
|
updateGoodsNum
|
||||||
} from "@/api/cart.js";
|
} from "@/api/cart.js";
|
||||||
import { getSupportPay } from "@/api/order.js";
|
import { getSupportPay } from "@/api/order.js";
|
||||||
import { feedback } from "@/api/payment.js";
|
import { feedback } from "@/api/payment.js";
|
||||||
@@ -809,11 +813,13 @@ export default {
|
|||||||
currentAmount = currentAmount + data.unitPrice;
|
currentAmount = currentAmount + data.unitPrice;
|
||||||
currentTotalPrice = currentTotalPrice + data.unitPrice;
|
currentTotalPrice = currentTotalPrice + data.unitPrice;
|
||||||
}
|
}
|
||||||
|
|
||||||
const params = {
|
const params = {
|
||||||
id: data.id,
|
id: data.id,
|
||||||
goodsNum: currentQuantity,
|
goodsNum: currentQuantity,
|
||||||
};
|
};
|
||||||
const result = await updateGoodsNum(params);
|
const result = await updateGoodsNum(params);
|
||||||
|
console.log("-----1")
|
||||||
if (result && result.bizcode === 100) {
|
if (result && result.bizcode === 100) {
|
||||||
this.orderInfo.shops[index].addrTimes[addIndex].goods[pIndex].num =
|
this.orderInfo.shops[index].addrTimes[addIndex].goods[pIndex].num =
|
||||||
currentQuantity;
|
currentQuantity;
|
||||||
@@ -821,7 +827,24 @@ export default {
|
|||||||
pIndex
|
pIndex
|
||||||
].totalPrice = currentTotalPrice.toFixed(2);
|
].totalPrice = currentTotalPrice.toFixed(2);
|
||||||
this.orderInfo.amount = currentAmount.toFixed(2);
|
this.orderInfo.amount = currentAmount.toFixed(2);
|
||||||
|
|
||||||
|
|
||||||
|
const resp = await getSettleList({cartIds: this.ids});
|
||||||
|
if (resp && resp.bizcode === 100) {
|
||||||
|
const data = resp.data;
|
||||||
|
const shops = data.shops;
|
||||||
|
if (shops && shops.length !== 0) {
|
||||||
|
shops.map((item) => {
|
||||||
|
item.addrTimes.map((addItem) => {
|
||||||
|
addItem.remark = null;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
data.shops = shops;
|
||||||
|
data.paymentMethod = null; // 支付方式
|
||||||
|
this.orderInfo = data;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// 获取备注
|
// 获取备注
|
||||||
|
|||||||
Reference in New Issue
Block a user