diff --git a/src/features/ecommerce/EcommercePage.tsx b/src/features/ecommerce/EcommercePage.tsx index 8561020..adf2e32 100644 --- a/src/features/ecommerce/EcommercePage.tsx +++ b/src/features/ecommerce/EcommercePage.tsx @@ -51,6 +51,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 type { CloneOutputKey, ProductSetOutputKey } from "./utils/platformRules"; @@ -1885,7 +1886,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"); @@ -5019,6 +5020,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(""); @@ -5084,6 +5105,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 @@ -6587,6 +6609,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 ( +
+
+