Kaynağa Gözat

公众号推送字段

jihuaqiang 4 gün önce
ebeveyn
işleme
5eaa607ae5

+ 1 - 0
src/views/publishContent/weCom/type.ts

@@ -25,6 +25,7 @@ export enum VideoSearchPlanType {
 	服务号推送 = 1,
 	企微社群 = 2,
 	企微自动回复 = 3,
+	公众号推送 = 4,
 }
 
 export interface WeVideoItem {

+ 11 - 1
src/views/publishContent/weGZH/components/videoSelectModal/index.tsx

@@ -47,6 +47,16 @@ const VideoSelectModal: React.FC<VideoSelectModalProps> = ({ planType, visible,
 	const [playingVideo, setPlayingVideo] = useState<VideoItem | null>(null);
 	const MAX_SELECTION = 3;
 
+	const getVideoListType = (planType: GzhPlanType) => {
+		if (planType === GzhPlanType.自动回复) {
+			return VideoSearchPlanType.自动回复;
+		} else if (planType === GzhPlanType.公众号推送) {
+			return VideoSearchPlanType.公众号推送;
+		} else {
+			return VideoSearchPlanType.服务号推送;
+		}
+	}
+
 	const getVideoList = async (pageNum?: number, _pageSize?: number) => {
 		setLoading(true);
 		setCurrentPage(pageNum || currentPage);
@@ -55,7 +65,7 @@ const VideoSelectModal: React.FC<VideoSelectModalProps> = ({ planType, visible,
 			category,
 			title: searchTerm,
 			sort,
-			type: planType === GzhPlanType.自动回复 ? VideoSearchPlanType.自动回复 : VideoSearchPlanType.服务号推送,
+			type: getVideoListType(planType),
 			pageNum: pageNum || currentPage,
 			pageSize: _pageSize || pageSize,
 		}).catch(() => {

+ 1 - 1
src/views/publishContent/weGZH/hooks/useAccountOptions.ts

@@ -20,7 +20,7 @@ export const useAccountOptions = () => {
       setError(null);
 			const data = await request.get(getGzhAccountOptionsApi, {
 				params: {
-					accountType: accountType === GzhPlanType.自动回复 ? undefined : GzhPlanType.服务号推送
+					accountType: (accountType === GzhPlanType.自动回复 || accountType === GzhPlanType.公众号推送) ? undefined : GzhPlanType.服务号推送
 				}
 			});
       setAccountOptions(data.data as Account[]);