修复售后申请退款金额

This commit is contained in:
hupeng
2023-12-06 18:38:23 +08:00
parent 583c1b8d81
commit 659466931e
2 changed files with 35 additions and 11 deletions

View File

@ -23,6 +23,13 @@ export function getAfterSealsList (params) {
}); });
} }
export function getRefundAmount(data) {
return request.post(`/getRefundAmount`, data, {
login: true
});
}
// 售后详情 // 售后详情
export function getAfterSalesDeatail(key) { export function getAfterSalesDeatail(key) {
return request.get(`/applyForAfterSales/${key}`); return request.get(`/applyForAfterSales/${key}`);

View File

@ -129,7 +129,8 @@ import {
postOrderRefund postOrderRefund
} from "@/api/order"; } from "@/api/order";
import { import {
submitAfterSealsOrder submitAfterSealsOrder,
getRefundAmount
} from '@/api/aftersales.js'; } from '@/api/aftersales.js';
import { import {
trim trim
@ -169,7 +170,8 @@ export default {
mounted() { mounted() {
this.id = this.$yroute.query.id || 0; this.id = this.$yroute.query.id || 0;
this.getOrderDetail(); this.getOrderDetail();
this.getRefundReason(); this.getRefundReason();
}, },
methods: { methods: {
changeReason(e) { changeReason(e) {
@ -185,6 +187,17 @@ export default {
return return
} }
this.refund_reason_wap_img.push(res.data.url); this.refund_reason_wap_img.push(res.data.url);
},
getAfterSalesMoney() {
getRefundAmount({
orderCode: this.orderInfo.orderId,
productParamList: this.productParamList
}).then(
res => {
this.totalMoney = res.data
console.log('res.data:',res.data)
}
)
}, },
getOrderDetail() { getOrderDetail() {
uni.showLoading({ uni.showLoading({
@ -193,7 +206,8 @@ export default {
}) })
orderDetail(this.id) orderDetail(this.id)
.then(res => { .then(res => {
this.orderInfo = res.data; this.orderInfo = res.data;
this.selectProduct = res.data.cartInfo.map(item => { this.selectProduct = res.data.cartInfo.map(item => {
item.checked = false item.checked = false
return item return item
@ -210,11 +224,11 @@ export default {
}) })
.catch(err => { .catch(err => {
uni.hideLoading() uni.hideLoading()
uni.showToast({ // uni.showToast({
title: err.msg || err.response.data.msg|| err.response.data.message, // title: err.msg || err.response.data.msg|| err.response.data.message,
icon: 'none', // icon: 'none',
duration: 2000 // duration: 2000
}); // });
}); });
}, },
getRefundReason() { getRefundReason() {
@ -241,20 +255,23 @@ export default {
}) })
}, },
// 选择退款类型 // 选择退款类型
chooseType (val) { chooseType (val) {
this.selectProduct = this.selectProduct.map(item => { this.selectProduct = this.selectProduct.map(item => {
if (item.checked) { if (item.checked) {
this.productParamList.push({ this.productParamList.push({
productId: item.productId productId: item.productId
}) })
console.log(item.costPrice) console.log(item.costPrice)
this.totalMoney += parseFloat(item.truePrice) //this.totalMoney += parseFloat(item.truePrice)
this.totalNum += 1 this.totalNum += 1
return item return item
} }
}).filter(r => r) }).filter(r => r)
this.selected = true; this.selected = true;
this.serviceType = val; this.serviceType = val;
this.getAfterSalesMoney();
}, },
submit() { submit() {
const refund_reason_wap_explain = trim(this.refund_reason_wap_explain); const refund_reason_wap_explain = trim(this.refund_reason_wap_explain);