diff --git a/app/space/page.js b/app/space/page.js index 0d2ebf5..9c6631e 100644 --- a/app/space/page.js +++ b/app/space/page.js @@ -51,6 +51,7 @@ export default function Space() { }, []); useEffect(() => { firstRequest(); + setDataList([]); }, [activeIndex]); const firstRequest = () => { resetOffset(); @@ -65,7 +66,6 @@ export default function Space() { }; const resetOffset = () => { setOffset(0); - // setDataList([]); }; const getSpaceList = async () => { // setLoading(true); @@ -136,7 +136,7 @@ export default function Space() { onChange={(key) => { const index = tabItems.findIndex((item) => item.key === key); setActiveIndex(index); - // swiperRef.current?.swipeTo(index); + swiperRef.current?.swipeTo(index); }} > {tabItems.map((item) => ( @@ -155,132 +155,131 @@ export default function Space() { + {} null} - // ref={swiperRef} + ref={swiperRef} defaultIndex={activeIndex} + allowTouchMove={false} onIndexChange={(index) => { setActiveIndex(index); }} > - {!activeIndex && ( -
- {!loading ? ( - //
+
+ {!loading ? ( + //
- //
- <> - {dataList?.length > 0 ? ( -
-
    - {dataList?.map((item) => ( -
  • - -
  • - ))} -
  • router.push("/search")}> + //
+ <> + {dataList?.length > 0 ? ( +
+
    + {dataList?.map((item) => ( +
  • + +
  • + ))} +
  • router.push("/search")}> +
    navigation.navigate("Stream")} + // onClick={} + className="w-full h-52" + >
    navigation.navigate("Stream")} - // onClick={} - className="w-full h-52" + 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" + })`, + }} > -
    - {/*
    + {/*
    */} -
    -

    - 发现更多 -

    -

    - 缘分就在不经意间 -

    - -
    +
    +

    + 发现更多 +

    +

    + 缘分就在不经意间 +

    +
    -
  • -
-
- ) : ( -
- -
- - 搜索空间 - - {/* + + +
+ ) : ( +
+ +
+ + 搜索空间 + + {/* 查看推荐 */} -
- )} - - ) : ( -
- -
- )} -
- )} +
+ )} + + ) : ( +
+ +
+ )} +
- {!!activeIndex && ( -
- - {loading && !dataList.length && ( - <> - - - - - - )} - {dataList?.map((item, index) => ( - - - - ))} - - + + {loading && !dataList.length && ( + <> + + + + + + )} + {dataList?.map((item, index) => ( + + - - - {/* {!dataList?.length && ( + + ))} + + + + + {/* {!dataList?.length && (
)} */} -
- )} +