Authored by lea guo

订单调价

... ... @@ -103,16 +103,16 @@ export default {
async onChange(price) {
// 预先算费
if (this.checkPrice(price)) {
const res = await this.computeChangePrice({
const { code, message, data } = await this.computeChangePrice({
price,
orderCode: this.orderCode
});
if (typeof res === "string") {
this.errorTip = res;
if (code !== 200) {
this.errorTip = message;
this.calced = false;
} else {
this.computePrice = res;
this.computePrice = data;
this.calced = true;
}
}
... ...
... ... @@ -176,28 +176,30 @@ export default {
case orderActionsMap.CHANGE_BID_PRICE.name: {
const { goodPrice } = goodsInfo;
const computePriceInfo = await this.computeChangePrice({
const { code, message, data } = await this.computeChangePrice({
orderCode,
price: goodPrice,
});
let isStr = false;
if (typeof computePriceInfo === 'string') {
if (code !== 200) {
isStr = true;
this.$createToast({
type: 'alert',
txt: computePriceInfo,
txt: message,
mask: true,
}).show();
return;
// 有未完成调价订单
if (code === 401) {
return;
}
}
let that = this;
this.$createChangeBidPriceDialog({
computePriceInfo: isStr
? { promotionFormulaList: [] }
: computePriceInfo,
computePriceInfo: isStr ? { promotionFormulaList: [] } : data,
goodsInfo,
orderCode,
onCloseAction() {},
... ...
... ... @@ -173,7 +173,9 @@ export default function() {
},
);
return res.code === 200 ? res.data : res.message || '';
const { code, message } = res;
return code === 200 ? res : { code, message };
},
// 买家调价
... ...