| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930 |
- <template>
- <view class="user-edit-container">
- <view class="header">
- <text class="title">{{ isEdit ? '完善个人信息' : '选择角色' }}</text>
- <text class="subtitle">{{ isEdit ? '以下信息可帮助您更好地使用服务' : '请选择您的身份类型' }}</text>
- </view>
- <!-- 角色选择(新用户首次登录时显示) -->
- <view class="role-select-section" v-if="!isEdit && showRoleSelect">
- <view
- class="role-card"
- :class="{ active: form.role === 'parent' }"
- @click="selectRole('parent')"
- >
- <text class="role-icon">👨👩👧</text>
- <text class="role-name">家长</text>
- <text class="role-desc">管理孩子任务、审核奖励</text>
- </view>
-
- <view
- class="role-card"
- :class="{ active: form.role === 'child' }"
- @click="selectRole('child')"
- >
- <text class="role-icon">👶</text>
- <text class="role-name">孩子</text>
- <text class="role-desc">执行任务、赚取积分</text>
- </view>
-
- <view
- class="role-card"
- :class="{ active: form.role === 'teacher' }"
- @click="selectRole('teacher')"
- >
- <text class="role-icon">👨🏫</text>
- <text class="role-name">成长规划师</text>
- <text class="role-desc">DAN测评、制定成长方案</text>
- </view>
- <button class="btn-next" @click="confirmRole" :disabled="!form.role">
- 下一步
- </button>
- </view>
- <!-- 详细信息填写(选择角色后显示) -->
- <view class="form-section" v-if="isEdit">
- <!-- 头像 -->
- <view class="form-item avatar-item">
- <text class="label">头像</text>
- <view class="avatar-upload" @click="chooseAvatar">
- <image v-if="form.avatar" :src="form.avatar" class="avatar-preview"></image>
- <view v-else class="avatar-placeholder">
- <text class="iconfont icon-plus">+</text>
- </view>
- </view>
- </view>
- <!-- 昵称 -->
- <view class="form-item">
- <text class="label">昵称 <text class="required">*</text></text>
- <input type="text" v-model="form.nickname" placeholder="请输入昵称" class="input" maxlength="20" />
- </view>
- <!-- 真实姓名 -->
- <view class="form-item">
- <text class="label">真实姓名</text>
- <input type="text" v-model="form.realName" placeholder="选填,用于家庭管理" class="input" maxlength="20" />
- </view>
- <!-- 性别(成长规划师必填) -->
- <view class="form-item">
- <text class="label">性别 <text class="required" v-if="form.role === 'teacher'">*</text></text>
- <radio-group class="role-select" @change="onGenderChange">
- <label class="role-option">
- <radio value="male" :checked="form.gender === 'male'" />
- <text>男</text>
- </label>
- <label class="role-option">
- <radio value="female" :checked="form.gender === 'female'" />
- <text>女</text>
- </label>
- </radio-group>
- </view>
- <!-- 身份证号(成长规划师必填) -->
- <view class="form-item">
- <text class="label">身份证号 <text class="required" v-if="form.role === 'teacher'">*</text></text>
- <input type="idcard" v-model="form.idCard" placeholder="选填,填写后自动生成生日" class="input" maxlength="18" @input="onIdCardInput" />
- </view>
- <!-- 生日 -->
- <view class="form-item">
- <text class="label">生日</text>
- <picker mode="date" :value="form.birthday" @change="onBirthdayChange">
- <view class="picker-input">{{ form.birthday || '请选择生日' }}</view>
- </picker>
- </view>
- <!-- 出生时辰 -->
- <view class="form-item">
- <text class="label">出生时辰</text>
- <picker mode="selector" :range="birthHourOptions" :value="birthHourIndex" @change="onBirthHourChange">
- <view class="picker-input">{{ form.birthHour || '请选择出生时辰' }}</view>
- </picker>
- </view>
- <!-- 民族 -->
- <view class="form-item">
- <text class="label">民族</text>
- <picker mode="selector" :range="ethnicityOptions" :value="ethnicityIndex" @change="onEthnicityChange">
- <view class="picker-input">{{ form.ethnicity || '请选择民族' }}</view>
- </picker>
- </view>
- <!-- 血型 -->
- <view class="form-item">
- <text class="label">血型</text>
- <picker mode="selector" :range="bloodTypeOptions" :value="bloodTypeIndex" @change="onBloodTypeChange">
- <view class="picker-input">{{ form.bloodType || '请选择血型' }}</view>
- </picker>
- </view>
- <!-- 最高学历 -->
- <view class="form-item">
- <text class="label">最高学历</text>
- <picker mode="selector" :range="educationOptions" :value="educationIndex" @change="onEducationChange">
- <view class="picker-input">{{ form.highestEducation || '请选择最高学历' }}</view>
- </picker>
- </view>
- <!-- 婚姻状态 -->
- <view class="form-item">
- <text class="label">婚姻状态</text>
- <picker mode="selector" :range="maritalOptions" :value="maritalIndex" @change="onMaritalChange">
- <view class="picker-input">{{ form.maritalStatus || '请选择婚姻状态' }}</view>
- </picker>
- </view>
- <!-- 地址选择 -->
- <view class="form-item">
- <text class="label">所在地区 <text class="required" v-if="isNewUserFlow">*</text></text>
- <AddressPicker ref="addressPicker" />
- </view>
- <!-- 兴趣爱好 -->
- <view class="form-item">
- <text class="label">兴趣爱好</text>
- <input type="text" v-model="form.hobbies" placeholder="如: 阅读、运动、音乐" class="input" maxlength="200" />
- </view>
- <!-- 饮食偏好 -->
- <view class="form-item">
- <text class="label">饮食偏好</text>
- <input type="text" v-model="form.dietPreferences" placeholder="如: 清淡、无辣、低糖" class="input" maxlength="200" />
- </view>
- <!-- 成长规划师额外字段 -->
- <view class="form-section-title" v-if="form.role === 'teacher'">成长规划师信息</view>
-
- <!-- 成长规划师证书号(成长规划师必填) -->
- <view class="form-item" v-if="form.role === 'teacher'">
- <text class="label">成长规划师证书号 <text class="required">*</text></text>
- <input type="text" v-model="form.teacherNo" placeholder="请输入成长规划师证书号" class="input" maxlength="50" />
- </view>
- <!-- 成长规划师照片(成长规划师必填) -->
- <view class="form-item" v-if="form.role === 'teacher'">
- <text class="label">成长规划师照片 <text class="required">*</text></text>
- <view class="photo-upload" @click="chooseTeacherPhoto">
- <image v-if="form.teacherPhoto" :src="form.teacherPhoto" class="photo-preview" mode="aspectFill"></image>
- <view v-else class="photo-placeholder">
- <text class="plus-icon">+</text>
- <text class="placeholder-text">上传照片</text>
- </view>
- </view>
- </view>
- <!-- 成长规划师证书照片(成长规划师必填) -->
- <view class="form-item" v-if="form.role === 'teacher'">
- <text class="label">成长规划师证书 <text class="required">*</text></text>
- <view class="photo-upload" @click="chooseCertificate">
- <image v-if="form.certificateImage" :src="form.certificateImage" class="photo-preview" mode="aspectFill"></image>
- <view v-else class="photo-placeholder">
- <text class="plus-icon">+</text>
- <text class="placeholder-text">上传证书</text>
- </view>
- </view>
- </view>
- </view>
- <!-- AI助手选择(已屏蔽)
- <view class="family-section" v-if="isEdit">
- <view class="section-title">🤖 选择AI助手</view>
- <view class="mascot-cards">
- <view class="mascot-card" :class="{ active: form.mascot === 'xibao' }" @click="selectMascot('xibao')">
- <view class="mascot-card-icon xibao-bg">🌟</view>
- <view class="mascot-card-info">
- <text class="mascot-card-name">浠宝</text>
- <text class="mascot-card-desc">温柔活泼的阳光女孩</text>
- </view>
- </view>
- <view class="mascot-card" :class="{ active: form.mascot === 'fubao' }" @click="selectMascot('fubao')">
- <view class="mascot-card-icon fubao-bg">💪</view>
- <view class="mascot-card-info">
- <text class="mascot-card-name">福宝</text>
- <text class="mascot-card-desc">开朗自信的阳光男孩</text>
- </view>
- </view>
- </view>
- </view> -->
- <!-- 家庭绑定(新用户注册时显示) -->
- <view class="family-section" v-if="isEdit && form.role !== 'teacher' && isNewUserFlow">
- <view class="section-title">家庭绑定</view>
- <!-- 邀请码输入 -->
- <view class="form-item">
- <text class="label">家庭邀请码</text>
- <input type="text" v-model="form.inviteCode" placeholder="选填,如有邀请码请输入" class="input" maxlength="8" />
- </view>
- <view class="family-actions">
- <button v-if="form.inviteCode" class="btn btn-primary" @click="joinFamilyAction" :loading="loading">
- 加入家庭
- </button>
- <button v-else class="btn btn-primary" @click="createFamilyAction" :loading="loading">
- 创建新家庭
- </button>
- <button class="btn btn-skip" @click="skip">
- 跳过
- </button>
- </view>
- </view>
- <!-- 修改个人资料保存按钮(非新用户流程时显示) -->
- <view class="family-section" v-if="isEdit && !isNewUserFlow && form.role !== 'teacher'">
- <view class="family-actions">
- <button class="btn btn-primary" @click="saveUserInfo" :loading="loading">
- 保存修改
- </button>
- </view>
- </view>
- <!-- 成长规划师提交按钮 -->
- <view class="family-section" v-if="isEdit && form.role === 'teacher' && isNewUserFlow">
- <view class="family-actions">
- <button class="btn btn-primary" @click="submitTeacherInfo" :loading="loading">
- 提交申请
- </button>
- </view>
- </view>
- </view>
- </template>
- <script>
- import { updateUserInfo, joinFamily, createFamily, directRegister, getUserInfo } from '../../utils/api.js'
- import AddressPicker from '../../components/address-picker.vue'
- export default {
- components: {
- AddressPicker
- },
- data() {
- return {
- isEdit: false,
- showRoleSelect: true,
- isNewUserFlow: false, // 是否是新用户注册流程
- form: {
- role: '',
- avatar: '',
- nickname: '',
- realName: '',
- gender: '',
- idCard: '',
- birthday: '',
- birthHour: '',
- inviteCode: '',
- mascot: '',
- phone: '',
- teacherNo: '',
- teacherPhoto: '',
- certificateImage: '',
- ethnicity: '',
- bloodType: '',
- highestEducation: '',
- maritalStatus: '',
- hobbies: '',
- dietPreferences: '',
- address: '',
- addressId: null
- },
- ethnicityOptions: ['汉族','蒙古族','回族','藏族','维吾尔族','苗族','彝族','壮族','布依族','朝鲜族','满族','侗族','瑶族','白族','土家族','哈尼族','哈萨克族','傣族','黎族','其他'],
- bloodTypeOptions: ['A','B','AB','O','未知'],
- birthHourOptions: ['子时(23-01)','丑时(01-03)','寅时(03-05)','卯时(05-07)','辰时(07-09)','巳时(09-11)','午时(11-13)','未时(13-15)','申时(15-17)','酉时(17-19)','戌时(19-21)','亥时(21-23)'],
- birthHourValues: ['子','丑','寅','卯','辰','巳','午','未','申','酉','戌','亥'],
- educationOptions: ['小学','初中','高中','中专','大专','本科','硕士','博士'],
- maritalOptions: ['未婚','已婚','离异','丧偶'],
- loading: false,
- userId: '',
- token: ''
- }
- },
- computed: {
- ethnicityIndex() {
- return this.ethnicityOptions.indexOf(this.form.ethnicity)
- },
- bloodTypeIndex() {
- return this.bloodTypeOptions.indexOf(this.form.bloodType)
- },
- birthHourIndex() {
- return this.birthHourValues.indexOf(this.form.birthHour)
- },
- educationIndex() {
- return this.educationOptions.indexOf(this.form.highestEducation)
- },
- maritalIndex() {
- return this.maritalOptions.indexOf(this.form.maritalStatus)
- },
- },
- onLoad(options) {
- if (options.token && options.userId) {
- this.token = options.token
- this.userId = options.userId
- if (options.autoParent === 'true') {
- // 首次登录:跳过角色选择,默认 parent,直接进入信息补充页
- this.showRoleSelect = false
- this.isEdit = true
- this.isNewUserFlow = true
- this.form.role = 'parent'
- } else {
- // 检查是否需要选择角色(新用户)- 只有明确传递 needsRoleSelect=true 才显示选择
- this.showRoleSelect = options.needsRoleSelect === 'true'
- this.isEdit = !this.showRoleSelect
- this.isNewUserFlow = options.needsRoleSelect === 'true'
- }
- } else if (options.phone && (options.autoParent === 'true' || options.needsRoleSelect === 'true')) {
- // 测试环境:没有token,只有手机号,是新用户注册流程
- this.showRoleSelect = options.needsRoleSelect === 'true'
- this.isEdit = !this.showRoleSelect
- this.isNewUserFlow = true
- if (options.autoParent === 'true') {
- this.form.role = 'parent'
- }
- // 将手机号传递给表单
- this.form.phone = options.phone
- } else {
- // 其他情况:默认进入编辑模式(如从"我的"页面进入)
- this.showRoleSelect = false
- this.isEdit = true
- this.isNewUserFlow = false
- }
-
- // 非新用户流程时,加载已有用户信息
- if (this.isEdit && !this.isNewUserFlow) {
- this.loadUserInfo()
- }
- },
- methods: {
- selectRole(role) {
- this.form.role = role
- },
- confirmRole() {
- if (!this.form.role) {
- uni.showToast({ title: '请选择角色', icon: 'none' })
- return
- }
- this.showRoleSelect = false
- this.isEdit = true
-
- // 测试环境:直接注册用户(不需要验证码)
- if (!this.token && this.form.phone) {
- // 自动进入家庭绑定流程
- }
- },
- chooseAvatar() {
- uni.chooseImage({
- count: 1,
- success: (res) => {
- this.form.avatar = res.tempFilePaths[0]
- }
- })
- },
- chooseTeacherPhoto() {
- uni.chooseImage({
- count: 1,
- success: (res) => {
- this.form.teacherPhoto = res.tempFilePaths[0]
- }
- })
- },
- chooseCertificate() {
- uni.chooseImage({
- count: 1,
- success: (res) => {
- this.form.certificateImage = res.tempFilePaths[0]
- }
- })
- },
- onGenderChange(e) {
- this.form.gender = e.detail.value
- },
- onIdCardInput(e) {
- const idCard = e.detail.value
- if (idCard.length === 18) {
- // 根据身份证号自动提取生日
- const year = idCard.substring(6, 10)
- const month = idCard.substring(10, 12)
- const day = idCard.substring(12, 14)
- this.form.birthday = `${year}-${month}-${day}`
- }
- },
- onBirthdayChange(e) {
- this.form.birthday = e.detail.value
- },
- onEthnicityChange(e) {
- this.form.ethnicity = this.ethnicityOptions[e.detail.value]
- },
- onBloodTypeChange(e) {
- this.form.bloodType = this.bloodTypeOptions[e.detail.value]
- },
- onBirthHourChange(e) {
- this.form.birthHour = this.birthHourValues[e.detail.value]
- },
- onEducationChange(e) {
- this.form.highestEducation = this.educationOptions[e.detail.value]
- },
- onMaritalChange(e) {
- this.form.maritalStatus = this.maritalOptions[e.detail.value]
- },
- selectMascot(code) {
- this.form.mascot = code
- },
- // 加载已有用户信息
- async loadUserInfo() {
- try {
- const res = await getUserInfo()
- if (res.code === 200 && res.data) {
- const userData = res.data
- this.form.nickname = userData.nickname || ''
- this.form.realName = userData.realName || ''
- this.form.gender = userData.gender || ''
- this.form.idCard = userData.idCard || ''
- // 生日只取日期部分,去掉时间和 ISO 格式的 T 分隔符
- this.form.birthday = userData.birthday ? String(userData.birthday).split(/[T ]/)[0] : ''
- this.form.avatar = userData.avatar || ''
- this.form.role = userData.role || ''
- this.form.phone = userData.phone || ''
- this.form.ethnicity = userData.ethnicity || ''
- this.form.bloodType = userData.bloodType || ''
- this.form.highestEducation = userData.highestEducation || ''
- this.form.maritalStatus = userData.maritalStatus || ''
- this.form.hobbies = userData.hobbies || ''
- this.form.dietPreferences = userData.dietPreferences || ''
- this.form.mascot = userData.mascot || ''
- this.form.address = userData.address || ''
- }
- } catch (e) {
- console.error('加载用户信息失败', e)
- }
- },
- // 保存修改
- async saveUserInfo() {
- if (!this.form.nickname) {
- uni.showToast({ title: '请输入昵称', icon: 'none' })
- return
- }
-
- // 从 AddressPicker 读取地址文本
- if (this.$refs.addressPicker && this.$refs.addressPicker.fullAddress) {
- this.form.address = this.$refs.addressPicker.fullAddress
- }
- this.loading = true
- try {
- await updateUserInfo({
- nickname: this.form.nickname,
- realName: this.form.realName,
- gender: this.form.gender,
- idCard: this.form.idCard,
- birthday: this.form.birthday,
- avatar: this.form.avatar,
- mascot: this.form.mascot,
- ethnicity: this.form.ethnicity,
- bloodType: this.form.bloodType,
- highestEducation: this.form.highestEducation,
- maritalStatus: this.form.maritalStatus,
- hobbies: this.form.hobbies,
- dietPreferences: this.form.dietPreferences,
- address: this.form.address
- })
- uni.showToast({ title: '保存成功', icon: 'success' })
- setTimeout(() => {
- uni.navigateBack()
- }, 1500)
- } catch (e) {
- uni.showToast({ title: '保存失败', icon: 'none' })
- } finally {
- this.loading = false
- }
- },
- async submitTeacherInfo() {
- // 验证必填字段
- if (!this.form.nickname) {
- uni.showToast({ title: '请输入昵称', icon: 'none' })
- return
- }
- if (!this.form.gender) {
- uni.showToast({ title: '请选择性别', icon: 'none' })
- return
- }
- if (!this.form.idCard) {
- uni.showToast({ title: '请输入身份证号', icon: 'none' })
- return
- }
- if (!this.form.teacherNo) {
- uni.showToast({ title: '请输入成长规划师证书号', icon: 'none' })
- return
- }
- if (!this.form.teacherPhoto) {
- uni.showToast({ title: '请上传成长规划师照片', icon: 'none' })
- return
- }
- if (!this.form.certificateImage) {
- uni.showToast({ title: '请上传成长规划师证书', icon: 'none' })
- return
- }
- this.loading = true
- try {
- await updateUserInfo({
- ...this.form,
- roles: this.form.role
- })
- uni.showToast({ title: '提交成功,请等待审核' })
- setTimeout(() => {
- uni.switchTab({
- url: '/pages/home-pages/parent-index'
- })
- }, 1500)
- } catch (e) {
- uni.showToast({ title: '提交失败', icon: 'none' })
- } finally {
- this.loading = false
- }
- },
- async joinFamilyAction() {
- if (!this.form.inviteCode) {
- uni.showToast({ title: '请输入邀请码', icon: 'none' })
- return
- }
-
- if (!this.form.nickname) {
- uni.showToast({ title: '请输入昵称', icon: 'none' })
- return
- }
-
- this.loading = true
- try {
- let userId = this.userId
-
- // 测试环境:没有token,需要先注册用户
- if (!this.token && this.form.phone) {
- const regRes = await directRegister({
- phone: this.form.phone,
- nickname: this.form.nickname,
- avatar: this.form.avatar,
- role: this.form.role,
- mascot: this.form.mascot,
- birthday: this.form.birthday,
- gender: this.form.gender,
- inviteCode: this.form.inviteCode
- })
- userId = regRes.data.userId
- // 保存登录信息
- uni.setStorageSync('token', regRes.data.token)
- uni.setStorageSync('userId', userId)
- uni.setStorageSync('role', regRes.data.role)
- uni.setStorageSync('familyId', regRes.data.familyId)
- } else {
- await updateUserInfo(this.form)
- await joinFamily(this.form.inviteCode)
- }
-
- uni.showToast({ title: '加入成功' })
- setTimeout(() => {
- this.navigateToHome()
- }, 1500)
- } catch (e) {
- uni.showToast({ title: e.message || '加入失败', icon: 'none' })
- } finally {
- this.loading = false
- }
- },
- async createFamilyAction() {
- if (!this.form.nickname) {
- uni.showToast({ title: '请输入昵称', icon: 'none' })
- return
- }
-
- this.loading = true
- try {
- let userId = this.userId
-
- // 测试环境:没有token,需要先注册用户
- if (!this.token && this.form.phone) {
- const regRes = await directRegister({
- phone: this.form.phone,
- nickname: this.form.nickname,
- avatar: this.form.avatar,
- role: this.form.role,
- mascot: this.form.mascot,
- birthday: this.form.birthday,
- gender: this.form.gender
- })
- userId = regRes.data.userId
- // 保存登录信息
- uni.setStorageSync('token', regRes.data.token)
- uni.setStorageSync('userId', userId)
- uni.setStorageSync('role', regRes.data.role)
- uni.setStorageSync('familyId', regRes.data.familyId)
- } else {
- await updateUserInfo(this.form)
- await createFamily(this.form.nickname + '的家庭')
- }
-
- uni.showToast({ title: '创建成功' })
- setTimeout(() => {
- this.navigateToHome()
- }, 1500)
- } catch (e) {
- uni.showToast({ title: e.message || '创建失败', icon: 'none' })
- } finally {
- this.loading = false
- }
- },
- skip() {
- this.navigateToHome()
- },
- navigateToHome() {
- // 保存 mascot 到 userInfo 存储,供 AI 聊天页读取
- if (this.form.mascot) {
- try {
- const userInfo = uni.getStorageSync('userInfo') || {}
- userInfo.mascot = this.form.mascot
- uni.setStorageSync('userInfo', userInfo)
- } catch (e) {
- console.error('保存 mascot 失败', e)
- }
- }
- const role = this.form.role || 'parent'
- if (role === 'parent') {
- uni.navigateTo({ url: '/pages/home-pages/parent-index' })
- } else if (role === 'child') {
- uni.navigateTo({ url: '/pages/home-pages/child-index' })
- } else if (role === 'teacher') {
- uni.navigateTo({ url: '/pages/teacher/index' })
- }
- }
- }
- }
- </script>
- <style scoped>
- .user-edit-container {
- min-height: 100vh;
- background: #f5f5f5;
- padding: 30rpx;
- }
- .header {
- margin-bottom: 40rpx;
- text-align: center;
- }
- .title {
- font-size: 40rpx;
- font-weight: bold;
- color: #333;
- display: block;
- margin-bottom: 10rpx;
- }
- .subtitle {
- font-size: 28rpx;
- color: #999;
- }
- /* 角色选择 */
- .role-select-section {
- margin-bottom: 40rpx;
- }
- .role-card {
- background: #fff;
- border-radius: 16rpx;
- padding: 40rpx;
- margin-bottom: 20rpx;
- display: flex;
- flex-direction: column;
- align-items: center;
- border: 2rpx solid transparent;
- transition: all 0.3s;
- }
- .role-card.active {
- border-color: #4CAF50;
- background: #f8fdf8;
- }
- .role-icon {
- font-size: 80rpx;
- margin-bottom: 16rpx;
- }
- .role-name {
- font-size: 32rpx;
- font-weight: bold;
- color: #333;
- margin-bottom: 8rpx;
- }
- .role-desc {
- font-size: 24rpx;
- color: #999;
- }
- .btn-next {
- background: #4CAF50;
- color: #fff;
- border-radius: 40rpx;
- margin-top: 20rpx;
- }
- /* 表单 */
- .form-section {
- background: #fff;
- border-radius: 16rpx;
- padding: 30rpx;
- margin-bottom: 30rpx;
- }
- .form-section-title {
- font-size: 30rpx;
- font-weight: bold;
- color: #333;
- margin-bottom: 20rpx;
- padding-bottom: 16rpx;
- border-bottom: 1rpx solid #f0f0f0;
- }
- .form-item {
- margin-bottom: 30rpx;
- }
- .label {
- display: block;
- font-size: 28rpx;
- color: #333;
- margin-bottom: 16rpx;
- }
- .required {
- color: #f44336;
- }
- .input, .picker-input {
- padding: 20rpx;
- background: #f5f5f5;
- border-radius: 12rpx;
- font-size: 28rpx;
- }
- .role-select {
- display: flex;
- gap: 40rpx;
- }
- .role-option {
- display: flex;
- align-items: center;
- gap: 8rpx;
- }
- /* 头像上传 */
- .avatar-upload {
- width: 150rpx;
- height: 150rpx;
- }
- .avatar-preview {
- width: 150rpx;
- height: 150rpx;
- border-radius: 50%;
- }
- .avatar-placeholder {
- width: 150rpx;
- height: 150rpx;
- background: #f5f5f5;
- border-radius: 50%;
- display: flex;
- align-items: center;
- justify-content: center;
- font-size: 60rpx;
- color: #ccc;
- }
- /* 照片上传 */
- .photo-upload {
- width: 300rpx;
- height: 200rpx;
- }
- .photo-preview {
- width: 300rpx;
- height: 200rpx;
- border-radius: 12rpx;
- }
- .photo-placeholder {
- width: 300rpx;
- height: 200rpx;
- background: #f5f5f5;
- border-radius: 12rpx;
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- }
- .plus-icon {
- font-size: 60rpx;
- color: #ccc;
- }
- .placeholder-text {
- font-size: 24rpx;
- color: #999;
- margin-top: 8rpx;
- }
- /* AI助手选择 */
- .mascot-cards {
- display: flex;
- gap: 20rpx;
- margin-top: 16rpx;
- }
- .mascot-card {
- flex: 1;
- background: #f8f8f8;
- border-radius: 16rpx;
- padding: 24rpx;
- display: flex;
- align-items: center;
- gap: 16rpx;
- border: 2rpx solid transparent;
- transition: all 0.3s;
- }
- .mascot-card.active {
- border-color: #4CAF50;
- background: #f0fdf4;
- }
- .mascot-card-icon {
- width: 72rpx;
- height: 72rpx;
- border-radius: 50%;
- display: flex;
- align-items: center;
- justify-content: center;
- font-size: 36rpx;
- flex-shrink: 0;
- }
- .xibao-bg {
- background: linear-gradient(135deg, #FFF0DB, #FFD6A5);
- }
- .fubao-bg {
- background: linear-gradient(135deg, #FFF8E1, #FCD34D);
- }
- .mascot-card-info {
- display: flex;
- flex-direction: column;
- gap: 4rpx;
- }
- .mascot-card-name {
- font-size: 30rpx;
- font-weight: bold;
- color: #333;
- }
- .mascot-card-desc {
- font-size: 22rpx;
- color: #999;
- }
- /* 家庭绑定 */
- .family-section {
- background: #fff;
- border-radius: 16rpx;
- padding: 30rpx;
- }
- .section-title {
- font-size: 30rpx;
- font-weight: bold;
- color: #333;
- margin-bottom: 20rpx;
- }
- .family-actions {
- display: flex;
- flex-direction: column;
- gap: 20rpx;
- margin-top: 30rpx;
- }
- .btn {
- border-radius: 40rpx;
- font-size: 30rpx;
- }
- .btn-primary {
- background: #4CAF50;
- color: #fff;
- }
- .btn-skip {
- background: #f5f5f5;
- color: #999;
- }
- </style>
|