|
@@ -137,20 +137,38 @@ export function useRefund(tableRef: Ref) {
|
|
|
|
|
|
|
|
async function handleOrderDetail(row: RefundApplicationItem) {
|
|
async function handleOrderDetail(row: RefundApplicationItem) {
|
|
|
try {
|
|
try {
|
|
|
- // 先获取订单详情,拿到 activityId 后再拉媒体
|
|
|
|
|
|
|
+ // 先获取订单详情
|
|
|
const { data: order } = await getOrderById(row.orderId) as any;
|
|
const { data: order } = await getOrderById(row.orderId) as any;
|
|
|
if (!order) { message("获取订单详情失败", { type: "error" }); return; }
|
|
if (!order) { message("获取订单详情失败", { type: "error" }); return; }
|
|
|
|
|
|
|
|
- // 用哈哈平台的 activityId 查询媒体(不能用内部 orderNo)
|
|
|
|
|
|
|
+ // 尝试多种方式获取订单媒体(activityId > orderNo > order.videoUrl)
|
|
|
let media: any = null;
|
|
let media: any = null;
|
|
|
- if (order.activityId) {
|
|
|
|
|
- try { const res = await getOrderMedia({ activityId: order.activityId }); media = res.data; } catch { /* 忽略 */ }
|
|
|
|
|
|
|
+ const activityId = order.activityId || row.activityId || "";
|
|
|
|
|
+ const orderNo = order.orderNo || row.orderNo || "";
|
|
|
|
|
+ console.log("[退款详情] 订单信息:", { orderId: row.orderId, activityId, orderNo, hasVideoUrl: !!order.videoUrl });
|
|
|
|
|
+
|
|
|
|
|
+ // 优先用 activityId 查哈哈平台
|
|
|
|
|
+ if (activityId) {
|
|
|
|
|
+ try {
|
|
|
|
|
+ const res = await getOrderMedia({ activityId });
|
|
|
|
|
+ media = res.data;
|
|
|
|
|
+ console.log("[退款详情] 媒体查询结果(activityId):", media);
|
|
|
|
|
+ } catch (e) { console.warn("[退款详情] activityId 查媒体失败:", e); }
|
|
|
|
|
+ }
|
|
|
|
|
+ // 如果 activityId 没查到,尝试用 orderNo(哈哈平台可能用内部 orderId 也能查)
|
|
|
|
|
+ if (!media?.video_url && !media?.main_video?.length && orderNo) {
|
|
|
|
|
+ try {
|
|
|
|
|
+ const res = await getOrderMedia({ orderId: orderNo });
|
|
|
|
|
+ media = res.data;
|
|
|
|
|
+ console.log("[退款详情] 媒体查询结果(orderNo):", media);
|
|
|
|
|
+ } catch (e) { console.warn("[退款详情] orderNo 查媒体失败:", e); }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 提取视频URL
|
|
// 提取视频URL
|
|
|
const videoUrl: string | null = media?.video_url || media?.videoUrl
|
|
const videoUrl: string | null = media?.video_url || media?.videoUrl
|
|
|
|| (media?.main_video?.length ? media.main_video[0] : null)
|
|
|| (media?.main_video?.length ? media.main_video[0] : null)
|
|
|
|| order.videoUrl || null;
|
|
|| order.videoUrl || null;
|
|
|
|
|
+ console.log("[退款详情] 最终 videoUrl:", videoUrl);
|
|
|
|
|
|
|
|
const payStatusMap: Record<string, { text: string; type: string }> = {
|
|
const payStatusMap: Record<string, { text: string; type: string }> = {
|
|
|
"UNPAID": { text: "未支付", type: "warning" },
|
|
"UNPAID": { text: "未支付", type: "warning" },
|