From 91b83995543a25be9ce99d1932fe672ba46252cb Mon Sep 17 00:00:00 2001 From: yezian Date: Wed, 22 May 2024 12:15:24 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- screeens/CreateImagePost/index.jsx | 8 ++++---- screeens/CreateVideoPost/index.jsx | 8 ++++---- screeens/EditSpacePost/index.jsx | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/screeens/CreateImagePost/index.jsx b/screeens/CreateImagePost/index.jsx index b403c1b..3827840 100644 --- a/screeens/CreateImagePost/index.jsx +++ b/screeens/CreateImagePost/index.jsx @@ -131,7 +131,7 @@ export default function CreateImagePost({ navigation, route }) { }); return; } - if (isCreatingPaidText && !paidText) { + if (isCreatingPaidText && price > 0 && !paidText) { Toast.show({ type: "error", text1: "请填写付费文案", @@ -160,8 +160,8 @@ export default function CreateImagePost({ navigation, route }) { ? parseInt(imageVisibleRange, 10) : 1, price: parseFloat(price) ? parseInt(parseFloat(price) * 100, 10) : null, - is_creating_paid_text: isCreatingPaidText ? 1 : 0, - paid_text: paidText, + is_creating_paid_text: isCreatingPaidText && price > 0 ? 1 : 0, + paid_text: isCreatingPaidText && price > 0 ? paidText : null, }; const signature = await generateSignature(body); const response = await fetch( @@ -326,7 +326,7 @@ export default function CreateImagePost({ navigation, route }) { "h-32 bg-[#FFFFFF1A] text-white rounded-2xl mt-2 mb-4 p-2" )} /> - {isCreatingPaidText && ( + {isCreatingPaidText && price > 0 && ( <> 付费文案 diff --git a/screeens/CreateVideoPost/index.jsx b/screeens/CreateVideoPost/index.jsx index 1a03e04..d1875ce 100644 --- a/screeens/CreateVideoPost/index.jsx +++ b/screeens/CreateVideoPost/index.jsx @@ -109,7 +109,7 @@ export default function CreateVideoPost({ navigation, route }) { }); return; } - if (isCreatingPaidText && !paidText) { + if (isCreatingPaidText && price > 0 && !paidText) { Toast.show({ type: "error", text1: "请填写付费文案", @@ -136,8 +136,8 @@ export default function CreateVideoPost({ navigation, route }) { : 999, is_blurring_cover: blurCover ? 1 : 0, price: parseFloat(price) ? parseInt(parseFloat(price) * 100, 10) : null, - is_creating_paid_text: isCreatingPaidText ? 1 : 0, - paid_text: paidText, + is_creating_paid_text: isCreatingPaidText && price > 0 ? 1 : 0, + paid_text: isCreatingPaidText && price > 0 ? paidText : null, }; const signature = await generateSignature(body); const response = await fetch( @@ -302,7 +302,7 @@ export default function CreateVideoPost({ navigation, route }) { "h-32 bg-[#FFFFFF1A] text-white rounded-2xl mt-2 mb-4 p-2" )} /> - {isCreatingPaidText && ( + {isCreatingPaidText && price > 0 && ( <> 付费文案 diff --git a/screeens/EditSpacePost/index.jsx b/screeens/EditSpacePost/index.jsx index 27902de..1c26e06 100644 --- a/screeens/EditSpacePost/index.jsx +++ b/screeens/EditSpacePost/index.jsx @@ -222,7 +222,7 @@ export default function EditSpacePost({ navigation, route }) { }); return; } - if (isCreatingPaidText && !paidText) { + if (isCreatingPaidText && price > 0 && !paidText) { Toast.show({ type: "error", text1: "请填写付费文案", @@ -260,8 +260,8 @@ export default function EditSpacePost({ navigation, route }) { is_blurring_cover: blurCover ? 1 : 0, is_ironfan_visible: isFreeForIronfan ? 1 : 0, price: parseFloat(price) ? parseInt(parseFloat(price) * 100, 10) : null, - is_creating_paid_text: isCreatingPaidText ? 1 : 0, - paid_text: paidText, + is_creating_paid_text: isCreatingPaidText && price > 0 ? 1 : 0, + paid_text: isCreatingPaidText && price > 0 ? paidText : null, }; const signature = await generateSignature(body); const _response = await fetch( @@ -372,7 +372,7 @@ export default function EditSpacePost({ navigation, route }) { "h-32 bg-[#FFFFFF1A] text-white rounded-2xl mt-2 mb-4 p-2" )} /> - {isCreatingPaidText && ( + {isCreatingPaidText && price > 0 && ( <> 付费文案