Skip to content

Let's use AI to Earn!

feat: 1. 视频发布添加:用户上传视频后,如果发现分辨率过低的情况,低于640*480,提示“视频清晰度过低,有概率被平台限流或不能发布”。 2. 添加填写更多参数功能。

gaoSir75ab188e1890
diff --git a/src/store/pubStroe.ts b/src/store/pubStroe.ts
index f49734b6..50948b4e 100644
--- a/src/store/pubStroe.ts
+++ b/src/store/pubStroe.ts
@@ -9,10 +9,13 @@ import {
export interface IPubStore {
// 视频发布保存的数据
videoPubSaveData: string;
+ // 是否开启填写更多参数
+ moreParamsOpen: boolean;
}
const state: IPubStore = {
videoPubSaveData: '',
+ moreParamsOpen: false,
};
export const usePubStroe = createPersistStore(
@@ -21,6 +24,12 @@ export const usePubStroe = createPersistStore(
},
(set, _get) => {
return {
+ setMoreParamsOpen(moreParamsOpen: boolean) {
+ set({
+ moreParamsOpen,
+ });
+ },
+
// 设置视频发布保存的数据
setVideoPubSaveData(data: Partial<IVideoPageStore>) {
if (data.videoListChoose && data.videoListChoose.length !== 0) {
diff --git a/src/views/publish/children/videoPage/components/VideoChooseItem.tsx b/src/views/publish/children/videoPage/components/VideoChooseItem.tsx
index 71709616..182a58bf 100644
--- a/src/views/publish/children/videoPage/components/VideoChooseItem.tsx
+++ b/src/views/publish/children/videoPage/components/VideoChooseItem.tsx
@@ -1,4 +1,4 @@
-import { ForwardedRef, forwardRef, memo } from 'react';
+import React, { ForwardedRef, forwardRef, memo } from 'react';
import { IVideoChooseItem } from '@/views/publish/children/videoPage/videoPage';
import { Alert, Avatar, Button, Tooltip } from 'antd';
import { AccountPlatInfoMap } from '@/views/account/comment';
@@ -9,6 +9,7 @@ import {
PlusOutlined,
VideoCameraFilled,
SwapOutlined,
+ ExclamationCircleOutlined,
} from '@ant-design/icons';
import { useVideoPageStore } from '@/views/publish/children/videoPage/useVideoPageStore';
import { useShallow } from 'zustand/react/shallow';
@@ -99,12 +100,25 @@ const VideoChooseItem = memo(
{formatSeconds(videoChooseItem.video.duration)}
</span>
</div>
- <div className="videoChooseItem-left-bottom-item">
+ <div
+ className={[
+ 'videoChooseItem-left-bottom-item',
+ videoChooseItem.video.width < 640 &&
+ videoChooseItem.video.width < 480 &&
+ 'videoChooseItem-left-bottom-item--warning',
+ ].join(' ')}
+ >
<label>分辨率</label>
<span>
{videoChooseItem.video.width}*
{videoChooseItem.video.height}
</span>
+ {videoChooseItem.video.width < 640 &&
+ videoChooseItem.video.width < 480 && (
+ <Tooltip title="视频清晰度过低,有概率被平台限流或不能发布">
+ <ExclamationCircleOutlined />
+ </Tooltip>
+ )}
</div>
</div>
</div>
diff --git a/src/views/publish/children/videoPage/components/VideoPubSetModal/VideoPubSetModal.tsx b/src/views/publish/children/videoPage/components/VideoPubSetModal/VideoPubSetModal.tsx
index c5aaa147..f723c4cc 100644
--- a/src/views/publish/children/videoPage/components/VideoPubSetModal/VideoPubSetModal.tsx
+++ b/src/views/publish/children/videoPage/components/VideoPubSetModal/VideoPubSetModal.tsx
@@ -15,6 +15,7 @@ import {
Modal,
notification,
Space,
+ Switch,
Tabs,
Tooltip,
} from 'antd';
@@ -91,6 +92,12 @@ const VideoPubSetModal = memo(
clear: state.clear,
})),
);
+ const { moreParamsOpen, setMoreParamsOpen } = usePubStroe(
+ useShallow((state) => ({
+ moreParamsOpen: state.moreParamsOpen,
+ setMoreParamsOpen: state.setMoreParamsOpen,
+ })),
+ );
const [loading, setLoading] = useState(false);
const [api, contextHolder] = notification.useNotification();
const pubAccountDetModuleRef = useRef<IPubAccountDetModuleRef>(null);
@@ -253,6 +260,7 @@ const VideoPubSetModal = memo(
if (errVideoItem) {
setCurrChooseAccountId(key);
message.warning(errVideoItem.message);
+ setMoreParamsOpen(true);
return;
}
}
@@ -299,9 +307,26 @@ const VideoPubSetModal = memo(
}}
/>
<Modal
- width={900}
+ width={moreParamsOpen ? 900 : 500}
maskClosable={false}
- title="预览/发布配置"
+ title={
+ <div className={styles.videoPubSetModal_titleWrap}>
+ <div className="videoPubSetModal-title">预览及发布</div>
+ <div className="videoPubSetModal-more">
+ <div className="videoPubSetModal-more-core">
+ <label>填写更多参数</label>
+ <Switch
+ size="small"
+ value={moreParamsOpen}
+ onClick={(e) => setMoreParamsOpen(e)}
+ />
+ </div>
+ <div className="videoPubSetModal-more-tips">
+ 开启后,将显示更多发布参数供您填写
+ </div>
+ </div>
+ </div>
+ }
open={videoPubSetModalOpen}
onOk={handleOk}
onCancel={close}
@@ -345,7 +370,12 @@ const VideoPubSetModal = memo(
.filter((v) => v !== undefined)}
/>
- <div className="videoPubSetModal_con">
+ <div
+ className={[
+ 'videoPubSetModal_con',
+ !moreParamsOpen && 'videoPubSetModal_con--noMore',
+ ].join(' ')}
+ >
<div className="videoPubSetModal_con-left">
{(() => {
const errItem = errVideoMap.get(
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.tsx
index a9d760aa..42637924 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
@@ -3,23 +3,22 @@ import {
IVideoPubSetModalChildProps,
IVideoPubSetModalChildRef,
} from '@/views/publish/children/videoPage/components/VideoPubSetModal/videoPubSetModal.type';
-import { Checkbox, Input, Select, Spin, Tooltip } from 'antd';
+import { Checkbox, Input, Select, Spin } from 'antd';
import { useVideoPageStore } from '@/views/publish/children/videoPage/useVideoPageStore';
import { useShallow } from 'zustand/react/shallow';
import LocationSelect from '@/views/publish/children/videoPage/components/VideoPubSetModal/components/LocationSelect';
import { AccountStatus, AccountType } from '@@/AccountEnum';
-import { QuestionCircleOutlined } from '@ant-design/icons';
import useDebounceFetcher from '@/views/publish/children/videoPage/components/VideoPubSetModal/components/useDebounceFetcher';
import {
DescTextArea,
- ScheduledTimeSelect, TitleInput,
- VideoPubRestartLogin
-} from "@/views/publish/children/videoPage/components/VideoPubSetModal/components/VideoPubSetModalCommon";
+ ScheduledTimeSelect,
+ TitleInput,
+ VideoPubRestartLogin,
+} from '@/views/publish/children/videoPage/components/VideoPubSetModal/components/VideoPubSetModalCommon';
import { getSphActivity } from '@/icp/publish';
import { ipcUpdateAccountStatus } from '@/icp/account';
import { WxSphEventList } from '../../../../../../../../electron/plat/shipinhao/wxShp.type';
import UserSelect from '../components/UserSelect';
-import { AccountPlatInfoMap } from '../../../../../../account/comment';
const { TextArea } = Input;
diff --git a/src/views/publish/children/videoPage/components/VideoPubSetModal/videoPubSetModal.module.scss b/src/views/publish/children/videoPage/components/VideoPubSetModal/videoPubSetModal.module.scss
index b6845bea..8a2cef7b 100644
--- a/src/views/publish/children/videoPage/components/VideoPubSetModal/videoPubSetModal.module.scss
+++ b/src/views/publish/children/videoPage/components/VideoPubSetModal/videoPubSetModal.module.scss
@@ -20,8 +20,17 @@
.videoPubSetModal_con {
display: flex;
justify-content: space-between;
+ &--noMore {
+ justify-content: center;
+ .videoPubSetModal_con-left {
+ display: none !important;
+ }
+ .videoPubSetModal_con-right {
+ width: 250px;
+ }
+ }
&-red {
- color: red;
+ color: var(--errerColor);
margin-right: 5px;
}
&-tips {
@@ -224,3 +233,30 @@
}
}
}
+
+.videoPubSetModal_titleWrap {
+ padding-bottom: 10px;
+ display: flex;
+ align-items: center;
+
+ :global {
+ .videoPubSetModal-title {
+ }
+ .videoPubSetModal-more {
+ margin-left: 30px;
+ font-size: var(--fs-sm);
+ &-core {
+ display: flex;
+ align-items: center;
+ label {
+ margin-right: 5px;
+ }
+ }
+ &-tips {
+ font-weight: 400;
+ font-size: var(--fs-xs);
+ color: var(--lightGreyColor);
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/views/publish/children/videoPage/video.module.scss b/src/views/publish/children/videoPage/video.module.scss
index 8afc633d..bf00bd22 100644
--- a/src/views/publish/children/videoPage/video.module.scss
+++ b/src/views/publish/children/videoPage/video.module.scss
@@ -254,6 +254,15 @@
margin-right: 10px;
color: var(--lightGreyColor);
}
+ &--warning {
+ color: var(--errerColor);
+ label {
+ color: var(--errerColor);
+ }
+ & > span {
+ margin-right: 5px;
+ }
+ }
}
}
&-title {