diff --git a/src/features/ecommerce/EcommercePage.tsx b/src/features/ecommerce/EcommercePage.tsx index 0badc5d..36bf1b3 100644 --- a/src/features/ecommerce/EcommercePage.tsx +++ b/src/features/ecommerce/EcommercePage.tsx @@ -48,6 +48,7 @@ import EcommerceSetPanel from "./panels/EcommerceSetPanel"; import EcommerceTryOnPanel from "./panels/EcommerceTryOnPanel"; import EcommerceClonePanel from "./panels/EcommerceClonePanel"; import EcommerceCopywritingPanel from "./panels/EcommerceCopywritingPanel"; +import EcommerceOneClickVideoPanel from "./panels/EcommerceOneClickVideoPanel"; import { ecommerceOssScopes, saveUnifiedEcommerceGenerationRecord, deleteEcommerceGenerationRecord } from "./ecommerceGenerationPersistence"; import { downloadResultAsset } from "../workbench/workbenchDownload"; import { @@ -1066,7 +1067,7 @@ function ProductClonePage(_props: ProductClonePageProps = {}) { const [selectedProductSetPreview, setSelectedProductSetPreview] = useState(null); const [showHostingModal, setShowHostingModal] = useState(false); const [productImages, setProductImages] = useState([]); - const [activeQuickTool, setActiveQuickTool] = useState<"cutout" | "detail" | "watermark" | "image-edit" | "translate" | "hot" | "quick-set" | "copywriting" | null>(null); + const [activeQuickTool, setActiveQuickTool] = useState<"cutout" | "detail" | "watermark" | "image-edit" | "translate" | "hot" | "quick-set" | "copywriting" | "oneClickVideo" | null>(null); const [smartCutoutImage, setSmartCutoutImage] = useState(null); const [smartCutoutBatchImages, setSmartCutoutBatchImages] = useState([]); const [smartCutoutBackgroundColor, setSmartCutoutBackgroundColor] = useState("#ffffff"); @@ -4273,6 +4274,26 @@ function ProductClonePage(_props: ProductClonePageProps = {}) { setComposerMenu(null); }; + const openOneClickVideoPage = () => { + clearSmartCutoutTransition(); + setActiveQuickTool("oneClickVideo"); + setComposerMenu(null); + setIsCloneSettingsCollapsed(false); + setIsQuickPanelCollapsed(false); + }; + + const closeOneClickVideoPage = () => { + setActiveQuickTool(null); + setComposerMenu(null); + }; + + const handleOneClickVideoPlatformChange = (nextPlatform: string) => { + const normalizedPlatform = normalizePlatform(nextPlatform); + setPlatform(normalizedPlatform); + setRatio((current) => normalizeRatioForPlatform(normalizedPlatform, current, "video")); + setLanguage(getPlatformDefaultLanguage(normalizedPlatform, market)); + }; + const resetTask = () => { setSetImages([]); setProductSetRequirement(""); @@ -4338,6 +4359,7 @@ function ProductClonePage(_props: ProductClonePageProps = {}) { const isHotCloneTool = isCloneTool && activeQuickTool === "hot"; const isQuickSetTool = isCloneTool && activeQuickTool === "quick-set"; const isCopywritingTool = isCloneTool && activeQuickTool === "copywriting"; + const isOneClickVideoTool = isCloneTool && activeQuickTool === "oneClickVideo"; const pageLabel = isSetTool ? "商品套图" : isDetail ? "A+/详情页" : isTryOn ? "AI服饰穿戴" : activeToolMeta?.label || "商品工具"; const setPrimaryLabel = setImages.length === 0 @@ -6027,6 +6049,7 @@ function ProductClonePage(_props: ProductClonePageProps = {}) { { label: "图片翻译", tone: "translate", icon: , onClick: openImageTranslatePage }, { label: "商品套图", tone: "product", icon: , onClick: openQuickSetPage }, { label: "一键文案", tone: "copywriting", icon: , onClick: openCopywritingPage }, + { label: "一键视频", tone: "video", icon: , onClick: openOneClickVideoPage }, { label: "更多功能", tone: "more", icon: , disabled: true }, ].map((item) => ( + + ))} + + ); + + return ( +
+
+