修复inviter问题
This commit is contained in:
parent
5ec7cb005f
commit
a6a55e75b2
|
@ -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);
|
||||||
|
}
|
||||||
|
};
|
|
@ -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"
|
||||||
>
|
>
|
||||||
登录
|
登录
|
||||||
|
|
|
@ -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 />
|
||||||
|
|
|
@ -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 />
|
||||||
|
|
|
@ -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 />
|
||||||
|
|
|
@ -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,7 +83,8 @@ 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 flex-col gap-2 -mt-12">
|
||||||
<div className="flex w-full justify-end">
|
<div className="flex w-full justify-end">
|
||||||
<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"
|
||||||
|
@ -112,7 +113,7 @@ export default function Photos({
|
||||||
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"
|
||||||
|
@ -128,6 +129,7 @@ export default function Photos({
|
||||||
<FontAwesomeIcon icon={faSave} size="2xl" />
|
<FontAwesomeIcon icon={faSave} size="2xl" />
|
||||||
</div> */}
|
</div> */}
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
),
|
),
|
||||||
bodyStyle: {
|
bodyStyle: {
|
||||||
background: "none",
|
background: "none",
|
||||||
|
|
|
@ -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);
|
||||||
})
|
})
|
||||||
},[])
|
},[])
|
||||||
|
|
Loading…
Reference in New Issue