完成售后页和处理页面的修改申请
This commit is contained in:
parent
9557a51e28
commit
ee60321a03
@ -6,4 +6,5 @@ export const apiArr = {
|
|||||||
isAllow: "/api/v2/wechat/commodity/after-sales/is-allow", //判断订单是否能申请售后
|
isAllow: "/api/v2/wechat/commodity/after-sales/is-allow", //判断订单是否能申请售后
|
||||||
revokeApply: "/api/v2/wechat/commodity/after-sales/revoke-apply", //撤销售后申请
|
revokeApply: "/api/v2/wechat/commodity/after-sales/revoke-apply", //撤销售后申请
|
||||||
changeGoodsList: "/api/v2/wechat/commodity/after-sales/change-goods-list", //商品售后换货商品列表
|
changeGoodsList: "/api/v2/wechat/commodity/after-sales/change-goods-list", //商品售后换货商品列表
|
||||||
|
updateApply: "/api/v2/wechat/commodity/after-sales/update-apply", //商品订单售后修改申请
|
||||||
};
|
};
|
||||||
|
|||||||
@ -42,7 +42,7 @@
|
|||||||
|
|
||||||
<!-- 操作按钮 -->
|
<!-- 操作按钮 -->
|
||||||
<view class="action-buttons">
|
<view class="action-buttons">
|
||||||
<button class="modify-btn" @click="modifyApplication">修改申请</button>
|
<button class="modify-btn" @click="modifyApplication(item)">修改申请</button>
|
||||||
<button class="cancel-btn" @click="cancelApplication(item)">撤销申请</button>
|
<button class="cancel-btn" @click="cancelApplication(item)">撤销申请</button>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@ -121,8 +121,8 @@ export default {
|
|||||||
const seconds = String(date.getSeconds()).padStart(2, '0');
|
const seconds = String(date.getSeconds()).padStart(2, '0');
|
||||||
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
|
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
|
||||||
},
|
},
|
||||||
modifyApplication() {
|
modifyApplication(item) {
|
||||||
console.log('修改申请');
|
NavgateTo(`../apply/index?item=${JSON.stringify(item)}`);
|
||||||
},
|
},
|
||||||
cancelApplication(item) {
|
cancelApplication(item) {
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
|
|||||||
@ -72,7 +72,7 @@
|
|||||||
退货退款</view>
|
退货退款</view>
|
||||||
<view :class="['asTab2', selectedAfterSaleType2 === 1 ? 'active' : '']"
|
<view :class="['asTab2', selectedAfterSaleType2 === 1 ? 'active' : '']"
|
||||||
@click="selectAfterSaleType2(1)">
|
@click="selectAfterSaleType2(1)">
|
||||||
退货
|
退款
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="reason-list" v-if="selectedAfterSaleType2 === 0">
|
<view class="reason-list" v-if="selectedAfterSaleType2 === 0">
|
||||||
@ -103,14 +103,15 @@ import {
|
|||||||
upload,
|
upload,
|
||||||
NavgateTo
|
NavgateTo
|
||||||
} from '../../../utils';
|
} from '../../../utils';
|
||||||
|
import { apiArr } from "../../../api/afterSale";
|
||||||
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
currentAfterSale: null,
|
currentAfterSale: null,
|
||||||
afterSalePopup2: false,
|
afterSalePopup2: false,
|
||||||
afterSalePopup3: false,
|
selectedAfterSaleType2: 0, // 0:退货/退款, 1:退款
|
||||||
selectedAfterSaleType2: 0, // 0:退货/退款, 1:退货
|
|
||||||
selectedAsReason: 0,
|
selectedAsReason: 0,
|
||||||
selectedServiceType: '',
|
selectedServiceType: '',
|
||||||
selectedRefundReason: '',
|
selectedRefundReason: '',
|
||||||
@ -119,9 +120,10 @@ export default {
|
|||||||
postage: 0,
|
postage: 0,
|
||||||
refundDescription: '',
|
refundDescription: '',
|
||||||
refundMethod: '自行寄回',
|
refundMethod: '自行寄回',
|
||||||
merchantAddress: '衡水市路北街道中心北大街世纪名城41号楼',
|
merchantAddress: '',
|
||||||
merchantContact: '高尚 18032753127',
|
merchantContact: '',
|
||||||
imgList: [],
|
imgList: [],
|
||||||
|
afterSalesType: 2,
|
||||||
applyRefundReasons: [
|
applyRefundReasons: [
|
||||||
'商品质量问题',
|
'商品质量问题',
|
||||||
'商品与描述不符',
|
'商品与描述不符',
|
||||||
@ -143,8 +145,10 @@ export default {
|
|||||||
this.currentAfterSale = item;
|
this.currentAfterSale = item;
|
||||||
// 设置初始退款金额等数据
|
// 设置初始退款金额等数据
|
||||||
if (item) {
|
if (item) {
|
||||||
this.refundAmount = item.sales_price || 0;
|
this.refundAmount = item.refund_amount || 0;
|
||||||
this.maxRefundAmount = item.sales_price || 0;
|
this.maxRefundAmount = item.sales_price || 0;
|
||||||
|
this.merchantAddress = item.supplier_address || '未设置';
|
||||||
|
this.merchantContact = `${item.supplier_name} ${item.supplier_phone}` || '未设置';
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@ -153,12 +157,13 @@ export default {
|
|||||||
this.afterSalePopup2 = false;
|
this.afterSalePopup2 = false;
|
||||||
},
|
},
|
||||||
|
|
||||||
closeAfterSalePopup3() {
|
|
||||||
this.afterSalePopup3 = false;
|
|
||||||
},
|
|
||||||
|
|
||||||
// 选择售后类型
|
// 选择售后类型
|
||||||
selectAfterSaleType2(index) {
|
selectAfterSaleType2(index) {
|
||||||
|
if (index == 0) {
|
||||||
|
this.afterSalesType = 2;
|
||||||
|
} else {
|
||||||
|
this.afterSalesType = 1;
|
||||||
|
}
|
||||||
this.selectedAfterSaleType2 = index;
|
this.selectedAfterSaleType2 = index;
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -169,7 +174,7 @@ export default {
|
|||||||
|
|
||||||
// 确认退款原因选择
|
// 确认退款原因选择
|
||||||
confirmAfterSaleCancel2() {
|
confirmAfterSaleCancel2() {
|
||||||
const afterSaleTypes = ['退货退款', '退货'];
|
const afterSaleTypes = ['退货退款', '退款'];
|
||||||
const selectedType = afterSaleTypes[this.selectedAfterSaleType2];
|
const selectedType = afterSaleTypes[this.selectedAfterSaleType2];
|
||||||
console.log('选中的售后类型:', selectedType);
|
console.log('选中的售后类型:', selectedType);
|
||||||
|
|
||||||
@ -191,7 +196,6 @@ export default {
|
|||||||
|
|
||||||
// 打开选择服务类型或退款原因弹窗
|
// 打开选择服务类型或退款原因弹窗
|
||||||
openAfterSalePopup2(type) {
|
openAfterSalePopup2(type) {
|
||||||
this.afterSalePopup3 = false;
|
|
||||||
this.afterSalePopup2 = true;
|
this.afterSalePopup2 = true;
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -213,16 +217,14 @@ export default {
|
|||||||
// 修改退款金额
|
// 修改退款金额
|
||||||
modifyRefundAmount() {
|
modifyRefundAmount() {
|
||||||
console.log('修改退款金额');
|
console.log('修改退款金额');
|
||||||
// 这里可以添加修改退款金额的逻辑
|
|
||||||
},
|
},
|
||||||
|
|
||||||
// 查看地址详情
|
// 查看地址详情
|
||||||
viewAddressDetails() {
|
viewAddressDetails() {
|
||||||
console.log('查看地址详情');
|
console.log('查看地址详情');
|
||||||
// 这里可以添加查看地址详情的逻辑
|
|
||||||
},
|
},
|
||||||
|
|
||||||
// 提交退款申请
|
// 提交修改申请
|
||||||
submitRefundApplication() {
|
submitRefundApplication() {
|
||||||
if (!this.selectedServiceType || !this.selectedRefundReason) {
|
if (!this.selectedServiceType || !this.selectedRefundReason) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
@ -232,26 +234,38 @@ export default {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 输出弹窗中的所有内容
|
const params = {
|
||||||
const refundInfo = {
|
id: this.currentAfterSale.id,
|
||||||
serviceType: this.selectedServiceType,
|
after_sales_type: this.afterSalesType,
|
||||||
refundReason: this.selectedRefundReason,
|
after_sales_reason: this.selectedRefundReason,
|
||||||
refundAmount: this.refundAmount,
|
refund_amount: this.refundAmount,
|
||||||
maxRefundAmount: this.maxRefundAmount,
|
application_description: this.refundDescription,
|
||||||
postage: this.postage,
|
application_images: this.imgList && this.imgList.length > 0 ?
|
||||||
refundDescription: this.refundDescription,
|
this.imgList.map(img => img.url).join(',') : '',
|
||||||
refundMethod: this.refundMethod,
|
receiving_address: this.merchantAddress
|
||||||
merchantAddress: this.merchantAddress,
|
}
|
||||||
merchantContact: this.merchantContact,
|
console.log("🚀 ~ submitRefundApplication ~ params:", params)
|
||||||
imgList: this.imgList
|
request(apiArr.updateApply, "POST", params).then((res) => {
|
||||||
};
|
uni.showToast({
|
||||||
console.log('提交退款申请:', refundInfo);
|
title: '申请提交成功',
|
||||||
|
icon: 'success'
|
||||||
|
});
|
||||||
|
|
||||||
this.afterSalePopup3 = false;
|
// 构造更新后的数据
|
||||||
// 这里可以添加提交后的处理逻辑
|
const updatedAfterSale = {
|
||||||
uni.showToast({
|
...this.currentAfterSale,
|
||||||
title: '退款申请提交成功',
|
after_sales_type: this.afterSalesType,
|
||||||
icon: 'success'
|
after_sales_reason: this.selectedRefundReason,
|
||||||
|
refund_amount: this.refundAmount,
|
||||||
|
application_description: this.refundDescription,
|
||||||
|
application_images: this.imgList && this.imgList.length > 0 ?
|
||||||
|
this.imgList.map(img => img.url).join(',') : ''
|
||||||
|
};
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
this.currentAfterSale = updatedAfterSale;
|
||||||
|
uni.setStorageSync('afterSaleItem', updatedAfterSale);
|
||||||
|
}, 1500);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -365,6 +365,7 @@ export default {
|
|||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
this.getOrderList();
|
this.getOrderList();
|
||||||
|
uni.removeStorageSync('afterSaleItem')
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -117,7 +117,6 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
import { apiArr } from "../../../api/afterSale";
|
import { apiArr } from "../../../api/afterSale";
|
||||||
import {
|
import {
|
||||||
isPhone,
|
isPhone,
|
||||||
@ -139,11 +138,24 @@ export default {
|
|||||||
// 初始化日期选择器默认值为当前申请时间
|
// 初始化日期选择器默认值为当前申请时间
|
||||||
this.pickerDefaultDate = new Date(this.currentAfterSale.create_time);
|
this.pickerDefaultDate = new Date(this.currentAfterSale.create_time);
|
||||||
},
|
},
|
||||||
|
onShow() {
|
||||||
|
const storageAfterSale = uni.getStorageSync('afterSaleItem');
|
||||||
|
if (storageAfterSale) {
|
||||||
|
this.currentAfterSale = storageAfterSale;
|
||||||
|
uni.removeStorageSync('afterSaleItem');
|
||||||
|
}
|
||||||
|
},
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
const item = JSON.parse(options?.item);
|
const item = JSON.parse(options?.item);
|
||||||
console.log("🚀 ~ onLoad ~ item:", item)
|
console.log("🚀 ~ onLoad ~ item:", item)
|
||||||
this.currentAfterSale = item;
|
this.currentAfterSale = item;
|
||||||
},
|
},
|
||||||
|
// 添加onBackPress生命周期钩子,处理左上角返回按钮点击事件
|
||||||
|
onBackPress() {
|
||||||
|
// 确保使用uni.navigateBack()返回上一页,触发index页面的onShow生命周期
|
||||||
|
uni.navigateBack();
|
||||||
|
return true; // 阻止默认返回行为
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getServiceTypeText(type) {
|
getServiceTypeText(type) {
|
||||||
return type === 1 ? '退款' : (type === 2 ? '退货退款' : '换货');
|
return type === 1 ? '退款' : (type === 2 ? '退货退款' : '换货');
|
||||||
@ -194,7 +206,6 @@ export default {
|
|||||||
title: '订单撤销成功',
|
title: '订单撤销成功',
|
||||||
icon: 'success'
|
icon: 'success'
|
||||||
});
|
});
|
||||||
this.$emit('revokeApplySuccess');
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user