|
@@ -1,7 +1,15 @@
|
|
|
<template>
|
|
<template>
|
|
|
<view class="container">
|
|
<view class="container">
|
|
|
|
|
+ <!-- 退款状态提示 -->
|
|
|
|
|
+ <view v-if="refundDisabled" class="refund-status-banner">
|
|
|
|
|
+ <text class="banner-icon">{{ refundBannerIcon }}</text>
|
|
|
|
|
+ <text class="banner-title">{{ refundBannerTitle }}</text>
|
|
|
|
|
+ <text class="banner-desc">{{ refundBannerDesc }}</text>
|
|
|
|
|
+ <button class="banner-back-btn" @click="goBack">返回订单详情</button>
|
|
|
|
|
+ </view>
|
|
|
|
|
+
|
|
|
<!-- 退款商品选择 -->
|
|
<!-- 退款商品选择 -->
|
|
|
- <view class="section-block product-section">
|
|
|
|
|
|
|
+ <view v-if="!refundDisabled" class="section-block product-section">
|
|
|
<text class="section-title">选择退款商品</text>
|
|
<text class="section-title">选择退款商品</text>
|
|
|
<view class="product-list">
|
|
<view class="product-list">
|
|
|
<view
|
|
<view
|
|
@@ -226,6 +234,34 @@ const refundExpireText = computed(() => {
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
|
|
+// 是否禁用退款(待审核 / 已全额退款)
|
|
|
|
|
+const refundDisabled = computed(() => {
|
|
|
|
|
+ if (!orderInfo.value.id) return false;
|
|
|
|
|
+ if (orderInfo.value.refundStatus === 'PENDING') return true;
|
|
|
|
|
+ const paid = orderInfo.value.paidAmount || orderInfo.value.totalAmount || 0;
|
|
|
|
|
+ const refunded = orderInfo.value.refundAmount || 0;
|
|
|
|
|
+ return refunded >= paid;
|
|
|
|
|
+});
|
|
|
|
|
+
|
|
|
|
|
+const refundBannerIcon = computed(() => {
|
|
|
|
|
+ if (orderInfo.value.refundStatus === 'PENDING') return '⏳';
|
|
|
|
|
+ return '✅';
|
|
|
|
|
+});
|
|
|
|
|
+
|
|
|
|
|
+const refundBannerTitle = computed(() => {
|
|
|
|
|
+ if (orderInfo.value.refundStatus === 'PENDING') return '退款审核中';
|
|
|
|
|
+ return '已全额退款';
|
|
|
|
|
+});
|
|
|
|
|
+
|
|
|
|
|
+const refundBannerDesc = computed(() => {
|
|
|
|
|
+ if (orderInfo.value.refundStatus === 'PENDING') return '您的退款申请已提交,正在审核中,请耐心等待';
|
|
|
|
|
+ return '该订单已全额退款,无需再次申请';
|
|
|
|
|
+});
|
|
|
|
|
+
|
|
|
|
|
+const goBack = () => {
|
|
|
|
|
+ uni.navigateBack();
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
const selectedReason = ref('');
|
|
const selectedReason = ref('');
|
|
|
const refundRemark = ref('');
|
|
const refundRemark = ref('');
|
|
|
const customRefundAmount = ref<string>('');
|
|
const customRefundAmount = ref<string>('');
|
|
@@ -295,6 +331,17 @@ const loadOrderDetail = async () => {
|
|
|
const detail = await getOrderDetail({ orderId: orderId.value });
|
|
const detail = await getOrderDetail({ orderId: orderId.value });
|
|
|
orderInfo.value = detail;
|
|
orderInfo.value = detail;
|
|
|
|
|
|
|
|
|
|
+ // 检查是否已全额退款
|
|
|
|
|
+ const paidAmount = detail.paidAmount || detail.totalAmount || 0;
|
|
|
|
|
+ if ((detail.refundAmount || 0) >= paidAmount) {
|
|
|
|
|
+ return; // refundDisabled computed will show banner
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 检查是否有待审核的退款申请
|
|
|
|
|
+ if (detail.refundStatus === 'PENDING') {
|
|
|
|
|
+ return; // refundDisabled computed will show banner
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
if (detail.payTime) {
|
|
if (detail.payTime) {
|
|
|
const payTime = new Date(detail.payTime);
|
|
const payTime = new Date(detail.payTime);
|
|
|
const now = new Date();
|
|
const now = new Date();
|
|
@@ -416,6 +463,50 @@ const submitRefund = async () => {
|
|
|
padding-bottom: 40rpx;
|
|
padding-bottom: 40rpx;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+/* 退款状态横幅 */
|
|
|
|
|
+.refund-status-banner {
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ flex-direction: column;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ padding: 60rpx 40rpx;
|
|
|
|
|
+ margin: 30rpx;
|
|
|
|
|
+ background-color: $color-bg-primary;
|
|
|
|
|
+ border-radius: 16rpx;
|
|
|
|
|
+ text-align: center;
|
|
|
|
|
+
|
|
|
|
|
+ .banner-icon {
|
|
|
|
|
+ font-size: 80rpx;
|
|
|
|
|
+ margin-bottom: 24rpx;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .banner-title {
|
|
|
|
|
+ font-size: 36rpx;
|
|
|
|
|
+ font-weight: 600;
|
|
|
|
|
+ color: $color-text-primary;
|
|
|
|
|
+ margin-bottom: 16rpx;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .banner-desc {
|
|
|
|
|
+ font-size: 28rpx;
|
|
|
|
|
+ color: $color-text-secondary;
|
|
|
|
|
+ line-height: 1.6;
|
|
|
|
|
+ margin-bottom: 40rpx;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .banner-back-btn {
|
|
|
|
|
+ background-color: $color-bg-secondary;
|
|
|
|
|
+ border: 1rpx solid $color-border;
|
|
|
|
|
+ border-radius: 10rpx;
|
|
|
|
|
+ font-size: 28rpx;
|
|
|
|
|
+ color: $color-text-primary;
|
|
|
|
|
+ padding: 20rpx 60rpx;
|
|
|
|
|
+
|
|
|
|
|
+ &::after {
|
|
|
|
|
+ border: none;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
.product-section {
|
|
.product-section {
|
|
|
margin-bottom: 20rpx;
|
|
margin-bottom: 20rpx;
|
|
|
padding-bottom: 20rpx;
|
|
padding-bottom: 20rpx;
|