diff --git a/components/pages/create-to-video2.tsx b/components/pages/create-to-video2.tsx index 442f46b..456cabf 100644 --- a/components/pages/create-to-video2.tsx +++ b/components/pages/create-to-video2.tsx @@ -29,7 +29,7 @@ export function CreateToVideo2() { const [isFocus, setIsFocus] = useState(false); const [selectedMode, setSelectedMode] = useState(ModeEnum.AUTOMATIC); const [selectedResolution, setSelectedResolution] = useState(ResolutionEnum.HD_720P); - const [selectedLanguage, setSelectedLanguage] = useState('en'); + const [selectedLanguage, setSelectedLanguage] = useState('english'); const [script, setInputText] = useState(''); const editorRef = useRef(null); const [runTour, setRunTour] = useState(true); @@ -136,7 +136,8 @@ export function CreateToVideo2() { user_id: String(userId), script: script, mode: selectedMode, - resolution: selectedResolution + resolution: selectedResolution, + language: selectedLanguage }; // 调用创建剧集API @@ -244,7 +245,7 @@ export function CreateToVideo2() { ), children: [ { - key: 'en', + key: 'english', label: (
English @@ -252,7 +253,7 @@ export function CreateToVideo2() { ), }, { - key: 'zh', + key: 'chinese', label: (
Chinese @@ -261,7 +262,7 @@ export function CreateToVideo2() { ), }, { - key: 'ja', + key: 'japanese', label: (
Japanese @@ -270,7 +271,7 @@ export function CreateToVideo2() { ), }, { - key: 'ko', + key: 'korean', label: (
Korean @@ -302,16 +303,11 @@ export function CreateToVideo2() { if (loadingIdea) return; setLoadingIdea(true); setTimeout(() => { - setInputText('idea'); + setInputText(ideaText); setLoadingIdea(false); }, 3000); }; - const handleStartCreating = () => { - setActiveTab('script'); - setInputText(ideaText); - } - // 处理编辑器聚焦 const handleEditorFocus = () => { setIsFocus(true); diff --git a/components/script-renderer/ScriptRenderer.tsx b/components/script-renderer/ScriptRenderer.tsx index 8c4b9c5..62ffe98 100644 --- a/components/script-renderer/ScriptRenderer.tsx +++ b/components/script-renderer/ScriptRenderer.tsx @@ -107,7 +107,12 @@ export const ScriptRenderer: React.FC = ({ data }) => { const handleThemeTagChange = (value: string[]) => { console.log('主题标签更改', value); if (value.length > 5) { - return toast.error('最多可选择5个主题标签'); + toast.error('最多可选择5个主题标签', { + duration: 3000, + position: 'top-center', + richColors: true, + }); + return; } setAddThemeTag(value); }; diff --git a/components/ui/shot-editor/ShotEditor.tsx b/components/ui/shot-editor/ShotEditor.tsx index e9ab0c0..1cddd66 100644 --- a/components/ui/shot-editor/ShotEditor.tsx +++ b/components/ui/shot-editor/ShotEditor.tsx @@ -5,6 +5,8 @@ import { motion } from "framer-motion"; import { CharacterTokenExtension } from './CharacterToken'; import { ShotTitle } from './ShotTitle'; import { ReadonlyText } from './ReadonlyText'; +import { Sparkles } from 'lucide-react'; +import { toast } from 'sonner'; const initialContent = { type: 'doc', @@ -41,6 +43,14 @@ interface ShotEditorProps { const ShotEditor = React.forwardRef<{ addSegment: () => void, onCharacterClick: (attrs: any) => void }, ShotEditorProps>(function ShotEditor({ onAddSegment, onCharacterClick }, ref) { const [segments, setSegments] = useState(initialContent.content); + const [isOptimizing, setIsOptimizing] = useState(false); + + const handleSmartPolish = () => { + setIsOptimizing(true); + setTimeout(() => { + setIsOptimizing(false); + }, 3000); + }; const editor = useEditor({ extensions: [ @@ -86,6 +96,16 @@ const ShotEditor = React.forwardRef<{ addSegment: () => void, onCharacterClick: shotCount++; } }); + + // 不能超过4个分镜 + if (shotCount >= 4) { + toast.error('不能超过4个分镜', { + duration: 3000, + position: 'top-center', + richColors: true, + }); + return; + } editor.chain().focus('end').insertContent([ { @@ -116,8 +136,21 @@ const ShotEditor = React.forwardRef<{ addSegment: () => void, onCharacterClick: } return ( -
+
+ {/* 智能润色按钮 */} + + + {isOptimizing ? "优化中..." : "智能优化"} + {/*