修改一些样式
This commit is contained in:
parent
539be2b06a
commit
8983e84cf9
|
@ -18,8 +18,6 @@ export const handleLogout = async () => {
|
|||
position: "top",
|
||||
});
|
||||
return;
|
||||
} else {
|
||||
console.error(error);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
|
|
|
@ -33,13 +33,13 @@ export const viewport = {
|
|||
};
|
||||
export default function RootLayout({ children }) {
|
||||
return (
|
||||
<html lang="zh-CN" className="bg-deepBg" data-prefers-color-scheme="dark">
|
||||
<html lang="zh-CN" className="bg-deepBg h-full" data-prefers-color-scheme="dark">
|
||||
<Head>
|
||||
<title>{metadata.title}</title>
|
||||
<meta name="description" content={metadata.description} keywords={metadata.keywords}/>
|
||||
</Head>
|
||||
<body className={inter.className}>
|
||||
<main className={`w-full bg-deepBg `}>
|
||||
<body className={`${inter.className } h-full`}>
|
||||
<main className={`w-full bg-deepBg h-full`}>
|
||||
{withAuth(<Provider store={store}>{children}</Provider>)}
|
||||
{/* <Provider store={store}>{children}</Provider> */}
|
||||
</main>
|
||||
|
|
|
@ -197,11 +197,12 @@ function Login({ handleLogin }) {
|
|||
}
|
||||
};
|
||||
return (
|
||||
<div className={`${styles.loginBox}`}>
|
||||
<div className="h-full flex justify-center items-center">
|
||||
<div className={`lg:max-w-[450px] overflow-hidden`}>
|
||||
<Image
|
||||
src={process.env.NEXT_PUBLIC_CDN_URL + "/public/images/slogan.png"}
|
||||
alt=""
|
||||
className="mt-24 w-[90vw]"
|
||||
className="w-full"
|
||||
/>
|
||||
<div className="mt-6 flex justify-between items-center px-2 text-[#ffffff80] sticky top-0 z-10 bg-deepBg">
|
||||
<Tabs
|
||||
|
@ -342,6 +343,7 @@ function Login({ handleLogin }) {
|
|||
</Swiper.Item>
|
||||
</Swiper>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ export default function Space() {
|
|||
const [activeIndex, setActiveIndex] = useState(0);
|
||||
const [dataList, setDataList] = useState([]);
|
||||
// const [spacePost, setSpacePost] = useState([]);
|
||||
const [hasMore, setHasMore] = useState(true);
|
||||
const [hasMore, setHasMore] = useState(1);
|
||||
const [scrollHeight, setScrollHeight] = useState(0);
|
||||
const [offset, setOffset] = useState(0);
|
||||
const [loading, setLoading] = useState(false);
|
||||
|
@ -39,7 +39,7 @@ export default function Space() {
|
|||
// 获取屏幕高度
|
||||
// const scrollHeight = 600;
|
||||
useEffect(() => {
|
||||
setScrollHeight(window.innerHeight - 57);
|
||||
setScrollHeight(window.innerHeight - 57 - 44);
|
||||
// const handleResize = () => {
|
||||
// setScrollHeight(window.innerHeight - 126);
|
||||
// };
|
||||
|
@ -67,10 +67,10 @@ export default function Space() {
|
|||
// setDataList([]);
|
||||
};
|
||||
const getSpaceList = async () => {
|
||||
setLoading(true);
|
||||
// setLoading(true);
|
||||
try {
|
||||
const data = await requireAPI("POST", "/api/zone/list_by_visitor_mid");
|
||||
setLoading(false);
|
||||
// setLoading(false);
|
||||
if (data.ret === -1) {
|
||||
Toast.show({
|
||||
icon: "fail",
|
||||
|
@ -90,13 +90,16 @@ export default function Space() {
|
|||
}
|
||||
};
|
||||
const getSpacePosts = async (offset) => {
|
||||
setLoading(true);
|
||||
// setLoading(true);
|
||||
try {
|
||||
const data =
|
||||
await requireAPI("POST", "/api/zone_moment/list_by_visitor_mid", {
|
||||
const data = await requireAPI(
|
||||
"POST",
|
||||
"/api/zone_moment/list_by_visitor_mid",
|
||||
{
|
||||
body: { offset, limit: 4 },
|
||||
});
|
||||
setLoading(false);
|
||||
}
|
||||
);
|
||||
// setLoading(false);
|
||||
if (data.ret === -1) {
|
||||
Toast.show({
|
||||
icon: "fail",
|
||||
|
@ -106,9 +109,10 @@ export default function Space() {
|
|||
return;
|
||||
}
|
||||
//在末尾添加元素以展示查看更多卡片
|
||||
setHasMore(data.data.more);
|
||||
setOffset(data.data.offset);
|
||||
if (data.data.list.length !== 0) {
|
||||
const finalData = [...data.data.list];
|
||||
setOffset(offset + 1);
|
||||
return finalData;
|
||||
}
|
||||
} catch (error) {
|
||||
|
@ -120,13 +124,13 @@ export default function Space() {
|
|||
const append = await getSpacePosts(offset);
|
||||
if (append) {
|
||||
setDataList((val) => [...val, ...append]);
|
||||
setHasMore(append.length > 0);
|
||||
// setHasMore(append.length > 0);
|
||||
}
|
||||
}
|
||||
return (
|
||||
<div
|
||||
className="h-screen overflow-x-hidden"
|
||||
style={{ maxHeight: `${scrollHeight}px` }}
|
||||
// style={{ maxHeight: `${scrollHeight}px` }}
|
||||
>
|
||||
<div className="flex justify-between items-center px-2 custom-tabs text-gray-400 sticky top-0 z-10 bg-deepBg">
|
||||
<Tabs
|
||||
|
@ -166,9 +170,13 @@ export default function Space() {
|
|||
{!activeIndex && (
|
||||
<div>
|
||||
{!loading ? (
|
||||
<div className="px-4 pb-8">
|
||||
// <div className="px-4 pb-8">
|
||||
|
||||
// </div>
|
||||
<>
|
||||
{dataList?.length > 0 ? (
|
||||
<ul className="grid grid-cols-2 gap-2 overflow-y-auto">
|
||||
<div className="px-4 pb-8">
|
||||
<ul className="grid grid-cols-2 gap-2 overflow-y-auto">
|
||||
{dataList?.map((item) => (
|
||||
<li key={item.id}>
|
||||
<VisitingCard data={item} />
|
||||
|
@ -209,6 +217,7 @@ export default function Space() {
|
|||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
) : (
|
||||
<div
|
||||
className={`flex flex-col items-center justify-center`}
|
||||
|
@ -231,7 +240,7 @@ export default function Space() {
|
|||
</div>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</>
|
||||
) : (
|
||||
<div
|
||||
className="w-full text-center flex items-center justify-center"
|
||||
|
@ -266,14 +275,14 @@ export default function Space() {
|
|||
))}
|
||||
<InfiniteScroll loadMore={loadMore} hasMore={hasMore} />
|
||||
</List>
|
||||
{!dataList?.length && (
|
||||
{/* {!dataList?.length && (
|
||||
<div
|
||||
className={`flex flex-col items-center justify-center`}
|
||||
style={{ height: `${scrollHeight}px` }}
|
||||
>
|
||||
<Empty type="nodata" />
|
||||
</div>
|
||||
)}
|
||||
)} */}
|
||||
</div>
|
||||
)}
|
||||
</Swiper.Item>
|
||||
|
|
|
@ -7,7 +7,7 @@ import { faAngleUp, faClose, faSave } from "@fortawesome/free-solid-svg-icons";
|
|||
import { saveFile } from "@/utils/tools/handleFuns";
|
||||
import { useRouter } from "next/navigation";
|
||||
import baseRequest from "@/utils/baseRequest";
|
||||
export default function Photos({ isUnlocked, mediaAmount, media, type }) {
|
||||
export default function Photos({ isUnlocked, mediaAmount, media, type, data }) {
|
||||
const [seeAllPhotos, setSeeAllPhotos] = useState(false);
|
||||
const [currentPhotos, setCurrentPhotos] = useState([]);
|
||||
const [photos, setPhotos] = useState([]);
|
||||
|
@ -185,7 +185,7 @@ export default function Photos({ isUnlocked, mediaAmount, media, type }) {
|
|||
}}
|
||||
>
|
||||
{
|
||||
<div className="overflow-hidden rounded h-full min-h-[24vw] max-h-80">
|
||||
<div className={`overflow-hidden rounded h-full max-h-80 ${currentPhotos.length>1?"min-h-[24vw]":"min-h-[38vw]"}`}>
|
||||
<Image
|
||||
// lazy={true}
|
||||
placeholder={
|
||||
|
|
|
@ -132,6 +132,7 @@ export default function PostItem({
|
|||
<div className="mr-8">
|
||||
{data.media_component && (
|
||||
<Photos
|
||||
data={data}
|
||||
media={data.media_component}
|
||||
isUnlocked={data.is_zone_moment_unlocked}
|
||||
mediaAmount={data.media_amount}
|
||||
|
|
Loading…
Reference in New Issue