修复inviter问题

This commit is contained in:
al 2024-08-05 15:48:59 +08:00
parent 5ec7cb005f
commit a6a55e75b2
7 changed files with 58 additions and 32 deletions

24
api/streamer.js Normal file
View File

@ -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);
}
};

View File

@ -430,7 +430,7 @@ const LoginBtn = ({ loginInfo, setLoginInfo, type, handleSubmit }) => {
size="middle" size="middle"
block block
onClick={() => handleSubmit(type)} onClick={() => handleSubmit(type)}
style={{ "--background-color": "#FF669E", color: "#FFFFFF" }} style={{ "--background-color": "#FF669E", color: "#FFFFFF",marginTop:"1rem" }}
className="mt-4 py-2" className="mt-4 py-2"
> >
登录 登录

View File

@ -125,7 +125,7 @@ export default function Home() {
> >
<FontAwesomeIcon icon={faRefresh} size="xl" /> <FontAwesomeIcon icon={faRefresh} size="xl" />
</div> </div>
<StreamerNavigator visible={visible} setVisible={setVisible} mid={Number(get("inviter"))}/> <StreamerNavigator visible={visible} setVisible={setVisible} userId={Number(get("inviter"))}/>
</div> </div>
); );
} }
@ -182,7 +182,7 @@ const RecommPostList = forwardRef(({ scrollHeight }, ref) => {
return ( return (
<div className="px-4 pb-20"> <div className="px-4 pb-20">
<List> <List>
{loading && ( {loading && !commenPostList.length && (
<div> <div>
<PostItemSkeleton /> <PostItemSkeleton />
<PostItemSkeleton /> <PostItemSkeleton />
@ -282,7 +282,7 @@ const FollowPostList = forwardRef(({ scrollHeight }, ref) => {
<div className="px-4 pb-20"> <div className="px-4 pb-20">
{/* <PullToRefresh onRefresh={doRefresh}> */} {/* <PullToRefresh onRefresh={doRefresh}> */}
<List> <List>
{loading && ( {loading && !followPostList.length && (
<div className="my-[31px]"> <div className="my-[31px]">
<PostItemSkeleton /> <PostItemSkeleton />
<PostItemSkeleton /> <PostItemSkeleton />

View File

@ -401,7 +401,7 @@ export default function PersonSpace() {
> >
<div className="overflow-y-auto scrollbarBox_hidden px-1"> <div className="overflow-y-auto scrollbarBox_hidden px-1">
<List> <List>
{loading && ( {loading && !postList.length && (
<> <>
<PostItemSkeleton /> <PostItemSkeleton />
<PostItemSkeleton /> <PostItemSkeleton />

View File

@ -264,7 +264,7 @@ export default function Space() {
{!!activeIndex && ( {!!activeIndex && (
<div className="px-4 pb-20" ref={scrollRef}> <div className="px-4 pb-20" ref={scrollRef}>
<List className="scrollbarBox_hidden"> <List className="scrollbarBox_hidden">
{loading && ( {loading && !dataList.length && (
<> <>
<PostItemSkeleton /> <PostItemSkeleton />
<PostItemSkeleton /> <PostItemSkeleton />

View File

@ -6,7 +6,7 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { faAngleUp, faClose } from "@fortawesome/free-solid-svg-icons"; import { faAngleUp, faClose } from "@fortawesome/free-solid-svg-icons";
import { useRouter } from "next/navigation"; import { useRouter } from "next/navigation";
import baseRequest from "@/utils/baseRequest"; import baseRequest from "@/utils/baseRequest";
import Player from 'next-video/player'; import Player from "next-video/player";
export default function Photos({ export default function Photos({
isUnlocked, isUnlocked,
mediaVisibleRange, mediaVisibleRange,
@ -83,18 +83,19 @@ export default function Photos({
Dialog.show({ Dialog.show({
title: "", title: "",
content: ( content: (
<div className="flex flex-col gap-2"> <div className="h-screen flex justify-center items-center">
<div className="flex w-full justify-end"> <div className="flex flex-col gap-2 -mt-12">
<div <div className="flex w-full justify-end">
className="flex w-12 h-12 justify-center items-center bg-[#33333348] rounded-full" <div
key="closeBtn" className="flex w-12 h-12 justify-center items-center bg-[#33333348] rounded-full"
onClick={() => Dialog.clear()} key="closeBtn"
> onClick={() => Dialog.clear()}
<FontAwesomeIcon icon={faClose} size="2xl" /> >
<FontAwesomeIcon icon={faClose} size="2xl" />
</div>
</div> </div>
</div> <div className="my-4">
<div className="my-4"> {/* <video
{/* <video
width="100%" width="100%"
height="100%" height="100%"
controls controls
@ -106,27 +107,28 @@ export default function Photos({
<source src={video.mp4} type="video/mp4" /> <source src={video.mp4} type="video/mp4" />
您的浏览器不支持 Video 标签 您的浏览器不支持 Video 标签
</video> */} </video> */}
{/* <Video as={ReactPlayer} src={video.mp4} /> */} {/* <Video as={ReactPlayer} src={video.mp4} /> */}
<Player <Player
src={video.mp4} src={video.mp4}
poster={video?.url.src} poster={video?.url.src}
blurDataURL={video?.url.blurDataURL} blurDataURL={video?.url.blurDataURL}
autoPlay={true} autoPlay={true}
style={{height:"500px"}} style={{ height: "500px",width:"100vw" }}
/> />
{/* <Player {/* <Player
src="https://www.mydomain.com/remote-video.mp4" src="https://www.mydomain.com/remote-video.mp4"
poster="https://www.mydomain.com/remote-poster.webp" poster="https://www.mydomain.com/remote-poster.webp"
blurDataURL="data:image/webp;base64,UklGRlA..." blurDataURL="data:image/webp;base64,UklGRlA..."
/> */} /> */}
</div> </div>
{/* <div {/* <div
className="flex w-12 h-12 justify-center items-center bg-[#33333348] rounded-full" className="flex w-12 h-12 justify-center items-center bg-[#33333348] rounded-full"
key="closeBtn" key="closeBtn"
onClick={() => saveFile(video.mp4)} onClick={() => saveFile(video.mp4)}
> >
<FontAwesomeIcon icon={faSave} size="2xl" /> <FontAwesomeIcon icon={faSave} size="2xl" />
</div> */} </div> */}
</div>
</div> </div>
), ),
bodyStyle: { bodyStyle: {

View File

@ -2,19 +2,19 @@
import React, { useEffect, useState } from "react"; import React, { useEffect, useState } from "react";
import { Mask, Image,Button } from "antd-mobile"; import { Mask, Image,Button } from "antd-mobile";
import {getStreamerInfo} from "@/api/space"; import {getStreamer} from "@/api/streamer";
import { useRouter } from "next/navigation"; import { useRouter } from "next/navigation";
import {remove} from "@/utils/storeInfo" import {remove} from "@/utils/storeInfo"
export default function StreamerNavigator({ export default function StreamerNavigator({
visible, visible,
mid, userId,
setVisible setVisible
}) { }) {
const [streamerInfo,setStreamerInfo] = useState(null); const [streamerInfo,setStreamerInfo] = useState(null);
const router = useRouter(); const router = useRouter();
useEffect(()=>{ useEffect(()=>{
getStreamerInfo(mid).then(res=>{ getStreamer(userId).then(res=>{
setStreamerInfo(res); setStreamerInfo(res);
}) })
},[]) },[])