|
|
@@ -1,6 +1,6 @@
|
|
|
import { View } from "@tarojs/components";
|
|
|
-import { Gift, Home, Plus, User } from "@nutui/icons-react-taro";
|
|
|
-import { navigateTo, redirectTo } from "@tarojs/taro";
|
|
|
+import { Gift, Home, User } from "@nutui/icons-react-taro";
|
|
|
+import { navigateTo, redirectTo, getStorageSync } from "@tarojs/taro";
|
|
|
import PostList from "../../components/post-list";
|
|
|
|
|
|
import "./index.scss";
|
|
|
@@ -14,7 +14,6 @@ import {
|
|
|
import { useEffect, useRef, useState } from "react";
|
|
|
import { getCircleInfoApi } from "../../api/circle";
|
|
|
import GameIntro from "../../components/game-intro";
|
|
|
-import { getVipUserInfoApi, getVipUserRoleListApi } from "../../api/user";
|
|
|
|
|
|
function Index() {
|
|
|
const [circleData, setCircleData] = useState<any>(null);
|
|
|
@@ -25,26 +24,9 @@ function Index() {
|
|
|
getCircleInfoApi({ id: 1 }).then((res: any) => {
|
|
|
setCircleData(res.data);
|
|
|
});
|
|
|
- getVipUserRoleList();
|
|
|
+ setVipUserInfo(getStorageSync("vipInfo"));
|
|
|
}, []);
|
|
|
|
|
|
- // 获取vip用户角色信息
|
|
|
- const getVipUserRoleList = async () => {
|
|
|
- const res: any = await getVipUserRoleListApi({});
|
|
|
-
|
|
|
- if (res.code === 200 && res.data.length > 0) {
|
|
|
- getVipUserInfo(res.data[0].role_id);
|
|
|
- }
|
|
|
- };
|
|
|
-
|
|
|
- // 获取vip用户信息
|
|
|
- const getVipUserInfo = async (role_id: number) => {
|
|
|
- const res: any = await getVipUserInfoApi({ role_id });
|
|
|
- if (res.code === 200) {
|
|
|
- setVipUserInfo(res.data);
|
|
|
- }
|
|
|
- };
|
|
|
-
|
|
|
return (
|
|
|
<View ref={containerTopRef} className="index">
|
|
|
{/* 头部导航栏 - 移出page-content容器 */}
|
|
|
@@ -91,25 +73,26 @@ function Index() {
|
|
|
{/* 页面内容 - 使用ScrollView控制整个页面滚动 */}
|
|
|
|
|
|
<View className="page-content">
|
|
|
- <View className="flex items-center justify-around w-[100%]">
|
|
|
- <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] "
|
|
|
- onClick={() => {
|
|
|
- navigateTo({ url: "/pages/act/index" });
|
|
|
- }}
|
|
|
- >
|
|
|
- 积分中心
|
|
|
- </View>
|
|
|
- <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]"
|
|
|
- onClick={() => {
|
|
|
- navigateTo({ url: "/pages/gift/index" });
|
|
|
- }}
|
|
|
- >
|
|
|
- <Gift size={16} />
|
|
|
- 礼包中心
|
|
|
- </View>
|
|
|
- {/* <View
|
|
|
+ {vipUserInfo && (
|
|
|
+ <View className="flex items-center justify-around w-[100%]">
|
|
|
+ <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] "
|
|
|
+ onClick={() => {
|
|
|
+ navigateTo({ url: "/pages/act/index" });
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ 积分中心
|
|
|
+ </View>
|
|
|
+ <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]"
|
|
|
+ onClick={() => {
|
|
|
+ navigateTo({ url: "/pages/gift/index" });
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ <Gift size={16} />
|
|
|
+ 礼包中心
|
|
|
+ </View>
|
|
|
+ {/* <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]"
|
|
|
onClick={() => {
|
|
|
navigateTo({ url: "/pages/publish/index" });
|
|
|
@@ -118,9 +101,14 @@ function Index() {
|
|
|
<Plus size={20} />
|
|
|
发布帖子
|
|
|
</View> */}
|
|
|
- </View>
|
|
|
+ </View>
|
|
|
+ )}
|
|
|
{vipUserInfo?.notice && <NoticeBar content={vipUserInfo.notice} />}
|
|
|
- <View style={{ height: "calc(100vh - 180px)" }}>
|
|
|
+ <View
|
|
|
+ style={{
|
|
|
+ height: vipUserInfo ? "calc(100vh - 180px)" : "calc(100vh - 100px)",
|
|
|
+ }}
|
|
|
+ >
|
|
|
<Tabs
|
|
|
align="left"
|
|
|
autoHeight
|
|
|
@@ -132,14 +120,24 @@ function Index() {
|
|
|
{vipUserInfo?.download_list && (
|
|
|
<TabPane title="游戏介绍" value="0">
|
|
|
<GameIntro
|
|
|
- style={{ height: "calc(100vh - 260px)" }}
|
|
|
+ style={{
|
|
|
+ height: vipUserInfo
|
|
|
+ ? "calc(100vh - 260px)"
|
|
|
+ : "calc(100vh - 180px)",
|
|
|
+ }}
|
|
|
vipUserInfo={vipUserInfo}
|
|
|
/>
|
|
|
</TabPane>
|
|
|
)}
|
|
|
|
|
|
<TabPane title="官方咨讯" value="1">
|
|
|
- <PostList style={{ height: "calc(100vh - 260px)" }} />
|
|
|
+ <PostList
|
|
|
+ style={{
|
|
|
+ height: vipUserInfo
|
|
|
+ ? "calc(100vh - 260px)"
|
|
|
+ : "calc(100vh - 180px)",
|
|
|
+ }}
|
|
|
+ />
|
|
|
</TabPane>
|
|
|
</Tabs>
|
|
|
</View>
|