+
+ {loading && !spacesList.length && (
+
+
+
+
+
+
+
+
+
+
+
+
+ )}
+
+ {spacesList?.map((item) => (
+ -
+
+
+ ))}
+ - router.push("/search")}>
+
navigation.navigate("Stream")}
+ // onClick={}
+ className="w-full h-52"
+ >
+
+
+
+ {/* {spacesList?.length == 0 && !loading && (
+
+
+
+ )} */}
+
+ {/* {!!spacesList?.length && (
+
+ )} */}
+
+
+
+
+ );
+});
+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 (
+
+ {/*
*/}
+
+ {loading && !spacePostList.length && (
+
+ )}
+ {spacePostList?.map((item, index) => (
+
+
+
+ ))}
+ {!spacePostList?.length && (
+
+
+
+ )}
+
+ {!!spacePostList?.length && (
+
+ )}
+ {/* */}
+
+ );
+});
diff --git a/app/space/person_space_introduce/[mid]/page.js b/app/space/person_space_introduce/[mid]/page.js
index 853f57c..cd8ef54 100644
--- a/app/space/person_space_introduce/[mid]/page.js
+++ b/app/space/person_space_introduce/[mid]/page.js
@@ -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() {
{
+ 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 && (
-
+ {data?.exit_status === 1 ? (
+
已解锁
+ ) : (
+ <>
+ {data?.admission_price !== 0 && (
+
+ )}
+
+ {data?.admission_price === 0
+ ? "免费加入"
+ : `${(data?.admission_price || 0) / 100}元立即加入`}
+
+ >
)}
-
- {data?.admission_price === 0
- ? "免费加入"
- : `${(data?.admission_price || 0) / 100}元立即加入`}
-
+
{
// if (value.length === 0) {
// return Promise.reject(messageEle("请选择性别"));
diff --git a/components/skeletons/SpaceItemSkeleton/index.js b/components/skeletons/SpaceItemSkeleton/index.js
new file mode 100644
index 0000000..15998b1
--- /dev/null
+++ b/components/skeletons/SpaceItemSkeleton/index.js
@@ -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 (
+
+
+
+
+ );
+}
diff --git a/components/skeletons/SpaceItemSkeleton/index.module.scss b/components/skeletons/SpaceItemSkeleton/index.module.scss
new file mode 100644
index 0000000..45e7743
--- /dev/null
+++ b/components/skeletons/SpaceItemSkeleton/index.module.scss
@@ -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;
+}
\ No newline at end of file