From c98ab85e4b303c175111f098036f8dc00dc7a22e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8C=97=E6=9E=B3?= <7854742+wang_rumeng@user.noreply.gitee.com> Date: Mon, 7 Jul 2025 11:54:17 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E9=A6=96=E9=A1=B5=E7=B4=A0?= =?UTF-8?q?=E6=9D=90=E6=A0=B7=E5=BC=8F=E4=BD=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/pages/home-page2.tsx | 9 +++++++-- components/video-screen-layout.tsx | 7 ++++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/components/pages/home-page2.tsx b/components/pages/home-page2.tsx index b9cc1ae..2110bc5 100644 --- a/components/pages/home-page2.tsx +++ b/components/pages/home-page2.tsx @@ -107,7 +107,7 @@ export function HomePage2() { return (
-
+
{/* 工具栏-列表形式切换 */}
@@ -133,6 +133,11 @@ export function HomePage2() { className={`absolute top-[4rem] w-full transition-all duration-500 ${activeTool === "stretch" ? "opacity-100 translate-x-0" : "opacity-0 translate-x-[-100%] pointer-events-none"} `} + style={{ + height: 'calc(100% - 8rem)', + display: 'flex', + alignItems: 'center' + }} >
@@ -177,7 +182,7 @@ export function HomePage2() { )}
- {isCreating ? "Creating..." : "Create"} + {isCreating ? "Action..." : "Action"}
diff --git a/components/video-screen-layout.tsx b/components/video-screen-layout.tsx index b7a5b0c..c04016d 100644 --- a/components/video-screen-layout.tsx +++ b/components/video-screen-layout.tsx @@ -22,6 +22,10 @@ function VideoScreenLayoutComponent({ videos }: VideoScreenLayoutProps) { const containerRef = useRef(null); const videoRefs = useRef<(HTMLVideoElement | null)[]>([]); + useEffect(() => { + setCurrentIndex(videos.length > 2 ? 1 : 0); + }, [videos.length]); + // 确保视频refs数组长度与videos数组一致 useEffect(() => { videoRefs.current = videoRefs.current.slice(0, videos.length); @@ -139,7 +143,7 @@ function VideoScreenLayoutComponent({ videos }: VideoScreenLayoutProps) { }; return ( -
+
{/* 视频面板容器 */}
{ if (index === currentIndex && videoRefs.current[index]) { applyVolumeSettings(videoRefs.current[index]!);