diff --git a/components/pages/work-flow.tsx b/components/pages/work-flow.tsx index bcc0a0d..3606522 100644 --- a/components/pages/work-flow.tsx +++ b/components/pages/work-flow.tsx @@ -5,6 +5,7 @@ import "./style/work-flow.css"; import { EditModal } from "@/components/ui/edit-modal"; import { TaskInfo } from "./work-flow/task-info"; import H5TaskInfo from "./work-flow/H5TaskInfo"; +import H5ProgressBar from "./work-flow/H5ProgressBar"; import H5MediaViewer from "./work-flow/H5MediaViewer"; import { MediaViewer } from "./work-flow/media-viewer"; import { ThumbnailGrid } from "./work-flow/thumbnail-grid"; @@ -16,12 +17,8 @@ import { SaveEditUseCase } from "@/app/service/usecase/SaveEditUseCase"; import { useSearchParams } from "next/navigation"; import SmartChatBox from "@/components/SmartChatBox/SmartChatBox"; import { Drawer, Tooltip, notification } from 'antd'; -import { showEditingNotification } from "@/components/pages/work-flow/editing-notification"; -// import { AIEditingIframeButton } from './work-flow/ai-editing-iframe'; import { exportVideoWithRetry } from '@/utils/export-service'; -import { getFirstFrame } from '@/utils/tools'; import { EditPoint as EditPointType } from './work-flow/video-edit/types'; -import { AIEditingIframeButton } from './work-flow/ai-editing-iframe'; import { useDeviceType } from '@/hooks/useDeviceType'; import { H5ProgressToastProvider, useH5ProgressToast } from '@/components/ui/h5-progress-toast'; @@ -141,16 +138,16 @@ const WorkFlow = React.memo(function WorkFlow() { const title = isMobile ? 'editing...' : 'Performing intelligent editing...'; // 显示进度提示并启动超时定时器 - emitToastShow({ title: title, progress: 0 }); + // emitToastShow({ title: title, progress: 0 }); // 启动自动推进到 90% 的进度(8分钟) if (editingProgressIntervalRef.current) clearInterval(editingProgressIntervalRef.current); editingProgressStartRef.current = Date.now(); const totalMs = 8 * 60 * 1000; - editingProgressIntervalRef.current = setInterval(() => { - const elapsed = Date.now() - editingProgressStartRef.current; - const pct = Math.min(90, Math.max(0, Math.floor((elapsed / totalMs) * 90))); - emitToastUpdate({ progress: pct }); - }, 250); + // editingProgressIntervalRef.current = setInterval(() => { + // const elapsed = Date.now() - editingProgressStartRef.current; + // const pct = Math.min(90, Math.max(0, Math.floor((elapsed / totalMs) * 90))); + // emitToastUpdate({ progress: pct }); + // }, 250); if (editingTimeoutRef.current) clearTimeout(editingTimeoutRef.current); editingTimeoutRef.current = setTimeout(() => { console.log('❌ Editing timeout - retrying...'); @@ -159,9 +156,9 @@ const WorkFlow = React.memo(function WorkFlow() { clearInterval(editingProgressIntervalRef.current); editingProgressIntervalRef.current = null; } - emitToastHide(); + // emitToastHide(); setTimeout(() => { - emitToastShow({ title: 'Retry intelligent editing...', progress: 0 }); + // emitToastShow({ title: 'Retry intelligent editing...', progress: 0 }); // 重试阶段自动推进(5分钟到 90%) if (editingProgressIntervalRef.current) clearInterval(editingProgressIntervalRef.current); editingProgressStartRef.current = Date.now(); @@ -169,7 +166,7 @@ const WorkFlow = React.memo(function WorkFlow() { editingProgressIntervalRef.current = setInterval(() => { const elapsed = Date.now() - editingProgressStartRef.current; const pct = Math.min(90, Math.max(0, Math.floor((elapsed / retryTotalMs) * 90))); - emitToastUpdate({ progress: pct }); + // emitToastUpdate({ progress: pct }); }, 250); if (editingTimeoutRef.current) clearTimeout(editingTimeoutRef.current); editingTimeoutRef.current = setTimeout(() => { @@ -183,7 +180,7 @@ const WorkFlow = React.memo(function WorkFlow() { clearInterval(editingProgressIntervalRef.current); editingProgressIntervalRef.current = null; } - emitToastHide(); + // emitToastHide(); }, 5000); }, 5 * 60 * 1000); }, 200); @@ -204,7 +201,7 @@ const WorkFlow = React.memo(function WorkFlow() { clearInterval(editingProgressIntervalRef.current); editingProgressIntervalRef.current = null; } - emitToastHide(); + // emitToastHide(); }, [emitToastHide]); // 使用自定义 hooks 管理状态 @@ -272,15 +269,15 @@ const WorkFlow = React.memo(function WorkFlow() { clearInterval(editingProgressIntervalRef.current); editingProgressIntervalRef.current = null; } - emitToastUpdate({ title: 'Editing successful', progress: 100 }); + // emitToastUpdate({ title: 'Editing successful', progress: 100 }); console.log('Editing successful'); localStorage.setItem(`isLoaded_plan_${episodeId}`, 'true'); setEditingStatus('success'); setIsEditingInProgress(false); isEditingInProgressRef.current = false; - setTimeout(() => { - emitToastHide(); - }, 3000); + // setTimeout(() => { + // emitToastHide(); + // }, 3000); } }, [taskObject.final, isHandleEdit, episodeId, emitToastHide, emitToastUpdate]); @@ -422,13 +419,22 @@ Please process this video editing request.`;
{isMobile || isTablet ? ( - + <> + + {taskObject.currentStage !== 'init' && ( + + )} + ) : ( { const { w, h } = parseAspect(aspectRatio); - return `min(calc(100vw * ${h} / ${w}), calc(100vh - 8.5rem))`; + return `min(calc(100vw * ${h} / ${w}), calc(100vh - 10.5rem))`; }, [aspectRatio]); /** 图片轮播容器高度:默认 16:9 */ const imageWrapperHeight = useMemo(() => { // return 'calc(100vw * 9 / 16)'; const { w, h } = parseAspect(aspectRatio); - return `min(calc(100vw * ${h} / ${w}), calc(100vh - 8.5rem))`; + return `min(calc(100vw * ${h} / ${w}), calc(100vh - 10.5rem))`; }, [aspectRatio]); // 计算当前阶段类型 @@ -354,7 +354,7 @@ export function H5MediaViewer({
- {/* 右侧状态区域 */} -
- - {currentLoadingText && currentLoadingText !== 'Task completed' && ( - -
- {StageIcon} -
-
- {/* 背景流光 */} - - {currentLoadingText} - - - {/* 主文字轻微律动 */} - - - - {/* 底部装饰线 */} - -
-
- )} -
-
) diff --git a/components/pages/work-flow/task-info.tsx b/components/pages/work-flow/task-info.tsx index 1e198b2..f9149e3 100644 --- a/components/pages/work-flow/task-info.tsx +++ b/components/pages/work-flow/task-info.tsx @@ -29,19 +29,19 @@ interface TaskInfoProps { const stageIconMap = { 0: { icon: Heart, - color: '#8b5cf6' + color: '#6bf5f9' }, 1: { icon: Camera, - color: '#06b6d4' + color: '#88bafb' }, 2: { icon: Film, - color: '#10b981' + color: '#a285fd' }, 3: { icon: Scissors, - color: '#f59e0b' + color: '#c73dff' } } diff --git a/components/pages/work-flow/use-workflow-data.tsx b/components/pages/work-flow/use-workflow-data.tsx index 8625c0a..2660043 100644 --- a/components/pages/work-flow/use-workflow-data.tsx +++ b/components/pages/work-flow/use-workflow-data.tsx @@ -49,7 +49,7 @@ export function useWorkflowData({ onEditPlanGenerated, editingStatus, onExportFa return () => { console.log("unmount-useWorkflowData"); // 组件卸载时隐藏H5进度提示 - emitToastHide(); + // emitToastHide(); }; }, []); // 查看缓存中 是否已经 加载过 这个项目的 剪辑计划 @@ -161,7 +161,7 @@ export function useWorkflowData({ onEditPlanGenerated, editingStatus, onExportFa return; } // 显示生成剪辑计划进度提示 - emitToastShow({ title: isMobile ? 'Preparing for editing...' : `Generating intelligent editing plan... ${retryCount ? 'Retry Time: ' + retryCount : ''}`, progress: 0 }); + // !emitToastShow({ title: isMobile ? 'Preparing for editing...' : `Generating intelligent editing plan... ${retryCount ? 'Retry Time: ' + retryCount : ''}`, progress: 0 }); // 平滑推进到 80%,后续阶段接管 const start = Date.now(); const duration = 3 * 60 * 1000; // 3分钟推进到 80% @@ -170,7 +170,7 @@ export function useWorkflowData({ onEditPlanGenerated, editingStatus, onExportFa interval = setInterval(() => { const elapsed = Date.now() - start; const pct = Math.min(80, Math.floor((elapsed / duration) * 80)); - emitToastUpdate({ progress: pct }); + // emitToastUpdate({ progress: pct }); if (pct >= 80) stop(); }, 300); // 先停止轮询 @@ -200,10 +200,8 @@ export function useWorkflowData({ onEditPlanGenerated, editingStatus, onExportFa setNeedStreamData(true); setIsGenerateEditPlan(false); - // 显示失败提示,并在稍后隐藏 - // emitToastShow({ title: isMobile ? 'Editing plan generation failed. Retrying later.' : 'Editing plan generation failed. Retrying later.', progress: 0 }); setTimeout(() => { - emitToastHide(); + // emitToastHide(); setIsLoadingGenerateEditPlan(false); }, 8000); stop(); @@ -234,14 +232,14 @@ export function useWorkflowData({ onEditPlanGenerated, editingStatus, onExportFa setCurrentLoadingText(LOADING_TEXT_MAP.toManyFailed); // 停止轮询 setNeedStreamData(false); - emitToastHide(); + // emitToastHide(); } if (editingStatus === 'error') { window.msg.error('Editing failed, Please click the scissors button to go to the intelligent editing platform.', 8000); setCurrentLoadingText(LOADING_TEXT_MAP.editingError); // 停止轮询 setNeedStreamData(false); - emitToastHide(); + // emitToastHide(); } }, [isShowError, editingStatus]); @@ -422,7 +420,7 @@ export function useWorkflowData({ onEditPlanGenerated, editingStatus, onExportFa if (analyze_video_total_count > 0 && !isAnalyzing && analyze_video_completed_count !== analyze_video_total_count) { setIsAnalyzing(true); // 显示准备剪辑计划的提示 - emitToastShow({ title: isMobile ? 'Preparing for editing...' : 'Preparing intelligent editing plan...', progress: 0 }); + // emitToastShow({ title: isMobile ? 'Preparing for editing...' : 'Preparing intelligent editing plan...', progress: 0 }); } if (analyze_video_total_count && analyze_video_completed_count === analyze_video_total_count) { @@ -435,7 +433,7 @@ export function useWorkflowData({ onEditPlanGenerated, editingStatus, onExportFa } else { setIsShowError(true); setIsAnalyzing(false); - emitToastHide(); + // emitToastHide(); } } }