import { Pressable, StyleSheet, Text, View } from 'react-native'; import { colors } from '../../../src/theme'; import { useOnboarding } from '../../../src/hooks'; import { applySalaryMin, salaryMaxOptions } from '../../../src/api'; import { SALARY_MIN_OPTIONS } from '../../../src/constants'; import { ScreenShell } from '../ui/ScreenShell'; import { PrimaryButton } from '../ui/PrimaryButton'; export function P7Salary() { const { data, setData, navigate, back } = useOnboarding(); // 「最高」档位随「最低」收窄(规则在 API 层),改最低时同步校正最高, // 避免存出「最低 30K / 最高 15K」这种自相矛盾的期望薪资 const maxOptions = salaryMaxOptions(data.expectedSalaryMin); const canNext = data.expectedSalaryMin !== '' && data.expectedSalaryMax !== ''; return ( 1K 代表 1000 元 最低 {SALARY_MIN_OPTIONS.map((v) => ( setData(applySalaryMin(v, data.expectedSalaryMax))} > {v} ))} 最高 {maxOptions.map((v) => ( setData({ expectedSalaryMax: v })} > {v} ))} navigate('P8')} /> ); } const styles = StyleSheet.create({ tip: { fontSize: 13, color: colors.textHint, marginBottom: 20 }, cols: { flexDirection: 'row', gap: 16 }, col: { flex: 1, gap: 12 }, colTitle: { fontSize: 15, fontWeight: '700', color: colors.textPrimary, textAlign: 'center', marginBottom: 4 }, opt: { height: 50, borderRadius: 12, borderWidth: 1, borderColor: colors.border, backgroundColor: colors.white, alignItems: 'center', justifyContent: 'center', }, optActive: { borderColor: colors.primary, backgroundColor: colors.primaryLight }, optText: { fontSize: 16, color: colors.textSecondary }, optTextActive: { color: colors.primaryText, fontWeight: '700' }, footer: { marginTop: 32 }, });