2025-11-05 15:18:15 +08:00
|
|
|
import React from "react";
|
2025-12-25 16:16:01 +08:00
|
|
|
import { View, Text, TouchableOpacity, StyleSheet, StatusBar, Image } from "react-native";
|
|
|
|
|
import { NativeStackScreenProps,NativeStackNavigationProp } from "@react-navigation/native-stack";
|
2025-11-05 15:18:15 +08:00
|
|
|
import { RootStackParamList } from "../App";
|
2025-12-25 16:16:01 +08:00
|
|
|
import MyStatusbar from "./component/MyStatusbar";
|
|
|
|
|
import MyHeader from "./component/MyHeader";
|
|
|
|
|
import pxToDp from "./helper/pxToDp";
|
|
|
|
|
import DeviceInfo from "react-native-device-info";
|
|
|
|
|
import { useTranslation } from 'react-i18next';
|
2025-11-05 15:18:15 +08:00
|
|
|
|
2025-12-25 16:16:01 +08:00
|
|
|
type Props = NativeStackScreenProps<RootStackParamList>;
|
2025-11-05 15:18:15 +08:00
|
|
|
|
|
|
|
|
export default function HomeScreen({ navigation }: Props) {
|
2025-12-25 16:16:01 +08:00
|
|
|
const { t } = useTranslation();
|
2025-11-05 15:18:15 +08:00
|
|
|
return (
|
|
|
|
|
<View style={styles.container}>
|
|
|
|
|
{/* 设置状态栏颜色 */}
|
2025-12-25 16:16:01 +08:00
|
|
|
<MyStatusbar backgroundColor="#E7141E" dark={false}></MyStatusbar>
|
|
|
|
|
<MyHeader title={t('home.title')} textColor="#fff" backgroundColor="#E7141E" hideBack navigation={navigation}
|
|
|
|
|
rightView={<TouchableOpacity style={{width:pxToDp(56),height:pxToDp(56),alignItems:'center',justifyContent:'center'}}
|
|
|
|
|
onPress={() => navigation.navigate("Setting")}>
|
|
|
|
|
<Image source={require('./img/Settings.png')} style={{width:pxToDp(48),height:pxToDp(44)}}></Image>
|
|
|
|
|
</TouchableOpacity>}></MyHeader>
|
2025-11-05 15:18:15 +08:00
|
|
|
{/* 中间按钮 */}
|
|
|
|
|
<View style={styles.centerBox}>
|
2025-12-25 16:16:01 +08:00
|
|
|
<Image source={require("./img/Search.png")} style={{width:pxToDp(568),height:pxToDp(344),marginBottom:pxToDp(100)}}></Image>
|
2025-11-05 15:18:15 +08:00
|
|
|
<TouchableOpacity
|
|
|
|
|
style={styles.button}
|
|
|
|
|
onPress={() => navigation.navigate("Scan")}
|
|
|
|
|
>
|
2025-12-25 16:16:01 +08:00
|
|
|
<Text style={styles.buttonText}>{t('home.scan')}</Text>
|
2025-11-05 15:18:15 +08:00
|
|
|
</TouchableOpacity>
|
|
|
|
|
</View>
|
|
|
|
|
</View>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const styles = StyleSheet.create({
|
|
|
|
|
container: {
|
|
|
|
|
flex: 1,
|
|
|
|
|
backgroundColor: "#fff",
|
|
|
|
|
},
|
|
|
|
|
centerBox: {
|
|
|
|
|
flex: 1,
|
2025-12-25 16:16:01 +08:00
|
|
|
// justifyContent: "center",
|
2025-11-05 15:18:15 +08:00
|
|
|
alignItems: "center",
|
2025-12-25 16:16:01 +08:00
|
|
|
backgroundColor:'#fff',
|
|
|
|
|
paddingTop:pxToDp(250)
|
2025-11-05 15:18:15 +08:00
|
|
|
},
|
|
|
|
|
button: {
|
2025-12-25 16:16:01 +08:00
|
|
|
backgroundColor: "#E7141E",
|
|
|
|
|
borderRadius: pxToDp(24),
|
|
|
|
|
width:pxToDp(300),
|
|
|
|
|
height:pxToDp(96),
|
|
|
|
|
alignItems:'center',
|
|
|
|
|
justifyContent:'center'
|
2025-11-05 15:18:15 +08:00
|
|
|
},
|
|
|
|
|
buttonText: {
|
|
|
|
|
color: "#fff",
|
2025-12-25 16:16:01 +08:00
|
|
|
fontSize: pxToDp(32),
|
2025-11-05 15:18:15 +08:00
|
|
|
fontWeight: "bold",
|
|
|
|
|
},
|
|
|
|
|
bottomBox: {
|
|
|
|
|
alignItems: "center",
|
|
|
|
|
marginBottom: 20,
|
|
|
|
|
},
|
|
|
|
|
privacyText: {
|
|
|
|
|
fontSize: 16,
|
|
|
|
|
color: "#E7141E", // 红色字体
|
|
|
|
|
marginBottom: 8,
|
|
|
|
|
},
|
|
|
|
|
version: {
|
|
|
|
|
fontSize: 14,
|
|
|
|
|
color: "#999",
|
|
|
|
|
},
|
|
|
|
|
});
|