Skip to content

Let's use AI to Earn!

params

bulaienaofutuojiesenzhangca34a9f5871e
diff --git a/src/components/PublishDialog/compoents/PlatParamsSetting/plats/YouTubeParams.tsx b/src/components/PublishDialog/compoents/PlatParamsSetting/plats/YouTubeParams.tsx
index 89338fb0..41d71298 100644
--- a/src/components/PublishDialog/compoents/PlatParamsSetting/plats/YouTubeParams.tsx
+++ b/src/components/PublishDialog/compoents/PlatParamsSetting/plats/YouTubeParams.tsx
@@ -9,7 +9,7 @@ import CommonTitleInput from "@/components/PublishDialog/compoents/PlatParamsSet
import { usePublishDialogData } from "@/components/PublishDialog/usePublishDialogData";
import { useShallow } from "zustand/react/shallow";
import styles from "../platParamsSetting.module.scss";
-import { Radio, Select } from "antd";
+import { Radio, Select, Checkbox } from "antd";
import { YouTubeCategoryItem } from "@/components/PublishDialog/publishDialog.type";
import { useTransClient } from "@/app/i18n/client";
@@ -43,8 +43,26 @@ const YouTubeParams = memo(
if (!option.youtube) {
option.youtube = {};
}
+ let needsUpdate = false;
+
if (!option.youtube.privacyStatus) {
option.youtube.privacyStatus = 'public';
+ needsUpdate = true;
+ }
+ if ((option.youtube as any).notifySubscribers === undefined) {
+ (option.youtube as any).notifySubscribers = true;
+ needsUpdate = true;
+ }
+ if ((option.youtube as any).embeddable === undefined) {
+ (option.youtube as any).embeddable = true;
+ needsUpdate = true;
+ }
+ if ((option.youtube as any).selfDeclaredMadeForKids === undefined) {
+ (option.youtube as any).selfDeclaredMadeForKids = false;
+ needsUpdate = true;
+ }
+
+ if (needsUpdate) {
setOnePubParams(
{
option,
@@ -69,24 +87,27 @@ const YouTubeParams = memo(
extend={
<>
<CommonTitleInput pubItem={pubItem} />
+
<div
className={styles.commonTitleInput}
style={{ marginTop: "10px" }}
>
- <div className="platParamsSetting-label">{t("form.privacyStatus")}</div>
+ <div className="platParamsSetting-label">{t("form.region")}</div>
<Select
- value={pubItem.params.option.youtube?.privacyStatus}
- options={[
- { value: "public", label: t("form.public") },
- { value: "unlisted", label: t("form.unlisted") },
- { value: "private", label: t("form.private") },
- ]}
+ style={{ width: "100%" }}
+ options={youTubeRegions.map((item) => ({
+ label: item,
+ value: item,
+ }))}
+ value={pubItem.params.option.youtube?.regionCode}
onChange={(value) => {
const option = pubItem.params.option;
if (!option.youtube) {
option.youtube = {};
}
- option.youtube.privacyStatus = value;
+ option.youtube.regionCode = value;
+ // 清空之前选择的视频分类
+ option.youtube.categoryId = undefined;
setOnePubParams(
{
option,
@@ -94,31 +115,32 @@ const YouTubeParams = memo(
pubItem.account.id,
);
}}
- style={{ width: "100%" }}
- placeholder="请选择隐私状态"
+ showSearch={true}
+ placeholder={t("form.regionPlaceholder")}
/>
</div>
+ <div style={{display: 'flex', flexDirection: 'row', alignItems: 'center', gap: '10px'}}>
+
+
<div
className={styles.commonTitleInput}
- style={{ marginTop: "10px" }}
+ style={{ marginTop: "10px", flex: 1 }}
>
- <div className="platParamsSetting-label">{t("form.region")}</div>
+ <div className="platParamsSetting-label">{t("form.privacyStatus")}</div>
<Select
- style={{ width: "100%" }}
- options={youTubeRegions.map((item) => ({
- label: item,
- value: item,
- }))}
- value={pubItem.params.option.youtube?.regionCode}
+ value={pubItem.params.option.youtube?.privacyStatus}
+ options={[
+ { value: "public", label: t("form.public") },
+ { value: "unlisted", label: t("form.unlisted") },
+ { value: "private", label: t("form.private") },
+ ]}
onChange={(value) => {
const option = pubItem.params.option;
if (!option.youtube) {
option.youtube = {};
}
- option.youtube.regionCode = value;
- // 清空之前选择的视频分类
- option.youtube.categoryId = undefined;
+ option.youtube.privacyStatus = value;
setOnePubParams(
{
option,
@@ -126,14 +148,14 @@ const YouTubeParams = memo(
pubItem.account.id,
);
}}
- showSearch={true}
- placeholder={t("form.regionPlaceholder")}
+ style={{ width: "100%" }}
+ placeholder="请选择隐私状态"
/>
</div>
<div
className={styles.commonTitleInput}
- style={{ marginTop: "10px" }}
+ style={{ marginTop: "10px", flex: 1 }}
>
<div className="platParamsSetting-label">{t("form.category")}</div>
<Select
@@ -161,6 +183,77 @@ const YouTubeParams = memo(
disabled={!pubItem.params.option.youtube?.regionCode}
/>
</div>
+
+ </div>
+
+ {/* YouTube 复选框选项 */}
+ <div style={{
+ display: 'flex',
+ flexDirection: 'row',
+ alignItems: 'center',
+ justifyContent: 'space-between',
+ marginTop: '20px',
+ flexWrap: 'wrap'
+ }}>
+
+ <div style={{width: '40px'}}> </div>
+ <Checkbox
+ checked={(pubItem.params.option.youtube as any)?.notifySubscribers}
+ onChange={(e) => {
+ const option = pubItem.params.option;
+ if (!option.youtube) {
+ option.youtube = {};
+ }
+ (option.youtube as any).notifySubscribers = e.target.checked;
+ setOnePubParams(
+ {
+ option,
+ },
+ pubItem.account.id,
+ );
+ }}
+ >
+ Notify Subscribers
+ </Checkbox>
+
+ <Checkbox
+ checked={(pubItem.params.option.youtube as any)?.embeddable}
+ onChange={(e) => {
+ const option = pubItem.params.option;
+ if (!option.youtube) {
+ option.youtube = {};
+ }
+ (option.youtube as any).embeddable = e.target.checked;
+ setOnePubParams(
+ {
+ option,
+ },
+ pubItem.account.id,
+ );
+ }}
+ >
+ Allow Embedding
+ </Checkbox>
+
+ <Checkbox
+ checked={(pubItem.params.option.youtube as any)?.selfDeclaredMadeForKids}
+ onChange={(e) => {
+ const option = pubItem.params.option;
+ if (!option.youtube) {
+ option.youtube = {};
+ }
+ (option.youtube as any).selfDeclaredMadeForKids = e.target.checked;
+ setOnePubParams(
+ {
+ option,
+ },
+ pubItem.account.id,
+ );
+ }}
+ >
+ Made for Kids
+ </Checkbox>
+ </div>
</>
}
/>
diff --git a/src/components/PublishDialog/publishDialog.type.ts b/src/components/PublishDialog/publishDialog.type.ts
index 5b95f209..4c6e12a4 100644
--- a/src/components/PublishDialog/publishDialog.type.ts
+++ b/src/components/PublishDialog/publishDialog.type.ts
@@ -66,6 +66,12 @@ export interface IPlatOption {
regionCode?: string;
// 视频分类ID
categoryId?: string;
+ // 是否通知订阅者
+ notifySubscribers?: boolean;
+ // 是否允许嵌入
+ embeddable?: boolean;
+ // 是否为儿童内容
+ selfDeclaredMadeForKids?: boolean;
};
pinterest?: {
// Board ID,由获取Pinterest Board信息接口得到