Skip to content

Let's use AI to Earn!

feat: 发布记录展示添加状态展示

gaoSire989673a01f6
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 48061bc9..6504afe3 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -4,12 +4,11 @@
<option name="autoReloadType" value="SELECTIVE" />
</component>
<component name="ChangeListManager">
- <list default="true" id="8ce961ad-7c9e-494c-bc53-9ecde4358af8" name="更改" comment="feat(CalendarTiming): 优化发布记录列表展示&#10;- 调整日历记录项的样式和布局&#10;- 优化 RecordCore组件,添加平台图标和时间显示&#10;- 调整 index.tsx 中的日期格式化逻辑">
- <change beforePath="$PROJECT_DIR$/.idea/material_theme_project_new.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/material_theme_project_new.xml" afterDir="false" />
+ <list default="true" id="8ce961ad-7c9e-494c-bc53-9ecde4358af8" name="更改" comment="fix: platInfo添加一些非空判断">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
- <change beforePath="$PROJECT_DIR$/src/app/[lng]/accounts/components/AccountSidebar/AccountSidebar.tsx" beforeDir="false" afterPath="$PROJECT_DIR$/src/app/[lng]/accounts/components/AccountSidebar/AccountSidebar.tsx" afterDir="false" />
- <change beforePath="$PROJECT_DIR$/src/app/[lng]/accounts/components/AccountSidebar/UserManageModal.tsx" beforeDir="false" afterPath="$PROJECT_DIR$/src/app/[lng]/accounts/components/AccountSidebar/UserManageModal.tsx" afterDir="false" />
- <change beforePath="$PROJECT_DIR$/src/components/AvatarPlat/index.tsx" beforeDir="false" afterPath="$PROJECT_DIR$/src/components/AvatarPlat/index.tsx" 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/components/PublishDialog/compoents/PublishDialogPreview.tsx" beforeDir="false" afterPath="$PROJECT_DIR$/src/components/PublishDialog/compoents/PublishDialogPreview.tsx" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -24,6 +23,9 @@
&quot;associatedIndex&quot;: 4
}</component>
<component name="ProjectId" id="2zamg25p8l4plGQi1IzdkD1GGzA" />
+ <component name="ProjectLevelVcsManager">
+ <ConfirmationsSetting value="2" id="Add" />
+ </component>
<component name="ProjectViewState">
<option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" />
@@ -54,7 +56,7 @@
"node.js.selected.package.eslint": "(autodetect)",
"node.js.selected.package.tslint": "(autodetect)",
"nodejs_package_manager_path": "npm",
- "settings.editor.selected.configurable": "project.propVCSSupport.CommitDialog",
+ "settings.editor.selected.configurable": "preferences.pluginManager",
"ts.external.directory.path": "E:\\project-dev\\web\\艺咖\\aitoearn-web\\node_modules\\typescript\\lib",
"vue.rearranger.settings.migration": "true"
}
@@ -77,7 +79,7 @@
<option name="presentableId" value="Default" />
<updated>1751977665735</updated>
<workItem from="1751977666787" duration="3372000" />
- <workItem from="1751981060502" duration="1904000" />
+ <workItem from="1751981060502" duration="5059000" />
</task>
<task id="LOCAL-00001" summary="feat(CalendarTiming): 优化发布记录列表展示&#10;- 调整日历记录项的样式和布局&#10;- 优化 RecordCore组件,添加平台图标和时间显示&#10;- 修改 CalendarTimingItem 组件,移除不必要的 Fragment&#10;-调整 index.tsx 中的日期格式化逻辑">
<option name="closed" value="true" />
@@ -95,7 +97,15 @@
<option name="project" value="LOCAL" />
<updated>1751980771015</updated>
</task>
- <option name="localTasksCounter" value="3" />
+ <task id="LOCAL-00003" summary="fix: platInfo添加一些非空判断">
+ <option name="closed" value="true" />
+ <created>1751986703860</created>
+ <option name="number" value="00003" />
+ <option name="presentableId" value="LOCAL-00003" />
+ <option name="project" value="LOCAL" />
+ <updated>1751986703860</updated>
+ </task>
+ <option name="localTasksCounter" value="4" />
<servers />
</component>
<component name="TypeScriptGeneratedFilesManager">
@@ -106,6 +116,7 @@
<option name="CHECK_NEW_TODO" value="false" />
<MESSAGE value="feat(CalendarTiming): 优化发布记录列表展示&#10;- 调整日历记录项的样式和布局&#10;- 优化 RecordCore组件,添加平台图标和时间显示&#10;- 修改 CalendarTimingItem 组件,移除不必要的 Fragment&#10;-调整 index.tsx 中的日期格式化逻辑" />
<MESSAGE value="feat(CalendarTiming): 优化发布记录列表展示&#10;- 调整日历记录项的样式和布局&#10;- 优化 RecordCore组件,添加平台图标和时间显示&#10;- 调整 index.tsx 中的日期格式化逻辑" />
- <option name="LAST_COMMIT_MESSAGE" value="feat(CalendarTiming): 优化发布记录列表展示&#10;- 调整日历记录项的样式和布局&#10;- 优化 RecordCore组件,添加平台图标和时间显示&#10;- 调整 index.tsx 中的日期格式化逻辑" />
+ <MESSAGE value="fix: platInfo添加一些非空判断" />
+ <option name="LAST_COMMIT_MESSAGE" value="fix: platInfo添加一些非空判断" />
</component>
</project>
\ No newline at end of file
diff --git a/src/app/[lng]/accounts/components/CalendarTiming/CalendarTimingItem/RecordCore.tsx b/src/app/[lng]/accounts/components/CalendarTiming/CalendarTimingItem/RecordCore.tsx
index 443af9a2..454e1f45 100644
--- a/src/app/[lng]/accounts/components/CalendarTiming/CalendarTimingItem/RecordCore.tsx
+++ b/src/app/[lng]/accounts/components/CalendarTiming/CalendarTimingItem/RecordCore.tsx
@@ -1,14 +1,21 @@
import { ForwardedRef, forwardRef, memo, useMemo } from "react";
-import { Button, Dropdown, Image, Popover } from "antd";
+import { Button, Dropdown, Image, Popover, Tag } from "antd";
import { useCalendarTiming } from "@/app/[lng]/accounts/components/CalendarTiming/useCalendarTiming";
import { useShallow } from "zustand/react/shallow";
-import { PublishRecordItem } from "@/api/plat/types/publish.types";
+import {
+ PublishRecordItem,
+ PublishStatus,
+} from "@/api/plat/types/publish.types";
import styles from "./recordCore.module.scss";
import dayjs from "dayjs";
import { AccountPlatInfoMap } from "@/app/config/platConfig";
import {
+ CheckCircleOutlined,
+ ClockCircleOutlined,
+ CloseCircleOutlined,
FieldTimeOutlined,
FullscreenOutlined,
+ LoadingOutlined,
MoreOutlined,
} from "@ant-design/icons";
import AvatarPlat from "@/components/AvatarPlat";
@@ -21,6 +28,36 @@ export interface IRecordCoreProps {
publishRecord: PublishRecordItem;
}
+const PubStatus = ({ status }: { status: PublishStatus }) => {
+ return (
+ <div className={styles.pubStatus}>
+ {status === PublishStatus.FAIL ? (
+ <Tag color="error">
+ 发布失败
+ <CloseCircleOutlined />
+ </Tag>
+ ) : status === PublishStatus.PUB_LOADING ? (
+ <Tag color="cyan">
+ 发布中
+ <LoadingOutlined />
+ </Tag>
+ ) : status === PublishStatus.RELEASED ? (
+ <Tag color="success">
+ 发布成功
+ <CheckCircleOutlined />
+ </Tag>
+ ) : status === PublishStatus.UNPUBLISH ? (
+ <Tag color="processing">
+ 等待发布
+ <ClockCircleOutlined />
+ </Tag>
+ ) : (
+ <></>
+ )}
+ </div>
+ );
+};
+
const RecordCore = memo(
forwardRef(
(
@@ -76,10 +113,15 @@ const RecordCore = memo(
</div>
<div className="recordDetails-center">
<div className="recordDetails-center-left">
- <AvatarPlat account={account} size="large" />
- <span className="recordDetails-center-title">
- {account.nickname}
- </span>
+ <div className="recordDetails-center-left-user">
+ <AvatarPlat account={account} size="large" />
+ <span className="recordDetails-center-title">
+ {account.nickname}
+ </span>
+ </div>
+ <div className="recordDetails-center-left-status">
+ <PubStatus status={publishRecord.status} />
+ </div>
</div>
<div className="recordDetails-center-right">
<Image src={publishRecord.coverUrl} />
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 e0ba9681..55c852bb 100644
--- a/src/app/[lng]/accounts/components/CalendarTiming/CalendarTimingItem/recordCore.module.scss
+++ b/src/app/[lng]/accounts/components/CalendarTiming/CalendarTimingItem/recordCore.module.scss
@@ -59,6 +59,9 @@
justify-content: space-between;
border-bottom: 1px solid var(--grayColor2);
&-left {
+ &-status {
+ margin-top: 15px;
+ }
}
&-right {
img {
@@ -94,4 +97,12 @@
padding: 0 !important;
}
}
+}
+
+.pubStatus {
+ :global {
+ .anticon {
+ margin-left: 5px;
+ }
+ }
}
\ No newline at end of file
diff --git a/src/components/PublishDialog/compoents/PublishDialogPreview.tsx b/src/components/PublishDialog/compoents/PublishDialogPreview.tsx
index 79a993a3..0033bea0 100644
--- a/src/components/PublishDialog/compoents/PublishDialogPreview.tsx
+++ b/src/components/PublishDialog/compoents/PublishDialogPreview.tsx
@@ -59,7 +59,7 @@ const PublishDialogPreview = memo(
<div className="publishDialogPreview-preview-video-top" />
<div className="publishDialogPreview-preview-images">
<Swiper
- loop={true}
+ loop={expandedPubItem!.params.images!.length > 1}
modules={[Navigation, Pagination]}
pagination={{
clickable: true,