Jelajahi Sumber

日常开发

林旭祥 6 hari lalu
induk
melakukan
b6a97b83ae
6 mengubah file dengan 209 tambahan dan 9 penghapusan
  1. 49 5
      App.tsx
  2. 39 0
      src/pages/Data/index.tsx
  3. 39 0
      src/pages/Match/index.tsx
  4. 39 0
      src/pages/Me/index.tsx
  5. 4 4
      src/pages/Play/index.tsx
  6. 39 0
      src/pages/Team/index.tsx

+ 49 - 5
App.tsx

@@ -2,14 +2,18 @@ import React from 'react';
 import { NavigationContainer } from '@react-navigation/native';
 import { createNativeStackNavigator } from '@react-navigation/native-stack';
 import LoginScreen from './src/pages/Login';
-import HomeScreen from './src/pages/Home';
+import TeamScreen from './src/pages/Team';
+import DataScreen from './src/pages/Data';
+import PlayScreen from './src/pages/Play';
+import MatchScreen from './src/pages/Match';
+import MeScreen from './src/pages/Me';
 
 const Stack = createNativeStackNavigator();
 
 function App(): React.JSX.Element {
   return (
     <NavigationContainer>
-      <Stack.Navigator initialRouteName="Home">
+      <Stack.Navigator initialRouteName="Team">
         <Stack.Screen
           name="Login"
           component={LoginScreen}
@@ -20,10 +24,50 @@ function App(): React.JSX.Element {
           }}
         />
         <Stack.Screen
-          name="Home"
-          component={HomeScreen}
+          name="Team"
+          component={TeamScreen}
           options={{
-            title: '首页',
+            title: '球队',
+            headerBackVisible: false,
+            headerShown: false,
+          }}
+        />
+
+        <Stack.Screen
+          name="Data"
+          component={DataScreen}
+          options={{
+            title: '数据',
+            headerBackVisible: false,
+            headerShown: false,
+          }}
+        />
+
+        <Stack.Screen
+          name="Play"
+          component={PlayScreen}
+          options={{
+            title: 'PLAY',
+            headerBackVisible: false,
+            headerShown: false,
+          }}
+        />
+
+        <Stack.Screen
+          name="Match"
+          component={MatchScreen}
+          options={{
+            title: '赛事',
+            headerBackVisible: false,
+            headerShown: false,
+          }}
+        />
+
+        <Stack.Screen
+          name="Me"
+          component={MeScreen}
+          options={{
+            title: '我的',
             headerBackVisible: false,
             headerShown: false,
           }}

+ 39 - 0
src/pages/Data/index.tsx

@@ -0,0 +1,39 @@
+import React from 'react';
+import { StyleSheet, View, Text, TouchableOpacity } from 'react-native';
+import { useNavigation } from '@react-navigation/native';
+
+const DataScreen = () => {
+  const navigation = useNavigation();
+  const getJump = async (data) => {
+    navigation.navigate(data);
+  };
+  return (
+    <View style={styles.main}>
+      <View>
+        <TouchableOpacity onPress={() => getJump('Team')}>
+          <Text>球队</Text>
+        </TouchableOpacity>
+        <TouchableOpacity onPress={() => getJump('Data')}>
+          <Text>数据</Text>
+        </TouchableOpacity>
+        <TouchableOpacity onPress={() => getJump('Play')}>
+          <Text>PLAY</Text>
+        </TouchableOpacity>
+        <TouchableOpacity onPress={() => getJump('Custom')}>
+          <Text>赛事</Text>
+        </TouchableOpacity>
+        <TouchableOpacity onPress={() => getJump('Custom')}>
+          <Text>我的</Text>
+        </TouchableOpacity>
+      </View>
+    </View>
+  );
+};
+
+const styles = StyleSheet.create({
+  main: {
+    paddingTop: 50,
+  },
+});
+
+export default DataScreen;

+ 39 - 0
src/pages/Match/index.tsx

@@ -0,0 +1,39 @@
+import React from 'react';
+import { StyleSheet, View, Text, TouchableOpacity } from 'react-native';
+import { useNavigation } from '@react-navigation/native';
+
+const MatchScreen = () => {
+  const navigation = useNavigation();
+  const getJump = async (data) => {
+    navigation.navigate(data);
+  };
+  return (
+    <View style={styles.main}>
+      <View>
+        <TouchableOpacity onPress={() => getJump('Team')}>
+          <Text>球队</Text>
+        </TouchableOpacity>
+        <TouchableOpacity onPress={() => getJump('Data')}>
+          <Text>数据</Text>
+        </TouchableOpacity>
+        <TouchableOpacity onPress={() => getJump('Play')}>
+          <Text>PLAY</Text>
+        </TouchableOpacity>
+        <TouchableOpacity onPress={() => getJump('Match')}>
+          <Text>赛事</Text>
+        </TouchableOpacity>
+        <TouchableOpacity onPress={() => getJump('Me')}>
+          <Text>我的</Text>
+        </TouchableOpacity>
+      </View>
+    </View>
+  );
+};
+
+const styles = StyleSheet.create({
+  main: {
+    paddingTop: 50,
+  },
+});
+
+export default MatchScreen;

+ 39 - 0
src/pages/Me/index.tsx

@@ -0,0 +1,39 @@
+import React from 'react';
+import { StyleSheet, View, Text, TouchableOpacity } from 'react-native';
+import { useNavigation } from '@react-navigation/native';
+
+const MeScreen = () => {
+  const navigation = useNavigation();
+  const getJump = async (data) => {
+    navigation.navigate(data);
+  };
+  return (
+    <View style={styles.main}>
+      <View>
+        <TouchableOpacity onPress={() => getJump('Team')}>
+          <Text>球队</Text>
+        </TouchableOpacity>
+        <TouchableOpacity onPress={() => getJump('Data')}>
+          <Text>数据</Text>
+        </TouchableOpacity>
+        <TouchableOpacity onPress={() => getJump('Play')}>
+          <Text>PLAY</Text>
+        </TouchableOpacity>
+        <TouchableOpacity onPress={() => getJump('Match')}>
+          <Text>赛事</Text>
+        </TouchableOpacity>
+        <TouchableOpacity onPress={() => getJump('Me')}>
+          <Text>我的</Text>
+        </TouchableOpacity>
+      </View>
+    </View>
+  );
+};
+
+const styles = StyleSheet.create({
+  main: {
+    paddingTop: 50,
+  },
+});
+
+export default MeScreen;

+ 4 - 4
src/pages/Home/index.tsx → src/pages/Play/index.tsx

@@ -2,7 +2,7 @@ import React from 'react';
 import { StyleSheet, View, Text, TouchableOpacity } from 'react-native';
 import { useNavigation } from '@react-navigation/native';
 
-const HomeScreen = () => {
+const PlayScreen = () => {
   const navigation = useNavigation();
   const getJump = async (data) => {
     navigation.navigate(data);
@@ -10,10 +10,10 @@ const HomeScreen = () => {
   return (
     <View style={styles.main}>
       <View>
-        <TouchableOpacity onPress={() => getJump('Face')}>
+        <TouchableOpacity onPress={() => getJump('Team')}>
           <Text>球队</Text>
         </TouchableOpacity>
-        <TouchableOpacity onPress={() => getJump('Custom')}>
+        <TouchableOpacity onPress={() => getJump('Data')}>
           <Text>数据</Text>
         </TouchableOpacity>
         <TouchableOpacity onPress={() => getJump('Custom')}>
@@ -36,4 +36,4 @@ const styles = StyleSheet.create({
   },
 });
 
-export default HomeScreen;
+export default PlayScreen;

+ 39 - 0
src/pages/Team/index.tsx

@@ -0,0 +1,39 @@
+import React from 'react';
+import { StyleSheet, View, Text, TouchableOpacity } from 'react-native';
+import { useNavigation } from '@react-navigation/native';
+
+const TeamScreen = () => {
+  const navigation = useNavigation();
+  const getJump = async (data) => {
+    navigation.navigate(data);
+  };
+  return (
+    <View style={styles.main}>
+      <View>
+        <TouchableOpacity onPress={() => getJump('Team')}>
+          <Text>球队</Text>
+        </TouchableOpacity>
+        <TouchableOpacity onPress={() => getJump('Data')}>
+          <Text>数据</Text>
+        </TouchableOpacity>
+        <TouchableOpacity onPress={() => getJump('Play')}>
+          <Text>PLAY</Text>
+        </TouchableOpacity>
+        <TouchableOpacity onPress={() => getJump('Match')}>
+          <Text>赛事</Text>
+        </TouchableOpacity>
+        <TouchableOpacity onPress={() => getJump('Me')}>
+          <Text>我的</Text>
+        </TouchableOpacity>
+      </View>
+    </View>
+  );
+};
+
+const styles = StyleSheet.create({
+  main: {
+    paddingTop: 50,
+  },
+});
+
+export default TeamScreen;