|
@@ -9,6 +9,16 @@
|
|
|
<view class="info-row"><text class="info-label">申请时间</text><text class="info-value">{{ detail.createTime }}</text></view>
|
|
<view class="info-row"><text class="info-label">申请时间</text><text class="info-value">{{ detail.createTime }}</text></view>
|
|
|
<view class="info-row"><text class="info-label">状态</text><view class="card-status" :class="statusClass(detail.status)"><text>{{ RefundStatusText[detail.status] }}</text></view></view>
|
|
<view class="info-row"><text class="info-label">状态</text><view class="card-status" :class="statusClass(detail.status)"><text>{{ RefundStatusText[detail.status] }}</text></view></view>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
+ <view class="section" v-if="orderVideoUrl">
|
|
|
|
|
+ <text class="section-title">订单视频</text>
|
|
|
|
|
+ <video
|
|
|
|
|
+ :src="orderVideoUrl"
|
|
|
|
|
+ controls
|
|
|
|
|
+ enable-play-gesture
|
|
|
|
|
+ object-fit="contain"
|
|
|
|
|
+ style="width:100%;height:400rpx;border-radius:12rpx;background:#000;"
|
|
|
|
|
+ />
|
|
|
|
|
+ </view>
|
|
|
</scroll-view>
|
|
</scroll-view>
|
|
|
<view class="bottom-actions" v-if="detail && detail.status === 0">
|
|
<view class="bottom-actions" v-if="detail && detail.status === 0">
|
|
|
<view class="action-row">
|
|
<view class="action-row">
|
|
@@ -25,11 +35,23 @@ import { ref } from 'vue'
|
|
|
import { onLoad } from '@dcloudio/uni-app';
|
|
import { onLoad } from '@dcloudio/uni-app';
|
|
|
import NavBar from '@/components/NavBar.vue';
|
|
import NavBar from '@/components/NavBar.vue';
|
|
|
import { getRefundDetail, reviewRefund } from '@/api/refund';
|
|
import { getRefundDetail, reviewRefund } from '@/api/refund';
|
|
|
|
|
+import { getOrderMedia } from '@/api/order';
|
|
|
import { RefundStatusText } from '@/utils/constants';
|
|
import { RefundStatusText } from '@/utils/constants';
|
|
|
import { formatMoney, showToast, showConfirm } from '@/utils/common';
|
|
import { formatMoney, showToast, showConfirm } from '@/utils/common';
|
|
|
-const detail = ref<any>(null); const remark = ref('');
|
|
|
|
|
|
|
+const detail = ref<any>(null); const remark = ref(''); const orderVideoUrl = ref('');
|
|
|
onLoad((options?: Record<string, string>) => { const id = options?.id ? Number(options.id) : 0; if (id) loadDetail(id); });
|
|
onLoad((options?: Record<string, string>) => { const id = options?.id ? Number(options.id) : 0; if (id) loadDetail(id); });
|
|
|
-const loadDetail = async (id: number) => { try { detail.value = await getRefundDetail(id); } catch { showToast('加载失败'); uni.navigateBack(); } };
|
|
|
|
|
|
|
+const loadDetail = async (id: number) => {
|
|
|
|
|
+ try {
|
|
|
|
|
+ detail.value = await getRefundDetail(id);
|
|
|
|
|
+ if (detail.value?.orderId && detail.value?.activityId) {
|
|
|
|
|
+ try {
|
|
|
|
|
+ const media = await getOrderMedia(detail.value.orderId, detail.value.activityId);
|
|
|
|
|
+ if (media?.video_url) orderVideoUrl.value = media.video_url;
|
|
|
|
|
+ else if (media?.main_video?.length) orderVideoUrl.value = media.main_video[0];
|
|
|
|
|
+ } catch { /* 媒体获取失败不影响详情展示 */ }
|
|
|
|
|
+ }
|
|
|
|
|
+ } catch { showToast('加载失败'); uni.navigateBack(); }
|
|
|
|
|
+};
|
|
|
const statusClass = (status: number) => status === 0 ? 'pending' : status === 1 ? 'approved' : 'rejected';
|
|
const statusClass = (status: number) => status === 0 ? 'pending' : status === 1 ? 'approved' : 'rejected';
|
|
|
const handleReview = async (approved: boolean) => {
|
|
const handleReview = async (approved: boolean) => {
|
|
|
if (!(await showConfirm(approved ? '确认通过?' : '确认驳回?'))) return;
|
|
if (!(await showConfirm(approved ? '确认通过?' : '确认驳回?'))) return;
|