修改未发货状态下的申请退款的请求接口

This commit is contained in:
赵毅 2025-09-17 15:10:20 +08:00
parent 80d6fb8cc9
commit a8168c6db1
5 changed files with 14 additions and 27 deletions

View File

@ -8,4 +8,5 @@ export const apiArr = {
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", //商品订单售后修改申请 updateApply: "/api/v2/wechat/commodity/after-sales/update-apply", //商品订单售后修改申请
createReview: "/api/v2/wechat/commodity/review/create", //创建订单评价 createReview: "/api/v2/wechat/commodity/review/create", //创建订单评价
orderRefund: "/api/v2/wechat/commodity/order/refund", //商品订单退款
}; };

View File

@ -31,7 +31,7 @@
</view> </view>
<!-- 退款状态 --> <!-- 退款状态 -->
<view class="status-container"> <view class="status-container" v-if="showStatus">
<view class="status-item" @click="pendingPage(item)"> <view class="status-item" @click="pendingPage(item)">
<text class="status-label">{{ getStatusText(item) }}</text> <text class="status-label">{{ getStatusText(item) }}</text>
<text class="status-desc">商家将在<text style="color: #e73b05;">{{ <text class="status-desc">商家将在<text style="color: #e73b05;">{{
@ -41,7 +41,7 @@
</view> </view>
<!-- 操作按钮 --> <!-- 操作按钮 -->
<view class="action-buttons"> <view class="action-buttons" v-if="showStatus">
<button class="modify-btn" @click="modifyApplication(item)">修改申请</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>
@ -71,6 +71,7 @@ export default {
data() { data() {
return { return {
currentAfterSale: this.afterSaleList, currentAfterSale: this.afterSaleList,
showStatus: true,
}; };
}, },
watch: { watch: {
@ -100,6 +101,7 @@ export default {
return '已撤销'; return '已撤销';
} }
if (item.process_status === 2) { if (item.process_status === 2) {
this.showStatus = false;
return '已完成'; return '已完成';
} else if (item.process_status === 3) { } else if (item.process_status === 3) {
return '已取消'; return '已取消';

View File

@ -143,10 +143,10 @@ export default {
categoryList: [ categoryList: [
{ category_name: "全部" }, { category_name: "全部" },
{ category_name: "待付款" }, { category_name: "待付款" },
{ category_name: "已取消" },
{ category_name: "备货中" }, { category_name: "备货中" },
{ category_name: "待自提" }, { category_name: "待自提" },
{ category_name: "已完成" }, { category_name: "已完成" },
{ category_name: "已取消" },
{ category_name: "待评价" }, { category_name: "待评价" },
{ category_name: "已评价" }, { category_name: "已评价" },
{ category_name: "售后" }, { category_name: "售后" },
@ -262,15 +262,10 @@ export default {
// 退 // 退
handleRefundConfirmed(data) { handleRefundConfirmed(data) {
const params = { const params = {
nick_name: uni.getStorageSync("nickName"),
order_id: this.afterSaleItem.id, order_id: this.afterSaleItem.id,
goods_ids: this.afterSaleItem.commodity_order_item_list.map(item => item.goods_id),
after_sales_type: 1,
after_sales_reason: data.reason,
refund_amount: this.afterSaleItem.total_amount,
order_status: 3
} }
request(afterSaleApi.afterSaleCreate, "POST", params).then((res) => { request(afterSaleApi.orderRefund, "POST", params).then((res) => {
uni.showToast({ title: "退款成功", icon: "none" });
this.getOrderList(); this.getOrderList();
}); });
}, },

View File

@ -144,10 +144,10 @@ export default {
categoryList: [ categoryList: [
{ category_name: "全部" }, { category_name: "全部" },
{ category_name: "待付款" }, { category_name: "待付款" },
{ category_name: "已取消" },
{ category_name: "待发货" }, { category_name: "待发货" },
{ category_name: "配送中" }, { category_name: "配送中" },
{ category_name: "已完成" }, { category_name: "已完成" },
{ category_name: "已取消" },
{ category_name: "待评价" }, { category_name: "待评价" },
{ category_name: "已评价" }, { category_name: "已评价" },
{ category_name: "售后" }, { category_name: "售后" },
@ -263,15 +263,10 @@ export default {
// 退 // 退
handleRefundConfirmed(data) { handleRefundConfirmed(data) {
const params = { const params = {
nick_name: uni.getStorageSync("nickName"),
order_id: this.afterSaleItem.id, order_id: this.afterSaleItem.id,
goods_ids: this.afterSaleItem.commodity_order_item_list.map(item => item.goods_id),
after_sales_type: 1,
after_sales_reason: data.reason,
refund_amount: this.afterSaleItem.total_amount,
order_status: 3
} }
request(afterSaleApi.afterSaleCreate, "POST", params).then((res) => { request(afterSaleApi.orderRefund, "POST", params).then((res) => {
uni.showToast({ title: "退款成功", icon: "none" });
this.getOrderList(); this.getOrderList();
}); });
}, },

View File

@ -226,16 +226,10 @@ export default {
success: (res) => { success: (res) => {
if (res.confirm) { if (res.confirm) {
const params = { const params = {
nick_name: uni.getStorageSync("nickName"),
order_id: this.orderInfo.id, order_id: this.orderInfo.id,
goods_ids: this.orderInfo.commodity_order_item_list.map(item => item.goods_id),
after_sales_type: 1,
after_sales_reason: '用户申请退款',
refund_amount: this.orderInfo.total_amount,
order_status: 3
} }
request(afterSaleApi.afterSaleCreate, "POST", params).then((res) => { request(afterSaleApi.orderRefund, "POST", params).then((res) => {
uni.showToast({ title: "退款申请已提交", icon: "none" }); uni.showToast({ title: "退款成功", icon: "none" });
setTimeout(() => { setTimeout(() => {
uni.navigateBack(); uni.navigateBack();
}, 1500); }, 1500);