From f8722ba8eded95148d7ff0472c6e690cc43d906e 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: Sat, 19 Jul 2025 23:12:06 +0800
Subject: [PATCH] =?UTF-8?q?=E5=BE=AE=E8=B0=83=E6=A0=B7=E5=BC=8F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
components/pages/login.tsx | 9 +-
components/pages/work-flow/media-viewer.tsx | 10 +-
components/pages/work-flow/task-info.tsx | 328 ++++++++----------
.../pages/work-flow/use-workflow-data.tsx | 23 +-
test/movie.http | 6 +-
5 files changed, 181 insertions(+), 195 deletions(-)
diff --git a/components/pages/login.tsx b/components/pages/login.tsx
index 1fa68c8..2d806d4 100644
--- a/components/pages/login.tsx
+++ b/components/pages/login.tsx
@@ -7,6 +7,7 @@ import { useRouter, useSearchParams } from 'next/navigation';
import React from 'react';
import Link from 'next/link';
import { signInWithGoogle, loginUser } from '@/lib/auth';
+import { GradientText } from '@/components/ui/gradient-text';
export default function Login() {
const [isLoaded, setIsLoaded] = useState(false);
@@ -73,7 +74,13 @@ export default function Login() {
{/* logo Movie Flow */}
- MovieFlow
+
+
+
diff --git a/components/pages/work-flow/media-viewer.tsx b/components/pages/work-flow/media-viewer.tsx
index 058b36d..df18832 100644
--- a/components/pages/work-flow/media-viewer.tsx
+++ b/components/pages/work-flow/media-viewer.tsx
@@ -497,7 +497,7 @@ export function MediaViewer({
@@ -336,13 +323,15 @@ export function TaskInfo({
) : (
setIsScriptModalOpen(true)}
>
setIsStageIconsExpanded(true)}
+ onMouseLeave={() => setIsStageIconsExpanded(false)}
>
-
-
-
+
([]);
const [taskVideos, setTaskVideos] = useState([]);
const [sketchCount, setSketchCount] = useState(0);
+ const [videoCount, setVideoCount] = useState(0);
const [isLoading, setIsLoading] = useState(true);
const [currentStep, setCurrentStep] = useState('0');
const [currentSketchIndex, setCurrentSketchIndex] = useState(0);
@@ -107,6 +108,16 @@ export function useWorkflowData() {
handleAutoPlay();
}, [sketchCount, totalSketchCount, isGeneratingSketch, autoPlaySketch]);
+ useEffect(() => {
+ console.log('sketchCount 已更新:', sketchCount);
+ setCurrentSketchIndex(sketchCount - 1);
+ }, [sketchCount]);
+
+ useEffect(() => {
+ console.log('videoCount 已更新:', videoCount);
+ setCurrentSketchIndex(videoCount - 1);
+ }, [videoCount]);
+
// 添加手动播放控制
const handleManualPlay = useCallback(async () => {
if (!isGeneratingSketch && taskSketch.length > 0) {
@@ -149,7 +160,6 @@ export function useWorkflowData() {
setTaskSketch(sketchList);
setSketchCount(sketchList.length);
setIsGeneratingSketch(true);
- setCurrentSketchIndex(sketchList.length - 1);
loadingText = LOADING_TEXT_MAP.sketch(sketchList.length, task.task_result.total_count);
}
if (task.task_status === 'COMPLETED') {
@@ -201,7 +211,6 @@ export function useWorkflowData() {
setTaskShotSketch(sketchList);
setSketchCount(sketchList.length);
setIsGeneratingSketch(true);
- setCurrentSketchIndex(sketchList.length - 1);
loadingText = LOADING_TEXT_MAP.shotSketch(sketchList.length, task.task_result.total_count);
}
if (task.task_status === 'COMPLETED') {
@@ -220,20 +229,20 @@ export function useWorkflowData() {
if (task.task_name === 'generate_videos' && task.task_result) {
const realTaskResultData = task.task_result.data.filter((item: any) => item.urls && item.urls.length > 0);
if (realTaskResultData.length >= 0 && taskVideos.length !== realTaskResultData.length) {
- console.log('----------正在生成视频中-发生变化才触发');
+ console.log('----------正在生成视频中-发生变化才触发', taskVideos.length);
// 正在生成视频中 替换视频数据
const videoList = [];
for (const video of realTaskResultData) {
// 每一项 video 有多个视频 先默认取第一个
videoList.push({
- url: video.urls[0],
+ url: video.urls && video.urls.length > 0 ? video.urls.find((url: string) => url) : null,
script: video.description,
audio: null,
});
}
setTaskVideos(videoList);
+ setVideoCount(videoList.length);
setIsGeneratingVideo(true);
- setCurrentSketchIndex(videoList.length - 1);
loadingText = LOADING_TEXT_MAP.video(videoList.length, task.task_result.total_count);
}
if (task.task_status === 'COMPLETED') {
@@ -370,7 +379,6 @@ export function useWorkflowData() {
// 设置为最后一个草图
if (data.sketch.total_count > data.sketch.data.length) {
setIsGeneratingSketch(true);
- setCurrentSketchIndex(data.sketch.data.length - 1);
loadingText = LOADING_TEXT_MAP.sketch(data.sketch.data.length, data.sketch.total_count);
} else {
finalStep = '2';
@@ -415,7 +423,6 @@ export function useWorkflowData() {
// 设置为最后一个草图
if (data.shot_sketch.total_count > data.shot_sketch.data.length) {
setIsGeneratingSketch(true);
- setCurrentSketchIndex(data.shot_sketch.data.length - 1);
loadingText = LOADING_TEXT_MAP.shotSketch(data.shot_sketch.data.length, data.shot_sketch.total_count);
} else {
finalStep = '3';
@@ -439,10 +446,10 @@ export function useWorkflowData() {
});
}
setTaskVideos(videoList);
+ setVideoCount(videoList.length);
// 如果在视频步骤,设置为最后一个视频
if (data.video.total_count > realDataVideoData.length) {
setIsGeneratingVideo(true);
- setCurrentSketchIndex(realDataVideoData.length - 1);
loadingText = LOADING_TEXT_MAP.video(realDataVideoData.length, data.video.total_count);
} else {
finalStep = '4';
diff --git a/test/movie.http b/test/movie.http
index 91c3a14..60a1ad1 100644
--- a/test/movie.http
+++ b/test/movie.http
@@ -1,4 +1,4 @@
-@host = https://77.smartvideo.py.qikongjian.com
+@host = https://pre.movieflow.api.huiying.video
### Create a movie project
POST http://localhost:8000/movie/create_movie_project
Content-Type: application/json
@@ -19,7 +19,7 @@ Content-Type: application/json
}
### Get movie project detail
-POST https://77.smartvideo.py.qikongjian.com/movie/get_movie_project_detail
+POST https://pre.movieflow.api.huiying.video/movie/get_movie_project_detail
Content-Type: application/json
{
@@ -43,7 +43,7 @@ Content-Type: application/json
}
### Get status
-POST https://77.smartvideo.py.qikongjian.com/movie/get_status
+POST https://pre.movieflow.api.huiying.video/movie/get_status
Content-Type: application/json
{