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 { useGrowthData } from '../src/hooks';
import { colors, jobLevelTextColors } from '../src/theme';
import { JOB_LEVEL_LABEL } from '../src/constants';
import type { JobLevel } from '../src/types';
const ENTRIES = [
{
id: 'holland',
title: '霍兰德职业兴趣测评',
desc: '发现你的职业性格类型',
icon: 'compass-outline',
route: '/holland',
color: colors.primary,
bg: colors.primaryLight,
},
{
id: 'ability',
title: '四维能力测评',
desc: '全方位评估你的职场竞争力',
icon: 'stats-chart-outline',
route: '/ability',
color: colors.success,
bg: colors.successLight,
},
{
id: 'resume',
title: 'AI简历优化',
desc: '一键提升简历通过率',
icon: 'document-text-outline',
route: '/resume',
color: colors.info,
bg: colors.infoLight,
},
{
id: 'interview',
title: '模拟面试',
desc: 'AI面试官真实场景演练',
icon: 'videocam-outline',
route: '/game',
color: colors.action,
bg: colors.actionLight,
},
];
function Header({ onBack }: { onBack: () => void }) {
return (
我的测评
);
}
function AbilityCard({
score,
level,
onPress,
}: {
score: number;
level: JobLevel;
onPress: () => void;
}) {
return (
四维能力综合评分
{score}
分
{JOB_LEVEL_LABEL[level]}
查看详细能力拆解与提升建议 >
);
}
function EntryCard({
entry,
onPress,
}: {
entry: (typeof ENTRIES)[number];
onPress: () => void;
}) {
return (
{entry.title}
{entry.desc}
);
}
export default function AssessmentScreen() {
const router = useRouter();
const { ability, loading, error, refresh } = useGrowthData();
return (
router.back()} />
{loading ? (
) : error ? (
加载失败
重试
) : (
{ability && (
router.push('/ability')}
/>
)}
全部测评
{ENTRIES.map((entry) => (
router.push(entry.route)} />
))}
)}
);
}
const styles = StyleSheet.create({
container: { flex: 1, backgroundColor: colors.pageBg },
header: {
flexDirection: 'row',
alignItems: 'center',
justifyContent: 'space-between',
paddingHorizontal: 12,
paddingVertical: 12,
backgroundColor: colors.white,
},
headerBtn: { width: 40, alignItems: 'center' },
headerTitle: { fontSize: 17, fontWeight: '700', color: colors.textPrimary },
body: { padding: 16, paddingBottom: 32 },
abilityCard: {
flexDirection: 'row',
alignItems: 'center',
justifyContent: 'space-between',
backgroundColor: colors.white,
borderRadius: 14,
padding: 18,
marginBottom: 16,
borderWidth: 1,
borderColor: colors.borderLight,
},
abilityLabel: { fontSize: 14, color: colors.textSecondary },
abilityScoreRow: { flexDirection: 'row', alignItems: 'center', marginTop: 8 },
abilityScore: { fontSize: 42, fontWeight: '800', color: colors.textPrimary },
abilityUnit: { fontSize: 14, color: colors.textSecondary, marginTop: 16, marginRight: 8 },
levelBadge: { borderRadius: 10, paddingHorizontal: 10, paddingVertical: 4 },
levelText: { fontSize: 12, fontWeight: '700' },
abilityDesc: { fontSize: 13, color: colors.primary, marginTop: 8 },
sectionTitle: { fontSize: 18, fontWeight: '700', color: colors.textPrimary, marginBottom: 12 },
entries: { gap: 12 },
entryCard: {
flexDirection: 'row',
alignItems: 'center',
borderRadius: 12,
padding: 16,
},
entryIcon: {
width: 44,
height: 44,
borderRadius: 22,
alignItems: 'center',
justifyContent: 'center',
},
entryBody: { flex: 1, marginLeft: 14 },
entryTitle: { fontSize: 15, fontWeight: '700', color: colors.textPrimary },
entryDesc: { fontSize: 13, color: colors.textSecondary, marginTop: 2 },
center: { flex: 1, alignItems: 'center', justifyContent: 'center', paddingHorizontal: 40, gap: 12 },
tip: { fontSize: 14, color: colors.textSecondary },
retryBtn: { paddingHorizontal: 18, paddingVertical: 8, borderRadius: 16, backgroundColor: colors.primaryLight },
retryText: { fontSize: 13, fontWeight: '600', color: colors.primaryText },
});