Skip to content

Let's use AI to Earn!

feat(日历):细节调整,1. 发布记录查看,添加图片、视频分别处理。 2. 发布API添加图片处理

gaoSir4cf69ddc5441
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 61c8e918..f58e5c33 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -4,9 +4,15 @@
<option name="autoReloadType" value="SELECTIVE" />
</component>
<component name="ChangeListManager">
- <list default="true" id="8ce961ad-7c9e-494c-bc53-9ecde4358af8" name="更改" comment="feat(日历): 删除任务、修改任务时间接入API,删除任务完成">
+ <list default="true" id="8ce961ad-7c9e-494c-bc53-9ecde4358af8" name="更改" comment="fix(发布): 默认返回快手参数">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
- <change beforePath="$PROJECT_DIR$/src/components/PublishDialog/compoents/PlatParamsSetting/index.tsx" beforeDir="false" afterPath="$PROJECT_DIR$/src/components/PublishDialog/compoents/PlatParamsSetting/index.tsx" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/src/api/plat/types/publish.types.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/api/plat/types/publish.types.ts" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/src/app/[lng]/accounts/components/CalendarTiming/CalendarTimingItem/RecordCore.tsx" beforeDir="false" afterPath="$PROJECT_DIR$/src/app/[lng]/accounts/components/CalendarTiming/CalendarTimingItem/RecordCore.tsx" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/src/app/[lng]/accounts/components/CalendarTiming/CalendarTimingItem/recordCore.module.scss" beforeDir="false" afterPath="$PROJECT_DIR$/src/app/[lng]/accounts/components/CalendarTiming/CalendarTimingItem/recordCore.module.scss" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/src/app/[lng]/accounts/components/CalendarTiming/index.tsx" beforeDir="false" afterPath="$PROJECT_DIR$/src/app/[lng]/accounts/components/CalendarTiming/index.tsx" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/src/app/config/platConfig.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/app/config/platConfig.ts" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/src/app/config/publishConfig.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/app/config/publishConfig.ts" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/src/components/PublishDialog/index.tsx" beforeDir="false" afterPath="$PROJECT_DIR$/src/components/PublishDialog/index.tsx" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -92,7 +98,7 @@
<workItem from="1752118620733" duration="566000" />
<workItem from="1752130881346" duration="11774000" />
<workItem from="1752200550278" duration="253000" />
- <workItem from="1752200816463" duration="3076000" />
+ <workItem from="1752200816463" duration="10299000" />
</task>
<task id="LOCAL-00001" summary="feat(CalendarTiming): 优化发布记录列表展示&#10;- 调整日历记录项的样式和布局&#10;- 优化 RecordCore组件,添加平台图标和时间显示&#10;- 修改 CalendarTimingItem 组件,移除不必要的 Fragment&#10;-调整 index.tsx 中的日期格式化逻辑">
<option name="closed" value="true" />
@@ -182,7 +188,15 @@
<option name="project" value="LOCAL" />
<updated>1752153478814</updated>
</task>
- <option name="localTasksCounter" value="12" />
+ <task id="LOCAL-00012" summary="fix(发布): 默认返回快手参数">
+ <option name="closed" value="true" />
+ <created>1752219562256</created>
+ <option name="number" value="00012" />
+ <option name="presentableId" value="LOCAL-00012" />
+ <option name="project" value="LOCAL" />
+ <updated>1752219562256</updated>
+ </task>
+ <option name="localTasksCounter" value="13" />
<servers />
</component>
<component name="TypeScriptGeneratedFilesManager">
@@ -213,6 +227,7 @@
<MESSAGE value="fix: 快手授权修改完成,改为任务" />
<MESSAGE value="feat: 删除不需要的文件" />
<MESSAGE value="feat(日历): 删除任务、修改任务时间接入API,删除任务完成" />
- <option name="LAST_COMMIT_MESSAGE" value="feat(日历): 删除任务、修改任务时间接入API,删除任务完成" />
+ <MESSAGE value="fix(发布): 默认返回快手参数" />
+ <option name="LAST_COMMIT_MESSAGE" value="fix(发布): 默认返回快手参数" />
</component>
</project>
\ No newline at end of file
diff --git a/src/api/plat/types/publish.types.ts b/src/api/plat/types/publish.types.ts
index c2e09348..59bdbfca 100644
--- a/src/api/plat/types/publish.types.ts
+++ b/src/api/plat/types/publish.types.ts
@@ -20,7 +20,8 @@ export interface PublishParams {
accountType: PlatType;
videoUrl?: string;
coverUrl?: string;
- imgList?: string[];
+ // 图片列表
+ imgUrlList?: string[];
// 话题
topics?: string[];
publishTime?: string;
diff --git a/src/app/[lng]/accounts/components/CalendarTiming/CalendarTimingItem/RecordCore.tsx b/src/app/[lng]/accounts/components/CalendarTiming/CalendarTimingItem/RecordCore.tsx
index 7a5f69fa..5ecbe838 100644
--- a/src/app/[lng]/accounts/components/CalendarTiming/CalendarTimingItem/RecordCore.tsx
+++ b/src/app/[lng]/accounts/components/CalendarTiming/CalendarTimingItem/RecordCore.tsx
@@ -147,7 +147,30 @@ const RecordCore = memo(
</div>
</div>
<div className="recordDetails-center-right">
- <Image src={publishRecord.coverUrl} />
+ {publishRecord.videoUrl ? (
+ <>
+ <Image
+ src={publishRecord.coverUrl}
+ preview={{
+ destroyOnHidden: true,
+ imageRender: () => (
+ <video
+ muted
+ width="80%"
+ height={500}
+ controls
+ src={publishRecord.videoUrl}
+ />
+ ),
+ toolbarRender: () => null,
+ }}
+ />
+ </>
+ ) : (
+ <Image.PreviewGroup items={publishRecord.imgUrlList}>
+ <Image src={publishRecord.coverUrl} />
+ </Image.PreviewGroup>
+ )}
</div>
</div>
<div className="recordDetails-bottom">
diff --git a/src/app/[lng]/accounts/components/CalendarTiming/CalendarTimingItem/recordCore.module.scss b/src/app/[lng]/accounts/components/CalendarTiming/CalendarTimingItem/recordCore.module.scss
index 9a37d5cc..97ebb2f7 100644
--- a/src/app/[lng]/accounts/components/CalendarTiming/CalendarTimingItem/recordCore.module.scss
+++ b/src/app/[lng]/accounts/components/CalendarTiming/CalendarTimingItem/recordCore.module.scss
@@ -25,6 +25,7 @@
width: 24px;
height: 24px;
border-radius: 4px;
+ object-fit: cover;
}
}
}
diff --git a/src/app/[lng]/accounts/components/CalendarTiming/index.tsx b/src/app/[lng]/accounts/components/CalendarTiming/index.tsx
index d117a0e6..1ba60841 100644
--- a/src/app/[lng]/accounts/components/CalendarTiming/index.tsx
+++ b/src/app/[lng]/accounts/components/CalendarTiming/index.tsx
@@ -168,7 +168,7 @@ const CalendarTiming = memo(
</h1>
<Button onClick={handleToday}>{t("today")}</Button>
</div>
- <div className="calendarTiming-toolbar-right"></div>
+ <div className="calendarTiming-toolbar-right">1</div>
</div>
<CSSTransition
in={!animating}
diff --git a/src/app/config/platConfig.ts b/src/app/config/platConfig.ts
index 54ab4e44..8e2b48d1 100644
--- a/src/app/config/platConfig.ts
+++ b/src/app/config/platConfig.ts
@@ -8,8 +8,7 @@ import facebookSvg from "@/assets/svgs/plat/facebook.svg";
// 平台类型
export enum PlatType {
- Tiktok = "douyin", // 抖音
- Xhs = "xhs", // 小红书
+ Tiktok = "tiktok", // tiktok
WxSph = "wxSph", // 微信视频号
KWAI = "KWAI", // 快手
YouTube = "youtube", // YouTube
@@ -38,13 +37,6 @@ export interface IAccountPlatInfo {
commonPubParamsConfig: {
// title限制字数,可以不填,不填表示该平台无标题参数
titleMax?: number;
- // 定时发布,可以不填,不填表示该平台无定时发布参数
- timingMax?: {
- // 同 VideoPubSetModalCommon.maxDate
- maxDate: number;
- // 同 VideoPubSetModalCommon.timeOffset
- timeOffset: number;
- };
// 话题数量限制
topicMax: number;
// 仅图文发布的限制参数
@@ -71,10 +63,6 @@ export const AccountPlatInfoMap = new Map<PlatType, IAccountPlatInfo>([
url: "https://cp.kuaishou.com/profile",
pubTypes: new Set([PubType.VIDEO]),
commonPubParamsConfig: {
- timingMax: {
- maxDate: 13,
- timeOffset: 60,
- },
topicMax: 4,
},
themeColor: "#FF4D00",
@@ -88,10 +76,6 @@ export const AccountPlatInfoMap = new Map<PlatType, IAccountPlatInfo>([
url: "https://cp.kuaishou.com/profile",
pubTypes: new Set([PubType.VIDEO]),
commonPubParamsConfig: {
- timingMax: {
- maxDate: 13,
- timeOffset: 60,
- },
topicMax: 4,
},
themeColor: "blue",
@@ -105,10 +89,6 @@ export const AccountPlatInfoMap = new Map<PlatType, IAccountPlatInfo>([
url: "https://www.youtube.com/",
pubTypes: new Set([PubType.VIDEO]),
commonPubParamsConfig: {
- timingMax: {
- maxDate: 30,
- timeOffset: 60,
- },
titleMax: 16,
topicMax: 10,
},
@@ -123,10 +103,6 @@ export const AccountPlatInfoMap = new Map<PlatType, IAccountPlatInfo>([
url: "https://x.com/",
pubTypes: new Set([PubType.VIDEO]),
commonPubParamsConfig: {
- timingMax: {
- maxDate: 30,
- timeOffset: 60,
- },
titleMax: 16,
topicMax: 10,
},
@@ -141,10 +117,6 @@ export const AccountPlatInfoMap = new Map<PlatType, IAccountPlatInfo>([
url: "https://www.tiktok.com/",
pubTypes: new Set([PubType.VIDEO]),
commonPubParamsConfig: {
- timingMax: {
- maxDate: 30,
- timeOffset: 60,
- },
titleMax: 16,
topicMax: 10,
},
@@ -159,10 +131,6 @@ export const AccountPlatInfoMap = new Map<PlatType, IAccountPlatInfo>([
url: "https://www.facebook.com/",
pubTypes: new Set([PubType.VIDEO]),
commonPubParamsConfig: {
- timingMax: {
- maxDate: 30,
- timeOffset: 60,
- },
titleMax: 16,
topicMax: 10,
},
diff --git a/src/app/config/publishConfig.ts b/src/app/config/publishConfig.ts
index 5b46a5fb..55d34c7a 100644
--- a/src/app/config/publishConfig.ts
+++ b/src/app/config/publishConfig.ts
@@ -1,7 +1,6 @@
// 发布类型
export enum PubType {
VIDEO = "video", // 视频
- ARTICLE = "article", // 文章
ImageText = "image-text", // 图文
}
diff --git a/src/components/PublishDialog/index.tsx b/src/components/PublishDialog/index.tsx
index b5a8b3cc..e550a9c0 100644
--- a/src/components/PublishDialog/index.tsx
+++ b/src/components/PublishDialog/index.tsx
@@ -141,13 +141,17 @@ const PublishDialog = memo(
const res = await apiCreatePublish({
topics: [],
flowId: item.account.uid,
- type: PubType.VIDEO,
- title: "",
+ type: item.params.video?.cover.ossUrl
+ ? PubType.VIDEO
+ : PubType.ImageText,
+ title: "测试视频标题",
desc: item.params.des,
accountId: item.account.account,
accountType: item.account.type,
videoUrl: item.params.video?.ossUrl,
- coverUrl: item.params.video?.cover.ossUrl,
+ coverUrl:
+ item.params.video?.cover.ossUrl || item.params.images![0].ossUrl!,
+ imgUrlList: item.params.images?.map((v) => v.ossUrl!),
publishTime,
option: {
isAutoPublish: true,