对接售后模块部分接口
This commit is contained in:
parent
6bf7d78776
commit
998a14c878
@ -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", //商品售后换货商品列表
|
||||||
};
|
};
|
||||||
|
|||||||
@ -1,3 +0,0 @@
|
|||||||
export const apiArr = {
|
|
||||||
orderList: '/api/v2/wechat/commodity/order', // 商品订单列表
|
|
||||||
}
|
|
||||||
@ -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;
|
||||||
|
|||||||
@ -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>
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
page {
|
page {
|
||||||
background-color: #f6f7fb;
|
background-color: #f6f7fb;
|
||||||
padding-bottom: 0;
|
padding-bottom: 50rpx;
|
||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -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">
|
||||||
@ -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,14 +184,17 @@ 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);
|
||||||
|
|
||||||
@ -210,7 +215,27 @@ export default {
|
|||||||
|
|
||||||
// 处理退款提交事件
|
// 处理退款提交事件
|
||||||
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();
|
||||||
|
// });
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
@ -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,7 +282,7 @@ 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();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -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>
|
||||||
|
|||||||
@ -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,
|
||||||
|
|||||||
@ -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{
|
||||||
|
|||||||
@ -19,7 +19,8 @@
|
|||||||
</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">
|
||||||
@ -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 class="itemSize" v-for="(item, index) in info.commodity_goods_info_list" :key="item.id"
|
</view>
|
||||||
|
<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() {
|
||||||
|
const params = {
|
||||||
|
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.afterSalePopup3 = false;
|
||||||
this.showSize = true;
|
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,6 +490,7 @@ export default {
|
|||||||
|
|
||||||
// 提交退款申请
|
// 提交退款申请
|
||||||
submitRefundApplication() {
|
submitRefundApplication() {
|
||||||
|
if(this.afterSalesType !== 3) {
|
||||||
if (!this.selectedServiceType || !this.selectedRefundReason) {
|
if (!this.selectedServiceType || !this.selectedRefundReason) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '请选择服务类型和退款原因',
|
title: '请选择服务类型和退款原因',
|
||||||
@ -472,19 +498,22 @@ export default {
|
|||||||
});
|
});
|
||||||
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);
|
||||||
|
|
||||||
|
|||||||
@ -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: "千辛万苦挑选的商品,确定要取消吗?",
|
||||||
|
|||||||
@ -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({
|
||||||
|
|||||||
@ -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 {
|
||||||
|
|||||||
@ -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,11 +186,15 @@ export default {
|
|||||||
confirmColor: "#ff4d4f",
|
confirmColor: "#ff4d4f",
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
if (res.confirm) {
|
if (res.confirm) {
|
||||||
// 撤销售后接口
|
const params = {
|
||||||
|
id: this.currentAfterSale.id,
|
||||||
|
}
|
||||||
|
request(apiArr.revokeApply, "POST", params).then((res) => {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '订单撤销成功',
|
title: '订单撤销成功',
|
||||||
icon: 'success'
|
icon: 'success'
|
||||||
});
|
});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user