From a6a55e75b2f960797f0e7b265ac5998d918fcaae Mon Sep 17 00:00:00 2001 From: al Date: Mon, 5 Aug 2024 15:48:59 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dinviter=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/streamer.js | 24 ++++++++++++++ app/login/page.js | 2 +- app/page.js | 6 ++-- app/space/[id]/page.js | 2 +- app/space/page.js | 2 +- components/Photos/index.js | 48 ++++++++++++++------------- components/StreamerNavigator/index.js | 6 ++-- 7 files changed, 58 insertions(+), 32 deletions(-) create mode 100644 api/streamer.js diff --git a/api/streamer.js b/api/streamer.js new file mode 100644 index 0000000..bb76021 --- /dev/null +++ b/api/streamer.js @@ -0,0 +1,24 @@ +import requireAPI from "@/utils/requireAPI"; +import { Toast } from "antd-mobile"; +export const getStreamer = async (userId) => { + try { + const data = await requireAPI("POST", "/api/streamer/list_ext_by_user_id", { + body: { + user_id:userId, + }, + }); + if (data.ret === -1) { + Toast.show({ + icon: "fail", + content: data.msg, + position: "top", + }); + return; + } + return { + ...data.data, + }; + } catch (error) { + console.error(error); + } + }; \ No newline at end of file diff --git a/app/login/page.js b/app/login/page.js index b2268dd..f60423d 100644 --- a/app/login/page.js +++ b/app/login/page.js @@ -430,7 +430,7 @@ const LoginBtn = ({ loginInfo, setLoginInfo, type, handleSubmit }) => { size="middle" block onClick={() => handleSubmit(type)} - style={{ "--background-color": "#FF669E", color: "#FFFFFF" }} + style={{ "--background-color": "#FF669E", color: "#FFFFFF",marginTop:"1rem" }} className="mt-4 py-2" > 登录 diff --git a/app/page.js b/app/page.js index 6d237ec..796e3a1 100644 --- a/app/page.js +++ b/app/page.js @@ -125,7 +125,7 @@ export default function Home() { > - + ); } @@ -182,7 +182,7 @@ const RecommPostList = forwardRef(({ scrollHeight }, ref) => { return (
- {loading && ( + {loading && !commenPostList.length && (
@@ -282,7 +282,7 @@ const FollowPostList = forwardRef(({ scrollHeight }, ref) => {
{/* */} - {loading && ( + {loading && !followPostList.length && (
diff --git a/app/space/[id]/page.js b/app/space/[id]/page.js index a0dae6b..df838a6 100644 --- a/app/space/[id]/page.js +++ b/app/space/[id]/page.js @@ -401,7 +401,7 @@ export default function PersonSpace() { >
- {loading && ( + {loading && !postList.length && ( <> diff --git a/app/space/page.js b/app/space/page.js index 487799b..53ee7dc 100644 --- a/app/space/page.js +++ b/app/space/page.js @@ -264,7 +264,7 @@ export default function Space() { {!!activeIndex && (
- {loading && ( + {loading && !dataList.length && ( <> diff --git a/components/Photos/index.js b/components/Photos/index.js index f706319..f76afd6 100644 --- a/components/Photos/index.js +++ b/components/Photos/index.js @@ -6,7 +6,7 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faAngleUp, faClose } from "@fortawesome/free-solid-svg-icons"; import { useRouter } from "next/navigation"; import baseRequest from "@/utils/baseRequest"; -import Player from 'next-video/player'; +import Player from "next-video/player"; export default function Photos({ isUnlocked, mediaVisibleRange, @@ -83,18 +83,19 @@ export default function Photos({ Dialog.show({ title: "", content: ( -
-
-
Dialog.clear()} - > - +
+
+
+
Dialog.clear()} + > + +
-
-
- {/*
- {/*
+ {/*
saveFile(video.mp4)} >
*/} +
), bodyStyle: { diff --git a/components/StreamerNavigator/index.js b/components/StreamerNavigator/index.js index 9fadfa1..a5f46ea 100644 --- a/components/StreamerNavigator/index.js +++ b/components/StreamerNavigator/index.js @@ -2,19 +2,19 @@ import React, { useEffect, useState } from "react"; import { Mask, Image,Button } from "antd-mobile"; -import {getStreamerInfo} from "@/api/space"; +import {getStreamer} from "@/api/streamer"; import { useRouter } from "next/navigation"; import {remove} from "@/utils/storeInfo" export default function StreamerNavigator({ visible, - mid, + userId, setVisible }) { const [streamerInfo,setStreamerInfo] = useState(null); const router = useRouter(); useEffect(()=>{ - getStreamerInfo(mid).then(res=>{ + getStreamer(userId).then(res=>{ setStreamerInfo(res); }) },[])