From ce40a40489a6b4ef615bba80a60f84e2016a7eb2 Mon Sep 17 00:00:00 2001 From: anln Date: Wed, 13 Nov 2024 14:03:26 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=BE=A9=E5=AD=98=E5=9C=A8=E7=9A=84?= =?UTF-8?q?=E5=95=8F=E9=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/page.js | 2 +- app/space/editSpacePost/[zid]/page.jsx | 2 +- app/streamerPosts/createPost/page.jsx | 17 ++++++++++------- components/AddToHome/index.jsx | 2 +- components/PostItem/index.js | 10 +++++----- 5 files changed, 18 insertions(+), 15 deletions(-) diff --git a/app/page.js b/app/page.js index c8228c9..14eb7fc 100644 --- a/app/page.js +++ b/app/page.js @@ -123,7 +123,7 @@ export default function Home() {
setIsCreatePostModalVisible(!isCreatePostModalVisible)} className="fixed right-6 bottom-16" - style={{ zIndex: 999 }} + style={{ zIndex: 99 }} onClick={() => { router.push("/streamerPosts/createPost"); }} diff --git a/app/space/editSpacePost/[zid]/page.jsx b/app/space/editSpacePost/[zid]/page.jsx index 59e9725..a4f7a77 100644 --- a/app/space/editSpacePost/[zid]/page.jsx +++ b/app/space/editSpacePost/[zid]/page.jsx @@ -316,7 +316,7 @@ export default function EditSpacePost() { })) } autoSize={{ minRows: 6, maxRows: 15 }} - value={formData.paidText && formData.paidText.slice(2)} + value={formData.paidText.includes("\n") ? formData.paidText.slice(2): formData.paidText} style={{ "--font-size": "14px" }} className="bg-[#FFFFFF1A] rounded-2xl mt-2 mb-4 p-2 h-full" /> diff --git a/app/streamerPosts/createPost/page.jsx b/app/streamerPosts/createPost/page.jsx index d23f22b..1f06513 100644 --- a/app/streamerPosts/createPost/page.jsx +++ b/app/streamerPosts/createPost/page.jsx @@ -63,14 +63,17 @@ export default function CreatePost() { //提交数据 if (isSubmitting) return; setIsSubmitting(true); - const { content, imageAssets } = formData; - const newMedia = imageAssets.filter((it) => it.id == undefined); - const media = await multiUploadImage(newMedia, 1); + const { content, imageAssets, videoAssets} = formData; + const newImageMedia = imageAssets.filter((it) => it.id == undefined); + const type = formData.imageAssets.length > 0 ? 1 : 2; + const media = await multiUploadImage(type==1?newImageMedia:videoAssets, type); // const media = await multiUploadImage(imageAssets); - media.image_ids = [ - ...imageAssets.filter((it) => it.id != undefined).map((it) => it.id), - ...media.image_ids, - ]; + if(type==1){ + media.image_ids = [ + ...imageAssets.filter((it) => it.id != undefined).map((it) => it.id), + ...media.image_ids, + ]; + } try { const body = { text: content, diff --git a/components/AddToHome/index.jsx b/components/AddToHome/index.jsx index eb1fc6b..9965433 100644 --- a/components/AddToHome/index.jsx +++ b/components/AddToHome/index.jsx @@ -14,7 +14,7 @@ export default function AddToHome() { }, []); return firstLogin.first == "1" ? (
{!firstLogin.second ? ( diff --git a/components/PostItem/index.js b/components/PostItem/index.js index 5e39a65..2a45fe3 100644 --- a/components/PostItem/index.js +++ b/components/PostItem/index.js @@ -77,9 +77,9 @@ export default function PostItem({ if (time === 1) return "昨日"; return `${time}日前`; }, []); - const handleDelete = async () => { + const handleDelete = async (type) => { try { - const _data = await requireAPI("POST", "/api/zone_moment/delete", { + const _data = await requireAPI("POST", `/api/${type=="space"?"zone_moment":"moment"}/delete`, { body: { id: data?.id, }, @@ -196,7 +196,7 @@ export default function PostItem({ ) : (

- 审核未通过,请删除后重新提交。{type} + 审核未通过,请删除后重新提交。

))} @@ -397,13 +397,13 @@ export default function PostItem({ 编辑
-
  • +
  • handleDelete("space")}> 删除
  • ) : type == "post" && account?.mid == data?.mid ? ( <> -
  • +
  • handleDelete("post")}> 删除