修复售后申请退款金额

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

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