对接售后模块部分接口

This commit is contained in:
赵毅 2025-09-11 18:04:54 +08:00
parent 6bf7d78776
commit 998a14c878
13 changed files with 230 additions and 126 deletions

View File

@ -1,5 +1,9 @@
export const apiArr = { export const apiArr = {
orderList: '/api/v2/wechat/commodity/order', // 商品订单列表
afterSalesList: '/api/v2/wechat/commodity/after-sales/list', // 商品订单售后列表
afterSaleCreate: "/api/v2/wechat/commodity/after-sales/refund-info/create", //商品订单售后信息创建 afterSaleCreate: "/api/v2/wechat/commodity/after-sales/refund-info/create", //商品订单售后信息创建
cancelOrConfirm: "/api/v2/wechat/commodity/order/cancel_or_confirm", //商品订单确认收货或取消 cancelOrConfirm: "/api/v2/wechat/commodity/order/cancel_or_confirm", //商品订单确认收货或取消
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", //撤销售后申请
changeGoodsList: "/api/v2/wechat/commodity/after-sales/change-goods-list", //商品售后换货商品列表
}; };

View File

@ -1,3 +0,0 @@
export const apiArr = {
orderList: '/api/v2/wechat/commodity/order', // 商品订单列表
}

View File

@ -93,8 +93,7 @@
.goods-desc { .goods-desc {
font-size: 26rpx; font-size: 26rpx;
color: #ff4d4f; color: #999999;
background-color: #fff2f0;
padding: 4rpx 12rpx; padding: 4rpx 12rpx;
border-radius: 8rpx; border-radius: 8rpx;
display: inline-block; display: inline-block;

View File

@ -5,9 +5,8 @@
<!-- 头部信息 --> <!-- 头部信息 -->
<view class="header"> <view class="header">
<view class="company-info"> <view class="company-info">
<text class="company-name">{{ item.commodity_order_item[0].goods_name || '衡水喜屏传媒有限公司' <text class="company-name">{{ item.commodity_order_item[0].goods_name }}</text>
}}</text> <text class="after-sale-no">{{ item.after_sales_type === 1 ? '退款' : (item.after_sales_type === 2 ? '退货瑞款' : '换货') }}</text>
<text class="after-sale-no">退货退款</text>
</view> </view>
<text class="order-time">提交订单{{ formatDate(item.create_time) }}</text> <text class="order-time">提交订单{{ formatDate(item.create_time) }}</text>
</view> </view>
@ -22,7 +21,7 @@
{{ ite.goods_name }} {{ ite.goods_name }}
<text class="refund-amount">退款¥{{ ite.sales_price }}</text> <text class="refund-amount">退款¥{{ ite.sales_price }}</text>
</text> </text>
<text class="goods-desc">{{ ite.after_sales_reason }}</text> <text class="goods-desc">{{ ite.goods_spec }}</text>
<view class="price-count"> <view class="price-count">
<text class="goods-price">¥{{ ite.sales_price }}/</text> <text class="goods-price">¥{{ ite.sales_price }}/</text>
<text class="goods-count">x{{ ite.count }}</text> <text class="goods-count">x{{ ite.count }}</text>
@ -43,7 +42,7 @@
<!-- 操作按钮 --> <!-- 操作按钮 -->
<view class="action-buttons"> <view class="action-buttons">
<button class="modify-btn" @click="modifyApplication">修改申请</button> <button class="modify-btn" @click="modifyApplication">修改申请</button>
<button class="cancel-btn" @click="cancelApplication">撤销申请</button> <button class="cancel-btn" @click="cancelApplication(item)">撤销申请</button>
</view> </view>
</view> </view>
</view> </view>
@ -53,6 +52,7 @@
<script> <script>
import afterSaleData from './afterSale.json'; import afterSaleData from './afterSale.json';
import { apiArr } from "../../../api/afterSale";
import { import {
isPhone, isPhone,
picUrl, picUrl,
@ -62,15 +62,32 @@ import {
} from '../../../utils'; } from '../../../utils';
export default { export default {
props: {
afterSaleList: {
type: Array,
default: () => []
}
},
data() { data() {
return { return {
currentAfterSale: afterSaleData // currentAfterSale: afterSaleData
currentAfterSale: this.afterSaleList,
}; };
},
onLoad() {
}, },
methods: { methods: {
getList() {
const params = {
user_id: uni.getStorageSync('userId'),
}
request(apiArr.afterSalesList, "POST", params).then((res) => {
res.after_sales_list.forEach(item => {
item.commodity_order_item?.forEach(good => {
good.commodity_pic = picUrl + good.commodity_pic;
})
})
this.currentAfterSale = res.after_sales_list;
});
},
getStatusText(status) { getStatusText(status) {
// //
const statusMap = { const statusMap = {
@ -98,14 +115,22 @@ export default {
modifyApplication() { modifyApplication() {
console.log('修改申请'); console.log('修改申请');
}, },
cancelApplication() { cancelApplication(item) {
uni.showModal({ uni.showModal({
title: '提示', title: '提示',
content: '确定要撤销退款申请吗?', content: '确定要撤销退款申请吗?',
success: (res) => { success: (res) => {
if (res.confirm) { if (res.confirm) {
console.log('撤销申请'); const params = {
uni.navigateBack(); id: item.id,
}
request(apiArr.revokeApply, "POST", params).then((res) => {
this.getList();
uni.showToast({
title: '订单撤销成功',
icon: 'success'
});
});
} }
} }
}); });
@ -116,8 +141,7 @@ export default {
// NavgateTo(`/packages/myOrders/refundOver/index?item=${JSON.stringify(item)}`); //退 // NavgateTo(`/packages/myOrders/refundOver/index?item=${JSON.stringify(item)}`); //退
// NavgateTo(`/packages/myOrders/changeInfo/index?item=${JSON.stringify(item)}`); // // NavgateTo(`/packages/myOrders/changeInfo/index?item=${JSON.stringify(item)}`); //
} }
},
}
}; };
</script> </script>

View File

@ -1,6 +1,6 @@
page { page {
background-color: #f6f7fb; background-color: #f6f7fb;
padding-bottom: 0; padding-bottom: 50rpx;
min-height: 100vh; min-height: 100vh;
} }

View File

@ -5,7 +5,7 @@
:class="['tabItem', selectedTab === index ? 'active2' : '']" @click="selectTab(index, item)"> :class="['tabItem', selectedTab === index ? 'active2' : '']" @click="selectTab(index, item)">
{{ item.category_name }} {{ item.category_name }}
</view> </view>
</view> </view>
<view class="content"> <view class="content">
@ -16,7 +16,7 @@
<rated /> <rated />
</view> </view>
<view v-if="selectedTab === 8"> <view v-if="selectedTab === 8">
<afterSale /> <afterSale :afterSaleList="afterSaleList" />
</view> </view>
<view v-else> <view v-else>
<view v-for="(item, index) in orderData" :key="index"> <view v-for="(item, index) in orderData" :key="index">
@ -63,7 +63,7 @@
<button class="pay-btn" @click="confirmReceiving(item)">确认收货</button> <button class="pay-btn" @click="confirmReceiving(item)">确认收货</button>
</view> </view>
<view class="btn-group" v-if="item.order_status === 5"> <view class="btn-group" v-if="item.order_status === 5">
<text class="afterSaleNum">{{item.commodity_order_item_list.length}}笔售后</text> <text class="afterSaleNum">{{ item.commodity_order_item_list.length }}笔售后</text>
<button class="cancel-btn" @click="afterSale(item)">退换/售后</button> <button class="cancel-btn" @click="afterSale(item)">退换/售后</button>
<button class="pay-btn" @click="cancelOrder">评价</button> <button class="pay-btn" @click="cancelOrder">评价</button>
</view> </view>
@ -93,7 +93,7 @@
<!-- 退换 售后 - 选择退款原因 --> <!-- 退换 售后 - 选择退款原因 -->
<!-- 售后弹窗组件 --> <!-- 售后弹窗组件 -->
<after-sale-popup :afterSaleGoods.sync="afterSaleGoods" ref="afterSalePopupRef" <after-sale-popup :afterSaleGoods.sync="afterSaleGoods" :orderItem="afterSaleOrderItem" ref="afterSalePopupRef"
@refundSubmitted="handleRefundSubmitted" /> @refundSubmitted="handleRefundSubmitted" />
<!-- 无售后商品 --> <!-- 无售后商品 -->
@ -117,7 +117,6 @@ import {
upload, upload,
NavgateTo NavgateTo
} from '../../../utils'; } from '../../../utils';
import { apiArr } from "../../../api/order";
import { apiArr as afterSaleApi } from "../../../api/afterSale"; import { apiArr as afterSaleApi } from "../../../api/afterSale";
import Rated from "../rated/rated.vue"; import Rated from "../rated/rated.vue";
import AwaitRated from "../awaitRated/awaitRated.vue"; import AwaitRated from "../awaitRated/awaitRated.vue";
@ -151,13 +150,16 @@ export default {
{ category_name: "售后" }, { category_name: "售后" },
], ],
selectedTab: 0, selectedTab: 0,
orderData: orderMockData, // orderData: orderMockData,
orderData: [],
showPopup: false,// showPopup: false,//
afterSaleGoods: [],// afterSaleGoods: [],//
afterSaleOrderItem: {},//
noSalePopup: false,// noSalePopup: false,//
showTkPopup: false,//退 showTkPopup: false,//退
afterSaleItem: '',// afterSaleItem: '',//
afterSaleList: [],//
}; };
}, },
methods: { methods: {
@ -182,35 +184,58 @@ export default {
cancel_reason: data.reason, cancel_reason: data.reason,
} }
request(afterSaleApi.cancelOrConfirm, "POST", params).then((res) => { request(afterSaleApi.cancelOrConfirm, "POST", params).then((res) => {
console.log("🚀 ~ handleOrderCancelled ~ res:", res) this.getOrderList();
}); });
}, },
// //
afterSale(item) { afterSale(item) {
console.log("🚀 ~ afterSale ~ item:", item)
this.afterSaleGoods = item.commodity_order_item_list; this.afterSaleGoods = item.commodity_order_item_list;
//
this.afterSaleOrderItem = item;
this.$refs.afterSalePopupRef.openAfterSalePopup(); this.$refs.afterSalePopupRef.openAfterSalePopup();
console.log(item.id); console.log(item.id);
// //
// request(afterSaleApi.isAllow, "POST", { // request(afterSaleApi.isAllow, "POST", {
// order_id: item.id, // order_id: item.id,
// }).then((res) => { // }).then((res) => {
// console.log("🚀 ~ afterSale ~ res:", res) // console.log("🚀 ~ afterSale ~ res:", res)
// if (res.data.is_allow_after_sales) { // if (res.data.is_allow_after_sales) {
// this.afterSaleGoods = res.data.allow_items; // this.afterSaleGoods = res.data.allow_items;
// // this.selectedAsGood = item.commodity_order_item_list[0].id; // // this.selectedAsGood = item.commodity_order_item_list[0].id;
// this.$refs.afterSalePopupRef.openAfterSalePopup(); // this.$refs.afterSalePopupRef.openAfterSalePopup();
// } else { // } else {
// this.noSalePopup = true // this.noSalePopup = true
// } // }
// }); // });
}, },
// 退 // 退
handleRefundSubmitted(data) { handleRefundSubmitted(data) {
console.log("🚀 ~ handleRefundSubmitted ~ handleRefundSubmitted:", this.afterSaleOrderItem)
console.log("🚀 ~ handleRefundSubmitted ~ 退款申请提交成功:", data); console.log("🚀 ~ handleRefundSubmitted ~ 退款申请提交成功:", data);
const params = {
nick_name: uni.getStorageSync("nickName"),
order_id: this.afterSaleOrderItem.id,
goods_ids: this.afterSaleOrderItem.commodity_order_item_list.map(item => item.goods_id),
after_sales_type: data.afterSalesType,
after_sales_reason: data.refundReason,
refund_amount: this.afterSaleOrderItem.total_amount,
application_description: data.refundDescription,
// URL
application_images: data.imgList && data.imgList.length > 0 ?
data.imgList.map(img => img.url).join(',') : '',
order_status: 5,
receiving_address: data.merchantAddress,
change_goods_id: data.changeServiceId
}
console.log("🚀 ~ handleRefundConfirmed ~ parasm:", params)
// request(afterSaleApi.afterSaleCreate, "POST", params).then((res) => {
// this.getOrderList();
// });
}, },
@ -219,11 +244,11 @@ export default {
this.afterSaleItem = item; this.afterSaleItem = item;
this.showTkPopup = true this.showTkPopup = true
}, },
// //
viewLogistics(item) { viewLogistics(item) {
}, },
// 退 // 退
handleRefundConfirmed(data) { handleRefundConfirmed(data) {
@ -232,6 +257,7 @@ export default {
const params = { const params = {
nick_name: uni.getStorageSync("nickName"), 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_type: 1,
after_sales_reason: data.reason, after_sales_reason: data.reason,
refund_amount: this.afterSaleItem.total_amount, refund_amount: this.afterSaleItem.total_amount,
@ -239,7 +265,7 @@ export default {
} }
console.log("🚀 ~ handleRefundConfirmed ~ parasm:", params) console.log("🚀 ~ handleRefundConfirmed ~ parasm:", params)
request(afterSaleApi.afterSaleCreate, "POST", params).then((res) => { request(afterSaleApi.afterSaleCreate, "POST", params).then((res) => {
console.log("🚀 ~ handleRefundConfirmed ~ res:", res) this.getOrderList();
}); });
}, },
@ -256,14 +282,14 @@ export default {
} }
console.log("🚀 ~ confirmReceiving ~ params:", params) console.log("🚀 ~ confirmReceiving ~ params:", params)
request(afterSaleApi.cancelOrConfirm, "POST", params).then((res) => { request(afterSaleApi.cancelOrConfirm, "POST", params).then((res) => {
console.log("🚀 ~ handleRefundConfirmed ~ res:", res) this.getOrderList();
}); });
} }
}, },
}); });
}, },
goToPay(item) { goToPay(item) {
console.log(item); console.log(item);
}, },
toDetails(item) { toDetails(item) {
NavgateTo( NavgateTo(
@ -301,16 +327,39 @@ export default {
}, },
getOrderList() { getOrderList() {
request(apiArr.orderList, "POST", { request(afterSaleApi.orderList, "POST", {
order_status: this.selectedTab,
user_id: uni.getStorageSync("userId"), user_id: uni.getStorageSync("userId"),
}).then((res) => { }).then((res) => {
// res.order_list.forEach(item => {
item.commodity_order_item_list.forEach(good => {
good.commodity_pic = picUrl + good.commodity_pic;
})
})
this.orderData = res.order_list;
}); });
}, },
getAfterSaleList() {
const params = {
user_id: uni.getStorageSync('userId'),
}
request(afterSaleApi.afterSalesList, "POST", params).then((res) => {
res.after_sales_list.forEach(item => {
// 退URL
if (item.return_images) {
const images = item.return_images.split(',');
const processedImages = images.map(img => picUrl + img).join(',');
item.return_images = processedImages;
}
})
this.afterSaleList = res.after_sales_list;
});
}
}, },
onLoad(options) { onLoad(options) {
this.getOrderList(); this.getOrderList();
this.getAfterSaleList();
}, },
}; };
</script> </script>

View File

@ -173,6 +173,8 @@
"create_time": "2024-08-22 14:50:33", "create_time": "2024-08-22 14:50:33",
"update_time": "2024-08-22 18:30:15", "update_time": "2024-08-22 18:30:15",
"after_sales_count": 1, "after_sales_count": 1,
"supplier_address": "供应商收货地址",
"supplier_phone": "11111111111",
"commodity_order_item_list": [ "commodity_order_item_list": [
{ {
"id": 50005, "id": 50005,

View File

@ -427,7 +427,6 @@
} }
.itemSize { .itemSize {
width: 30%;
font-size: 26rpx; font-size: 26rpx;
color: #333; color: #333;
background: #F6F7FB; background: #F6F7FB;
@ -447,7 +446,6 @@
height: 100rpx; height: 100rpx;
margin-right: 30rpx; margin-right: 30rpx;
border-radius: 20rpx; border-radius: 20rpx;
border:1rpx solid red;
} }
.itemSize_top{ .itemSize_top{

View File

@ -19,13 +19,14 @@
</view> </view>
<view class="asGoodsInfo" v-for="(item, index) in afterSaleGoods" :key="index"> <view class="asGoodsInfo" v-for="(item, index) in afterSaleGoods" :key="index">
<view class="asGoodInfo" @click="selectAsGood(item)"> <view class="asGoodInfo" @click="selectAsGood(item)">
<view :class="['radio asGoodRadio', selectedAsGood == item.id ? 'active' : '']"></view> <view :class="['radio asGoodRadio', selectedAsGood == item.goods_id ? 'active' : '']">
</view>
<view class="asGoodTag tag-img" v-if="item.is_support_same_day === 1">当日达</view> <view class="asGoodTag tag-img" v-if="item.is_support_same_day === 1">当日达</view>
<image :src="item.commodity_pic" class="asGoodImg"></image> <image :src="item.commodity_pic" class="asGoodImg"></image>
<view class="asGoodDetail"> <view class="asGoodDetail">
<view class="asGoodTitle"> <view class="asGoodTitle">
<text class="asGoodTag asGoodTag1" v-if="item.is_support_same_day === 1">当日达</text> <text class="asGoodTag asGoodTag1" v-if="item.is_support_same_day === 1">当日达</text>
{{ item.goods_name}} {{ item.goods_name }}
</view> </view>
<view class="asGoodDesc">{{ item.goods_spec }}</view> <view class="asGoodDesc">{{ item.goods_spec }}</view>
<view class="asGoodPrice">¥{{ item.cost_price }}/</view> <view class="asGoodPrice">¥{{ item.cost_price }}/</view>
@ -50,7 +51,7 @@
@click="selectAfterSaleType2(0)"> @click="selectAfterSaleType2(0)">
退货退款</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">
@ -79,7 +80,6 @@
<view class="refund-title">确认退款信息</view> <view class="refund-title">确认退款信息</view>
<view class="refund-item"> <view class="refund-item">
<view class="refund-label">服务类型<text class="required">*</text></view> <view class="refund-label">服务类型<text class="required">*</text></view>
<view class="refund-value" @click="openAfterSalePopup2('serviceType')"> <view class="refund-value" @click="openAfterSalePopup2('serviceType')">
{{ selectedServiceType || '请选择服务类型' }} {{ selectedServiceType || '请选择服务类型' }}
<text class="arrow-right"></text> <text class="arrow-right"></text>
@ -173,20 +173,21 @@
<view class="refund-item"> <view class="refund-item">
<view class="refund-label">换货商品<text class="required">*</text></view> <view class="refund-label">换货商品<text class="required">*</text></view>
<view class="refund-value" @click="changeGood()"> <view class="refund-value" @click="changeGood()">
{{ changeServiceType || '请选择需要换的商品' }} {{ changeServiceName || '请选择需要换的商品' }}
<text class="arrow-right"></text> <text class="arrow-right"></text>
</view> </view>
</view> </view>
<view class="text-wrapper_8"> <view class="text-wrapper_8">
<text class="text_41">高尚</text> <text class="text_41">{{ orderItem.receiving_name }}</text>
<text class="text_42">15901518415</text> <text class="text_42">{{ orderItem.receiving_phone }}</text>
</view> </view>
<view class="block_15"> <view class="block_15">
<view class="address-view"> <view class="address-view">
<text> {{ merchantAddress }} </text> <text> {{ orderItem.receiving_address }} </text>
<view class="copy-icon" @click="copyRefundNo"></view> <view class="copy-icon" @click="copyRefundNo"></view>
</view> </view>
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/af_update_address.png" class="icon_2"></image> <image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/af_update_address.png"
class="icon_2"></image>
</view> </view>
<view class="hr"></view> <view class="hr"></view>
<view class="refund-item2"> <view class="refund-item2">
@ -215,13 +216,14 @@
<view class="popup-header-view" @click="closeSize">取消</view> <view class="popup-header-view" @click="closeSize">取消</view>
</view> </view>
<view class="itemSize_top"> <view class="itemSize_top">
<image :src="changeImg" class="itemSize-img"></image> <image :src="currentGG.commodity_pic" class="itemSize-img"></image>
<view class="itemSize_info"> <view class="itemSize_info">
<view class="itemSize_name">{{ changeName }}</view> <view class="itemSize_name">{{ currentGG.goods_name }}</view>
<view class="itemSize_price">{{ changePrice }}/</view> <view class="itemSize_price">{{ currentGG.sales_price }}/{{ currentGG.goods_unit }}
</view>
</view> </view>
</view> </view>
<view class="itemSize" v-for="(item, index) in info.commodity_goods_info_list" :key="item.id" <view class="itemSize" v-for="(item, index) in changeGoodsList" :key="item.id"
@click="changeGG(item, index)" :class="index == currentGGIndex ? 'itemSize_active' : ''"> @click="changeGG(item, index)" :class="index == currentGGIndex ? 'itemSize_active' : ''">
{{ item.goods_name }} {{ item.goods_spec }} / {{ item.goods_unit }} {{ item.goods_name }} {{ item.goods_spec }} / {{ item.goods_unit }}
</view> </view>
@ -230,11 +232,23 @@
</template> </template>
<script> <script>
import { upload, picUrl } from '../../../../../utils';
import {
isPhone,
picUrl,
request,
upload,
NavgateTo
} from '../../../../../utils';
import { apiArr } from "../../../../../api/afterSale";
export default { export default {
name: 'AfterSalePopup', name: 'AfterSalePopup',
props: { props: {
orderItem: {
type: Object,
default: () => ({})
},
afterSaleGoods: { afterSaleGoods: {
type: Array, type: Array,
default: () => [] default: () => []
@ -247,25 +261,22 @@ export default {
afterSalePopup3: false, afterSalePopup3: false,
selectedAsGood: '', selectedAsGood: '',
selectedAfterSaleType: 0, // 0:退/退, 1: selectedAfterSaleType: 0, // 0:退/退, 1:
selectedAfterSaleType2: 0, // 0:退/退, 1:退 selectedAfterSaleType2: 0, // 0:退/退, 1:退
selectedAsReason: 0, selectedAsReason: 0,
selectedReason: 0,// selectedReason: 0,//
selectedServiceType: '', selectedServiceType: '',
selectedRefundReason: '', selectedRefundReason: '',
changeRefundReason: '', // changeRefundReason: '', //
changeServiceType: '', // changeServiceName: '', //
changeServiceId: '', // id
changeGoodsList: [], //
showSize: false,// showSize: false,//
changeImg: "", currentGG: {},//
changeName: "", currentGGIndex: 0,
changePrice: "", afterSalesType: 0, // 1:退 2:退退 3:
refundAmount: 0,
maxRefundAmount: 0,
postage: 0,
refundDescription: '', refundDescription: '',
refundMethod: '自行寄回', refundMethod: '自行寄回',
merchantAddress: '衡水市路北街道中心北大街世纪名城41号楼',
merchantContact: '高尚 18032753127',
imgList: [], imgList: [],
applyRefundReasons: [ applyRefundReasons: [
'商品质量问题', '商品质量问题',
@ -294,7 +305,7 @@ export default {
openAfterSalePopup() { openAfterSalePopup() {
this.$nextTick(() => { this.$nextTick(() => {
if (this.afterSaleGoods && this.afterSaleGoods.length > 0) { if (this.afterSaleGoods && this.afterSaleGoods.length > 0) {
this.selectedAsGood = this.afterSaleGoods[0].id; this.selectedAsGood = this.afterSaleGoods[0].goods_id;
this.afterSalePopup = true; this.afterSalePopup = true;
} }
}) })
@ -302,7 +313,7 @@ export default {
// //
selectAsGood(item) { selectAsGood(item) {
this.selectedAsGood = item.id; this.selectedAsGood = item.goods_id;
}, },
// //
@ -328,10 +339,18 @@ export default {
// //
selectAfterSaleType(index) { selectAfterSaleType(index) {
if (index === 1) {
this.afterSalesType = 3;
}
this.selectedAfterSaleType = index; this.selectedAfterSaleType = index;
}, },
selectAfterSaleType2(index) { selectAfterSaleType2(index) {
if(index === 1) {
this.afterSalesType = 1;
}else{
this.afterSalesType = 2;
}
this.selectedAfterSaleType2 = index; this.selectedAfterSaleType2 = index;
}, },
@ -379,7 +398,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);
@ -394,10 +413,6 @@ export default {
// 退 // 退
this.selectedServiceType = selectedType; this.selectedServiceType = selectedType;
this.selectedRefundReason = selectedReasonText; this.selectedRefundReason = selectedReasonText;
// 退
this.refundAmount = 4704.00;
this.maxRefundAmount = 53.80;
this.postage = 0.00;
this.selectAsReason(0); this.selectAsReason(0);
this.afterSalePopup2 = false; this.afterSalePopup2 = false;
@ -412,8 +427,25 @@ export default {
// //
changeGood() { changeGood() {
this.afterSalePopup3 = false; const params = {
this.showSize = true; goods_id: this.selectedAsGood,
}
request(apiArr.changeGoodsList, "POST", params).then((res) => {
res.change_goods_list.forEach(item => {
item.commodity_pic = picUrl + item.commodity_pic;
})
this.changeGoodsList = res.change_goods_list;
console.log("🚀 ~ changeGood ~ this.currentGG:", this.currentGG)
if (!this.currentGG.goods_name) {
this.currentGG = this.changeGoodsList.find(item => item.id == this.selectedAsGood);
this.currentGGIndex = this.changeGoodsList.indexOf(this.currentGG);
this.changeServiceName = this.currentGG.goods_name
this.changeServiceId = this.currentGG.id
}
this.afterSalePopup3 = false;
this.showSize = true;
});
}, },
closeSize() { closeSize() {
@ -422,17 +454,10 @@ export default {
// //
changeGG(item, index) { changeGG(item, index) {
console.log("🚀 ~ changeGG ~ item:", item);
this.currentGG = item; this.currentGG = item;
this.currentGGIndex = index; this.currentGGIndex = index;
if (this.currentGG.cart_count) { this.changeServiceName = this.currentGG.goods_name
this.currentNum = this.currentGG.cart_count.count; this.changeServiceId = this.currentGG.id
} else {
this.currentGG.cart_count = { count: 0 };
}
this.changeImg = item.commodity_pic[0]
this.changeName = item.goods_alias
this.changePrice = item.sales_price
this.afterSalePopup3 = true; this.afterSalePopup3 = true;
this.showSize = false; this.showSize = false;
@ -465,26 +490,30 @@ export default {
// 退 // 退
submitRefundApplication() { submitRefundApplication() {
if (!this.selectedServiceType || !this.selectedRefundReason) { if(this.afterSalesType !== 3) {
uni.showToast({ if (!this.selectedServiceType || !this.selectedRefundReason) {
title: '请选择服务类型和退款原因', uni.showToast({
icon: 'none' title: '请选择服务类型和退款原因',
}); icon: 'none'
return; });
return;
}
} }
// //
const refundInfo = { const refundInfo = {
afterSalesType: this.afterSalesType,
serviceType: this.selectedServiceType, serviceType: this.selectedServiceType,
refundReason: this.selectedRefundReason, refundReason: this.selectedRefundReason || this.changeRefundReason,
refundAmount: this.refundAmount, refundAmount: this.orderItem.total_amount,
maxRefundAmount: this.maxRefundAmount, maxRefundAmount: this.orderItem.total_amount,
postage: this.postage, postage: 0, // 0
refundDescription: this.refundDescription, refundDescription: this.refundDescription,
refundMethod: this.refundMethod, refundMethod: this.refundMethod,
merchantAddress: this.merchantAddress, merchantAddress: this.orderItem.receiving_address,
merchantContact: this.merchantContact, merchantContact: `${this.orderItem.receiving_name} ${this.orderItem.receiving_phone}`,
imgList: this.imgList imgList: this.imgList,
changeServiceId: this.changeServiceId,
}; };
console.log('提交退款申请:', refundInfo); console.log('提交退款申请:', refundInfo);

View File

@ -49,7 +49,6 @@ export default {
confirmCancel() { confirmCancel() {
const selectedText = this.cancelReasons[this.selectedReason]; const selectedText = this.cancelReasons[this.selectedReason];
console.log("🚀 ~ confirmCancel ~ 取消原因:", selectedText);
uni.showModal({ uni.showModal({
title: "取消订单", title: "取消订单",
content: "千辛万苦挑选的商品,确定要取消吗?", content: "千辛万苦挑选的商品,确定要取消吗?",

View File

@ -50,7 +50,6 @@ export default {
confirmRefund() { confirmRefund() {
const selectedText = this.applyRefundReasons[this.selectedReason]; const selectedText = this.applyRefundReasons[this.selectedReason];
console.log("🚀 ~ confirmRefund ~ 退款原因:", selectedText);
this.$emit('update:showPopup', false); this.$emit('update:showPopup', false);
this.$emit('refundConfirmed', { reason: selectedText }); this.$emit('refundConfirmed', { reason: selectedText });
uni.showModal({ uni.showModal({

View File

@ -89,6 +89,7 @@
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: space-between; justify-content: space-between;
position: relative;
} }
.asGoodTag { .asGoodTag {
@ -123,12 +124,9 @@
.goods-desc { .goods-desc {
font-size: 26rpx; font-size: 26rpx;
color: #ff4d4f; color: #999999;
background-color: #fff2f0;
padding: 4rpx 12rpx;
border-radius: 8rpx; border-radius: 8rpx;
display: inline-block; display: inline-block;
margin: 10rpx 0;
} }
.goods-price { .goods-price {
@ -146,10 +144,9 @@
.refund-amount { .refund-amount {
font-size: 28rpx; font-size: 28rpx;
align-self: flex-start; align-self: flex-start;
margin-top: 20rpx;
font-weight: 500; font-weight: 500;
position: relative; position: absolute;
left: 140rpx; right: 10rpx;
} }
.refund-info { .refund-info {
@ -246,7 +243,6 @@
/* 弹窗样式 */ /* 弹窗样式 */
.popup-content { .popup-content {
width: 600rpx;
background-color: #ffffff; background-color: #ffffff;
border-radius: 20rpx; border-radius: 20rpx;
padding: 40rpx; padding: 40rpx;
@ -301,12 +297,13 @@
.continue-btn { .continue-btn {
width: 240rpx; width: 240rpx;
height: 80rpx; height: 80rpx;
background-color: #f6f7fb; background-color: #ffe8e5;
color: #333333; color: #ff370b;
border-radius: 40rpx; border-radius: 40rpx;
font-size: 28rpx; font-size: 28rpx;
line-height: 80rpx; line-height: 80rpx;
text-align: center; text-align: center;
border: none;
} }
.know-btn { .know-btn {

View File

@ -50,9 +50,10 @@
<text class="asGoodTag asGoodTag1" <text class="asGoodTag asGoodTag1"
v-if="currentAfterSale.commodity_order_item[0].is_support_same_day === 1">当日达</text> v-if="currentAfterSale.commodity_order_item[0].is_support_same_day === 1">当日达</text>
{{ currentAfterSale.commodity_order_item[0].goods_name }} {{ currentAfterSale.commodity_order_item[0].goods_name }}
<text class="refund-amount">退款¥{{ currentAfterSale.refund_amount.toFixed(2) }}</text> <text class="refund-amount">退款¥{{ currentAfterSale.refund_amount ?
currentAfterSale.refund_amount.toFixed(2) : '0.00' }}</text>
</text> </text>
<text class="goods-desc">{{ ite.after_sales_reason }}</text> <text class="goods-desc">{{ currentAfterSale.commodity_order_item[0].goods_spec }}</text>
<text class="goods-price"> <text class="goods-price">
{{ '¥' + currentAfterSale.commodity_order_item[0].sales_price.toFixed(2) + '/个' }} {{ '¥' + currentAfterSale.commodity_order_item[0].sales_price.toFixed(2) + '/个' }}
<text class="goods-count">X{{ currentAfterSale.commodity_order_item[0].count }}</text> <text class="goods-count">X{{ currentAfterSale.commodity_order_item[0].count }}</text>
@ -75,7 +76,8 @@
</view> </view>
<view class="info-item"> <view class="info-item">
<text class="info-label">退款金额<text style="color: #fc3811;">*</text></text> <text class="info-label">退款金额<text style="color: #fc3811;">*</text></text>
<text class="info-value amount">{{ '¥' + currentAfterSale.refund_amount.toFixed(2) }}</text> <text class="info-value amount">{{ '¥' + (currentAfterSale.refund_amount ?
currentAfterSale.refund_amount.toFixed(2) : '0.00') }}</text>
</view> </view>
<view class="info-item"> <view class="info-item">
<text class="info-label">申请时间<text style="color: #fc3811;">*</text></text> <text class="info-label">申请时间<text style="color: #fc3811;">*</text></text>
@ -116,6 +118,7 @@
<script> <script>
import { apiArr } from "../../../api/afterSale";
import { import {
isPhone, isPhone,
picUrl, picUrl,
@ -183,10 +186,14 @@ export default {
confirmColor: "#ff4d4f", confirmColor: "#ff4d4f",
success: (res) => { success: (res) => {
if (res.confirm) { if (res.confirm) {
// const params = {
uni.showToast({ id: this.currentAfterSale.id,
title: '订单撤销成功', }
icon: 'success' request(apiArr.revokeApply, "POST", params).then((res) => {
uni.showToast({
title: '订单撤销成功',
icon: 'success'
});
}); });
} }
}, },