feat: 首页更新
This commit is contained in:
59
pages/HomeScreen/index.tsx
Normal file
59
pages/HomeScreen/index.tsx
Normal file
@@ -0,0 +1,59 @@
|
||||
/**
|
||||
* 首页主容器组件
|
||||
*
|
||||
* 支持浅色/深色主题,包含完整的首页功能:
|
||||
* - Header(搜索、用户信息)
|
||||
* - 轮播图
|
||||
* - 游戏分类菜单
|
||||
* - 游戏大厅
|
||||
* - 公告栏
|
||||
* - 高奖金游戏(深色主题)
|
||||
* - 快速导航(深色主题)
|
||||
* - BottomTabs(底部导航)
|
||||
*/
|
||||
|
||||
import React, { useMemo, useCallback } from 'react';
|
||||
import { ScrollView, StyleSheet, RefreshControl } from 'react-native';
|
||||
import { useColorScheme } from '@/hooks';
|
||||
import { createThemeStyles } from '@/theme';
|
||||
import Colors from '@/constants/Colors';
|
||||
import HomeScreenComplete from './HomeScreenComplete';
|
||||
|
||||
/**
|
||||
* 创建主题样式
|
||||
*/
|
||||
const styles = createThemeStyles((colors) => ({
|
||||
container: {
|
||||
flex: 1,
|
||||
backgroundColor: colors.background,
|
||||
},
|
||||
scrollView: {
|
||||
flex: 1,
|
||||
},
|
||||
}));
|
||||
|
||||
/**
|
||||
* 首页主容器组件
|
||||
*/
|
||||
export default function HomeScreen() {
|
||||
const theme = useColorScheme();
|
||||
const s = styles[theme];
|
||||
const [refreshing, setRefreshing] = React.useState(false);
|
||||
|
||||
// 下拉刷新处理
|
||||
const onRefresh = useCallback(() => {
|
||||
setRefreshing(true);
|
||||
// 模拟刷新延迟
|
||||
setTimeout(() => {
|
||||
setRefreshing(false);
|
||||
}, 1000);
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<HomeScreenComplete
|
||||
theme={theme}
|
||||
isDarkTheme={theme === 'dark'}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user