diff --git a/src/features/ecommerce/EcommercePage.tsx b/src/features/ecommerce/EcommercePage.tsx index ee4df8a..ebb95be 100644 --- a/src/features/ecommerce/EcommercePage.tsx +++ b/src/features/ecommerce/EcommercePage.tsx @@ -2,6 +2,7 @@ AppstoreOutlined, CloudUploadOutlined, CloseOutlined, + DeleteOutlined, FileImageOutlined, FolderOpenOutlined, FrownOutlined, @@ -16,6 +17,7 @@ TableOutlined, } from "@ant-design/icons"; import { useEffect, useMemo, useRef, useState, type CSSProperties, type ChangeEvent, type DragEvent, type KeyboardEvent as ReactKeyboardEvent, type MouseEvent as ReactMouseEvent, type PointerEvent as ReactPointerEvent, type ReactNode } from "react"; +import { useTypewriter } from "../../hooks/useTypewriter"; import "../../styles/pages/ecommerce.css"; import "../../styles/pages/local-theme-parity.css"; import { ossAssets } from "../../data/ossAssets"; @@ -1253,7 +1255,7 @@ function ProductClonePage(_props: ProductClonePageProps = {}) { const [visibleComposerMenu, setVisibleComposerMenu] = useState(null); const [isComposerMenuClosing, setIsComposerMenuClosing] = useState(false); const [composerPopoverLeft, setComposerPopoverLeft] = useState(0); - const [isCommandHistoryCollapsed, setIsCommandHistoryCollapsed] = useState(false); + const [isCommandHistoryCollapsed, setIsCommandHistoryCollapsed] = useState(() => (typeof window !== "undefined" ? window.innerWidth <= 1180 : false)); const [isQuickPanelCollapsed, setIsQuickPanelCollapsed] = useState(false); const [openCloneModelSelect, setOpenCloneModelSelect] = useState(null); const [cloneModelSelectDropUp, setCloneModelSelectDropUp] = useState(false); @@ -1297,6 +1299,7 @@ function ProductClonePage(_props: ProductClonePageProps = {}) { offsetY: 0, }); const [isCommandComposerCompact, setIsCommandComposerCompact] = useState(false); + const typewriterText = useTypewriter("万物皆可AI,广告素材一键生成"); useEffect(() => { return () => { @@ -1312,6 +1315,16 @@ function ProductClonePage(_props: ProductClonePageProps = {}) { previewOffsetRef.current = previewOffset; }, [previewOffset]); + useEffect(() => { + if (typeof window === "undefined") return undefined; + const syncHistoryPanel = () => { + setIsCommandHistoryCollapsed(window.innerWidth <= 1180); + }; + syncHistoryPanel(); + window.addEventListener("resize", syncHistoryPanel); + return () => window.removeEventListener("resize", syncHistoryPanel); + }, []); + const previewTransformStyle = useMemo( () => ({ transform: `translate3d(${previewOffset.x}px, ${previewOffset.y}px, 0) scale(${previewZoom})`, @@ -4361,7 +4374,10 @@ function ProductClonePage(_props: ProductClonePageProps = {}) { if (isCommandComposerCompact) setIsCommandComposerCompact(false); }} > -

万物皆可AI,广告素材一键生成

+

+ {typewriterText} + +

- - 添加 + + 上传商品图 {productImages.length || videoOutfitVideoFile ? (
@@ -4415,7 +4431,9 @@ function ProductClonePage(_props: ProductClonePageProps = {}) { - + ))} {videoOutfitVideoFile && videoOutfitPreviewUrl ? ( @@ -4424,7 +4442,9 @@ function ProductClonePage(_props: ProductClonePageProps = {}) { - + ) : null} @@ -4468,8 +4488,8 @@ function ProductClonePage(_props: ProductClonePageProps = {}) { if (files.length) addComposerAssets(files); }} > - - 添加 + + 上传素材