|
|
@@ -7,19 +7,13 @@ import "./index.scss";
|
|
|
import { Image, Sticky, TabPane, Tabs } from "@nutui/nutui-react-taro";
|
|
|
import { useEffect, useRef, useState } from "react";
|
|
|
import { getCircleInfoApi } from "../../api/circle";
|
|
|
+import GameIntro from "../../components/game-intro";
|
|
|
|
|
|
function Index() {
|
|
|
const [circleData, setCircleData] = useState<any>(null);
|
|
|
- const [tab1value, setTab1value] = useState<string | number>("0");
|
|
|
- const [stickyNum, setStickyNum] = useState<number>(50);
|
|
|
+ const [tab1value, setTab1value] = useState<string | number>("1");
|
|
|
const containerTopRef = useRef<HTMLDivElement>(null);
|
|
|
const postListRef = useRef<PostListRef>(null);
|
|
|
- // const [userInfo, setUserInfo] = useState<any>(null);
|
|
|
-
|
|
|
- // const getUserInfo = () => {
|
|
|
- // const userInfo = getStorageSync("User");
|
|
|
- // setUserInfo(userInfo);
|
|
|
- // };
|
|
|
useEffect(() => {
|
|
|
getCircleInfoApi({ id: 1 }).then((res: any) => {
|
|
|
setCircleData(res.data);
|
|
|
@@ -29,14 +23,11 @@ function Index() {
|
|
|
|
|
|
const handleUpperThreshold = () => {
|
|
|
console.log("handleUpperThreshold");
|
|
|
- setStickyNum(50);
|
|
|
};
|
|
|
const handleScroll = (e: any) => {
|
|
|
console.log("handleScroll", e);
|
|
|
if (e.detail.scrollTop > 50) {
|
|
|
- setStickyNum(0);
|
|
|
} else {
|
|
|
- setStickyNum(50);
|
|
|
containerTopRef.current?.scrollTo({
|
|
|
top: 50,
|
|
|
behavior: "smooth",
|
|
|
@@ -56,7 +47,7 @@ function Index() {
|
|
|
};
|
|
|
return (
|
|
|
<View
|
|
|
- style={{ height: "calc(100vh - 50px)" }}
|
|
|
+ style={{ height: "calc(100vh)" }}
|
|
|
ref={containerTopRef}
|
|
|
className="index"
|
|
|
>
|
|
|
@@ -99,19 +90,19 @@ function Index() {
|
|
|
<View className="page-content">
|
|
|
<View className="scrollable-banner h-[100px] pb-[10px] bg-[#6069d9] pt-[60px] flex items-center justify-around">
|
|
|
<View
|
|
|
- className="text-[#fff] w-[100px] h-[30px] flex items-center justify-center text-center text-[14px] font-[800] px-[10px] bg-[#5258acf0] "
|
|
|
+ className="text-[#fff] w-[28%] h-[30px] flex items-center justify-center text-center text-[12px] rounded-[5px] font-[800] px-[10px] bg-[#5258acf0] "
|
|
|
onClick={() => {
|
|
|
navigateTo({ url: "/pages/act/index" });
|
|
|
}}
|
|
|
>
|
|
|
积分中心
|
|
|
</View>
|
|
|
- <View className="text-[#fff] w-[100px] h-[30px] flex items-center justify-center text-center text-[14px] font-[800] px-[10px] bg-[#5258acf0]">
|
|
|
+ <View className="text-[#fff] w-[28%] h-[30px] flex items-center justify-center text-center text-[12px] rounded-[5px] font-[800] px-[10px] bg-[#5258acf0]">
|
|
|
<Gift size={16} />
|
|
|
礼包中心
|
|
|
</View>
|
|
|
<View
|
|
|
- className="text-[#fff] w-[100px] h-[30px] flex items-center justify-center text-center text-[14px] font-[800] px-[10px] bg-[#5258acf0]"
|
|
|
+ className="text-[#fff] w-[28%] h-[30px] flex items-center justify-center text-center text-[12px] rounded-[5px] font-[800] px-[10px] bg-[#5258acf0]"
|
|
|
onClick={() => {
|
|
|
navigateTo({ url: "/pages/publish/index" });
|
|
|
}}
|
|
|
@@ -128,6 +119,9 @@ function Index() {
|
|
|
setTab1value(value);
|
|
|
}}
|
|
|
>
|
|
|
+ <TabPane title="游戏介绍">
|
|
|
+ <GameIntro />
|
|
|
+ </TabPane>
|
|
|
<TabPane title="最新">
|
|
|
<ScrollView
|
|
|
upperThreshold={50}
|
|
|
@@ -136,7 +130,7 @@ function Index() {
|
|
|
onScrollToLower={handleScrollToLower}
|
|
|
onScroll={handleScroll}
|
|
|
scrollY
|
|
|
- style={{ height: "calc(100vh - 50px)" }}
|
|
|
+ style={{ height: "calc(100vh)" }}
|
|
|
>
|
|
|
<PostList ref={postListRef} />
|
|
|
</ScrollView>
|