Explorar o código

fix: 订单视频使用 activityId 查询哈哈平台而非内部 orderNo

- getOrderMedia 传 activityId,对应哈哈平台活动编号

Co-Authored-By: Claude <noreply@anthropic.com>
skyline hai 1 mes
pai
achega
8c1da66739
Modificáronse 1 ficheiros con 8 adicións e 7 borrados
  1. 8 7
      haha-admin-web/src/views/order/refund/utils/hook.tsx

+ 8 - 7
haha-admin-web/src/views/order/refund/utils/hook.tsx

@@ -137,15 +137,16 @@ export function useRefund(tableRef: Ref) {
 
   async function handleOrderDetail(row: RefundApplicationItem) {
     try {
-      // 并行获取订单详情和媒体信息
-      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;
+      // 先获取订单详情,拿到 activityId 后再拉媒体
+      const { data: order } = await getOrderById(row.orderId) as any;
       if (!order) { message("获取订单详情失败", { type: "error" }); return; }
 
+      // 用哈哈平台的 activityId 查询媒体(不能用内部 orderNo)
+      let media: any = null;
+      if (order.activityId) {
+        try { const res = await getOrderMedia({ activityId: order.activityId }); media = res.data; } catch { /* 忽略 */ }
+      }
+
       // 提取视频URL
       const videoUrl: string | null = media?.video_url || media?.videoUrl
         || (media?.main_video?.length ? media.main_video[0] : null)