Let's use AI to Earn!
TypeScript auto-publishdouyindouyin-apielectron-appelectron-reactkuaishoukwaipublishedshipinhaotoolxiaohongshu
feat: 账户选择开发中,图文发布静态页80%。
gaoSir2cd4e18decf5
diff --git a/src/views/publish/children/imagePage/components/ImageRightSetting/components/ImageParamsSet.tsx b/src/views/publish/children/imagePage/components/ImageRightSetting/components/ImageParamsSet.tsxindex 78dcf7a2..aa687f2a 100644--- a/src/views/publish/children/imagePage/components/ImageRightSetting/components/ImageParamsSet.tsx+++ b/src/views/publish/children/imagePage/components/ImageRightSetting/components/ImageParamsSet.tsx@@ -6,6 +6,7 @@ import { AccountType } from '../../../../../../../../commont/AccountEnum';import { IImageAccountItem } from '../../../imagePage.type';import { AccountPlatInfoMap } from '../../../../../../account/comment';import { CloseOutlined } from '@ant-design/icons';+import ParamsSettingItem from './ParamsSettingItem';export interface IImageParamsSetRef {}@@ -58,7 +59,7 @@ const ImageParamsSet = memo(<div className="imageParamsSet_plats-item-img"><img src={platInfo.icon} /><div- className="imageParamsSet_plats-item-close"+ className={`${styles.closeIcon} imageParamsSet_plats-item-close`}onClick={(e) => {e.stopPropagation();console.log('close');@@ -72,12 +73,11 @@ const ImageParamsSet = memo();})}</div>- <div className="imageParamsSet_paramsSet">- <h2>- <span>发布账号</span>- <i>*</i>- </h2>- </div>+ {activePlat && (+ <ParamsSettingItem+ imageAccountList={platAccountImagesMap.get(activePlat)!}+ />+ )}</div>);},diff --git a/src/views/publish/children/imagePage/components/ImageRightSetting/components/ImageParamsSet.type.ts b/src/views/publish/children/imagePage/components/ImageRightSetting/components/ImageParamsSet.type.tsnew file mode 100644index 00000000..8c4f0393--- /dev/null+++ b/src/views/publish/children/imagePage/components/ImageRightSetting/components/ImageParamsSet.type.ts@@ -0,0 +1 @@+export interface ImageRightSettingChildProps {}diff --git a/src/views/publish/children/imagePage/components/ImageRightSetting/components/ImageRightSettingCommon.tsx b/src/views/publish/children/imagePage/components/ImageRightSetting/components/ImageRightSettingCommon.tsxnew file mode 100644index 00000000..e69de29bdiff --git a/src/views/publish/children/imagePage/components/ImageRightSetting/components/ParamsSettingItem.tsx b/src/views/publish/children/imagePage/components/ImageRightSetting/components/ParamsSettingItem.tsxnew file mode 100644index 00000000..5cd8f338--- /dev/null+++ b/src/views/publish/children/imagePage/components/ImageRightSetting/components/ParamsSettingItem.tsx@@ -0,0 +1,72 @@+import { ForwardedRef, forwardRef, memo, useEffect } from 'react';+import { IImageAccountItem } from '../../../imagePage.type';+import { AccountType } from '../../../../../../../../commont/AccountEnum';+import ImageParamsSet_Douyin from './children/ImageParamsSet_Douyin';+import ImageParamsSet_XHS from './children/ImageParamsSet_XHS';+import styles from './imageParamsSet.module.scss';+import { Avatar, Tooltip } from 'antd';+import { CloseOutlined } from '@ant-design/icons';++export interface IParamsSettingItemRef {}++export interface IParamsSettingItemProps {+ imageAccountList: IImageAccountItem[];+}++const ParamsSettingItem = memo(+ forwardRef(+ (+ { imageAccountList }: IParamsSettingItemProps,+ ref: ForwardedRef<IParamsSettingItemRef>,+ ) => {+ useEffect(() => {+ console.log(imageAccountList);+ }, [imageAccountList]);++ return (+ <div className={styles.paramsSettingItem}>+ <h2>+ <span>发布账号</span>+ <i>*</i>+ </h2>+ <div className="paramsSettingItem-users">+ {imageAccountList.map((v) => {+ return (+ <div+ className="paramsSettingItem-users-item"+ key={v.account.id}+ >+ <div className="paramsSettingItem-users-item-img">+ <div+ className={`paramsSettingItem-users-item-close ${styles.closeIcon}`}+ >+ <CloseOutlined />+ </div>+ <Avatar src={v.account.avatar} />+ </div>+ <Tooltip title={v.account.nickname}>+ <p className="paramsSettingItem-users-item-name">+ {v.account.nickname}+ </p>+ </Tooltip>+ </div>+ );+ })}+ </div>++ {(() => {+ switch (imageAccountList[0].account.type) {+ case AccountType.Douyin:+ return <ImageParamsSet_Douyin />;+ case AccountType.Xhs:+ return <ImageParamsSet_XHS />;+ }+ })()}+ </div>+ );+ },+ ),+);+ParamsSettingItem.displayName = 'ParamsSettingItem';++export default ParamsSettingItem;diff --git a/src/views/publish/children/imagePage/components/ImageRightSetting/components/children/ImageParamsSet_Douyin.tsx b/src/views/publish/children/imagePage/components/ImageRightSetting/components/children/ImageParamsSet_Douyin.tsxnew file mode 100644index 00000000..6d15e329--- /dev/null+++ b/src/views/publish/children/imagePage/components/ImageRightSetting/components/children/ImageParamsSet_Douyin.tsx@@ -0,0 +1,11 @@+import { forwardRef, memo } from 'react';+import { ImageRightSettingChildProps } from '../ImageParamsSet.type';++const ImageParamsSet_Douyin = memo(+ forwardRef(({}: ImageRightSettingChildProps) => {+ return <></>;+ }),+);+ImageParamsSet_Douyin.displayName = 'ImageParamsSet_Douyin';++export default ImageParamsSet_Douyin;diff --git a/src/views/publish/children/imagePage/components/ImageRightSetting/components/children/ImageParamsSet_XHS.tsx b/src/views/publish/children/imagePage/components/ImageRightSetting/components/children/ImageParamsSet_XHS.tsxnew file mode 100644index 00000000..e5600ff6--- /dev/null+++ b/src/views/publish/children/imagePage/components/ImageRightSetting/components/children/ImageParamsSet_XHS.tsx@@ -0,0 +1,11 @@+import { forwardRef, memo } from 'react';+import { ImageRightSettingChildProps } from '../ImageParamsSet.type';++const ImageParamsSet_XHS = memo(+ forwardRef(({}: ImageRightSettingChildProps) => {+ return <></>;+ }),+);+ImageParamsSet_XHS.displayName = 'ImageParamsSet_XHS';++export default ImageParamsSet_XHS;diff --git a/src/views/publish/children/imagePage/components/ImageRightSetting/components/imageParamsSet.module.scss b/src/views/publish/children/imagePage/components/ImageRightSetting/components/imageParamsSet.module.scssindex 2b3f444c..11c743ed 100644--- a/src/views/publish/children/imagePage/components/ImageRightSetting/components/imageParamsSet.module.scss+++ b/src/views/publish/children/imagePage/components/ImageRightSetting/components/imageParamsSet.module.scss@@ -40,18 +40,7 @@}}&-close {- position: absolute;- background: red;- color: #fff;- border-radius: 50%;- justify-content: center;- align-items: center;- width: 14px;- height: 14px;- font-size: 9px;- top: -7px;- right: -7px;- display: none;+}&--active {@@ -60,4 +49,51 @@}}}+}++.closeIcon {+ position: absolute;+ background: red;+ color: #fff;+ border-radius: 50%;+ justify-content: center;+ align-items: center;+ width: 14px;+ height: 14px;+ font-size: 9px;+ top: -7px;+ right: -7px;+ display: none;+}++.paramsSettingItem {+ :global {+ .paramsSettingItem-users {+ display: flex;+ &-item {+ width: 60px;+ font-size: var(--fs-sm);+ cursor: pointer;+ margin-right: 10px;+ &:hover {+ .paramsSettingItem-users-item-close {+ display: flex !important;+ }+ }+ &-img {+ border: 1px solid red;+ display: inline-block;+ position: relative;+ }+ &-close {+ }+ &-name {+ margin-top: 4px;+ overflow: hidden;+ white-space: nowrap;+ text-overflow: ellipsis;+ }+ }+ }+ }}\ No newline at end of filediff --git a/src/views/publish/children/videoPage/components/VideoPubSetModal/VideoPubSetModal.tsx b/src/views/publish/children/videoPage/components/VideoPubSetModal/VideoPubSetModal.tsxindex f723c4cc..020cc6ca 100644--- a/src/views/publish/children/videoPage/components/VideoPubSetModal/VideoPubSetModal.tsx+++ b/src/views/publish/children/videoPage/components/VideoPubSetModal/VideoPubSetModal.tsx@@ -46,6 +46,10 @@ import VideoPubSetModalVideo, {IVideoPubSetModalVideoRef,} from '@/views/publish/children/videoPage/components/VideoPubSetModal/components/VideoPubSetModalVideo';import { usePubStroe } from '../../../../../../store/pubStroe';+import {+ IVideoPubSetModalChildProps,+ IVideoPubSetModalChildRef,+} from './videoPubSetModal.type';export interface IVideoPubSetModalRef {}@@ -276,6 +280,38 @@ const VideoPubSetModal = memo(videoPubSetModalVideoRef.current!.pause();};+ const PubSetModalChild = () => {+ if (!currChooseAccount) return <></>;+ let Component: React.MemoExoticComponent<+ React.ForwardRefExoticComponent<+ IVideoPubSetModalChildProps &+ React.RefAttributes<IVideoPubSetModalChildRef>+ >+ >;+ switch (currChooseAccount?.account?.type) {+ // 快手+ case AccountType.KWAI:+ Component = VideoPubSetModal_KWAI;+ break;+ // 抖音+ case AccountType.Douyin:+ Component = VideoPubSetModal_DouYin;+ break;+ // 小红书+ case AccountType.Xhs:+ Component = VideoPubSetModal_XSH;+ break;+ // 微信视频号+ case AccountType.WxSph:+ Component = VideoPubSetModal_WxSph;+ break;+ default:+ Component = VideoPubSetModal_KWAI;+ break;+ }+ return <Component currChooseAccount={currChooseAccount} />;+ };+return (<>{contextHolder}@@ -425,45 +461,7 @@ const VideoPubSetModal = memo(}}/>- {currChooseAccount &&- (() => {- switch (currChooseAccount?.account?.type) {- // 快手- case AccountType.KWAI:- return (- <VideoPubSetModal_KWAI- currChooseAccount={currChooseAccount}- />- );- // 抖音- case AccountType.Douyin:- return (- <VideoPubSetModal_DouYin- currChooseAccount={currChooseAccount}- />- );- // 小红书- case AccountType.Xhs:- return (- <VideoPubSetModal_XSH- currChooseAccount={currChooseAccount}- />- );- // 微信视频号- case AccountType.WxSph:- return (- <VideoPubSetModal_WxSph- currChooseAccount={currChooseAccount}- />- );- default:- return (- <VideoPubSetModal_DouYin- currChooseAccount={currChooseAccount}- />- );- }- })()}+ {currChooseAccount && <PubSetModalChild />}</div><div className="videoPubSetModal_con-right">{currChooseAccount && (diff --git a/src/views/publish/children/videoPage/components/VideoPubSetModal/children/VideoPubSetModal_DouYin.tsx b/src/views/publish/children/videoPage/components/VideoPubSetModal/children/VideoPubSetModal_DouYin.tsxindex 3b9e7254..39aa630b 100644--- a/src/views/publish/children/videoPage/components/VideoPubSetModal/children/VideoPubSetModal_DouYin.tsx+++ b/src/views/publish/children/videoPage/components/VideoPubSetModal/children/VideoPubSetModal_DouYin.tsx@@ -82,7 +82,7 @@ const ActivitySelect = ({ currChooseAccount }: IVideoPubSetModalChildProps) => {);};-const VideoPubSetModal_KWAI = memo(+const VideoPubSetModal_DouYin = memo(forwardRef((props: IVideoPubSetModalChildProps,@@ -210,6 +210,6 @@ const VideoPubSetModal_KWAI = memo(},),);-VideoPubSetModal_KWAI.displayName = 'VideoPubSetModal_KWAI';+VideoPubSetModal_DouYin.displayName = 'VideoPubSetModal_DouYin';-export default VideoPubSetModal_KWAI;+export default VideoPubSetModal_DouYin;diff --git a/src/views/publish/children/videoPage/components/VideoPubSetModal/children/VideoPubSetModal_WxSph.tsx b/src/views/publish/children/videoPage/components/VideoPubSetModal/children/VideoPubSetModal_WxSph.tsxindex ba330a92..45a80de0 100644--- a/src/views/publish/children/videoPage/components/VideoPubSetModal/children/VideoPubSetModal_WxSph.tsx+++ b/src/views/publish/children/videoPage/components/VideoPubSetModal/children/VideoPubSetModal_WxSph.tsx@@ -81,7 +81,7 @@ const WXSphActivity = ({ currChooseAccount }: IVideoPubSetModalChildProps) => {);};-const VideoPubSetModal_KWAI = memo(+const VideoPubSetModal_WxSph = memo(forwardRef(({ currChooseAccount }: IVideoPubSetModalChildProps,@@ -200,6 +200,6 @@ const VideoPubSetModal_KWAI = memo(},),);-VideoPubSetModal_KWAI.displayName = 'VideoPubSetModal_KWAI';+VideoPubSetModal_WxSph.displayName = 'VideoPubSetModal_WxSph';-export default VideoPubSetModal_KWAI;+export default VideoPubSetModal_WxSph;diff --git a/src/views/publish/children/videoPage/components/VideoPubSetModal/children/VideoPubSetModal_XSH.tsx b/src/views/publish/children/videoPage/components/VideoPubSetModal/children/VideoPubSetModal_XSH.tsxindex 783b235a..1faa22a6 100644--- a/src/views/publish/children/videoPage/components/VideoPubSetModal/children/VideoPubSetModal_XSH.tsx+++ b/src/views/publish/children/videoPage/components/VideoPubSetModal/children/VideoPubSetModal_XSH.tsx@@ -16,7 +16,7 @@ import {} from '@/views/publish/children/videoPage/components/VideoPubSetModal/components/VideoPubSetModalCommon';import UserSelect from '../components/UserSelect';-const VideoPubSetModal_KWAI = memo(+const VideoPubSetModal_WxSph = memo(forwardRef(({ currChooseAccount }: IVideoPubSetModalChildProps,@@ -81,6 +81,6 @@ const VideoPubSetModal_KWAI = memo(},),);-VideoPubSetModal_KWAI.displayName = 'VideoPubSetModal_KWAI';+VideoPubSetModal_WxSph.displayName = 'VideoPubSetModal_WxSph';-export default VideoPubSetModal_KWAI;+export default VideoPubSetModal_WxSph;