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 } from '../../src/theme'; import type { AboutLink } from '../../src/types'; /* ===================== 子组件:顶部导航 ===================== */ function Header({ onBack }: { onBack: () => void }) { return ( 关于我们 ); } /* ===================== 页面 ===================== */ export default function AboutScreen() { const router = useRouter(); const { about, loading, error, refresh } = useAboutInfo(); const handleLinkPress = (link: AboutLink) => { if (link.route) { router.push(link.route); return; } // 协议类页面待开发:仅占位,避免死路由 console.log(`[AboutScreen] 待开发协议页: ${link.title}`); }; 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; return ( handleLinkPress(link)} 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: 8, 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: 8, paddingBottom: 24, }, brandCard: { alignItems: 'center', paddingVertical: 28, backgroundColor: colors.white, borderRadius: 8, 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: 8, paddingHorizontal: 14, paddingVertical: 14, 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, }, 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: 8, borderRadius: 18, backgroundColor: colors.primaryBtn, }, retryText: { fontSize: 13, fontWeight: '600', color: colors.white, }, });