修复空间关注页面滚动,添加已解锁再进空间,修复空间价格不能为0 #40
|
@ -19,6 +19,7 @@ export const getStreamerInfo = async (mid) => {
|
|||
...data.data.list[0],
|
||||
refund_enable: data.data.refund_enable,
|
||||
refund_status: data.data.refund_status,
|
||||
exit_status: data.data.exit_status,
|
||||
};
|
||||
} catch (error) {
|
||||
// console.error(error);
|
||||
|
|
16
app/page.js
16
app/page.js
|
@ -40,7 +40,8 @@ export default function Home() {
|
|||
const [activeIndex, setActiveIndex] = useState(0);
|
||||
const [account, setAccount] = useState(null);
|
||||
const [scrollHeight, setScrollHeight] = useState(0);
|
||||
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [offset, setOffset] = useState(0);
|
||||
// useEffect(() => {
|
||||
// const info = get("account");
|
||||
// console.log("info",info)
|
||||
|
@ -49,11 +50,14 @@ export default function Home() {
|
|||
// }
|
||||
// }, []
|
||||
// )
|
||||
const childrenFunc = () => {
|
||||
const childrenFunc = async () => {
|
||||
setLoading(true);
|
||||
if (!activeIndex) {
|
||||
recommPostRef.current?.doRefresh();
|
||||
await recommPostRef.current?.doRefresh();
|
||||
setLoading(false);
|
||||
} else {
|
||||
followPostRef.current?.doRefresh();
|
||||
await followPostRef.current?.doRefresh();
|
||||
setLoading(false);
|
||||
}
|
||||
};
|
||||
useEffect(() => {
|
||||
|
@ -110,7 +114,9 @@ export default function Home() {
|
|||
</Swiper.Item>
|
||||
</Swiper>
|
||||
<div
|
||||
className={`fixed bottom-[146px] right-4 z-[50] w-10 h-10 flex items-center justify-center bg-[#1d1d1d71] rounded-full`}
|
||||
className={`fixed bottom-[146px] right-4 z-[50] w-10 h-10 flex items-center justify-center bg-[#1d1d1d71] rounded-full text-white ${
|
||||
loading && !offset ? "animate-spin" : ""
|
||||
}`}
|
||||
style={{ zIndex: 999 }}
|
||||
>
|
||||
<FontAwesomeIcon
|
||||
|
|
|
@ -1,20 +1,20 @@
|
|||
"use client";
|
||||
|
||||
import React, { useEffect, useRef, useState } from "react";
|
||||
import {
|
||||
Tabs,
|
||||
Swiper,
|
||||
Toast,
|
||||
List,
|
||||
InfiniteScroll,
|
||||
SpinLoading,
|
||||
} from "antd-mobile";
|
||||
import React, {
|
||||
useEffect,
|
||||
useRef,
|
||||
useState,
|
||||
useImperativeHandle,
|
||||
forwardRef,
|
||||
} from "react";
|
||||
import { Tabs, Swiper, Toast, List, InfiniteScroll } from "antd-mobile";
|
||||
import PostItem from "@/components/PostItem";
|
||||
import "./index.css";
|
||||
import Link from "next/link";
|
||||
import Empty from "@/components/Empty";
|
||||
import { useRouter } from "next/navigation";
|
||||
import PostItemSkeleton from "@/components/skeletons/PostItemSkeleton";
|
||||
import SpaceItemSkeleton from "@/components/skeletons/SpaceItemSkeleton";
|
||||
import requireAPI from "@/utils/requireAPI";
|
||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||
import { faRefresh } from "@fortawesome/free-solid-svg-icons";
|
||||
|
@ -30,13 +30,12 @@ const tabItems = [
|
|||
export default function Space() {
|
||||
const swiperRef = useRef(null);
|
||||
const [activeIndex, setActiveIndex] = useState(0);
|
||||
const [dataList, setDataList] = useState([]);
|
||||
// const [spacePost, setSpacePost] = useState([]);
|
||||
const [hasMore, setHasMore] = useState(1);
|
||||
const [scrollHeight, setScrollHeight] = useState(0);
|
||||
const [offset, setOffset] = useState(0);
|
||||
const [loading, setLoading] = useState(false);
|
||||
const router = useRouter();
|
||||
const spaceRef = useRef();
|
||||
const spacePostRef = useRef();
|
||||
// 获取屏幕高度
|
||||
// const scrollHeight = 600;
|
||||
useEffect(() => {
|
||||
|
@ -49,85 +48,16 @@ export default function Space() {
|
|||
// // window.removeEventListener("resize", handleResize);
|
||||
// };
|
||||
}, []);
|
||||
useEffect(() => {
|
||||
firstRequest();
|
||||
setDataList([]);
|
||||
}, [activeIndex]);
|
||||
const firstRequest = () => {
|
||||
resetOffset();
|
||||
if (activeIndex === 0) {
|
||||
getSpaceList();
|
||||
}
|
||||
if (activeIndex === 1) {
|
||||
getSpacePosts(0).then((res) => {
|
||||
res && setDataList(res);
|
||||
});
|
||||
const childrenFunc = async () => {
|
||||
setLoading(true);
|
||||
if (!activeIndex) {
|
||||
await spaceRef.current?.doRefresh();
|
||||
setLoading(false);
|
||||
} else {
|
||||
await spacePostRef.current?.doRefresh();
|
||||
setLoading(false);
|
||||
}
|
||||
};
|
||||
const resetOffset = () => {
|
||||
setOffset(0);
|
||||
};
|
||||
const getSpaceList = async () => {
|
||||
// setLoading(true);
|
||||
try {
|
||||
const data = await requireAPI("POST", "/api/zone/list_by_visitor_mid");
|
||||
// setLoading(false);
|
||||
if (data.ret === -1) {
|
||||
Toast.show({
|
||||
icon: "fail",
|
||||
content: data.msg,
|
||||
position: "top",
|
||||
});
|
||||
return;
|
||||
}
|
||||
//在末尾添加元素以展示查看更多卡片
|
||||
if (data.data.list.length !== 0) {
|
||||
const finalData = [...data.data.list];
|
||||
setDataList(finalData);
|
||||
return;
|
||||
}
|
||||
} catch (error) {
|
||||
// console.error(error);
|
||||
}
|
||||
};
|
||||
const getSpacePosts = async (offset) => {
|
||||
// setLoading(true);
|
||||
try {
|
||||
const data = await requireAPI(
|
||||
"POST",
|
||||
"/api/zone_moment/list_by_visitor_mid",
|
||||
{
|
||||
body: { offset, limit: 4 },
|
||||
}
|
||||
);
|
||||
// setLoading(false);
|
||||
if (data.ret === -1) {
|
||||
Toast.show({
|
||||
icon: "fail",
|
||||
content: data.msg,
|
||||
position: "top",
|
||||
});
|
||||
return;
|
||||
}
|
||||
//在末尾添加元素以展示查看更多卡片
|
||||
setHasMore(data.data.more);
|
||||
setOffset(data.data.offset);
|
||||
if (data.data.list.length !== 0) {
|
||||
const finalData = [...data.data.list];
|
||||
return finalData;
|
||||
}
|
||||
} catch (error) {
|
||||
// console.error(error);
|
||||
}
|
||||
};
|
||||
async function loadMore() {
|
||||
if (!offset) return;
|
||||
const append = await getSpacePosts(offset);
|
||||
if (append) {
|
||||
setDataList((val) => [...val, ...append]);
|
||||
// setHasMore(append.length > 0);
|
||||
}
|
||||
}
|
||||
return (
|
||||
<div className="">
|
||||
<div className="flex justify-between items-center px-2 custom-tabs text-gray-400 sticky top-0 z-10 bg-deepBg">
|
||||
|
@ -167,127 +97,14 @@ export default function Space() {
|
|||
}}
|
||||
>
|
||||
<Swiper.Item>
|
||||
<div>
|
||||
{!loading ? (
|
||||
// <div className="px-4 pb-8">
|
||||
|
||||
// </div>
|
||||
<>
|
||||
{dataList?.length > 0 ? (
|
||||
<div className="px-4 pb-20">
|
||||
<ul className="grid grid-cols-2 gap-2 overflow-y-auto">
|
||||
{dataList?.map((item) => (
|
||||
<li key={item.id}>
|
||||
<VisitingCard data={item} />
|
||||
</li>
|
||||
))}
|
||||
<li onClick={() => router.push("/search")}>
|
||||
<div
|
||||
// onPress={() => navigation.navigate("Stream")}
|
||||
// onClick={}
|
||||
className="w-full h-52"
|
||||
>
|
||||
<div
|
||||
className="h-full flex flex-col rounded-lg overflow-hidden bg-[#FFFFFF1A] bg-no-repeat bg-right-bottom bg-40%"
|
||||
style={{
|
||||
backgroundImage: `url(${
|
||||
process.env.NEXT_PUBLIC_WEB_ASSETS_URL +
|
||||
"/icons/magnifier.png"
|
||||
})`,
|
||||
}}
|
||||
>
|
||||
{/* <div className="w-full z-0"></div>
|
||||
<div
|
||||
className="w-full z-0 h-[42px]"
|
||||
></div> */}
|
||||
<div className="flex flex-col w-full h-full px-[22px] py-[30px]">
|
||||
<p className="text-white font-medium text-lg">
|
||||
发现更多
|
||||
</p>
|
||||
<p className="text-[#FFFFFF40] font-sm">
|
||||
缘分就在不经意间
|
||||
</p>
|
||||
<OwnIcon
|
||||
className="w-full h-full"
|
||||
outClassName="w-[32px] h-[32px] mt-4"
|
||||
src="/icons/rightarrow_border.png"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
) : (
|
||||
<div
|
||||
className={`flex flex-col items-center justify-center`}
|
||||
style={{ height: `calc(100vh - 120px)` }}
|
||||
>
|
||||
<Empty type="nospace" />
|
||||
<div className="flex flex-col mt-6">
|
||||
<Link
|
||||
href="search"
|
||||
className="bg-[#FFFFFF40] px-12 py-2 rounded-full text-base text-white"
|
||||
>
|
||||
搜索空间
|
||||
</Link>
|
||||
{/* <Link
|
||||
href="search"
|
||||
className="bg-[#FFFFFF40] px-12 py-2 rounded-full text-base text-white mt-2"
|
||||
>
|
||||
查看推荐
|
||||
</Link> */}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</>
|
||||
) : (
|
||||
<div
|
||||
className="w-full text-center flex items-center justify-center h-screen"
|
||||
// style={{ height: scrollHeight - 60 + "px" }}
|
||||
>
|
||||
<SpinLoading />
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
{!activeIndex && (
|
||||
<SpacesList scrollHeight={scrollHeight} ref={spaceRef} />
|
||||
)}
|
||||
</Swiper.Item>
|
||||
<Swiper.Item>
|
||||
<div className="px-4 pb-20">
|
||||
<List className="scrollbarBox_hidden">
|
||||
{loading && !dataList.length && (
|
||||
<>
|
||||
<PostItemSkeleton />
|
||||
<PostItemSkeleton />
|
||||
<PostItemSkeleton />
|
||||
<PostItemSkeleton />
|
||||
</>
|
||||
)}
|
||||
{dataList?.map((item, index) => (
|
||||
<List.Item className="!p-0" key={item.id + "_" + index}>
|
||||
<PostItem
|
||||
type="space"
|
||||
data={item}
|
||||
date={new Date(item.ct * 1000)}
|
||||
/>
|
||||
</List.Item>
|
||||
))}
|
||||
<InfiniteScroll loadMore={loadMore} hasMore={hasMore}>
|
||||
<InfiniteScrollContent
|
||||
hasMore={hasMore}
|
||||
isEmpty={dataList.length === 0}
|
||||
showNoMore={!dataList.length}
|
||||
/>
|
||||
</InfiniteScroll>
|
||||
</List>
|
||||
{/* {!dataList?.length && (
|
||||
<div
|
||||
className={`flex flex-col items-center justify-center`}
|
||||
style={{ height: `${scrollHeight}px` }}
|
||||
>
|
||||
<Empty type="nodata" />
|
||||
</div>
|
||||
)} */}
|
||||
</div>
|
||||
{!!activeIndex && (
|
||||
<SpacePostList scrollHeight={scrollHeight} ref={spacePostRef} />
|
||||
)}
|
||||
</Swiper.Item>
|
||||
</Swiper>
|
||||
<div
|
||||
|
@ -307,7 +124,8 @@ export default function Space() {
|
|||
left: 0,
|
||||
behavior: "smooth", // 可选,平滑滚动效果
|
||||
});
|
||||
firstRequest();
|
||||
childrenFunc();
|
||||
// firstRequest();
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
|
@ -358,3 +176,277 @@ const VisitingCard = ({ data }) => {
|
|||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
const SpacesList = forwardRef(({ scrollHeight }, ref) => {
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [hasMore, setHasMore] = useState(true);
|
||||
const [offset, setOffset] = useState(0);
|
||||
const [spacesList, setSpacesList] = useState([]);
|
||||
useEffect(() => {
|
||||
// getSpaceList(2).then((res) => {
|
||||
// setSpacesList(res);
|
||||
// setHasMore(true)
|
||||
// });
|
||||
}, []);
|
||||
useImperativeHandle(
|
||||
ref,
|
||||
() => {
|
||||
return { doRefresh };
|
||||
},
|
||||
[]
|
||||
);
|
||||
async function doRefresh() {
|
||||
// await sleep(1000);
|
||||
// Toast.show({
|
||||
// icon: "fail",
|
||||
// content: "刷新失败",
|
||||
// });
|
||||
// throw new Error("刷新失败");
|
||||
window.scrollTo({
|
||||
top: 0,
|
||||
left: 0,
|
||||
behavior: "smooth", // 可选,平滑滚动效果
|
||||
});
|
||||
const list = await getSpaceList(1);
|
||||
setSpacesList(list);
|
||||
setHasMore(true);
|
||||
return true;
|
||||
}
|
||||
async function loadMore() {
|
||||
// debugger
|
||||
const list = await getSpaceList(!spacesList.length ? 2 : 0);
|
||||
if (list.length == 0) {
|
||||
setHasMore(false);
|
||||
}
|
||||
setSpacesList([...spacesList, ...list]);
|
||||
}
|
||||
const getSpaceList = async (type = 2) => {
|
||||
setLoading(true);
|
||||
try {
|
||||
const data = await requireAPI(
|
||||
"POST",
|
||||
"/api/zone/list_by_visitor_mid_v2",
|
||||
{
|
||||
body: { offset, limit: 4 },
|
||||
}
|
||||
);
|
||||
setOffset(data.data.offset);
|
||||
setHasMore(data.data.more);
|
||||
setLoading(false);
|
||||
if (data.ret == -1) {
|
||||
// Toast.show({
|
||||
// icon: "fail",
|
||||
// content: data.msg,
|
||||
// position: "top",
|
||||
// });
|
||||
return [];
|
||||
} else {
|
||||
return data.data.list;
|
||||
}
|
||||
} catch (error) {
|
||||
setLoading(false);
|
||||
}
|
||||
};
|
||||
return (
|
||||
// <div className="px-4 pb-20 max-h-screen overflow-y-auto">
|
||||
<div className="px-4 pb-20 min-h-screen">
|
||||
{loading && !spacesList.length && (
|
||||
<div className="grid grid-cols-2 gap-2 overflow-y-auto">
|
||||
<SpaceItemSkeleton />
|
||||
<SpaceItemSkeleton />
|
||||
<SpaceItemSkeleton />
|
||||
<SpaceItemSkeleton />
|
||||
<SpaceItemSkeleton />
|
||||
<SpaceItemSkeleton />
|
||||
<SpaceItemSkeleton />
|
||||
<SpaceItemSkeleton />
|
||||
<SpaceItemSkeleton />
|
||||
<SpaceItemSkeleton />
|
||||
</div>
|
||||
)}
|
||||
<ul className="grid grid-cols-2 gap-2 overflow-y-auto">
|
||||
{spacesList?.map((item) => (
|
||||
<li key={item.id} className="!p-0">
|
||||
<VisitingCard data={item} />
|
||||
</li>
|
||||
))}
|
||||
<li onClick={() => router.push("/search")}>
|
||||
<div
|
||||
// onPress={() => navigation.navigate("Stream")}
|
||||
// onClick={}
|
||||
className="w-full h-52"
|
||||
>
|
||||
<div
|
||||
className="h-full flex flex-col rounded-lg overflow-hidden bg-[#FFFFFF1A] bg-no-repeat bg-right-bottom bg-40%"
|
||||
style={{
|
||||
backgroundImage: `url(${
|
||||
process.env.NEXT_PUBLIC_WEB_ASSETS_URL +
|
||||
"/icons/magnifier.png"
|
||||
})`,
|
||||
}}
|
||||
>
|
||||
{/* <div className="w-full z-0"></div>
|
||||
<div
|
||||
className="w-full z-0 h-[42px]"
|
||||
></div> */}
|
||||
<div className="flex flex-col w-full h-full px-[22px] py-[30px]">
|
||||
<p className="text-white font-medium text-lg">发现更多</p>
|
||||
<p className="text-[#FFFFFF40] font-sm">缘分就在不经意间</p>
|
||||
<OwnIcon
|
||||
className="w-full h-full"
|
||||
outClassName="w-[32px] h-[32px] mt-4"
|
||||
src="/icons/rightarrow_border.png"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
{/* {spacesList?.length == 0 && !loading && (
|
||||
<div
|
||||
className={`flex flex-col items-center justify-center h-screen`}
|
||||
// style={{ height: `${scrollHeight}px` }}
|
||||
>
|
||||
<Empty type="nodata" />
|
||||
</div>
|
||||
)} */}
|
||||
</ul>
|
||||
{/* {!!spacesList?.length && (
|
||||
<InfiniteScroll loadMore={loadMore} hasMore={hasMore} />
|
||||
)} */}
|
||||
<InfiniteScroll loadMore={loadMore} hasMore={hasMore}>
|
||||
<InfiniteScrollContent
|
||||
hasMore={hasMore}
|
||||
isEmpty={spacesList.length == 0}
|
||||
showNoMore={spacesList.length === 0}
|
||||
/>
|
||||
</InfiniteScroll>
|
||||
</div>
|
||||
);
|
||||
});
|
||||
const SpacePostList = forwardRef(({ scrollHeight }, ref) => {
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [hasMore, setHasMore] = useState(false);
|
||||
const [spacePostList, setSpacePostList] = useState([]);
|
||||
const [currentTime, setCurrentTime] = useState();
|
||||
const [offset, setOffset] = useState(0);
|
||||
const ids = useRef(null);
|
||||
useEffect(() => {
|
||||
getFollowIds().then((res) => {
|
||||
ids.current = res;
|
||||
getSpacePostList(res, 0);
|
||||
});
|
||||
}, []);
|
||||
useImperativeHandle(
|
||||
ref,
|
||||
() => {
|
||||
return { doRefresh };
|
||||
},
|
||||
[]
|
||||
);
|
||||
async function doRefresh() {
|
||||
// await sleep(1000);
|
||||
// Toast.show({
|
||||
// icon: "fail",
|
||||
// content: "刷新失败",
|
||||
// });
|
||||
// throw new Error("刷新失败");
|
||||
// getRecommPostList(1);
|
||||
window.scrollTo({
|
||||
top: 0,
|
||||
left: 0,
|
||||
behavior: "smooth", // 可选,平滑滚动效果
|
||||
});
|
||||
// setSpacePostList([]);
|
||||
await getSpacePostList(ids.current, 0);
|
||||
return true;
|
||||
}
|
||||
async function loadMore() {
|
||||
await getSpacePostList(ids.current, offset);
|
||||
// const newList = [...spacePostList, ...list];
|
||||
// setSpacePostList(newList);
|
||||
}
|
||||
const getFollowIds = async () => {
|
||||
setLoading(true);
|
||||
setCurrentTime(Math.floor(new Date().getTime() / 1000));
|
||||
const data = await requireAPI(
|
||||
"POST",
|
||||
"/api/account_relation/list_follow",
|
||||
{
|
||||
body: { offset, limit: 4 },
|
||||
},
|
||||
true
|
||||
);
|
||||
return data;
|
||||
};
|
||||
const getSpacePostList = async (data, offset) => {
|
||||
if (data.data.list.length > 0) {
|
||||
//查关注主播展示资料
|
||||
const postsResponse = await requireAPI(
|
||||
"POST",
|
||||
"/api/zone_moment/list_by_visitor_mid",
|
||||
{
|
||||
body: {
|
||||
offset,
|
||||
limit: 4,
|
||||
},
|
||||
}
|
||||
);
|
||||
// debugger;
|
||||
// console.log("offset", postsResponse.data.offset);
|
||||
setOffset(postsResponse.data.offset);
|
||||
setHasMore(postsResponse.data.more);
|
||||
setLoading(false);
|
||||
if (data.ret == -1) {
|
||||
// Toast.show({
|
||||
// icon: "fail",
|
||||
// content: data.msg,
|
||||
// position: "top",
|
||||
// });
|
||||
} else {
|
||||
setSpacePostList((old) => {
|
||||
if (!offset) {
|
||||
return postsResponse.data.list;
|
||||
} else {
|
||||
return [...old, ...postsResponse.data.list];
|
||||
}
|
||||
});
|
||||
}
|
||||
} else {
|
||||
setLoading(false);
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="px-4 pb-20">
|
||||
{/* <PullToRefresh onRefresh={doRefresh}> */}
|
||||
<List>
|
||||
{loading && !spacePostList.length && (
|
||||
<div className="mb-[31px]">
|
||||
<PostItemSkeleton />
|
||||
<PostItemSkeleton />
|
||||
<PostItemSkeleton />
|
||||
<PostItemSkeleton />
|
||||
<PostItemSkeleton />
|
||||
</div>
|
||||
)}
|
||||
{spacePostList?.map((item, index) => (
|
||||
<List.Item key={item.id + "_" + index} className="!p-0">
|
||||
<PostItem type="post" data={item} date={new Date(item.ct * 1000)} />
|
||||
</List.Item>
|
||||
))}
|
||||
{!spacePostList?.length && (
|
||||
<div
|
||||
className={`flex flex-col items-center justify-center h-screen`}
|
||||
style={{ height: `calc(100vh - 133px)` }}
|
||||
>
|
||||
<Empty type="nodata" />
|
||||
</div>
|
||||
)}
|
||||
</List>
|
||||
{!!spacePostList?.length && (
|
||||
<InfiniteScroll loadMore={loadMore} hasMore={hasMore} />
|
||||
)}
|
||||
{/* </PullToRefresh> */}
|
||||
</div>
|
||||
);
|
||||
});
|
||||
|
|
|
@ -72,7 +72,28 @@ export default function PersonSpaceIntroduce() {
|
|||
});
|
||||
return;
|
||||
}
|
||||
router.push("/space/" + mid);
|
||||
router.replace("/space/" + mid);
|
||||
} catch (error) {
|
||||
// console.error(error);
|
||||
}
|
||||
};
|
||||
const handleReenterSpace = async () => {
|
||||
try {
|
||||
const body = {
|
||||
zid: data?.id,
|
||||
};
|
||||
const _data = await requireAPI("POST", "/api/zone/exit_reenter", {
|
||||
body,
|
||||
});
|
||||
if (_data.ret === -1) {
|
||||
Toast.show({
|
||||
icon: "fail",
|
||||
content: _data.msg,
|
||||
position: "top",
|
||||
});
|
||||
return;
|
||||
}
|
||||
router.replace("/space/" + mid);
|
||||
} catch (error) {
|
||||
// console.error(error);
|
||||
}
|
||||
|
@ -235,6 +256,10 @@ export default function PersonSpaceIntroduce() {
|
|||
<div
|
||||
className="flex items-center py-2 text-base"
|
||||
onClick={() => {
|
||||
if (data.exit_status === 1) {
|
||||
handleReenterSpace();
|
||||
return;
|
||||
}
|
||||
if (data?.admission_price === 0) {
|
||||
handleJoinFreeSpace();
|
||||
} else {
|
||||
|
@ -269,18 +294,25 @@ export default function PersonSpaceIntroduce() {
|
|||
}
|
||||
}}
|
||||
>
|
||||
{data?.admission_price !== 0 && (
|
||||
<OwnIcon
|
||||
className="w-[18px] h-[18px]"
|
||||
outClassName="mr-2"
|
||||
src="/icons/money_pink.png"
|
||||
/>
|
||||
{data?.exit_status === 1 ? (
|
||||
<span>已解锁</span>
|
||||
) : (
|
||||
<>
|
||||
{data?.admission_price !== 0 && (
|
||||
<OwnIcon
|
||||
className="w-[18px] h-[18px]"
|
||||
outClassName="mr-2"
|
||||
src="/icons/money_pink.png"
|
||||
/>
|
||||
)}
|
||||
<span>
|
||||
{data?.admission_price === 0
|
||||
? "免费加入"
|
||||
: `${(data?.admission_price || 0) / 100}元立即加入`}
|
||||
</span>
|
||||
</>
|
||||
)}
|
||||
<span>
|
||||
{data?.admission_price === 0
|
||||
? "免费加入"
|
||||
: `${(data?.admission_price || 0) / 100}元立即加入`}
|
||||
</span>
|
||||
|
||||
<FontAwesomeIcon
|
||||
icon={faAngleRight}
|
||||
size="xl"
|
||||
|
|
|
@ -443,7 +443,7 @@ export default function SpacePaymentSetting() {
|
|||
{
|
||||
required: true,
|
||||
message: messageEle("请填写解锁空间的价格"),
|
||||
pattern: /^[1-9]\d*$/,
|
||||
pattern: /^[0-9]\d*$/,
|
||||
// validator: (rule, value) => {
|
||||
// if (value.length === 0) {
|
||||
// return Promise.reject(messageEle("请选择性别"));
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
"use client";
|
||||
|
||||
import React from "react";
|
||||
import { Skeleton } from "antd-mobile";
|
||||
import styles from "./index.module.scss";
|
||||
export default function SpaceItemSkeleton() {
|
||||
return (
|
||||
<div className="relative">
|
||||
<Skeleton animated className={styles.photoSkeleton} />
|
||||
<Skeleton animated className={styles.titleSkeleton} />
|
||||
</div>
|
||||
);
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
|
||||
.photoSkeleton {
|
||||
--height: 13rem!important;
|
||||
--border-radius: 4px!important;
|
||||
background-color: #ffffff1a;
|
||||
// margin-bottom: 1rem;
|
||||
}
|
||||
.titleSkeleton {
|
||||
--height: 42px!important;
|
||||
--border-radius: 4px!important;
|
||||
background-color: #ffffff1a;
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
}
|
Loading…
Reference in New Issue