/* ============================================================ ROOY · 15a 基本信息编辑 ─────────────────────────────────────────────────────────── 需求:编辑 onboarding 时填的画像 + 替换头像。从 15 设置 → 个人 资料卡进入。 结构:头像 (可点直接换 + 右下角相机角标) → 昵称 italic anchor → FieldRow 列表(性别 / 出生年 / 单双板 / 身高 / 体重 / 雪龄)。 依赖 onboarding.jsx 的 form 组件(FieldRow / FieldValue / NameInput / GenderPills / PickerSheet)—— list 节奏跟 11 onboarding 完全一致,让用户两处感觉是同一套界面。 ============================================================ */ function EditProfileScreen({ onNav }) { const [name, setName] = React.useState('Yuki'); const [gender, setGender] = React.useState('f'); const [age, setAge] = React.useState(29); const [height, setHeight] = React.useState(168); const [weight, setWeight] = React.useState(54); const [openPicker, setOpenPicker] = React.useState(null); const [avatarUrl, setAvatarUrl] = React.useState(null); const fileRef = React.useRef(null); const onFile = (e) => { const f = e.target.files && e.target.files[0]; if (!f) return; const url = URL.createObjectURL(f); setAvatarUrl(url); }; return (
onNav && onNav('settings')} title="个人资料" />
{/* ── Avatar upload — center, large, ink-stroked ─── */}
{/* HERO · 昵称 — italic anchor, same as 11. ⚠ 标签 "昵称" 用 body 17 ink (匹配下方 FieldRow label 字号), 不再是 eyebrow 13. */}
昵称
setName(e.target.value)} maxLength={20} style={{ ...N.italic, fontSize: 40, color: R.ink, lineHeight: 1, letterSpacing: '-0.02em', background: 'transparent', border: 'none', outline: 'none', padding: 0, flex: 1, minWidth: 0, fontWeight: 900, }} />
{/* ── 4 editorial fields (无 昵称 — 那行被 hero italic 替代) ── */}
setOpenPicker('age')}> setOpenPicker('height')}> setOpenPicker('weight')}>
{/* ── 保存 button — bottom, matches 11's "下一步" pattern ── */}
onNav && onNav('settings')}>保存
{openPicker && ( 10 + i) : openPicker === 'height' ? Array.from({ length: 81 }, (_, i) => 140 + i) : Array.from({ length: 91 }, (_, i) => 35 + i) } unit={ openPicker === 'age' ? '岁' : openPicker === 'height' ? 'cm' : 'kg' } onChange={(v) => { if (openPicker === 'age') setAge(v); else if (openPicker === 'height') setHeight(v); else setWeight(v); }} onClose={() => setOpenPicker(null)} /> )}
); } Object.assign(window, { EditProfileScreen });