From e513fff4c02bd2b39bd751bbcc09282ca5d9af35 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Fri, 29 Sep 2023 13:34:41 +0800 Subject: [PATCH] =?UTF-8?q?aftersale=EF=BC=9A=E8=B0=83=E6=95=B4=E5=94=AE?= =?UTF-8?q?=E5=90=8E=E7=90=86=E7=94=B1=E7=9A=84=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/trade/afterSale.js | 6 ---- pages/users/goods_return/index.vue | 47 ++++++++++++++++++++---------- 2 files changed, 31 insertions(+), 22 deletions(-) diff --git a/api/trade/afterSale.js b/api/trade/afterSale.js index 88bb83ad..5749a9df 100644 --- a/api/trade/afterSale.js +++ b/api/trade/afterSale.js @@ -14,12 +14,6 @@ export function getAfterSalePage(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) { return request.post("app-api/trade/after-sale/create", data); } diff --git a/pages/users/goods_return/index.vue b/pages/users/goods_return/index.vue index 127973c8..c8f18712 100644 --- a/pages/users/goods_return/index.vue +++ b/pages/users/goods_return/index.vue @@ -79,6 +79,7 @@ import { mapGetters } from "vuex"; import * as TradeOrderApi from '@/api/trade/order.js'; import * as AfterSaleApi from '@/api/trade/afterSale.js'; + import * as TradeConfigApi from '@/api/trade/config.js'; export default { data() { return { @@ -94,6 +95,8 @@ reasonIndex: 0, // 选中 reasons 的位置 applyPicUrls: [], // 补充凭证图片 + + tradeConfig: {}, // 交易配置 }; }, computed: mapGetters(['isLogin']), @@ -113,23 +116,25 @@ toLogin(); return; } - if (!options.orderId || !options.orderItemId) { - return this.$util.Tips({ - title:'缺少订单id,无法退款' - },{ - tab: 3, - url:1 - }); - } - this.orderId = parseInt(options.orderId); - this.orderItemId = parseInt(options.orderItemId); - this.getOrderInfo(); - this.getRefundReason(); - }, + if (!options.orderId || !options.orderItemId) { + return this.$util.Tips({ + title:'缺少订单id,无法退款' + },{ + tab: 3, + url:1 + }); + } + this.orderId = parseInt(options.orderId); + this.orderItemId = parseInt(options.orderItemId); + this.getOrderInfo(); + this.getRefundReason(); + this.getTradeConfig(); + }, methods: { onLoadFun:function() { this.getOrderInfo(); this.getRefundReason(); + this.getTradeConfig(); }, /** * 获取订单详情 @@ -147,6 +152,7 @@ }); }) }, + /** * 更改售后方式 */ @@ -165,9 +171,11 @@ */ getRefundReason: function() { const way = this.getWay(); - AfterSaleApi.getAfterSaleReasonList(way).then(res => { - this.reasons = res.data; - }) + if (way === 10) { + this.reasons = this.tradeConfig.afterSaleRefundReasons || []; + } else { + this.reasons = this.tradeConfig.afterSaleReturnReasons || []; + } }, /** * 选择售后原因 @@ -175,6 +183,13 @@ bindPickerChange: function(e) { this.$set(this, 'reasonIndex', e.detail.value); }, + getTradeConfig: function () { + TradeConfigApi.getTradeConfig().then(res => { + this.tradeConfig = res.data || {}; + this.getRefundReason(); + }); + }, + /** * 删除图片 */