import { StyleSheet, Text, View } from 'react-native'; import { colors } from '../../../src/theme'; import { useOnboarding } from '../../../src/hooks'; import { ScreenShell } from '../ui/ScreenShell'; import { Tag, TagGroup } from '../ui/Tag'; import { PrimaryButton } from '../ui/PrimaryButton'; const MAX = 5; const GROUPS = [ { name: '运维工具', items: ['Kubernetes', 'Docker'] }, { name: '前端框架', items: ['Vue.js', 'React', 'Angular', 'AngularJS', 'Bootstrap', 'JQuery', 'Vue'] }, { name: '软件开发工具', items: ['SVN'] }, { name: '技术类型', items: ['多进程', '网络协议', 'AJAX', '数据结构', '消息队列', '多线程', '分布式技术', '微服务架构'], }, { name: '后端框架', items: ['Spring', 'Django', 'Express', 'Gin'] }, ]; export function P14Skills() { const { data, setData, navigate, back } = useOnboarding(); const skills = data.skills; const full = skills.length >= MAX; const toggle = (s: string) => { if (skills.includes(s)) { setData({ skills: skills.filter((x) => x !== s) }); } else if (!full) { setData({ skills: [...skills, s] }); } }; return ( 技能选择 0 && styles.counterActive]}> 0 && styles.counterTextActive]}> {skills.length}/{MAX} {GROUPS.map((g) => ( {g.name} {g.items.map((s) => ( toggle(s)} /> ))} ))} 0} onPress={() => navigate('P16')} /> ); } const styles = StyleSheet.create({ header: { flexDirection: 'row', alignItems: 'center', justifyContent: 'space-between', marginBottom: 14 }, title: { fontSize: 20, fontWeight: '800', color: colors.textPrimary }, counter: { backgroundColor: colors.borderLight, paddingHorizontal: 12, paddingVertical: 4, borderRadius: 12 }, counterActive: { backgroundColor: colors.primaryLight }, counterText: { fontSize: 13, fontWeight: '700', color: colors.textDisabled }, counterTextActive: { color: colors.primaryText }, group: { marginBottom: 18 }, groupName: { fontSize: 14, fontWeight: '700', color: colors.textPrimary, marginBottom: 10 }, footer: { marginTop: 20 }, });