|
|
@@ -16,7 +16,8 @@ import {
|
|
|
getRefundApplicationList,
|
|
|
getRefundApplicationDetail,
|
|
|
reviewRefundApplication,
|
|
|
- getOrderById
|
|
|
+ getOrderById,
|
|
|
+ getOrderMedia
|
|
|
} from "@/api/order";
|
|
|
import type { RefundApplicationItem, RefundApplicationSearchForm } from "../../utils/types";
|
|
|
import { type Ref, ref, reactive, onMounted } from "vue";
|
|
|
@@ -136,8 +137,19 @@ export function useRefund(tableRef: Ref) {
|
|
|
|
|
|
async function handleOrderDetail(row: RefundApplicationItem) {
|
|
|
try {
|
|
|
- const { data } = await getOrderById(row.orderId);
|
|
|
- const order = data as any;
|
|
|
+ // 并行获取订单详情和媒体信息
|
|
|
+ const [orderRes, mediaRes] = await Promise.allSettled([
|
|
|
+ getOrderById(row.orderId),
|
|
|
+ getOrderMedia({ orderId: row.orderNo })
|
|
|
+ ]);
|
|
|
+ const order = orderRes.status === "fulfilled" ? (orderRes.value.data as any) : null;
|
|
|
+ const media = mediaRes.status === "fulfilled" ? (mediaRes.value.data as any) : null;
|
|
|
+ if (!order) { message("获取订单详情失败", { type: "error" }); return; }
|
|
|
+
|
|
|
+ // 提取视频URL
|
|
|
+ const videoUrl: string | null = media?.video_url || media?.videoUrl
|
|
|
+ || (media?.main_video?.length ? media.main_video[0] : null)
|
|
|
+ || order.videoUrl || null;
|
|
|
|
|
|
const payStatusMap: Record<string, { text: string; type: string }> = {
|
|
|
"UNPAID": { text: "未支付", type: "warning" },
|
|
|
@@ -149,7 +161,7 @@ export function useRefund(tableRef: Ref) {
|
|
|
|
|
|
addDialog({
|
|
|
title: `订单详情 - ${row.orderNo}`,
|
|
|
- width: "700px",
|
|
|
+ width: "780px",
|
|
|
draggable: true,
|
|
|
closeOnClickModal: false,
|
|
|
contentRenderer: () => (
|
|
|
@@ -224,6 +236,19 @@ export function useRefund(tableRef: Ref) {
|
|
|
</ElTable>
|
|
|
</>
|
|
|
)}
|
|
|
+
|
|
|
+ {videoUrl && (
|
|
|
+ <>
|
|
|
+ <div style="font-size: 15px; font-weight: 600; margin: 14px 0 10px; color: var(--el-text-color-primary);">订单视频</div>
|
|
|
+ <video
|
|
|
+ src={videoUrl}
|
|
|
+ controls
|
|
|
+ style="width:100%;max-height:400px;border-radius:8px;background:#000;"
|
|
|
+ >
|
|
|
+ 您的浏览器不支持视频播放
|
|
|
+ </video>
|
|
|
+ </>
|
|
|
+ )}
|
|
|
</div>
|
|
|
),
|
|
|
hideFooter: true
|