From 1017259249c1a425b89843f4299c3e816d2a7d9e Mon Sep 17 00:00:00 2001 From: mtvpls Date: Tue, 24 Mar 2026 17:12:10 +0800 Subject: [PATCH] =?UTF-8?q?=E6=92=AD=E6=94=BE=E8=AE=B0=E5=BD=95=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E7=9B=B4=E9=93=BE=E6=92=AD=E6=94=BE=E7=9A=84=E9=93=BE?= =?UTF-8?q?=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/MobileActionSheet.tsx | 7 ++++ src/components/VideoCard.tsx | 62 +++++++++++++++++++++++++++- 2 files changed, 68 insertions(+), 1 deletion(-) diff --git a/src/components/MobileActionSheet.tsx b/src/components/MobileActionSheet.tsx index 6370dc2..2f3d3cd 100644 --- a/src/components/MobileActionSheet.tsx +++ b/src/components/MobileActionSheet.tsx @@ -21,6 +21,7 @@ interface MobileActionSheetProps { sources?: string[]; // 播放源信息 isAggregate?: boolean; // 是否为聚合内容 sourceName?: string; // 播放源名称 + directLinkUrl?: string; // 直链播放完整链接 currentEpisode?: number; // 当前集数 totalEpisodes?: number; // 总集数 origin?: 'vod' | 'live'; @@ -36,6 +37,7 @@ const MobileActionSheet: React.FC = ({ sources, isAggregate, sourceName, + directLinkUrl, currentEpisode, totalEpisodes, origin = 'vod', @@ -253,6 +255,11 @@ const MobileActionSheet: React.FC = ({ )} + {directLinkUrl && ( +

+ {directLinkUrl} +

+ )}

选择操作

diff --git a/src/components/VideoCard.tsx b/src/components/VideoCard.tsx index 2dca7f4..95ddcf7 100644 --- a/src/components/VideoCard.tsx +++ b/src/components/VideoCard.tsx @@ -21,7 +21,7 @@ import { saveFavorite, subscribeToDataUpdates, } from '@/lib/db.client'; -import { processImageUrl } from '@/lib/utils'; +import { processImageUrl, base58Decode } from '@/lib/utils'; import { useLongPress } from '@/hooks/useLongPress'; import AIChatPanel from '@/components/AIChatPanel'; @@ -172,6 +172,14 @@ const VideoCard = forwardRef(function VideoCard const actualQuery = query || ''; const actualSearchType = type; const isDirectPlaySource = actualSource === 'directplay'; + const directLinkUrl = useMemo(() => { + if (!isDirectPlaySource || !actualId) return ''; + try { + return base58Decode(actualId); + } catch { + return ''; + } + }, [isDirectPlaySource, actualId]); const displayYear = useMemo(() => { if (!actualYear) return ''; const normalized = actualYear.trim(); @@ -938,6 +946,38 @@ const VideoCard = forwardRef(function VideoCard )} + {/* 竖向模式:顶部直链地址显示 */} + {orientation === 'vertical' && isDirectPlaySource && directLinkUrl && ( +
{ + e.preventDefault(); + return false; + }} + > +
{ + e.preventDefault(); + return false; + }} + title={directLinkUrl} + > + {directLinkUrl} +
+
+ )} + {actualEpisodes && actualEpisodes > 1 && orientation === 'vertical' && (
(function VideoCard 第{currentEpisode}集 · 共{actualEpisodes}集
)} + + {/* 直链地址 */} + {isDirectPlaySource && directLinkUrl && ( +
{ + e.preventDefault(); + return false; + }} + title={directLinkUrl} + > + {directLinkUrl} +
+ )} {/* 底部渐变遮罩 - 用于进度条背景 */} @@ -1487,6 +1546,7 @@ const VideoCard = forwardRef(function VideoCard sources={isAggregate && dynamicSourceNames ? Array.from(new Set(dynamicSourceNames)) : undefined} isAggregate={isAggregate} sourceName={cmsData ? undefined : source_name} + directLinkUrl={directLinkUrl || undefined} currentEpisode={currentEpisode} totalEpisodes={actualEpisodes} origin={origin}