import { Ionicons } from '@expo/vector-icons';
import { useRouter } from 'expo-router';
import { ActivityIndicator, Pressable, ScrollView, StyleSheet, Text, View } from 'react-native';
import { SafeAreaView } from 'react-native-safe-area-context';
import { useAboutInfo } from '../../src/hooks';
import { colors , spacing } from '../../src/theme';
/* ===================== 子组件:顶部导航 ===================== */
function Header({ onBack }: { onBack: () => void }) {
return (
关于我们
);
}
/* ===================== 页面 ===================== */
export default function AboutScreen() {
const router = useRouter();
const { about, loading, error, refresh } = useAboutInfo();
return (
router.back()} />
{loading ? (
) : error ? (
加载失败,请重试
重试
) : !about ? (
暂无应用信息
) : (
{/* 品牌区 */}
{about.appName}
{about.version}
{/* 简介 */}
应用简介
{about.description}
运营主体
{about.company}
{/* 协议与链接 */}
{about.links.map((link, index) => {
const isLast = index === about.links.length - 1;
const route = link.route;
/*
* 无 route 的条目**不做成可点**。
* 原先是「有 onPress、但函数体里什么都不做」—— 点了毫无反应,
* 既没有跳转也没有提示;审计脚本也看不见这一类(它有处理函数)。
* 现改为:保持可见 + 如实标注「待开放」,而不是给一个静默失效的箭头。
*/
if (!route) {
return (
{link.title}
待开放
);
}
return (
router.push(route)}
hitSlop={4}
>
{link.title}
);
})}
Copyright © 2026 {about.company}
{'\n'}All rights reserved.
)}
);
}
const styles = StyleSheet.create({
safeArea: {
flex: 1,
backgroundColor: colors.pageBg,
},
header: {
flexDirection: 'row',
alignItems: 'center',
justifyContent: 'space-between',
paddingHorizontal: spacing.card,
height: 48,
backgroundColor: colors.white,
borderBottomWidth: 1,
borderBottomColor: colors.borderLight,
},
headerBtn: {
width: 40,
height: 40,
alignItems: 'center',
justifyContent: 'center',
},
headerTitle: {
fontSize: 17,
fontWeight: '700',
color: colors.textPrimary,
},
scroll: {
flex: 1,
},
content: {
padding: spacing.card,
paddingBottom: 24,
},
brandCard: {
alignItems: 'center',
paddingVertical: spacing.card,
backgroundColor: colors.white,
borderRadius: spacing.card,
marginBottom: 8,
},
brandLogo: {
width: 72,
height: 72,
borderRadius: 36,
backgroundColor: colors.primaryLight,
alignItems: 'center',
justifyContent: 'center',
marginBottom: 12,
},
appName: {
fontSize: 20,
fontWeight: '700',
color: colors.textPrimary,
},
version: {
marginTop: 4,
fontSize: 13,
color: colors.textSecondary,
},
card: {
backgroundColor: colors.white,
borderRadius: spacing.card,
paddingHorizontal: spacing.card,
paddingVertical: spacing.card,
marginBottom: 8,
},
cardTitle: {
fontSize: 15,
fontWeight: '700',
color: colors.textPrimary,
marginBottom: 8,
},
desc: {
fontSize: 13,
lineHeight: 20,
color: colors.textSecondary,
},
companyRow: {
flexDirection: 'row',
alignItems: 'center',
marginTop: 12,
paddingTop: 12,
borderTopWidth: 1,
borderTopColor: colors.borderLight,
},
companyLabel: {
fontSize: 13,
color: colors.textSecondary,
marginRight: 8,
},
companyValue: {
flex: 1,
fontSize: 13,
fontWeight: '600',
color: colors.textPrimary,
},
row: {
flexDirection: 'row',
alignItems: 'center',
justifyContent: 'space-between',
paddingVertical: 14,
borderBottomWidth: 1,
borderBottomColor: colors.borderLight,
},
rowLast: {
borderBottomWidth: 0,
},
rowTitle: {
fontSize: 15,
color: colors.textPrimary,
},
/* 无 route 的条目:如实标注,不用箭头假装可点 */
rowPending: {
fontSize: 13,
color: colors.textHint,
},
copyright: {
marginTop: 20,
fontSize: 12,
lineHeight: 18,
color: colors.textHint,
textAlign: 'center',
},
stateBox: {
flex: 1,
alignItems: 'center',
justifyContent: 'center',
},
stateText: {
marginTop: 12,
fontSize: 14,
color: colors.textSecondary,
},
retryBtn: {
marginTop: 16,
paddingHorizontal: 24,
paddingVertical: spacing.card,
borderRadius: 18,
backgroundColor: colors.primaryBtn,
},
retryText: {
fontSize: 13,
fontWeight: '600',
color: colors.white,
},
});