user-edit.vue 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332
  1. <template>
  2. <view class="user-edit-container">
  3. <view class="header">
  4. <text class="title">{{ isEdit ? '完善个人信息' : '选择角色' }}</text>
  5. <text class="subtitle">{{ isEdit ? '以下信息可帮助您更好地使用服务' : '请选择您的身份类型' }}</text>
  6. </view>
  7. <!-- 角色选择(新用户首次登录时显示) -->
  8. <view class="role-select-section" v-if="!isEdit && showRoleSelect">
  9. <view
  10. class="role-card"
  11. :class="{ active: form.role === 'parent' }"
  12. @click="selectRole('parent')"
  13. >
  14. <text class="role-icon">👨‍👩‍👧</text>
  15. <text class="role-name">家长</text>
  16. <text class="role-desc">管理孩子任务、审核奖励</text>
  17. </view>
  18. <view
  19. class="role-card"
  20. :class="{ active: form.role === 'child' }"
  21. @click="selectRole('child')"
  22. >
  23. <text class="role-icon">👶</text>
  24. <text class="role-name">孩子</text>
  25. <text class="role-desc">执行任务、赚取积分</text>
  26. </view>
  27. <view
  28. class="role-card"
  29. :class="{ active: form.role === 'teacher' }"
  30. @click="selectRole('teacher')"
  31. >
  32. <text class="role-icon">👨‍🏫</text>
  33. <text class="role-name">成长规划师</text>
  34. <text class="role-desc">DAN测评、制定成长方案</text>
  35. </view>
  36. <button class="btn-next" @click="confirmRole" :disabled="!form.role">
  37. 下一步
  38. </button>
  39. </view>
  40. <!-- 详细信息填写(选择角色后显示) -->
  41. <view v-if="isEdit && (!isNewUserFlow || hasFamily)" :class="isEdit && form.role !== 'teacher' && isNewUserFlow ? 'user-form-wrap' : ''">
  42. <view class="form-section">
  43. <!-- 头像 -->
  44. <view class="form-item avatar-item">
  45. <text class="label">头像</text>
  46. <view class="avatar-upload" @click="chooseAvatar">
  47. <image v-if="form.avatar" :src="form.avatar" class="avatar-preview"></image>
  48. <view v-else class="avatar-placeholder">
  49. <text class="iconfont icon-plus">+</text>
  50. </view>
  51. </view>
  52. </view>
  53. <!-- 昵称 -->
  54. <view class="form-item">
  55. <text class="label">昵称 <text class="required">*</text></text>
  56. <input type="text" v-model="form.nickname" placeholder="请输入昵称" class="input" maxlength="20" />
  57. </view>
  58. <!-- 真实姓名 -->
  59. <view class="form-item">
  60. <text class="label">真实姓名</text>
  61. <input type="text" v-model="form.realName" placeholder="选填,用于家庭管理" class="input" maxlength="20" />
  62. </view>
  63. <!-- 性别(成长规划师必填) -->
  64. <view class="form-item">
  65. <text class="label">性别 <text class="required" v-if="form.role === 'teacher'">*</text></text>
  66. <radio-group class="role-select" @change="onGenderChange">
  67. <label class="role-option">
  68. <radio value="male" :checked="form.gender === 'male'" />
  69. <text>男</text>
  70. </label>
  71. <label class="role-option">
  72. <radio value="female" :checked="form.gender === 'female'" />
  73. <text>女</text>
  74. </label>
  75. </radio-group>
  76. </view>
  77. <!-- 身份证号(成长规划师必填) -->
  78. <view class="form-item">
  79. <text class="label">身份证号 <text class="required" v-if="form.role === 'teacher'">*</text></text>
  80. <input type="idcard" v-model="form.idCard" placeholder="选填,填写后自动生成生日" class="input" maxlength="18" @input="onIdCardInput" />
  81. </view>
  82. <!-- 生日 -->
  83. <view class="form-item">
  84. <text class="label">生日</text>
  85. <picker mode="date" :value="form.birthday" @change="onBirthdayChange">
  86. <view class="picker-input">{{ form.birthday || '请选择生日' }}</view>
  87. </picker>
  88. </view>
  89. <!-- 出生时辰 -->
  90. <view class="form-item">
  91. <text class="label">出生时辰</text>
  92. <picker mode="selector" :range="birthHourOptions" :value="birthHourIndex" @change="onBirthHourChange">
  93. <view class="picker-input">{{ form.birthHour || '请选择出生时辰' }}</view>
  94. </picker>
  95. </view>
  96. <!-- 民族 -->
  97. <view class="form-item">
  98. <text class="label">民族</text>
  99. <picker mode="selector" :range="ethnicityOptions" :value="ethnicityIndex" @change="onEthnicityChange">
  100. <view class="picker-input">{{ form.ethnicity || '请选择民族' }}</view>
  101. </picker>
  102. </view>
  103. <!-- 血型 -->
  104. <view class="form-item">
  105. <text class="label">血型</text>
  106. <picker mode="selector" :range="bloodTypeOptions" :value="bloodTypeIndex" @change="onBloodTypeChange">
  107. <view class="picker-input">{{ form.bloodType || '请选择血型' }}</view>
  108. </picker>
  109. </view>
  110. <!-- 最高学历 -->
  111. <view class="form-item">
  112. <text class="label">最高学历</text>
  113. <picker mode="selector" :range="educationOptions" :value="educationIndex" @change="onEducationChange">
  114. <view class="picker-input">{{ form.highestEducation || '请选择最高学历' }}</view>
  115. </picker>
  116. </view>
  117. <!-- 婚姻状态 -->
  118. <view class="form-item">
  119. <text class="label">婚姻状态</text>
  120. <picker mode="selector" :range="maritalOptions" :value="maritalIndex" @change="onMaritalChange">
  121. <view class="picker-input">{{ form.maritalStatus || '请选择婚姻状态' }}</view>
  122. </picker>
  123. </view>
  124. <!-- 所在地区(省市区三级联动,与订单收货人地址一致) -->
  125. <view class="form-item address-row" @click="openRegionPicker">
  126. <text class="label">所在地区</text>
  127. <view class="address-value-wrap">
  128. <text v-if="form.address" class="address-value">{{ form.address }}</text>
  129. <text v-else class="address-placeholder">请选择省市区</text>
  130. <text class="address-arrow">›</text>
  131. </view>
  132. </view>
  133. <!-- 详细地址 -->
  134. <view class="form-item">
  135. <text class="label">详细地址</text>
  136. <input type="text" v-model="form.street" placeholder="请输入详细地址(选填)" class="input" maxlength="100" @input="updateFullAddress" />
  137. </view>
  138. <!-- 兴趣爱好 -->
  139. <view class="form-item">
  140. <text class="label">兴趣爱好</text>
  141. <input type="text" v-model="form.hobbies" placeholder="如: 阅读、运动、音乐" class="input" maxlength="200" />
  142. </view>
  143. <!-- 饮食偏好 -->
  144. <view class="form-item">
  145. <text class="label">饮食偏好</text>
  146. <input type="text" v-model="form.dietPreferences" placeholder="如: 清淡、无辣、低糖" class="input" maxlength="200" />
  147. </view>
  148. <!-- 成长规划师额外字段 -->
  149. <view class="form-section-title" v-if="form.role === 'teacher'">成长规划师信息</view>
  150. <!-- 成长规划师证书号(成长规划师必填) -->
  151. <view class="form-item" v-if="form.role === 'teacher'">
  152. <text class="label">成长规划师证书号 <text class="required">*</text></text>
  153. <input type="text" v-model="form.teacherNo" placeholder="请输入成长规划师证书号" class="input" maxlength="50" />
  154. </view>
  155. <!-- 成长规划师照片(成长规划师必填) -->
  156. <view class="form-item" v-if="form.role === 'teacher'">
  157. <text class="label">成长规划师照片 <text class="required">*</text></text>
  158. <view class="photo-upload" @click="chooseTeacherPhoto">
  159. <image v-if="form.teacherPhoto" :src="form.teacherPhoto" class="photo-preview" mode="aspectFill"></image>
  160. <view v-else class="photo-placeholder">
  161. <text class="plus-icon">+</text>
  162. <text class="placeholder-text">上传照片</text>
  163. </view>
  164. </view>
  165. </view>
  166. <!-- 成长规划师证书照片(成长规划师必填) -->
  167. <view class="form-item" v-if="form.role === 'teacher'">
  168. <text class="label">成长规划师证书 <text class="required">*</text></text>
  169. <view class="photo-upload" @click="chooseCertificate">
  170. <image v-if="form.certificateImage" :src="form.certificateImage" class="photo-preview" mode="aspectFill"></image>
  171. <view v-else class="photo-placeholder">
  172. <text class="plus-icon">+</text>
  173. <text class="placeholder-text">上传证书</text>
  174. </view>
  175. </view>
  176. </view>
  177. </view>
  178. <!-- 助手选择(会员专属;新用户流程不展示,避免注册时被助手选择打扰) -->
  179. <view class="family-section" v-if="isEdit && !isNewUserFlow && memberLevel !== 'FREE'">
  180. <view class="section-title">🤖 选择助手</view>
  181. <view class="mascot-cards">
  182. <view class="mascot-card" :class="{ active: form.mascot === 'xibao' }" @click="selectMascot('xibao')">
  183. <view class="mascot-card-icon xibao-bg">🌟</view>
  184. <view class="mascot-card-info">
  185. <text class="mascot-card-name">浠宝</text>
  186. <text class="mascot-card-desc">温柔活泼的阳光女孩</text>
  187. </view>
  188. </view>
  189. <view class="mascot-card" :class="{ active: form.mascot === 'fubao' }" @click="selectMascot('fubao')">
  190. <view class="mascot-card-icon fubao-bg">💪</view>
  191. <view class="mascot-card-info">
  192. <text class="mascot-card-name">福宝</text>
  193. <text class="mascot-card-desc">开朗自信的阳光男孩</text>
  194. </view>
  195. </view>
  196. </view>
  197. </view>
  198. <!-- 免费用户提示(新用户首次注册信息完善时不展示,注册流程不推送会员) -->
  199. <view class="family-section" v-if="isEdit && !isNewUserFlow && memberLevel === 'FREE'">
  200. <view class="mascot-locked-hint" @click="goUpgrade">
  201. <text class="locked-icon">🔒</text>
  202. <text class="locked-text">开通会员解锁更多能力</text>
  203. <text class="locked-arrow">›</text>
  204. </view>
  205. </view>
  206. <!-- 修改个人资料保存按钮(非新用户流程时显示) -->
  207. <view class="family-section" v-if="isEdit && !isNewUserFlow && form.role !== 'teacher'">
  208. <view class="family-actions">
  209. <button class="btn btn-primary" @click="saveUserInfo" :loading="loading" :disabled="loading">
  210. 保存修改
  211. </button>
  212. </view>
  213. </view>
  214. <!-- 成长规划师提交按钮 -->
  215. <view class="family-section" v-if="isEdit && form.role === 'teacher' && isNewUserFlow">
  216. <view class="family-actions">
  217. <button class="btn btn-primary" @click="submitTeacherInfo" :loading="loading" :disabled="loading">
  218. 提交申请
  219. </button>
  220. </view>
  221. </view>
  222. </view>
  223. <view v-else-if="isEdit">
  224. <FamilyEmptyState type="card" />
  225. </view>
  226. <!-- 区域选择弹窗(省市区三级联动) -->
  227. <view class="region-mask" v-if="showRegionPicker" @click="cancelRegion">
  228. <view class="region-picker" @click.stop>
  229. <view class="region-header">
  230. <text class="region-header-btn" @click="cancelRegion">取消</text>
  231. <text class="region-header-title">选择地区</text>
  232. <text class="region-header-btn region-confirm" @click="confirmRegion">确定</text>
  233. </view>
  234. <view class="region-breadcrumb">
  235. <text
  236. v-for="(name, i) in regionBreadcrumb"
  237. :key="i"
  238. :class="['crumb-item', i === currentRegionLevel ? 'crumb-active' : '']"
  239. @click="jumpRegionLevel(i)"
  240. >{{ name || '请选择' }}</text>
  241. <text class="crumb-arrow" v-if="currentRegionLevel < 2">›</text>
  242. </view>
  243. <scroll-view class="region-list" scroll-y>
  244. <view
  245. v-for="(item, idx) in currentRegionItems"
  246. :key="idx"
  247. :class="['region-item', isRegionSelected(item) ? 'region-item-selected' : '']"
  248. @click="selectRegionItem(item)"
  249. >
  250. <text class="region-item-text">{{ getRegionName(item) }}</text>
  251. <text class="region-item-check" v-if="isRegionSelected(item)">✓</text>
  252. </view>
  253. <view v-if="regionLoading" class="region-loading">
  254. <text>加载中...</text>
  255. </view>
  256. </scroll-view>
  257. </view>
  258. </view>
  259. </view>
  260. </template>
  261. <script>
  262. import { updateUserInfo, createFamily, directRegister, getUserInfo, requestJoinByCode, getMyMembership, bindReferralIfNotSelf } from '../../utils/api.js'
  263. import config from '@/config.js'
  264. export default {
  265. data() {
  266. return {
  267. isEdit: false,
  268. showRoleSelect: true,
  269. isNewUserFlow: false, // 是否是新用户注册流程
  270. memberLevel: 'FREE', // 会员等级,用于判断是否解锁助手
  271. form: {
  272. role: '',
  273. avatar: '',
  274. nickname: '',
  275. realName: '',
  276. gender: '',
  277. idCard: '',
  278. birthday: '',
  279. birthHour: '',
  280. inviteCode: '',
  281. familyRole: '', // 家庭角色:爸爸/妈妈/爷爷/奶奶/姥爷/姥姥/其他(可选)
  282. mascot: '',
  283. phone: '',
  284. teacherNo: '',
  285. teacherPhoto: '',
  286. certificateImage: '',
  287. ethnicity: '',
  288. bloodType: '',
  289. highestEducation: '',
  290. maritalStatus: '',
  291. hobbies: '',
  292. dietPreferences: '',
  293. address: '',
  294. province: '',
  295. city: '',
  296. district: '',
  297. street: ''
  298. },
  299. // 区域选择弹窗(省市区三级联动,与订单收货人地址一致)
  300. showRegionPicker: false,
  301. currentRegionLevel: 0, // 0=省份, 1=城市, 2=区县
  302. regionLoading: false,
  303. provinceList: [],
  304. cityList: [],
  305. districtList: [],
  306. tempProvince: null,
  307. tempCity: null,
  308. tempDistrict: null,
  309. ethnicityOptions: ['汉族','蒙古族','回族','藏族','维吾尔族','苗族','彝族','壮族','布依族','朝鲜族','满族','侗族','瑶族','白族','土家族','哈尼族','哈萨克族','傣族','黎族','其他'],
  310. bloodTypeOptions: ['A','B','AB','O','未知'],
  311. 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)'],
  312. birthHourValues: ['子','丑','寅','卯','辰','巳','午','未','申','酉','戌','亥'],
  313. educationOptions: ['小学','初中','高中','中专','大专','本科','硕士','博士'],
  314. maritalOptions: ['未婚','已婚','离异','丧偶'],
  315. familyRoleOptions: ['爸爸', '妈妈', '爷爷', '奶奶', '姥爷', '姥姥', '其他'],
  316. loading: false,
  317. userId: '',
  318. token: ''
  319. }
  320. },
  321. computed: {
  322. ethnicityIndex() {
  323. return this.ethnicityOptions.indexOf(this.form.ethnicity)
  324. },
  325. bloodTypeIndex() {
  326. return this.bloodTypeOptions.indexOf(this.form.bloodType)
  327. },
  328. birthHourIndex() {
  329. return this.birthHourValues.indexOf(this.form.birthHour)
  330. },
  331. educationIndex() {
  332. return this.educationOptions.indexOf(this.form.highestEducation)
  333. },
  334. maritalIndex() {
  335. return this.maritalOptions.indexOf(this.form.maritalStatus)
  336. },
  337. familyRoleIndex: {
  338. get() {
  339. return this.familyRoleOptions.indexOf(this.form.familyRole)
  340. },
  341. set(val) {
  342. this.form.familyRole = this.familyRoleOptions[val] || ''
  343. }
  344. },
  345. hasFamily: function() {
  346. if (this.token) return true
  347. return this.$store.getters.hasFamily
  348. },
  349. regionBreadcrumb: function() {
  350. var names = []
  351. names.push(this.tempProvince ? this.getRegionName(this.tempProvince) : '省份')
  352. names.push(this.tempCity ? this.getRegionName(this.tempCity) : '城市')
  353. names.push(this.tempDistrict ? this.getRegionName(this.tempDistrict) : '区县')
  354. return names
  355. },
  356. currentRegionItems: function() {
  357. if (this.currentRegionLevel === 0) return this.provinceList
  358. if (this.currentRegionLevel === 1) return this.cityList
  359. if (this.currentRegionLevel === 2) return this.districtList
  360. return []
  361. },
  362. },
  363. onLoad(options) {
  364. // 注册零填写改造:本页仅保留「个人中心编辑资料」用途
  365. // 新用户注册不再跳转本页(autoParent / needsRoleSelect 参数已废弃,不再处理)
  366. this.showRoleSelect = false
  367. this.isEdit = true
  368. this.isNewUserFlow = false
  369. // 加载已有用户信息
  370. this.loadUserInfo()
  371. // 加载会员等级(用于助手解锁)
  372. var self = this
  373. getMyMembership().then(function(res) {
  374. if (res.data && res.data.memberLevel) {
  375. self.memberLevel = res.data.memberLevel
  376. }
  377. }).catch(function() {})
  378. },
  379. methods: {
  380. selectRole(role) {
  381. this.form.role = role
  382. },
  383. confirmRole() {
  384. if (!this.form.role) {
  385. uni.showToast({ title: '请选择角色', icon: 'none' })
  386. return
  387. }
  388. this.showRoleSelect = false
  389. this.isEdit = true
  390. // 测试环境:直接注册用户(不需要验证码)
  391. if (!this.token && this.form.phone) {
  392. // 自动进入家庭绑定流程
  393. }
  394. },
  395. chooseAvatar() {
  396. uni.chooseImage({
  397. count: 1,
  398. success: (res) => {
  399. this.form.avatar = res.tempFilePaths[0]
  400. }
  401. })
  402. },
  403. chooseTeacherPhoto() {
  404. uni.chooseImage({
  405. count: 1,
  406. success: (res) => {
  407. this.form.teacherPhoto = res.tempFilePaths[0]
  408. }
  409. })
  410. },
  411. chooseCertificate() {
  412. uni.chooseImage({
  413. count: 1,
  414. success: (res) => {
  415. this.form.certificateImage = res.tempFilePaths[0]
  416. }
  417. })
  418. },
  419. onGenderChange(e) {
  420. this.form.gender = e.detail.value
  421. },
  422. onIdCardInput(e) {
  423. const idCard = e.detail.value
  424. if (idCard.length === 18) {
  425. // 根据身份证号自动提取生日
  426. const year = idCard.substring(6, 10)
  427. const month = idCard.substring(10, 12)
  428. const day = idCard.substring(12, 14)
  429. this.form.birthday = `${year}-${month}-${day}`
  430. }
  431. },
  432. onBirthdayChange(e) {
  433. this.form.birthday = e.detail.value
  434. },
  435. onEthnicityChange(e) {
  436. this.form.ethnicity = this.ethnicityOptions[e.detail.value]
  437. },
  438. onBloodTypeChange(e) {
  439. this.form.bloodType = this.bloodTypeOptions[e.detail.value]
  440. },
  441. onBirthHourChange(e) {
  442. this.form.birthHour = this.birthHourValues[e.detail.value]
  443. },
  444. onEducationChange(e) {
  445. this.form.highestEducation = this.educationOptions[e.detail.value]
  446. },
  447. onMaritalChange(e) {
  448. this.form.maritalStatus = this.maritalOptions[e.detail.value]
  449. },
  450. onFamilyRoleChange(e) {
  451. this.form.familyRole = this.familyRoleOptions[e.detail.value] || ''
  452. },
  453. selectMascot(code) {
  454. this.form.mascot = code
  455. },
  456. goUpgrade() {
  457. uni.navigateTo({ url: '/pages/membership/upgrade' })
  458. },
  459. // ===== 省市区三级联动弹窗(与订单收货人地址一致) =====
  460. openRegionPicker() {
  461. this.tempProvince = this.form.province ? { name: this.form.province, id: null } : null
  462. this.tempCity = this.form.city ? { name: this.form.city, id: null } : null
  463. this.tempDistrict = this.form.district ? { name: this.form.district, id: null } : null
  464. this.currentRegionLevel = 0
  465. this.showRegionPicker = true
  466. this.loadRegionProvinces()
  467. },
  468. loadRegionProvinces() {
  469. var self = this
  470. self.regionLoading = true
  471. uni.request({
  472. url: config.api('/api/region/provinces'),
  473. method: 'POST',
  474. header: {
  475. 'Content-Type': 'application/json',
  476. 'Authorization': 'Bearer ' + uni.getStorageSync('token')
  477. },
  478. success: function(res) {
  479. self.regionLoading = false
  480. if (res.data && res.data.code === 200) {
  481. self.provinceList = res.data.data || []
  482. }
  483. },
  484. fail: function() {
  485. self.regionLoading = false
  486. }
  487. })
  488. },
  489. loadRegionCities(parentId) {
  490. if (!parentId) return
  491. var self = this
  492. self.regionLoading = true
  493. uni.request({
  494. url: config.api('/api/region/cities'),
  495. method: 'POST',
  496. data: { parentId: parentId },
  497. header: {
  498. 'Content-Type': 'application/json',
  499. 'Authorization': 'Bearer ' + uni.getStorageSync('token')
  500. },
  501. success: function(res) {
  502. self.regionLoading = false
  503. if (res.data && res.data.code === 200) {
  504. self.cityList = res.data.data || []
  505. }
  506. },
  507. fail: function() {
  508. self.regionLoading = false
  509. }
  510. })
  511. },
  512. loadRegionDistricts(parentId) {
  513. if (!parentId) return
  514. var self = this
  515. self.regionLoading = true
  516. uni.request({
  517. url: config.api('/api/region/districts'),
  518. method: 'POST',
  519. data: { parentId: parentId },
  520. header: {
  521. 'Content-Type': 'application/json',
  522. 'Authorization': 'Bearer ' + uni.getStorageSync('token')
  523. },
  524. success: function(res) {
  525. self.regionLoading = false
  526. if (res.data && res.data.code === 200) {
  527. self.districtList = res.data.data || []
  528. }
  529. },
  530. fail: function() {
  531. self.regionLoading = false
  532. }
  533. })
  534. },
  535. selectRegionItem(item) {
  536. if (this.currentRegionLevel === 0) {
  537. this.tempProvince = item
  538. this.tempCity = null
  539. this.tempDistrict = null
  540. this.cityList = []
  541. this.districtList = []
  542. this.currentRegionLevel = 1
  543. this.loadRegionCities(this.getRegionId(item))
  544. } else if (this.currentRegionLevel === 1) {
  545. this.tempCity = item
  546. this.tempDistrict = null
  547. this.districtList = []
  548. this.currentRegionLevel = 2
  549. this.loadRegionDistricts(this.getRegionId(item))
  550. } else if (this.currentRegionLevel === 2) {
  551. this.tempDistrict = item
  552. this.confirmRegion()
  553. }
  554. },
  555. confirmRegion() {
  556. if (this.tempProvince) {
  557. this.form.province = this.getRegionName(this.tempProvince)
  558. }
  559. if (this.tempCity) {
  560. this.form.city = this.getRegionName(this.tempCity)
  561. }
  562. if (this.tempDistrict) {
  563. this.form.district = this.getRegionName(this.tempDistrict)
  564. }
  565. this.updateFullAddress()
  566. this.showRegionPicker = false
  567. },
  568. cancelRegion() {
  569. this.showRegionPicker = false
  570. },
  571. jumpRegionLevel(level) {
  572. if (level < this.currentRegionLevel) {
  573. this.currentRegionLevel = level
  574. }
  575. },
  576. getRegionName(item) {
  577. return item && (item.name || item.province || item.city || item.district || '')
  578. },
  579. getRegionId(item) {
  580. return item && (item.id || item.code)
  581. },
  582. isRegionSelected(item) {
  583. var name = this.getRegionName(item)
  584. if (this.currentRegionLevel === 0) return this.tempProvince && this.getRegionName(this.tempProvince) === name
  585. if (this.currentRegionLevel === 1) return this.tempCity && this.getRegionName(this.tempCity) === name
  586. if (this.currentRegionLevel === 2) return this.tempDistrict && this.getRegionName(this.tempDistrict) === name
  587. return false
  588. },
  589. updateFullAddress() {
  590. this.form.address = (this.form.province || '') + (this.form.city || '') + (this.form.district || '') + (this.form.street || '')
  591. },
  592. // 加载已有用户信息
  593. async loadUserInfo() {
  594. try {
  595. const res = await getUserInfo()
  596. if (res.code === 200 && res.data) {
  597. const userData = res.data
  598. this.form.nickname = userData.nickname || ''
  599. this.form.realName = userData.realName || ''
  600. this.form.gender = userData.gender || ''
  601. this.form.idCard = userData.idCard || ''
  602. // 生日只取日期部分,去掉时间和 ISO 格式的 T 分隔符
  603. this.form.birthday = userData.birthday ? String(userData.birthday).split(/[T ]/)[0] : ''
  604. this.form.avatar = userData.avatar || ''
  605. this.form.role = userData.role || ''
  606. this.form.phone = userData.phone || ''
  607. this.form.ethnicity = userData.ethnicity || ''
  608. this.form.bloodType = userData.bloodType || ''
  609. this.form.highestEducation = userData.highestEducation || ''
  610. this.form.maritalStatus = userData.maritalStatus || ''
  611. this.form.hobbies = userData.hobbies || ''
  612. this.form.dietPreferences = userData.dietPreferences || ''
  613. this.form.mascot = userData.mascot || ''
  614. this.form.address = userData.address || ''
  615. this.form.province = userData.province || ''
  616. this.form.city = userData.city || ''
  617. this.form.district = userData.district || ''
  618. this.form.street = userData.street || ''
  619. // 若无完整地址文本但有省市区,则拼接
  620. if (!this.form.address && (this.form.province || this.form.city || this.form.district)) {
  621. this.updateFullAddress()
  622. }
  623. }
  624. } catch (e) {
  625. console.error('加载用户信息失败', e)
  626. }
  627. },
  628. // 保存修改
  629. async saveUserInfo() {
  630. if (this.loading) return
  631. // 新用户流程:昵称可跳过(跳过时用默认昵称);老用户流程:昵称必填
  632. if (!this.isNewUserFlow && !this.form.nickname) {
  633. uni.showToast({ title: '请输入昵称', icon: 'none' })
  634. return
  635. }
  636. if (this.isNewUserFlow && !this.form.nickname) {
  637. var phone = this.form.phone || ''
  638. this.form.nickname = phone ? '用户' + phone.substring(phone.length - 4) : '微信用户'
  639. }
  640. // 从省市区街道字段同步完整地址文本
  641. this.updateFullAddress()
  642. this.loading = true
  643. try {
  644. await updateUserInfo({
  645. nickname: this.form.nickname,
  646. realName: this.form.realName,
  647. gender: this.form.gender,
  648. idCard: this.form.idCard,
  649. birthday: this.form.birthday,
  650. avatar: this.form.avatar,
  651. mascot: this.form.mascot,
  652. ethnicity: this.form.ethnicity,
  653. bloodType: this.form.bloodType,
  654. highestEducation: this.form.highestEducation,
  655. maritalStatus: this.form.maritalStatus,
  656. hobbies: this.form.hobbies,
  657. dietPreferences: this.form.dietPreferences,
  658. address: this.form.address,
  659. province: this.form.province,
  660. city: this.form.city,
  661. district: this.form.district,
  662. street: this.form.street
  663. })
  664. uni.showToast({ title: '保存成功', icon: 'success' })
  665. setTimeout(() => {
  666. if (this.isNewUserFlow) {
  667. this.navigateToHome()
  668. } else {
  669. uni.navigateBack()
  670. }
  671. }, 1500)
  672. } catch (e) {
  673. uni.showToast({ title: '保存失败', icon: 'none' })
  674. } finally {
  675. this.loading = false
  676. }
  677. },
  678. async submitTeacherInfo() {
  679. if (this.loading) return
  680. // 验证必填字段
  681. if (!this.form.nickname) {
  682. uni.showToast({ title: '请输入昵称', icon: 'none' })
  683. return
  684. }
  685. if (!this.form.gender) {
  686. uni.showToast({ title: '请选择性别', icon: 'none' })
  687. return
  688. }
  689. if (!this.form.idCard) {
  690. uni.showToast({ title: '请输入身份证号', icon: 'none' })
  691. return
  692. }
  693. if (!this.form.teacherNo) {
  694. uni.showToast({ title: '请输入成长规划师证书号', icon: 'none' })
  695. return
  696. }
  697. if (!this.form.teacherPhoto) {
  698. uni.showToast({ title: '请上传成长规划师照片', icon: 'none' })
  699. return
  700. }
  701. if (!this.form.certificateImage) {
  702. uni.showToast({ title: '请上传成长规划师证书', icon: 'none' })
  703. return
  704. }
  705. this.loading = true
  706. try {
  707. await updateUserInfo({
  708. ...this.form,
  709. roles: this.form.role
  710. })
  711. uni.showToast({ title: '提交成功,请等待审核' })
  712. setTimeout(() => {
  713. uni.switchTab({ url: '/pages/index-home/index' })
  714. }, 1500)
  715. } catch (e) {
  716. uni.showToast({ title: '提交失败', icon: 'none' })
  717. } finally {
  718. this.loading = false
  719. }
  720. },
  721. async joinFamilyAction() {
  722. if (this.loading) return
  723. if (!this.form.inviteCode) {
  724. uni.showToast({ title: '请输入邀请码', icon: 'none' })
  725. return
  726. }
  727. if (!this.form.nickname) {
  728. uni.showToast({ title: '请输入昵称', icon: 'none' })
  729. return
  730. }
  731. this.loading = true
  732. try {
  733. let userId = this.userId
  734. // 测试环境:没有token,需要先注册用户
  735. if (!this.token && this.form.phone) {
  736. const regRes = await directRegister({
  737. phone: this.form.phone,
  738. nickname: this.form.nickname,
  739. avatar: this.form.avatar,
  740. role: this.form.role,
  741. mascot: this.form.mascot,
  742. birthday: this.form.birthday,
  743. gender: this.form.gender,
  744. inviteCode: this.form.inviteCode
  745. })
  746. userId = regRes.data.userId
  747. // 保存登录信息
  748. uni.setStorageSync('token', regRes.data.token)
  749. uni.setStorageSync('userId', userId)
  750. uni.setStorageSync('role', regRes.data.role)
  751. // 邀请码注册不写入 familyId(加入需管理员审批)
  752. } else {
  753. await updateUserInfo(this.form)
  754. await requestJoinByCode(this.form.inviteCode)
  755. }
  756. uni.showToast({ title: '申请已提交,等待管理员审批' })
  757. setTimeout(() => {
  758. this.navigateToHome()
  759. }, 1500)
  760. } catch (e) {
  761. uni.showToast({ title: e.message || '加入失败', icon: 'none' })
  762. } finally {
  763. this.loading = false
  764. }
  765. },
  766. async createFamilyAction() {
  767. if (!this.form.nickname) {
  768. uni.showToast({ title: '请输入昵称', icon: 'none' })
  769. return
  770. }
  771. this.loading = true
  772. try {
  773. let userId = this.userId
  774. // 测试环境:没有token,需要先注册用户
  775. if (!this.token && this.form.phone) {
  776. const regRes = await directRegister({
  777. phone: this.form.phone,
  778. nickname: this.form.nickname,
  779. avatar: this.form.avatar,
  780. role: this.form.role,
  781. mascot: this.form.mascot,
  782. birthday: this.form.birthday,
  783. gender: this.form.gender
  784. })
  785. userId = regRes.data.userId
  786. // 保存登录信息
  787. uni.setStorageSync('token', regRes.data.token)
  788. uni.setStorageSync('userId', userId)
  789. uni.setStorageSync('role', regRes.data.role)
  790. // 注册不写入 familyId(后端根据 userId 获取)
  791. } else {
  792. await updateUserInfo(this.form)
  793. const famRes = await createFamily(this.form.nickname + '的家庭')
  794. // 同步 familyId 到 store(hasFamily getter 依赖)
  795. if (famRes && famRes.data) {
  796. this.$store.commit('setFamilyId', famRes.data)
  797. }
  798. }
  799. uni.showToast({ title: '创建成功' })
  800. setTimeout(() => {
  801. this.navigateToHome()
  802. }, 1500)
  803. } catch (e) {
  804. uni.showToast({ title: e.message || '创建失败', icon: 'none' })
  805. } finally {
  806. this.loading = false
  807. }
  808. },
  809. skip() {
  810. // 跳过时不清理邀请码,用户可后续重新进入编辑页提交申请
  811. this.navigateToHome()
  812. },
  813. navigateToHome() {
  814. // 保存 mascot 到 userInfo 存储,供聊天页读取
  815. if (this.form.mascot) {
  816. try {
  817. const userInfo = uni.getStorageSync('userInfo') || {}
  818. userInfo.mascot = this.form.mascot
  819. uni.setStorageSync('userInfo', userInfo)
  820. } catch (e) {
  821. console.error('保存 mascot 失败', e)
  822. }
  823. }
  824. // 新用户流程:消费分享者推荐码,绑定推荐人(推荐码统一为 refCode storage)
  825. // 登录页 completeLogin 在 needsRoleSelect=true 时直接跳本页,跳过了 handleReferralBind,
  826. // 因此在此处统一消费 storage 中的 refCode/inviteCode,避免推荐人绑定丢失
  827. var refCode = uni.getStorageSync('refCode')
  828. var inviteCode = uni.getStorageSync('inviteCode')
  829. var inviteType = uni.getStorageSync('inviteType')
  830. var code = refCode || (inviteCode && inviteType !== 'team' ? inviteCode : '')
  831. if (code) {
  832. var self = this
  833. bindReferralIfNotSelf(code).then(function(res) {
  834. if (res && res.code === 200) {
  835. console.log('新用户绑定推荐人成功', code)
  836. }
  837. }).catch(function(e) {
  838. // 后端 Result.error(code=500) → request() 已 toast 业务消息
  839. if (e && e.code !== undefined && e.code !== 401) {
  840. console.log('新用户绑定推荐人业务拒绝', code, e.message || '')
  841. } else {
  842. console.log('新用户绑定推荐人失败', e)
  843. }
  844. })
  845. }
  846. uni.removeStorageSync('refCode')
  847. uni.removeStorageSync('inviteCode')
  848. uni.removeStorageSync('inviteType')
  849. // 用 switchTab 跳转带底部 TabBar 的首页(行/身/智/心/富)
  850. // parent-index/child-index 是分包页面(非 TabBar 页),用 navigateTo 会丢失底部 TabBar
  851. uni.switchTab({ url: '/pages/index-home/index' })
  852. }
  853. }
  854. }
  855. </script>
  856. <style scoped>
  857. .user-edit-container {
  858. min-height: 100vh;
  859. background: #f5f5f5;
  860. padding: 30rpx;
  861. }
  862. .header {
  863. margin-bottom: 40rpx;
  864. text-align: center;
  865. }
  866. .title {
  867. font-size: 40rpx;
  868. font-weight: bold;
  869. color: #333;
  870. display: block;
  871. margin-bottom: 10rpx;
  872. }
  873. .subtitle {
  874. font-size: 28rpx;
  875. color: #999;
  876. }
  877. /* 角色选择 */
  878. .role-select-section {
  879. margin-bottom: 40rpx;
  880. }
  881. .role-card {
  882. background: #fff;
  883. border-radius: 16rpx;
  884. padding: 40rpx;
  885. margin-bottom: 20rpx;
  886. display: flex;
  887. flex-direction: column;
  888. align-items: center;
  889. border: 2rpx solid transparent;
  890. transition: all 0.3s;
  891. }
  892. .role-card.active {
  893. border-color: #4CAF50;
  894. background: #f8fdf8;
  895. }
  896. .role-icon {
  897. font-size: 80rpx;
  898. margin-bottom: 16rpx;
  899. }
  900. .role-name {
  901. font-size: 32rpx;
  902. font-weight: bold;
  903. color: #333;
  904. margin-bottom: 8rpx;
  905. }
  906. .role-desc {
  907. font-size: 24rpx;
  908. color: #999;
  909. }
  910. .btn-next {
  911. background: #4CAF50;
  912. color: #fff;
  913. border-radius: 40rpx;
  914. margin-top: 20rpx;
  915. }
  916. /* 表单 */
  917. .form-section {
  918. background: #fff;
  919. border-radius: 16rpx;
  920. padding: 30rpx;
  921. margin-bottom: 30rpx;
  922. }
  923. .form-section-title {
  924. font-size: 30rpx;
  925. font-weight: bold;
  926. color: #333;
  927. margin-bottom: 20rpx;
  928. padding-bottom: 16rpx;
  929. border-bottom: 1rpx solid #f0f0f0;
  930. }
  931. .form-item {
  932. margin-bottom: 30rpx;
  933. }
  934. .label {
  935. display: block;
  936. font-size: 28rpx;
  937. color: #333;
  938. margin-bottom: 16rpx;
  939. }
  940. .required {
  941. color: #f44336;
  942. }
  943. .input, .picker-input {
  944. padding: 20rpx;
  945. background: #f5f5f5;
  946. border-radius: 12rpx;
  947. font-size: 28rpx;
  948. }
  949. .role-select {
  950. display: flex;
  951. gap: 40rpx;
  952. }
  953. .role-option {
  954. display: flex;
  955. align-items: center;
  956. gap: 8rpx;
  957. }
  958. /* 头像上传 */
  959. .avatar-upload {
  960. width: 150rpx;
  961. height: 150rpx;
  962. }
  963. .avatar-preview {
  964. width: 150rpx;
  965. height: 150rpx;
  966. border-radius: 50%;
  967. }
  968. .avatar-placeholder {
  969. width: 150rpx;
  970. height: 150rpx;
  971. background: #f5f5f5;
  972. border-radius: 50%;
  973. display: flex;
  974. align-items: center;
  975. justify-content: center;
  976. font-size: 60rpx;
  977. color: #ccc;
  978. }
  979. /* 照片上传 */
  980. .photo-upload {
  981. width: 300rpx;
  982. height: 200rpx;
  983. }
  984. .photo-preview {
  985. width: 300rpx;
  986. height: 200rpx;
  987. border-radius: 12rpx;
  988. }
  989. .photo-placeholder {
  990. width: 300rpx;
  991. height: 200rpx;
  992. background: #f5f5f5;
  993. border-radius: 12rpx;
  994. display: flex;
  995. flex-direction: column;
  996. align-items: center;
  997. justify-content: center;
  998. }
  999. .plus-icon {
  1000. font-size: 60rpx;
  1001. color: #ccc;
  1002. }
  1003. .placeholder-text {
  1004. font-size: 24rpx;
  1005. color: #999;
  1006. margin-top: 8rpx;
  1007. }
  1008. /* 助手选择 */
  1009. .mascot-cards {
  1010. display: flex;
  1011. gap: 20rpx;
  1012. margin-top: 16rpx;
  1013. }
  1014. .mascot-card {
  1015. flex: 1;
  1016. background: #f8f8f8;
  1017. border-radius: 16rpx;
  1018. padding: 24rpx;
  1019. display: flex;
  1020. align-items: center;
  1021. gap: 16rpx;
  1022. border: 2rpx solid transparent;
  1023. transition: all 0.3s;
  1024. }
  1025. .mascot-card.active {
  1026. border-color: #4CAF50;
  1027. background: #f0fdf4;
  1028. }
  1029. .mascot-card-icon {
  1030. width: 72rpx;
  1031. height: 72rpx;
  1032. border-radius: 50%;
  1033. display: flex;
  1034. align-items: center;
  1035. justify-content: center;
  1036. font-size: 36rpx;
  1037. flex-shrink: 0;
  1038. }
  1039. .xibao-bg {
  1040. background: linear-gradient(135deg, #FFF0DB, #FFD6A5);
  1041. }
  1042. .fubao-bg {
  1043. background: linear-gradient(135deg, #FFF8E1, #FCD34D);
  1044. }
  1045. .mascot-card-info {
  1046. display: flex;
  1047. flex-direction: column;
  1048. gap: 4rpx;
  1049. }
  1050. .mascot-card-name {
  1051. font-size: 30rpx;
  1052. font-weight: bold;
  1053. color: #333;
  1054. }
  1055. .mascot-card-desc {
  1056. font-size: 22rpx;
  1057. color: #999;
  1058. }
  1059. /* 家庭绑定 */
  1060. .family-section {
  1061. background: #fff;
  1062. border-radius: 16rpx;
  1063. padding: 30rpx;
  1064. }
  1065. .section-title {
  1066. font-size: 30rpx;
  1067. font-weight: bold;
  1068. color: #333;
  1069. margin-bottom: 20rpx;
  1070. }
  1071. .family-actions {
  1072. display: flex;
  1073. flex-direction: column;
  1074. gap: 20rpx;
  1075. margin-top: 30rpx;
  1076. }
  1077. /* 新用户流程(接受家庭邀请):提交申请/跳过固定悬浮页面底部,不随滚动消失 */
  1078. .family-actions-fixed {
  1079. position: fixed;
  1080. left: 0;
  1081. right: 0;
  1082. bottom: 0;
  1083. z-index: 100;
  1084. margin-top: 0;
  1085. padding: 20rpx 32rpx;
  1086. padding-bottom: calc(20rpx + env(safe-area-inset-bottom));
  1087. background: #ffffff;
  1088. box-shadow: 0 -4rpx 16rpx rgba(0, 0, 0, 0.06);
  1089. }
  1090. /* 新用户流程表单底部留白,避免内容被固定悬浮按钮遮挡 */
  1091. .user-form-wrap {
  1092. padding-bottom: 340rpx;
  1093. }
  1094. .btn {
  1095. border-radius: 40rpx;
  1096. font-size: 30rpx;
  1097. }
  1098. .btn-primary {
  1099. background: #4CAF50;
  1100. color: #fff;
  1101. }
  1102. .btn-skip {
  1103. background: #f5f5f5;
  1104. color: #999;
  1105. }
  1106. /* ===== 区域选择弹窗 ===== */
  1107. .region-mask {
  1108. position: fixed;
  1109. top: 0;
  1110. left: 0;
  1111. right: 0;
  1112. bottom: 0;
  1113. background: rgba(0, 0, 0, 0.5);
  1114. z-index: 999;
  1115. display: flex;
  1116. align-items: flex-end;
  1117. }
  1118. .region-picker {
  1119. background: #fff;
  1120. border-radius: 20rpx 20rpx 0 0;
  1121. width: 100%;
  1122. max-height: 70vh;
  1123. display: flex;
  1124. flex-direction: column;
  1125. }
  1126. .region-header {
  1127. display: flex;
  1128. justify-content: space-between;
  1129. align-items: center;
  1130. padding: 24rpx 30rpx;
  1131. border-bottom: 1rpx solid #f0f0f0;
  1132. }
  1133. .region-header-btn {
  1134. font-size: 28rpx;
  1135. color: #999;
  1136. }
  1137. .region-confirm {
  1138. color: #F97316;
  1139. font-weight: bold;
  1140. }
  1141. .region-header-title {
  1142. font-size: 30rpx;
  1143. font-weight: bold;
  1144. color: #333;
  1145. }
  1146. .region-breadcrumb {
  1147. display: flex;
  1148. align-items: center;
  1149. padding: 20rpx 30rpx;
  1150. border-bottom: 1rpx solid #f5f5f5;
  1151. }
  1152. .crumb-item {
  1153. font-size: 26rpx;
  1154. color: #999;
  1155. padding: 8rpx 12rpx;
  1156. border-radius: 8rpx;
  1157. }
  1158. .crumb-item.crumb-active {
  1159. color: #F97316;
  1160. font-weight: bold;
  1161. }
  1162. .crumb-arrow {
  1163. font-size: 24rpx;
  1164. color: #ccc;
  1165. margin: 0 8rpx;
  1166. }
  1167. .region-list {
  1168. max-height: 50vh;
  1169. overflow-y: auto;
  1170. }
  1171. .region-item {
  1172. display: flex;
  1173. justify-content: space-between;
  1174. align-items: center;
  1175. padding: 28rpx 30rpx;
  1176. border-bottom: 1rpx solid #f5f5f5;
  1177. }
  1178. .region-item:active {
  1179. background: #FFF7ED;
  1180. }
  1181. .region-item-text {
  1182. font-size: 28rpx;
  1183. color: #333;
  1184. }
  1185. .region-item-check {
  1186. font-size: 28rpx;
  1187. color: #F97316;
  1188. font-weight: bold;
  1189. }
  1190. .region-item-selected {
  1191. background: #FFF7ED;
  1192. }
  1193. .region-item-selected .region-item-text {
  1194. color: #F97316;
  1195. font-weight: bold;
  1196. }
  1197. .region-loading {
  1198. padding: 40rpx;
  1199. text-align: center;
  1200. font-size: 26rpx;
  1201. color: #999;
  1202. }
  1203. /* ===== 地址行(所在地区) ===== */
  1204. .address-row {
  1205. display: flex;
  1206. justify-content: space-between;
  1207. align-items: center;
  1208. }
  1209. .address-value-wrap {
  1210. display: flex;
  1211. align-items: center;
  1212. flex: 1;
  1213. justify-content: flex-end;
  1214. }
  1215. .address-value {
  1216. font-size: 28rpx;
  1217. color: #333;
  1218. }
  1219. .address-placeholder {
  1220. font-size: 28rpx;
  1221. color: #999;
  1222. }
  1223. .address-arrow {
  1224. font-size: 28rpx;
  1225. color: #ccc;
  1226. margin-left: 8rpx;
  1227. }
  1228. /* 助手锁定提示 */
  1229. .mascot-locked-hint {
  1230. display: flex;
  1231. align-items: center;
  1232. padding: 28rpx 32rpx;
  1233. background: linear-gradient(135deg, #FEF3C7, #FDE68A);
  1234. border-radius: 20rpx;
  1235. margin-top: 16rpx;
  1236. }
  1237. .locked-icon {
  1238. font-size: 36rpx;
  1239. margin-right: 16rpx;
  1240. }
  1241. .locked-text {
  1242. flex: 1;
  1243. font-size: 28rpx;
  1244. font-weight: 600;
  1245. color: #92400e;
  1246. }
  1247. .locked-arrow {
  1248. font-size: 32rpx;
  1249. color: #92400e;
  1250. margin-left: 8rpx;
  1251. }
  1252. </style>