|
@@ -33,6 +33,8 @@ export default defineComponent({
|
|
setup() {
|
|
setup() {
|
|
const route = useRoute();
|
|
const route = useRoute();
|
|
const router = useRouter();
|
|
const router = useRouter();
|
|
|
|
+ // 判断是否是退款详情
|
|
|
|
+ const isRefund = route.query.userRefundOrderId ? true : false;
|
|
const state = reactive({
|
|
const state = reactive({
|
|
refundAudit: '' as any, // 退回审核状态
|
|
refundAudit: '' as any, // 退回审核状态
|
|
refundOrderId: '', // 退回订单id
|
|
refundOrderId: '', // 退回订单id
|
|
@@ -45,30 +47,34 @@ export default defineComponent({
|
|
timerCount: 0 // 执行次数
|
|
timerCount: 0 // 执行次数
|
|
});
|
|
});
|
|
const getDetails = async () => {
|
|
const getDetails = async () => {
|
|
|
|
+ let res = null as any;
|
|
try {
|
|
try {
|
|
- if (!route.query.orderNo) return;
|
|
|
|
- const res = await api_userPaymentOrderRefundDetail(route.query.orderNo);
|
|
|
|
- if (res?.code !== 200) return;
|
|
|
|
- state.orders = res.data.order || {};
|
|
|
|
- const tempGoods = res.data.order.goodsInfos || [];
|
|
|
|
- tempGoods.forEach((item: any) => {
|
|
|
|
- const img = item.goodsUrl ? item.goodsUrl.split(',')[0] : '';
|
|
|
|
- item.goodsUrl = img;
|
|
|
|
- });
|
|
|
|
- state.goodsInfos = tempGoods;
|
|
|
|
- if (Array.isArray(res.data?.refund)) {
|
|
|
|
- const refunds = res.data.refund;
|
|
|
|
- const index = refunds.length - 1;
|
|
|
|
- state.refundAudit = refunds[index]?.refundAudit || '';
|
|
|
|
- state.refundOrderId = refunds[index]?.id || '';
|
|
|
|
- if (state.refundAudit === 'ING') {
|
|
|
|
- state.orders.status = 'REFUNDING';
|
|
|
|
- } else if (state.refundAudit === 'PASS') {
|
|
|
|
- state.orders.status = 'REFUNDED';
|
|
|
|
- }
|
|
|
|
|
|
+ // 退款详情
|
|
|
|
+ if (isRefund) {
|
|
|
|
+ res = await api_userPaymentOrderRefundDetail(
|
|
|
|
+ route.query.userRefundOrderId
|
|
|
|
+ );
|
|
|
|
+ } else {
|
|
|
|
+ // 订单详情
|
|
|
|
+ res = await api_userPaymentOrderDetail(route.query.orderNo);
|
|
}
|
|
}
|
|
- } catch {
|
|
|
|
- //
|
|
|
|
|
|
+ } catch {}
|
|
|
|
+ if (res?.code !== 200) return;
|
|
|
|
+ state.orders = res.data || {};
|
|
|
|
+ const tempGoods =
|
|
|
|
+ (isRefund ? res.data.studentRefundOrderDetails : res.data.goodsInfos) || [];
|
|
|
|
+ tempGoods.forEach((item: any) => {
|
|
|
|
+ const img = item.goodsUrl ? item.goodsUrl.split(',')[0] : '';
|
|
|
|
+ item.goodsUrl = img;
|
|
|
|
+ item.brandName = item.brandName
|
|
|
|
+ ? item.brandName
|
|
|
|
+ : goodsType[item.goodsType];
|
|
|
|
+ });
|
|
|
|
+ state.goodsInfos = tempGoods;
|
|
|
|
+ if (isRefund) {
|
|
|
|
+ state.refundAudit = res.data.refundAudit || '';
|
|
|
|
+ state.refundOrderId = res.data.userRefundOrderId || '';
|
|
|
|
+ state.orders.status = state.refundAudit;
|
|
}
|
|
}
|
|
};
|
|
};
|
|
|
|
|
|
@@ -97,8 +103,9 @@ export default defineComponent({
|
|
TIMEOUT: iconClose,
|
|
TIMEOUT: iconClose,
|
|
FAIL: iconClose,
|
|
FAIL: iconClose,
|
|
CLOSED: iconClose,
|
|
CLOSED: iconClose,
|
|
- REFUNDING: iconRefunding,
|
|
|
|
- REFUNDED: icon_success
|
|
|
|
|
|
+ ING: iconRefunding,
|
|
|
|
+ PASS: icon_success,
|
|
|
|
+ REJECT: iconClose
|
|
};
|
|
};
|
|
return template[type] || icon_success;
|
|
return template[type] || icon_success;
|
|
};
|
|
};
|
|
@@ -111,11 +118,17 @@ export default defineComponent({
|
|
TIMEOUT: '订单超时',
|
|
TIMEOUT: '订单超时',
|
|
FAIL: '领取失败',
|
|
FAIL: '领取失败',
|
|
CLOSED: '已关闭',
|
|
CLOSED: '已关闭',
|
|
- REFUNDING: '退回申请中',
|
|
|
|
- REFUNDED: '已退回'
|
|
|
|
|
|
+ ING: '退回申请中',
|
|
|
|
+ PASS: '已退回',
|
|
|
|
+ REJECT: '退回失败'
|
|
};
|
|
};
|
|
return temp[status];
|
|
return temp[status];
|
|
};
|
|
};
|
|
|
|
+ const goodsType: any = {
|
|
|
|
+ VIP: '数字化乐器学练工具',
|
|
|
|
+ INSTRUMENTS: '乐器购买',
|
|
|
|
+ TEXTBOOK: '教材'
|
|
|
|
+ };
|
|
|
|
|
|
onMounted(async () => {
|
|
onMounted(async () => {
|
|
await getDetails();
|
|
await getDetails();
|
|
@@ -143,7 +156,10 @@ export default defineComponent({
|
|
return () => (
|
|
return () => (
|
|
<div class={styles.paymentResult}>
|
|
<div class={styles.paymentResult}>
|
|
<div class={[styles.paymentTitle]}>
|
|
<div class={[styles.paymentTitle]}>
|
|
- <MHeader background="transparent" />
|
|
|
|
|
|
+ <MHeader
|
|
|
|
+ title={isRefund ? '申请退回' : '领取详情'}
|
|
|
|
+ background="transparent"
|
|
|
|
+ />
|
|
|
|
|
|
{state.orders.id && (
|
|
{state.orders.id && (
|
|
<>
|
|
<>
|
|
@@ -158,11 +174,11 @@ export default defineComponent({
|
|
<div class={styles.orderPrice}>
|
|
<div class={styles.orderPrice}>
|
|
实付金额:¥ {moneyFormat(state.orders.paymentCashAmount)}
|
|
实付金额:¥ {moneyFormat(state.orders.paymentCashAmount)}
|
|
</div>
|
|
</div>
|
|
- ) : (
|
|
|
|
- ''
|
|
|
|
- )}
|
|
|
|
|
|
+ ) : null}
|
|
|
|
|
|
- {['REFUNDING', 'REFUNDED'].includes(state.orders.status) && (
|
|
|
|
|
|
+ {['ING', 'PASS', 'REJECT', 'CLOSED'].includes(
|
|
|
|
+ state.orders.status
|
|
|
|
+ ) && (
|
|
<div class={styles.orderPrice}>
|
|
<div class={styles.orderPrice}>
|
|
退回金额:¥ {moneyFormat(state.orders.paymentCashAmount)}
|
|
退回金额:¥ {moneyFormat(state.orders.paymentCashAmount)}
|
|
</div>
|
|
</div>
|
|
@@ -177,7 +193,11 @@ export default defineComponent({
|
|
<Cell>
|
|
<Cell>
|
|
{{
|
|
{{
|
|
title: () => '付款时间',
|
|
title: () => '付款时间',
|
|
- value: () => <span>{state.orders.payTime || '--'}</span>
|
|
|
|
|
|
+ value: () => (
|
|
|
|
+ <span>
|
|
|
|
+ {state.orders.payTime || state.orders.refundTime || '--'}
|
|
|
|
+ </span>
|
|
|
|
+ )
|
|
}}
|
|
}}
|
|
</Cell>
|
|
</Cell>
|
|
<Cell>
|
|
<Cell>
|