import { View, Text } from "@tarojs/components"; import { Plus, User } from "@nutui/icons-react-taro"; import { getStorageSync, navigateTo } from "@tarojs/taro"; import PostList from "../../components/post-list"; import "./index.scss"; import { Image } from "@nutui/nutui-react-taro"; import { useEffect, useState } from "react"; import { getCircleInfoApi } from "../../api/circle"; import config from "../../config"; function Index() { const [circleData, setCircleData] = useState(null); const [userInfo, setUserInfo] = useState(null); const getUserInfo = () => { const userInfo = getStorageSync("User"); setUserInfo(userInfo); }; useEffect(() => { getCircleInfoApi({ id: 1 }).then((res: any) => { setCircleData(res.data); }); getUserInfo(); }, []); return ( {circleData?.name} {/* { navigateTo({ url: "/pages/self/index" }); }} > */} {userInfo?.is_vip ? ( <> { // window.location.href = `${config.TARO_ACT_HOST}/jifen/exchange?vip_code=${userInfo?.vip_code}`; navigateTo({ url: "/pages/act/index" }); }} > 福利中心 登录领奖 ) : ( <> )} {/* 游戏攻略 最新资讯 组队开黑 寻找队友 */} { navigateTo({ url: "/pages/self/index" }); }} > 个人中心 我的信息 {/* */} { navigateTo({ url: "/pages/publish/index" }); }} > ); } export default Index;