feat: 企业优惠
This commit is contained in:
@@ -39,6 +39,8 @@ export function updateGoodsNum(data) {
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// 查询结算列表
|
||||
export function getSettleList(data) {
|
||||
// return request.post('/common/getSmsCode',qs.stringify(params));
|
||||
|
||||
@@ -268,12 +268,16 @@
|
||||
<view class="price-view">
|
||||
<text class="text-32 text-zu">商品总价</text>
|
||||
<text class="text-32 text-zu text-bold"
|
||||
>¥{{ orderInfo.amount - orderInfo.postage }}</text
|
||||
>¥{{ orderInfo.amount - orderInfo.postage + (orderInfo.enterpriseAmount || 0) }}</text
|
||||
>
|
||||
</view>
|
||||
<view class="price-view">
|
||||
<text class="text-32 text-zu">运费</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 class="price-line"></view>
|
||||
<view class="price-view-two">
|
||||
@@ -424,7 +428,7 @@ import {
|
||||
getSettleList,
|
||||
settle,
|
||||
settlementOrder,
|
||||
updateGoodsNum,
|
||||
updateGoodsNum
|
||||
} from "@/api/cart.js";
|
||||
import { getSupportPay } from "@/api/order.js";
|
||||
import { feedback } from "@/api/payment.js";
|
||||
@@ -809,11 +813,13 @@ export default {
|
||||
currentAmount = currentAmount + data.unitPrice;
|
||||
currentTotalPrice = currentTotalPrice + data.unitPrice;
|
||||
}
|
||||
|
||||
const params = {
|
||||
id: data.id,
|
||||
goodsNum: currentQuantity,
|
||||
};
|
||||
const result = await updateGoodsNum(params);
|
||||
console.log("-----1")
|
||||
if (result && result.bizcode === 100) {
|
||||
this.orderInfo.shops[index].addrTimes[addIndex].goods[pIndex].num =
|
||||
currentQuantity;
|
||||
@@ -821,6 +827,23 @@ export default {
|
||||
pIndex
|
||||
].totalPrice = currentTotalPrice.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