|
|
@@ -1,11 +1,49 @@
|
|
|
<template>
|
|
|
<view class="user-edit-container">
|
|
|
<view class="header">
|
|
|
- <text class="title">完善个人信息</text>
|
|
|
- <text class="subtitle">以下信息可帮助您更好地使用服务</text>
|
|
|
+ <text class="title">{{ isEdit ? '完善个人信息' : '选择角色' }}</text>
|
|
|
+ <text class="subtitle">{{ isEdit ? '以下信息可帮助您更好地使用服务' : '请选择您的身份类型' }}</text>
|
|
|
</view>
|
|
|
|
|
|
- <view class="form-section">
|
|
|
+ <!-- 角色选择(新用户首次登录时显示) -->
|
|
|
+ <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>
|
|
|
@@ -29,24 +67,9 @@
|
|
|
<input type="text" v-model="form.realName" placeholder="选填,用于家庭管理" class="input" maxlength="20" />
|
|
|
</view>
|
|
|
|
|
|
- <!-- 角色选择 -->
|
|
|
+ <!-- 性别(指导师必填) -->
|
|
|
<view class="form-item">
|
|
|
- <text class="label">我是</text>
|
|
|
- <radio-group class="role-select" @change="onRoleChange">
|
|
|
- <label class="role-option">
|
|
|
- <radio value="parent" :checked="form.role === 'parent'" />
|
|
|
- <text>家长</text>
|
|
|
- </label>
|
|
|
- <label class="role-option">
|
|
|
- <radio value="child" :checked="form.role === 'child'" />
|
|
|
- <text>孩子</text>
|
|
|
- </label>
|
|
|
- </radio-group>
|
|
|
- </view>
|
|
|
-
|
|
|
- <!-- 性别选择 -->
|
|
|
- <view class="form-item">
|
|
|
- <text class="label">性别</text>
|
|
|
+ <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'" />
|
|
|
@@ -59,22 +82,56 @@
|
|
|
</radio-group>
|
|
|
</view>
|
|
|
|
|
|
- <!-- 身份证号 -->
|
|
|
+ <!-- 身份证号(指导师必填) -->
|
|
|
<view class="form-item">
|
|
|
- <text class="label">身份证号</text>
|
|
|
+ <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-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>
|
|
|
|
|
|
- <view class="family-section">
|
|
|
+ <!-- 家庭绑定(非指导师显示) -->
|
|
|
+ <view class="family-section" v-if="isEdit && form.role !== 'teacher'">
|
|
|
<view class="section-title">家庭绑定</view>
|
|
|
|
|
|
<!-- 邀请码输入 -->
|
|
|
@@ -95,6 +152,15 @@
|
|
|
</button>
|
|
|
</view>
|
|
|
</view>
|
|
|
+
|
|
|
+ <!-- 指导师提交按钮 -->
|
|
|
+ <view class="family-section" v-if="isEdit && form.role === 'teacher'">
|
|
|
+ <view class="family-actions">
|
|
|
+ <button class="btn btn-primary" @click="submitTeacherInfo" :loading="loading">
|
|
|
+ 提交申请
|
|
|
+ </button>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
@@ -104,302 +170,400 @@ import { updateUserInfo, joinFamily, createFamily } from '../../utils/api.js'
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
+ isEdit: false,
|
|
|
+ showRoleSelect: true,
|
|
|
form: {
|
|
|
+ role: '',
|
|
|
avatar: '',
|
|
|
nickname: '',
|
|
|
realName: '',
|
|
|
- role: 'parent',
|
|
|
gender: '',
|
|
|
idCard: '',
|
|
|
birthday: '',
|
|
|
- inviteCode: ''
|
|
|
+ inviteCode: '',
|
|
|
+ teacherNo: '',
|
|
|
+ teacherPhoto: '',
|
|
|
+ certificateImage: ''
|
|
|
},
|
|
|
loading: false,
|
|
|
- token: '',
|
|
|
- userId: null
|
|
|
+ userId: '',
|
|
|
+ token: ''
|
|
|
}
|
|
|
},
|
|
|
onLoad(options) {
|
|
|
- // 从登录页面传递过来的参数
|
|
|
- this.token = options.token || ''
|
|
|
- this.userId = options.userId || null
|
|
|
- // 从本地存储获取用户信息
|
|
|
- const userInfo = uni.getStorageSync('userInfo')
|
|
|
- if (userInfo) {
|
|
|
- this.form.nickname = userInfo.nickname || ''
|
|
|
- this.form.avatar = userInfo.avatar || ''
|
|
|
+ if (options.token && options.userId) {
|
|
|
+ this.token = options.token
|
|
|
+ this.userId = options.userId
|
|
|
+
|
|
|
+ // 检查是否需要选择角色(新用户)
|
|
|
+ this.showRoleSelect = options.needsRoleSelect === 'true'
|
|
|
+ this.isEdit = !this.showRoleSelect
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
- // 选择头像
|
|
|
+ selectRole(role) {
|
|
|
+ this.form.role = role
|
|
|
+ },
|
|
|
+ confirmRole() {
|
|
|
+ if (!this.form.role) {
|
|
|
+ uni.showToast({ title: '请选择角色', icon: 'none' })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.showRoleSelect = false
|
|
|
+ this.isEdit = true
|
|
|
+ },
|
|
|
chooseAvatar() {
|
|
|
uni.chooseImage({
|
|
|
count: 1,
|
|
|
- sizeType: ['compressed'],
|
|
|
- sourceType: ['album', 'camera'],
|
|
|
success: (res) => {
|
|
|
this.form.avatar = res.tempFilePaths[0]
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
-
|
|
|
- // 角色选择
|
|
|
- onRoleChange(e) {
|
|
|
- this.form.role = e.detail.value
|
|
|
+ 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
|
|
|
},
|
|
|
+ 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
|
|
|
+ }
|
|
|
|
|
|
- // 身份证输入 - 自动提取生日
|
|
|
- onIdCardInput(e) {
|
|
|
- const idCard = e.detail.value
|
|
|
- if (idCard.length === 15) {
|
|
|
- // 15位身份证:1985年07月08日 -> 19850708
|
|
|
- const birthYear = '19' + idCard.substring(6, 8)
|
|
|
- const birthMonth = idCard.substring(8, 10)
|
|
|
- const birthDay = idCard.substring(10, 12)
|
|
|
- this.form.birthday = `${birthYear}-${birthMonth}-${birthDay}`
|
|
|
- } else if (idCard.length === 18) {
|
|
|
- // 18位身份证:1985年07月08日 -> 19850708
|
|
|
- const birthYear = idCard.substring(6, 10)
|
|
|
- const birthMonth = idCard.substring(10, 12)
|
|
|
- const birthDay = idCard.substring(12, 14)
|
|
|
- this.form.birthday = `${birthYear}-${birthMonth}-${birthDay}`
|
|
|
+ this.loading = true
|
|
|
+ try {
|
|
|
+ await updateUserInfo({
|
|
|
+ ...this.form,
|
|
|
+ roles: this.form.role
|
|
|
+ })
|
|
|
+ uni.showToast({ title: '提交成功,请等待审核' })
|
|
|
+ setTimeout(() => {
|
|
|
+ uni.switchTab({
|
|
|
+ url: '/pages/index/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
|
|
|
}
|
|
|
- await this.saveUserInfo('join')
|
|
|
+ this.loading = true
|
|
|
+ try {
|
|
|
+ await updateUserInfo(this.form)
|
|
|
+ await joinFamily(this.form.inviteCode)
|
|
|
+ uni.showToast({ title: '加入成功' })
|
|
|
+ setTimeout(() => {
|
|
|
+ this.navigateToHome()
|
|
|
+ }, 1500)
|
|
|
+ } catch (e) {
|
|
|
+ uni.showToast({ title: '加入失败', icon: 'none' })
|
|
|
+ } finally {
|
|
|
+ this.loading = false
|
|
|
+ }
|
|
|
},
|
|
|
-
|
|
|
- // 创建新家庭
|
|
|
async createFamilyAction() {
|
|
|
- await this.saveUserInfo('create')
|
|
|
- },
|
|
|
-
|
|
|
- // 跳过
|
|
|
- async skip() {
|
|
|
- await this.saveUserInfo('skip')
|
|
|
- },
|
|
|
-
|
|
|
- // 保存用户信息
|
|
|
- async saveUserInfo(action) {
|
|
|
if (!this.form.nickname) {
|
|
|
uni.showToast({ title: '请输入昵称', icon: 'none' })
|
|
|
return
|
|
|
}
|
|
|
-
|
|
|
this.loading = true
|
|
|
-
|
|
|
try {
|
|
|
- // 1. 更新用户信息(包括新字段:role, gender, birthday, idCard)
|
|
|
- await updateUserInfo({
|
|
|
- nickname: this.form.nickname,
|
|
|
- avatar: this.form.avatar,
|
|
|
- realName: this.form.realName,
|
|
|
- role: this.form.role,
|
|
|
- gender: this.form.gender,
|
|
|
- birthday: this.form.birthday,
|
|
|
- idCard: this.form.idCard
|
|
|
- })
|
|
|
-
|
|
|
- // 2. 根据 action 处理家庭绑定
|
|
|
- if (action === 'join' && this.form.inviteCode) {
|
|
|
- await joinFamily(this.form.inviteCode)
|
|
|
- } else if (action === 'create') {
|
|
|
- await createFamily('我的家庭')
|
|
|
- }
|
|
|
- // action === 'skip' 时不做处理,使用自动创建的默认家庭
|
|
|
-
|
|
|
- uni.showToast({ title: '保存成功', icon: 'success' })
|
|
|
-
|
|
|
- // 更新本地存储的用户信息
|
|
|
- uni.setStorageSync('userInfo', {
|
|
|
- nickname: this.form.nickname,
|
|
|
- avatar: this.form.avatar
|
|
|
- })
|
|
|
- uni.setStorageSync('role', this.form.role)
|
|
|
-
|
|
|
- // 跳转到首页
|
|
|
- setTimeout(() => {
|
|
|
- // 根据角色跳转到对应的首页
|
|
|
- const role = uni.getStorageSync('role') || 'parent'
|
|
|
- if (role === 'parent') {
|
|
|
- uni.reLaunch({
|
|
|
- url: '/pages/index/parent-index'
|
|
|
- })
|
|
|
- } else {
|
|
|
- uni.reLaunch({
|
|
|
- url: '/pages/index/child-index'
|
|
|
- })
|
|
|
- }
|
|
|
- }, 1000)
|
|
|
- } catch (error) {
|
|
|
- uni.showToast({ title: error.message || '保存失败', icon: 'none' })
|
|
|
+ await updateUserInfo(this.form)
|
|
|
+ await createFamily(this.form.nickname + '的家庭')
|
|
|
+ uni.showToast({ title: '创建成功' })
|
|
|
+ setTimeout(() => {
|
|
|
+ this.navigateToHome()
|
|
|
+ }, 1500)
|
|
|
+ } catch (e) {
|
|
|
+ uni.showToast({ title: '创建失败', icon: 'none' })
|
|
|
} finally {
|
|
|
this.loading = false
|
|
|
}
|
|
|
+ },
|
|
|
+ skip() {
|
|
|
+ this.navigateToHome()
|
|
|
+ },
|
|
|
+ navigateToHome() {
|
|
|
+ const role = this.form.role || 'parent'
|
|
|
+ if (role === 'parent') {
|
|
|
+ uni.switchTab({ url: '/pages/index/parent-index' })
|
|
|
+ } else if (role === 'child') {
|
|
|
+ uni.switchTab({ url: '/pages/index/child-index' })
|
|
|
+ } else if (role === 'teacher') {
|
|
|
+ uni.switchTab({ url: '/pages/teacher/index' })
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
|
|
|
|
-<style lang="scss" scoped>
|
|
|
+<style scoped>
|
|
|
.user-edit-container {
|
|
|
min-height: 100vh;
|
|
|
- background: #f8f8f8;
|
|
|
- padding: 40rpx;
|
|
|
+ background: #f5f5f5;
|
|
|
+ padding: 30rpx;
|
|
|
}
|
|
|
|
|
|
.header {
|
|
|
+ margin-bottom: 40rpx;
|
|
|
text-align: center;
|
|
|
- margin-bottom: 60rpx;
|
|
|
-
|
|
|
- .title {
|
|
|
- display: block;
|
|
|
- font-size: 48rpx;
|
|
|
- font-weight: bold;
|
|
|
- color: #333;
|
|
|
- margin-bottom: 20rpx;
|
|
|
- }
|
|
|
+}
|
|
|
|
|
|
- .subtitle {
|
|
|
- display: block;
|
|
|
- font-size: 28rpx;
|
|
|
- color: #999;
|
|
|
- }
|
|
|
+.title {
|
|
|
+ font-size: 40rpx;
|
|
|
+ font-weight: bold;
|
|
|
+ color: #333;
|
|
|
+ display: block;
|
|
|
+ margin-bottom: 10rpx;
|
|
|
}
|
|
|
|
|
|
-.form-section {
|
|
|
+.subtitle {
|
|
|
+ font-size: 28rpx;
|
|
|
+ color: #999;
|
|
|
+}
|
|
|
+
|
|
|
+/* 角色选择 */
|
|
|
+.role-select-section {
|
|
|
+ margin-bottom: 40rpx;
|
|
|
+}
|
|
|
+
|
|
|
+.role-card {
|
|
|
background: #fff;
|
|
|
- border-radius: 20rpx;
|
|
|
+ border-radius: 16rpx;
|
|
|
padding: 40rpx;
|
|
|
- margin-bottom: 40rpx;
|
|
|
+ margin-bottom: 20rpx;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ align-items: center;
|
|
|
+ border: 2rpx solid transparent;
|
|
|
+ transition: all 0.3s;
|
|
|
}
|
|
|
|
|
|
-.form-item {
|
|
|
- margin-bottom: 40rpx;
|
|
|
+.role-card.active {
|
|
|
+ border-color: #4CAF50;
|
|
|
+ background: #f8fdf8;
|
|
|
+}
|
|
|
|
|
|
- &:last-child {
|
|
|
- margin-bottom: 0;
|
|
|
- }
|
|
|
+.role-icon {
|
|
|
+ font-size: 80rpx;
|
|
|
+ margin-bottom: 16rpx;
|
|
|
+}
|
|
|
|
|
|
- .label {
|
|
|
- display: block;
|
|
|
- font-size: 28rpx;
|
|
|
- color: #333;
|
|
|
- margin-bottom: 20rpx;
|
|
|
+.role-name {
|
|
|
+ font-size: 32rpx;
|
|
|
+ font-weight: bold;
|
|
|
+ color: #333;
|
|
|
+ margin-bottom: 8rpx;
|
|
|
+}
|
|
|
|
|
|
- .required {
|
|
|
- color: #ff6b6b;
|
|
|
- }
|
|
|
- }
|
|
|
+.role-desc {
|
|
|
+ font-size: 24rpx;
|
|
|
+ color: #999;
|
|
|
+}
|
|
|
|
|
|
- .input {
|
|
|
- width: 100%;
|
|
|
- height: 80rpx;
|
|
|
- background: #f8f8f8;
|
|
|
- border-radius: 12rpx;
|
|
|
- padding: 0 30rpx;
|
|
|
- font-size: 28rpx;
|
|
|
- }
|
|
|
+.btn-next {
|
|
|
+ background: #4CAF50;
|
|
|
+ color: #fff;
|
|
|
+ border-radius: 40rpx;
|
|
|
+ margin-top: 20rpx;
|
|
|
+}
|
|
|
|
|
|
- .picker-input {
|
|
|
- width: 100%;
|
|
|
- height: 80rpx;
|
|
|
- background: #f8f8f8;
|
|
|
- border-radius: 12rpx;
|
|
|
- padding: 0 30rpx;
|
|
|
- font-size: 28rpx;
|
|
|
- line-height: 80rpx;
|
|
|
- color: #333;
|
|
|
- }
|
|
|
+/* 表单 */
|
|
|
+.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;
|
|
|
- padding: 10rpx 0;
|
|
|
}
|
|
|
|
|
|
.role-option {
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
- gap: 10rpx;
|
|
|
+ gap: 8rpx;
|
|
|
+}
|
|
|
+
|
|
|
+/* 头像上传 */
|
|
|
+.avatar-upload {
|
|
|
+ width: 150rpx;
|
|
|
+ height: 150rpx;
|
|
|
+}
|
|
|
+
|
|
|
+.avatar-preview {
|
|
|
+ width: 150rpx;
|
|
|
+ height: 150rpx;
|
|
|
+ border-radius: 50%;
|
|
|
}
|
|
|
|
|
|
-.avatar-item {
|
|
|
+.avatar-placeholder {
|
|
|
+ width: 150rpx;
|
|
|
+ height: 150rpx;
|
|
|
+ background: #f5f5f5;
|
|
|
+ border-radius: 50%;
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
- justify-content: space-between;
|
|
|
-
|
|
|
- .avatar-upload {
|
|
|
- width: 120rpx;
|
|
|
- height: 120rpx;
|
|
|
- border-radius: 50%;
|
|
|
- overflow: hidden;
|
|
|
- background: #f8f8f8;
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- justify-content: center;
|
|
|
-
|
|
|
- .avatar-preview {
|
|
|
- width: 100%;
|
|
|
- height: 100%;
|
|
|
- }
|
|
|
+ justify-content: center;
|
|
|
+ font-size: 60rpx;
|
|
|
+ color: #ccc;
|
|
|
+}
|
|
|
|
|
|
- .avatar-placeholder {
|
|
|
- font-size: 48rpx;
|
|
|
- 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;
|
|
|
+}
|
|
|
+
|
|
|
+/* 家庭绑定 */
|
|
|
.family-section {
|
|
|
background: #fff;
|
|
|
- border-radius: 20rpx;
|
|
|
- padding: 40rpx;
|
|
|
+ border-radius: 16rpx;
|
|
|
+ padding: 30rpx;
|
|
|
+}
|
|
|
|
|
|
- .section-title {
|
|
|
- font-size: 32rpx;
|
|
|
- font-weight: bold;
|
|
|
- color: #333;
|
|
|
- margin-bottom: 30rpx;
|
|
|
- }
|
|
|
+.section-title {
|
|
|
+ font-size: 30rpx;
|
|
|
+ font-weight: bold;
|
|
|
+ color: #333;
|
|
|
+ margin-bottom: 20rpx;
|
|
|
}
|
|
|
|
|
|
.family-actions {
|
|
|
- margin-top: 40rpx;
|
|
|
-
|
|
|
- .btn {
|
|
|
- width: 100%;
|
|
|
- height: 88rpx;
|
|
|
- border-radius: 44rpx;
|
|
|
- font-size: 32rpx;
|
|
|
- margin-bottom: 20rpx;
|
|
|
- }
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ gap: 20rpx;
|
|
|
+ margin-top: 30rpx;
|
|
|
+}
|
|
|
|
|
|
- .btn-primary {
|
|
|
- background: #ff6b6b;
|
|
|
- color: #fff;
|
|
|
- }
|
|
|
+.btn {
|
|
|
+ border-radius: 40rpx;
|
|
|
+ font-size: 30rpx;
|
|
|
+}
|
|
|
|
|
|
- .btn-skip {
|
|
|
- background: #f8f8f8;
|
|
|
- color: #999;
|
|
|
- }
|
|
|
+.btn-primary {
|
|
|
+ background: #4CAF50;
|
|
|
+ color: #fff;
|
|
|
+}
|
|
|
+
|
|
|
+.btn-skip {
|
|
|
+ background: #f5f5f5;
|
|
|
+ color: #999;
|
|
|
}
|
|
|
</style>
|