aftersale:调整售后理由的接口

pull/3/head
YunaiV 2023-09-29 13:34:41 +08:00
parent f9253f9e56
commit e513fff4c0
2 changed files with 31 additions and 22 deletions

View File

@ -14,12 +14,6 @@ export function getAfterSalePage(data) {
return request.get("app-api/trade/after-sale/page", data); return request.get("app-api/trade/after-sale/page", data);
} }
export function getAfterSaleReasonList(way) {
return request.get("app-api/trade/after-sale/get-reason-list", {
way
});
}
export function createAfterSale(data) { export function createAfterSale(data) {
return request.post("app-api/trade/after-sale/create", data); return request.post("app-api/trade/after-sale/create", data);
} }

View File

@ -79,6 +79,7 @@
import { mapGetters } from "vuex"; import { mapGetters } from "vuex";
import * as TradeOrderApi from '@/api/trade/order.js'; import * as TradeOrderApi from '@/api/trade/order.js';
import * as AfterSaleApi from '@/api/trade/afterSale.js'; import * as AfterSaleApi from '@/api/trade/afterSale.js';
import * as TradeConfigApi from '@/api/trade/config.js';
export default { export default {
data() { data() {
return { return {
@ -94,6 +95,8 @@
reasonIndex: 0, // reasons reasonIndex: 0, // reasons
applyPicUrls: [], // applyPicUrls: [], //
tradeConfig: {}, //
}; };
}, },
computed: mapGetters(['isLogin']), computed: mapGetters(['isLogin']),
@ -125,11 +128,13 @@
this.orderItemId = parseInt(options.orderItemId); this.orderItemId = parseInt(options.orderItemId);
this.getOrderInfo(); this.getOrderInfo();
this.getRefundReason(); this.getRefundReason();
this.getTradeConfig();
}, },
methods: { methods: {
onLoadFun:function() { onLoadFun:function() {
this.getOrderInfo(); this.getOrderInfo();
this.getRefundReason(); this.getRefundReason();
this.getTradeConfig();
}, },
/** /**
* 获取订单详情 * 获取订单详情
@ -147,6 +152,7 @@
}); });
}) })
}, },
/** /**
* 更改售后方式 * 更改售后方式
*/ */
@ -165,9 +171,11 @@
*/ */
getRefundReason: function() { getRefundReason: function() {
const way = this.getWay(); const way = this.getWay();
AfterSaleApi.getAfterSaleReasonList(way).then(res => { if (way === 10) {
this.reasons = res.data; this.reasons = this.tradeConfig.afterSaleRefundReasons || [];
}) } else {
this.reasons = this.tradeConfig.afterSaleReturnReasons || [];
}
}, },
/** /**
* 选择售后原因 * 选择售后原因
@ -175,6 +183,13 @@
bindPickerChange: function(e) { bindPickerChange: function(e) {
this.$set(this, 'reasonIndex', e.detail.value); this.$set(this, 'reasonIndex', e.detail.value);
}, },
getTradeConfig: function () {
TradeConfigApi.getTradeConfig().then(res => {
this.tradeConfig = res.data || {};
this.getRefundReason();
});
},
/** /**
* 删除图片 * 删除图片
*/ */