diff --git a/pages/order/aftersale/detail.vue b/pages/order/aftersale/detail.vue
index ddd8269..775e4e4 100644
--- a/pages/order/aftersale/detail.vue
+++ b/pages/order/aftersale/detail.vue
@@ -3,26 +3,22 @@
-
-
-
+
+ :class="state.active >= index ? 'activity-color' : 'info-color'" />
-
+
{{ item.title }}
@@ -32,28 +28,33 @@
-
+
+
退款总额
- ¥{{ state.info.refundPrice/100 }}
+ ¥{{ fen2yuan(state.info.refundPrice) }}
-
-
+
@@ -71,7 +72,7 @@
售后类型:
- {{ status2[state.info.way] }}
+ {{ state.info.way === 10 ? '仅退款' : '退款退货' }}
申请原因:
@@ -83,114 +84,97 @@
+
+
-
+
+
- -->
+
diff --git a/pages/order/aftersale/list.vue b/pages/order/aftersale/list.vue
index 4cf824b..1201386 100644
--- a/pages/order/aftersale/list.vue
+++ b/pages/order/aftersale/list.vue
@@ -3,92 +3,73 @@
-
+
-
-
+
-
服务单号:{{ order.no }}
- {{ status[order.status] }}
+ {{ formatAfterSaleStatus(order) }}
-
+
-
- {{ status2[order.way] }}
-
- {{ order.applyReason }}
+ {{ order.way === 10 ? '仅退款' : '退款退货' }}
+ {{ formatAfterSaleStatusDescription(order) }}
-
+ v-if="order?.buttons.includes('cancel')">取消申请
-
-
-
- -->
+
+ }" @tap="loadMore" />
diff --git a/pages/order/detail.vue b/pages/order/detail.vue
index bded792..ee179ec 100644
--- a/pages/order/detail.vue
+++ b/pages/order/detail.vue
@@ -1,568 +1,626 @@
-
-
-
+
+
-
-
+
+
-
-
+
+
-
-
-
-
-
- {{ formatOrderStatus(state.orderInfo) }}
-
- {{ formatOrderStatusDescription(state.orderInfo) }}
-
+ "
+ class="state-img"
+ :src="sheep.$url.static('/static/img/shop/order/order_success.png')"
+ >
+
+
+
+
+
+ {{ formatOrderStatus(state.orderInfo) }}
+
+ {{
+ formatOrderStatusDescription(state.orderInfo)
+ }}
+
-
-
-
-
- {{ state.orderInfo.receiverName }}
-
- {{ state.orderInfo.receiverMobile }}
-
-
+
+
+
+
+ {{ state.orderInfo.receiverName }}
+
+ {{ state.orderInfo.receiverMobile }}
+
+
{{ state.orderInfo.receiverAreaName }} {{ state.orderInfo.receiverDetailAddress }}
-
+
-
-
-
-
-
+
+
+
+
-
-
-
-
-
- {{ item.status_text }}
-
-
-
-
-
-
+ "
+ >
+ 退款成功
+
+
+
+
+
+ {{ item.status_text }}
+
+
+
+
+
+
-
-
-
-
-
- 订单编号:
- {{ state.orderInfo.no }}
-
- 复制
-
-
- 下单时间:
-
+
+
+
+
+
+ 订单编号:
+ {{ state.orderInfo.no }}
+
+ 复制
+
+
+ 下单时间:
+
{{ sheep.$helper.timeFormat(state.orderInfo.createTime, 'yyyy-mm-dd hh:MM:ss') }}
-
-
- 支付时间:
-
+
+
+ 支付时间:
+
{{ sheep.$helper.timeFormat(state.orderInfo.payTime, 'yyyy-mm-dd hh:MM:ss') }}
-
-
- 支付方式:
- {{ state.orderInfo.payChannelName || '-' }}
-
-
-
+
+
+ 支付方式:
+ {{ state.orderInfo.payChannelName || '-' }}
+
+
+
-
-
-
- 商品总额
-
- ¥{{ fen2yuan(state.orderInfo.totalPrice) }}
-
-
-
- 运费
- ¥{{ fen2yuan(state.orderInfo.deliveryPrice) }}
-
+
+
+
+ 商品总额
+
+ ¥{{ fen2yuan(state.orderInfo.totalPrice) }}
+
+
+
+ 运费
+ ¥{{ fen2yuan(state.orderInfo.deliveryPrice) }}
+
-
- 优惠金额
- ¥{{ fen2yuan(state.orderInfo.discountPrice) }}
-
-
- {{ state.orderInfo.payStatus ? '已付款' : '需付款' }}
- ¥{{ fen2yuan(state.orderInfo.payPrice) }}
-
-
- 已退款
- ¥{{ fen2yuan(state.orderInfo.refundPrice) }}
-
-
+
+ 优惠金额
+ ¥{{ fen2yuan(state.orderInfo.discountPrice) }}
+
+
+ {{ state.orderInfo.payStatus ? '已付款' : '需付款' }}
+ ¥{{ fen2yuan(state.orderInfo.payPrice) }}
+
+
+ 已退款
+ ¥{{ fen2yuan(state.orderInfo.refundPrice) }}
+
+
-
-
-
-
+
+
\ No newline at end of file
+ .pay-btn {
+ width: 160rpx;
+ height: 60rpx;
+ font-size: 26rpx;
+ border-radius: 30rpx;
+ font-weight: 500;
+ color: #fff;
+ }
+ }
+
diff --git a/sheep/api/order.js b/sheep/api/order.js
index 1bcf981..e3ce154 100644
--- a/sheep/api/order.js
+++ b/sheep/api/order.js
@@ -129,13 +129,6 @@ export default {
}),
// 售后
aftersale: {
- // 申请售后
- apply: (data) =>
- request({
- url: 'order/aftersale',
- method: 'POST',
- data,
- }),
list: (params) =>
request({
url: '/app-api/trade/after-sale/page',
@@ -145,15 +138,6 @@ export default {
showLoading: false,
},
}),
- // list: (params) =>
- // request({
- // url: 'order/aftersale',
- // method: 'GET',
- // params,
- // custom: {
- // showLoading: false,
- // },
- // }),
//取消售后
cancel: (id) =>
request({
@@ -166,7 +150,7 @@ export default {
url: 'order/aftersale/' + id,
method: 'DELETE',
}),
- // 售后详情
+ // 售后详情 DONE
detail: (id) =>
request({
url: '/app-api/trade/after-sale/get?id=' + id,
diff --git a/sheep/api/trade/afterSale.js b/sheep/api/trade/afterSale.js
index 25aa31c..8207945 100644
--- a/sheep/api/trade/afterSale.js
+++ b/sheep/api/trade/afterSale.js
@@ -10,6 +10,26 @@ const AfterSaleApi = {
data,
});
},
+ // 获得售后
+ getAfterSale: (id) => {
+ return request2({
+ url: `/app-api/trade/after-sale/get`,
+ method: 'GET',
+ params: {
+ id,
+ },
+ });
+ },
+ // 取消售后
+ cancelAfterSale: (id) => {
+ return request2({
+ url: `/app-api/trade/after-sale/cancel`,
+ method: 'DELETE',
+ params: {
+ id,
+ },
+ });
+ }
};
export default AfterSaleApi;
diff --git a/sheep/hooks/useGoods.js b/sheep/hooks/useGoods.js
index 1a98b08..eb13a47 100644
--- a/sheep/hooks/useGoods.js
+++ b/sheep/hooks/useGoods.js
@@ -182,6 +182,87 @@ export function handleOrderButtons(order) {
}
}
+/**
+ * 格式化售后状态
+ *
+ * @param afterSale 售后
+ */
+export function formatAfterSaleStatus(afterSale) {
+ if (afterSale.status === 10) {
+ return '申请售后';
+ }
+ if (afterSale.status === 20) {
+ return '商品待退货';
+ }
+ if (afterSale.status === 30) {
+ return '商家待收货';
+ }
+ if (afterSale.status === 40) {
+ return '等待退款';
+ }
+ if (afterSale.status === 50) {
+ return '退款成功';
+ }
+ if (afterSale.status === 61) {
+ return '买家取消';
+ }
+ if (afterSale.status === 62) {
+ return '商家拒绝';
+ }
+ if (afterSale.status === 63) {
+ return '商家拒收货';
+ }
+ return '未知状态';
+}
+
+/**
+ * 格式化售后状态的描述
+ *
+ * @param afterSale 售后
+ */
+export function formatAfterSaleStatusDescription(afterSale) {
+ if (afterSale.status === 10) {
+ return '退款申请待商家处理';
+ }
+ if (afterSale.status === 20) {
+ return '请退货并填写物流信息';
+ }
+ if (afterSale.status === 30) {
+ return '退货退款申请待商家处理';
+ }
+ if (afterSale.status === 40) {
+ return '等待退款';
+ }
+ if (afterSale.status === 50) {
+ return '退款成功';
+ }
+ if (afterSale.status === 61) {
+ return '退款关闭';
+ }
+ if (afterSale.status === 62) {
+ return `商家不同意退款申请,拒绝原因:${afterSale.auditReason}`;
+ }
+ if (afterSale.status === 63) {
+ return `商家拒绝收货,不同意退款,拒绝原因:${afterSale.auditReason}`;
+ }
+ return '未知状态';
+}
+
+/**
+ * 处理售后的 button 操作按钮数组
+ *
+ * @param afterSale 售后
+ */
+export function handleAfterSaleButtons(afterSale) {
+ afterSale.buttons = [];
+ if ([10, 20, 30].includes(afterSale.status)) { // 取消订单
+ afterSale.buttons.push('cancel');
+ }
+ if (afterSale.status === 20) { // 退货信息
+ afterSale.buttons.push('delivery');
+ }
+}
+
/**
* 倒计时
* @param toTime 截止时间