Let's use AI to Earn!
TypeScript auto-publishdouyindouyin-apielectron-appelectron-reactkuaishoukwaipublishedshipinhaotoolxiaohongshu
feat: 【发布弹框】预览样式调整
gaoSir20f3206b36fe
diff --git a/.idea/workspace.xml b/.idea/workspace.xmlindex 7fa50d54..f7d16092 100644--- a/.idea/workspace.xml+++ b/.idea/workspace.xml@@ -4,14 +4,12 @@<option name="autoReloadType" value="SELECTIVE" /></component><component name="ChangeListManager">- <list default="true" id="90ed3383-49aa-4e32-95a2-9f070c0da49b" name="更改" comment="feat: 1. 【发布作品弹框】填写发布参数时未选中的账户参数自动填写。 2. 【发布作品弹框】切换步骤0->1保持展开状态">+ <list default="true" id="90ed3383-49aa-4e32-95a2-9f070c0da49b" name="更改" comment="feat: 【发布作品】图片和视频预览完成"><change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />- <change beforePath="$PROJECT_DIR$/package-lock.json" beforeDir="false" afterPath="$PROJECT_DIR$/package-lock.json" afterDir="false" />- <change beforePath="$PROJECT_DIR$/package.json" beforeDir="false" afterPath="$PROJECT_DIR$/package.json" afterDir="false" />+ <change beforePath="$PROJECT_DIR$/src/components/PublishDialog/compoents/PubParmasTextarea/index.tsx" beforeDir="false" afterPath="$PROJECT_DIR$/src/components/PublishDialog/compoents/PubParmasTextarea/index.tsx" afterDir="false" />+ <change beforePath="$PROJECT_DIR$/src/components/PublishDialog/compoents/PubParmasTextarea/pubCommonComps.module.scss" beforeDir="false" afterPath="$PROJECT_DIR$/src/components/PublishDialog/compoents/PubParmasTextarea/pubCommonComps.module.scss" afterDir="false" /><change beforePath="$PROJECT_DIR$/src/components/PublishDialog/compoents/PublishDialogPreview.tsx" beforeDir="false" afterPath="$PROJECT_DIR$/src/components/PublishDialog/compoents/PublishDialogPreview.tsx" afterDir="false" />- <change beforePath="$PROJECT_DIR$/src/components/PublishDialog/index.tsx" beforeDir="false" afterPath="$PROJECT_DIR$/src/components/PublishDialog/index.tsx" afterDir="false" /><change beforePath="$PROJECT_DIR$/src/components/PublishDialog/publishDialog.module.scss" beforeDir="false" afterPath="$PROJECT_DIR$/src/components/PublishDialog/publishDialog.module.scss" afterDir="false" />- <change beforePath="$PROJECT_DIR$/src/components/PublishDialog/usePublishDialog.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/components/PublishDialog/usePublishDialog.ts" afterDir="false" /></list><option name="SHOW_DIALOG" value="false" /><option name="HIGHLIGHT_CONFLICTS" value="true" />@@ -112,7 +110,7 @@<workItem from="1750989950480" duration="7000" /><workItem from="1750989966702" duration="688000" /><workItem from="1751010085244" duration="6172000" />- <workItem from="1751023561603" duration="2850000" />+ <workItem from="1751023561603" duration="4045000" /></task><task id="LOCAL-00001" summary="feat: 日历完善"><option name="closed" value="true" />@@ -242,7 +240,15 @@<option name="project" value="LOCAL" /><updated>1751018123318</updated></task>- <option name="localTasksCounter" value="17" />+ <task id="LOCAL-00017" summary="feat: 【发布作品】图片和视频预览完成">+ <option name="closed" value="true" />+ <created>1751026503209</created>+ <option name="number" value="00017" />+ <option name="presentableId" value="LOCAL-00017" />+ <option name="project" value="LOCAL" />+ <updated>1751026503209</updated>+ </task>+ <option name="localTasksCounter" value="18" /><servers /></component><component name="TypeScriptGeneratedFilesManager">@@ -278,6 +284,7 @@<MESSAGE value="feat: 【发布弹框】参数校验完成" /><MESSAGE value="fix: 【PubParmasTextarea.tsx】修复了初始化后会执行onChange的bug" /><MESSAGE value="feat: 1. 【发布作品弹框】填写发布参数时未选中的账户参数自动填写。 2. 【发布作品弹框】切换步骤0->1保持展开状态" />- <option name="LAST_COMMIT_MESSAGE" value="feat: 1. 【发布作品弹框】填写发布参数时未选中的账户参数自动填写。 2. 【发布作品弹框】切换步骤0->1保持展开状态" />+ <MESSAGE value="feat: 【发布作品】图片和视频预览完成" />+ <option name="LAST_COMMIT_MESSAGE" value="feat: 【发布作品】图片和视频预览完成" /></component></project>\ No newline at end of filediff --git a/src/components/PublishDialog/compoents/PubParmasTextarea/index.tsx b/src/components/PublishDialog/compoents/PubParmasTextarea/index.tsxindex 724ff7b2..26a0f116 100644--- a/src/components/PublishDialog/compoents/PubParmasTextarea/index.tsx+++ b/src/components/PublishDialog/compoents/PubParmasTextarea/index.tsx@@ -245,10 +245,18 @@ const PubParmasTextarea = memo(style={{ width: "100%", maxHeight: "600px" }}/>) : (- <Image- src={(previewData as IImgFile).imgUrl}- style={{ width: "100%" }}- />+ <div+ style={{+ display: "flex",+ justifyContent: "center",+ width: "100%",+ }}+ >+ <Image+ src={(previewData as IImgFile).imgUrl}+ style={{ width: "100%", height: "400px" }}+ />+ </div>)}</>)}diff --git a/src/components/PublishDialog/compoents/PubParmasTextarea/pubCommonComps.module.scss b/src/components/PublishDialog/compoents/PubParmasTextarea/pubCommonComps.module.scssindex 8bfc55de..c8d5deee 100644--- a/src/components/PublishDialog/compoents/PubParmasTextarea/pubCommonComps.module.scss+++ b/src/components/PublishDialog/compoents/PubParmasTextarea/pubCommonComps.module.scss@@ -1,3 +1,4 @@+$boxHegiht: 110px;.pubParmasTextarea {border: 1px solid var(--grayColor4);border-radius: 6px;@@ -17,8 +18,8 @@.ant-upload-wrapper {display: block;- width: 100px;- height: 100px;+ width: 100%;+ height: $boxHegiht;p {font-size: 12px;}@@ -29,12 +30,12 @@.pubParmasTextarea-uploads {display: grid;- grid-template-columns: repeat(6, 1fr);+ grid-template-columns: repeat(5, 1fr);flex-wrap: wrap;- gap: 15px;+ gap: 10px;&-item {//width: 98px;- height: 100px;+ height: $boxHegiht;border: 1px solid var(--grayColor4);border-radius: 4px;box-sizing: border-box;diff --git a/src/components/PublishDialog/compoents/PublishDialogPreview.tsx b/src/components/PublishDialog/compoents/PublishDialogPreview.tsxindex 09d31d91..d0b9491c 100644--- a/src/components/PublishDialog/compoents/PublishDialogPreview.tsx+++ b/src/components/PublishDialog/compoents/PublishDialogPreview.tsx@@ -36,8 +36,9 @@ const PublishDialogPreview = memo(<div className={styles.publishDialogPreview}><div className="publishDialogPreview-wrapper"><div className="publishDialogPreview-title">预览</div>- {expandedPubItem?.params.video ||- expandedPubItem?.params.images?.length !== 0 ? (+ {expandedPubItem &&+ (expandedPubItem?.params.video ||+ expandedPubItem?.params.images?.length !== 0) ? (<div className="publishDialogPreview-preview">{expandedPubItem?.params.video ? (<div className="publishDialogPreview-preview-video">@@ -66,7 +67,7 @@ const PublishDialogPreview = memo(>{expandedPubItem!.params.images!.map((image, index) => (- <SwiperSlide key={index}>+ <SwiperSlide key={index + image.imgUrl}><imgsrc={image.imgUrl}alt={`Image ${index + 1}`}diff --git a/src/components/PublishDialog/publishDialog.module.scss b/src/components/PublishDialog/publishDialog.module.scssindex 6ee2caf4..5740e84c 100644--- a/src/components/PublishDialog/publishDialog.module.scss+++ b/src/components/PublishDialog/publishDialog.module.scss@@ -136,14 +136,22 @@ $assistantWidth: 330px;background: #fff;height: 100%;box-sizing: border-box;- padding: 30px 10px 0;+ padding: 0 10px 0;display: flex;align-items: center;.swiper-pagination-bullet {background: var(--colorPrimary5);}+ .swiper {+ height: 100%;+ }+ .swiper-slide {+ height: 100%;+ }img {width: 100%;+ height: 100%;+ object-fit: contain;}}&-video {