From 98ab89a1f5406d44cf57b37062b51e02d43d1bd3 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: Tue, 21 Oct 2025 16:45:44 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=9F=E4=B8=80=E5=88=9B=E5=BB=BA=EF=BC=9A?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=BE=93=E5=85=A5=E6=A1=86=E4=B8=8D=E5=B1=95?= =?UTF-8?q?=E7=A4=BA=E5=BF=85=E9=A1=BB=E8=BE=93=E5=85=A5=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E4=BB=A5=E5=8F=8Apcode=E4=BA=92=E6=96=A5=E6=B8=85=E9=99=A4?= =?UTF-8?q?=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../create-video/CreateInput/ConfigPanel.tsx | 13 +++---------- .../CreateInput/MobileConfigModal.tsx | 19 +++++++++++++------ .../CreateInput/VideoCreationForm.tsx | 16 ++++++++++++++-- 3 files changed, 30 insertions(+), 18 deletions(-) diff --git a/components/pages/create-video/CreateInput/ConfigPanel.tsx b/components/pages/create-video/CreateInput/ConfigPanel.tsx index ea4d917..ac2f7dc 100644 --- a/components/pages/create-video/CreateInput/ConfigPanel.tsx +++ b/components/pages/create-video/CreateInput/ConfigPanel.tsx @@ -15,7 +15,7 @@ interface ConfigPanelProps { /** Current configuration options */ configOptions: ConfigOptions; /** Handler for configuration changes */ - onConfigChange: (key: K, value: ConfigOptions[K]) => void; + onConfigChange: (key: K, value: ConfigOptions[K], exclude?: boolean) => void; /** Whether it's mobile device */ isMobile?: boolean; /** Whether it's desktop device */ @@ -100,14 +100,7 @@ export const ConfigPanel = ({ { - onConfigChange('videoDuration', key as VideoDurationValue); - if (key === '8s') { - onConfigChange('expansion_mode', false); - } else { - onConfigChange('expansion_mode', true); - } - }, + onClick: ({ key }) => onConfigChange('videoDuration', key as VideoDurationValue), className: 'bg-[#1a1a1a] border border-white/10' }} trigger={['click']} @@ -151,7 +144,7 @@ export const ConfigPanel = ({ {/* Portrait/Anime selector */} onConfigChange('pcode', v)} + onChange={(v) => onConfigChange('pcode', v, true)} /> ); diff --git a/components/pages/create-video/CreateInput/MobileConfigModal.tsx b/components/pages/create-video/CreateInput/MobileConfigModal.tsx index c6c5090..2c1645b 100644 --- a/components/pages/create-video/CreateInput/MobileConfigModal.tsx +++ b/components/pages/create-video/CreateInput/MobileConfigModal.tsx @@ -10,7 +10,7 @@ import { WandSparkles, RectangleHorizontal, RectangleVertical, Palette } from 'l import { Modal, Dropdown } from 'antd'; import { LanguageOptions, VideoDurationOptions } from './config-options'; import type { ConfigOptions, LanguageValue, VideoDurationValue } from './config-options'; -import { useEffect, useState } from 'react'; +import { useEffect, useMemo, useState } from 'react'; import { fetchSettingByCode } from '@/api/serversetting'; interface MobileConfigModalProps { @@ -21,7 +21,7 @@ interface MobileConfigModalProps { /** Current configuration options */ configOptions: ConfigOptions; /** Handler for configuration changes */ - onConfigChange: (key: K, value: ConfigOptions[K]) => void; + onConfigChange: (key: K, value: ConfigOptions[K], exclude?: boolean) => void; } /** @@ -57,6 +57,11 @@ export function MobileConfigModal({ return () => { mounted = false; }; }, []); + /** Check if currentAnime is valid in animeOptions */ + const isValidAnimeChoice = useMemo(() => { + return animeOptions.some(opt => opt.pcode === configOptions.pcode); + }, [animeOptions, configOptions.pcode]); + const isPortrait = configOptions.pcode === 'portrait'; const currentLanguage = LanguageOptions.find(opt => opt.value === configOptions.language); @@ -225,7 +230,7 @@ export function MobileConfigModal({