service-role-apply.vue 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848
  1. <template>
  2. <view class="page" :style="{ '--font-scale': fontScale }">
  3. <!-- 审核状态展示 -->
  4. <view v-if="showStatusView" class="status-view">
  5. <view class="status-card" :class="'status-' + applyStatus">
  6. <view class="status-icon">{{ statusIcon }}</view>
  7. <text class="status-title">{{ statusTitle }}</text>
  8. <text class="status-desc">{{ statusDesc }}</text>
  9. </view>
  10. <view v-if="applyStatus === 'pending'" class="status-tip">
  11. <text>预计 1-3 个工作日内完成审核,请耐心等待</text>
  12. </view>
  13. <view v-if="applyStatus === 'rejected'" class="reject-info">
  14. <text class="reject-label">拒绝原因</text>
  15. <text class="reject-reason">{{ applyRecord && applyRecord.rejectReason }}</text>
  16. </view>
  17. <view class="action-buttons">
  18. <button v-if="applyStatus === 'rejected'" class="btn-reapply" @click="handleReapply">
  19. 重新申请
  20. </button>
  21. <button v-if="applyStatus === 'approved'" class="btn-center" @click="goToCenter">
  22. 进入服务商中心
  23. </button>
  24. <button v-if="applyStatus === 'approved'" class="btn-add-role" @click="handleAddRole">
  25. 申请其他角色
  26. </button>
  27. <button class="btn-back" @click="goBack">返回首页</button>
  28. </view>
  29. </view>
  30. <!-- 申请表单 -->
  31. <view v-else class="form-wrap">
  32. <view v-if="hasApprovedRole" class="multi-role-hint">
  33. <text>📌 您当前已是 {{ approvedRoleLabel }},可勾选下方新增其他角色</text>
  34. </view>
  35. <view class="header">
  36. <text class="title">服务角色申请</text>
  37. <text class="subtitle">选择申请角色,提交资质信息</text>
  38. </view>
  39. <view class="section">
  40. <view class="section-title">选择申请角色 <text class="required">*</text></view>
  41. <!-- 严格三列:roleRows 每行固定 3 个单元格,flex:1 等分,不依赖 calc/gap -->
  42. <view class="role-grid">
  43. <view
  44. v-for="(row, rowIdx) in roleRows"
  45. :key="getRoleRowKey(rowIdx)"
  46. class="role-row"
  47. >
  48. <view
  49. v-for="role in row"
  50. :key="role.key"
  51. class="role-cell"
  52. >
  53. <view
  54. v-if="!role.placeholder"
  55. class="role-card"
  56. :class="{ selected: selectedRoles.indexOf(role.key) > -1, approved: isApprovedRole(role.key) }"
  57. @click="toggleRole(role.key)"
  58. >
  59. <text class="role-icon">{{ role.icon }}</text>
  60. <text class="role-name">{{ role.name }}</text>
  61. <view v-if="isApprovedRole(role.key)" class="approved-badge">已通过</view>
  62. <view v-else-if="selectedRoles.indexOf(role.key) > -1" class="check-mark">✓</view>
  63. </view>
  64. </view>
  65. </view>
  66. </view>
  67. </view>
  68. <view class="section">
  69. <view class="section-title">身份证信息</view>
  70. <input class="input" v-model="form.idCard" placeholder="请输入身份证号码" maxlength="18" />
  71. <view class="upload-row">
  72. <view class="upload-item" @click="chooseIdCardImage('front')">
  73. <image v-if="form.idCardFront" :src="form.idCardFront" mode="aspectFill" class="upload-preview" />
  74. <view v-else class="upload-placeholder">
  75. <text class="upload-icon">+</text>
  76. <text class="upload-label">身份证正面</text>
  77. </view>
  78. </view>
  79. <view class="upload-item" @click="chooseIdCardImage('back')">
  80. <image v-if="form.idCardBack" :src="form.idCardBack" mode="aspectFill" class="upload-preview" />
  81. <view v-else class="upload-placeholder">
  82. <text class="upload-icon">+</text>
  83. <text class="upload-label">身份证反面</text>
  84. </view>
  85. </view>
  86. </view>
  87. </view>
  88. <view class="section">
  89. <view class="section-title">资质证书</view>
  90. <view class="cert-list">
  91. <view v-for="(img, idx) in form.certificateImages" :key="getCertKey(idx)" class="cert-item">
  92. <image :src="img" mode="aspectFill" class="cert-preview" />
  93. <text class="cert-del" @click="removeCert(idx)">×</text>
  94. </view>
  95. <view class="cert-add" @click="chooseCertificate">
  96. <text class="upload-icon">+</text>
  97. <text class="upload-label">添加证书</text>
  98. </view>
  99. </view>
  100. </view>
  101. <view class="section">
  102. <view class="section-title">联系地址 <text class="required">*</text></view>
  103. <view class="address-row" @click="openAddressPicker">
  104. <text class="address-label">所在地区</text>
  105. <view class="address-value-wrap">
  106. <text v-if="addressText" class="address-value">{{ addressText }}</text>
  107. <text v-else class="address-placeholder">请选择省市区街道</text>
  108. <text class="address-arrow">›</text>
  109. </view>
  110. </view>
  111. <input class="input" v-model="form.addressDetail" placeholder="详细地址(门牌号等)" />
  112. <!-- 与收件人地址共用同一组件 components/address-picker.vue -->
  113. <AddressPicker ref="addressPicker" :show-trigger="false" @change="onAddressChange" />
  114. </view>
  115. <button class="submit-btn" :disabled="submitting" @click="handleSubmit">
  116. {{ submitting ? '提交中...' : '提交申请' }}
  117. </button>
  118. <view class="footer-hint">
  119. <text>提交后将在 1-3 个工作日内完成审核</text>
  120. </view>
  121. </view>
  122. </view>
  123. </template>
  124. <script>
  125. import { submitServiceRoleApply, getMyServiceRoleApply, uploadServiceRoleImage } from '../../utils/api'
  126. import { pickImage } from '../../utils/image-picker.js'
  127. import AddressPicker from '@/components/address-picker.vue'
  128. import fontScaleMixin from '@/mixins/font-scale.js'
  129. export default {
  130. mixins: [fontScaleMixin],
  131. components: { AddressPicker },
  132. data() {
  133. return {
  134. roleList: [
  135. { key: 'planner', name: '规划师', icon: '📋' },
  136. { key: 'nutritionist', name: '营养师', icon: '🥗' },
  137. { key: 'butler', name: '管家', icon: '🔔' },
  138. { key: 'vendor', name: '服务商', icon: '🏪' },
  139. { key: 'article_admin', name: '文章管理员', icon: '📝' },
  140. { key: 'activity_provider', name: '活动提供商', icon: '🎪' }
  141. ],
  142. selectedRoles: [],
  143. addressText: '',
  144. form: {
  145. idCard: '',
  146. idCardFront: '',
  147. idCardBack: '',
  148. certificateImages: [],
  149. province: '',
  150. city: '',
  151. district: '',
  152. street: '',
  153. addressDetail: ''
  154. },
  155. submitting: false,
  156. applyRecord: null,
  157. showStatusView: false
  158. }
  159. },
  160. computed: {
  161. // 按每行 3 个拆分行;最后一行不足 3 个用空占位单元格补齐,保证各行严格三列等宽
  162. roleRows() {
  163. const rows = []
  164. const list = this.roleList || []
  165. const total = Math.ceil(list.length / 3) * 3
  166. for (let i = 0; i < total; i += 3) {
  167. const row = []
  168. for (let j = 0; j < 3; j++) {
  169. const item = list[i + j]
  170. row.push(
  171. item
  172. ? item
  173. : { key: 'role-placeholder-' + i + '-' + j, name: '', icon: '', placeholder: true }
  174. )
  175. }
  176. rows.push(row)
  177. }
  178. return rows
  179. },
  180. applyStatus() {
  181. if (!this.applyRecord) return 'none'
  182. const s = this.applyRecord.status
  183. return s === 0 ? 'pending' : s === 1 ? 'approved' : 'rejected'
  184. },
  185. hasApprovedRole() {
  186. return this.applyRecord && this.applyRecord.status === 1
  187. },
  188. // 已通过审核的角色集合(key 数组)——这些角色已开通,不可重复勾选
  189. approvedRoles() {
  190. if (!this.applyRecord || this.applyRecord.status !== 1 || !this.applyRecord.roles) return []
  191. try {
  192. const roles = JSON.parse(this.applyRecord.roles)
  193. return Array.isArray(roles) ? roles : []
  194. } catch (e) { return [] }
  195. },
  196. approvedRoleLabel() {
  197. if (!this.applyRecord || !this.applyRecord.roles) return ''
  198. try {
  199. const roles = JSON.parse(this.applyRecord.roles)
  200. // 取第一个角色名称作为展示
  201. const roleMap = { planner: '规划师', nutritionist: '营养师', butler: '管家', vendor: '服务商', article_admin: '文章管理员', activity_provider: '活动提供商' }
  202. return roles.map(r => roleMap[r] || r).join('、') || '服务商'
  203. } catch (e) { return '服务商' }
  204. },
  205. statusIcon() {
  206. return { pending: '⏳', approved: '✅', rejected: '❌' }[this.applyStatus] || '📋'
  207. },
  208. statusTitle() {
  209. return { pending: '审核中', approved: '申请已通过', rejected: '申请被驳回' }[this.applyStatus] || ''
  210. },
  211. statusDesc() {
  212. return {
  213. pending: '您的申请正在审核中,请留意消息通知',
  214. approved: '已开通服务商身份,可继续申请其他服务角色',
  215. rejected: '您的申请未通过审核,可查看原因后重新提交'
  216. }[this.applyStatus] || ''
  217. }
  218. },
  219. onLoad() {
  220. this.checkExistingApply()
  221. },
  222. methods: {
  223. // 模板里不能直接调用 uni.*(渲染时实例上没有 uni,会报
  224. // "Property or method uni is not defined"),统一收进方法
  225. goBack() {
  226. var pages = getCurrentPages()
  227. if (pages && pages.length > 1) {
  228. uni.navigateBack()
  229. } else {
  230. uni.switchTab({ url: '/pages/index/index' })
  231. }
  232. },
  233. async checkExistingApply() {
  234. try {
  235. const res = await getMyServiceRoleApply()
  236. if (res.code === 200 && res.data) {
  237. this.applyRecord = res.data
  238. // 身份证预填:原申请记录里已上传的身份证不再要求重传
  239. this.prefillIdCard(this.applyRecord)
  240. const status = res.data.status
  241. if (status === 0) {
  242. // 审核中,展示进度
  243. this.showStatusView = true
  244. } else if (status === 1) {
  245. // 已通过:不再强制跳转,显示当前身份卡片 + 允许申请其他角色
  246. this.showStatusView = true
  247. } else if (status === 2) {
  248. // 已拒绝,显示原因
  249. this.showStatusView = true
  250. }
  251. }
  252. } catch (e) {
  253. // 无申请记录,显示表单
  254. }
  255. },
  256. // 从历史申请记录回填身份证号码与正反面图片(已上传过则不再要求重传)
  257. prefillIdCard(record) {
  258. if (!record) return
  259. if (record.idCard) this.form.idCard = record.idCard
  260. if (record.idCardImages) {
  261. try {
  262. const imgs = JSON.parse(record.idCardImages)
  263. if (Array.isArray(imgs) && imgs.length) {
  264. if (imgs[0]) this.form.idCardFront = imgs[0]
  265. if (imgs[1]) this.form.idCardBack = imgs[1]
  266. }
  267. } catch (e) {}
  268. }
  269. },
  270. toggleRole(key) {
  271. // 已通过审核的角色不可重复申请(不可勾选)
  272. if (this.approvedRoles.indexOf(key) > -1) {
  273. uni.showToast({ title: '该角色已开通,无需重复申请', icon: 'none' })
  274. return
  275. }
  276. const idx = this.selectedRoles.indexOf(key)
  277. if (idx > -1) {
  278. this.selectedRoles.splice(idx, 1)
  279. } else {
  280. this.selectedRoles.push(key)
  281. }
  282. },
  283. isApprovedRole(key) {
  284. return this.approvedRoles.indexOf(key) > -1
  285. },
  286. chooseIdCardImage(side) {
  287. pickImage({
  288. count: 1,
  289. sizeType: ['compressed'],
  290. sourceType: ['album', 'camera'],
  291. success: async (res) => {
  292. uni.showLoading({ title: '上传中...' })
  293. try {
  294. const uploadRes = await uploadServiceRoleImage(res.tempFilePaths[0])
  295. uni.hideLoading()
  296. if (uploadRes.code === 200) {
  297. if (side === 'front') {
  298. this.form.idCardFront = uploadRes.data.url
  299. } else {
  300. this.form.idCardBack = uploadRes.data.url
  301. }
  302. uni.showToast({ title: '上传成功', icon: 'success' })
  303. } else {
  304. uni.showToast({ title: uploadRes.message || '上传失败', icon: 'none' })
  305. }
  306. } catch (e) {
  307. uni.hideLoading()
  308. uni.showToast({ title: '上传失败', icon: 'none' })
  309. }
  310. }
  311. })
  312. },
  313. async chooseCertificate() {
  314. pickImage({
  315. count: 9 - this.form.certificateImages.length,
  316. sizeType: ['compressed'],
  317. sourceType: ['album', 'camera'],
  318. success: async (res) => {
  319. uni.showLoading({ title: '上传中...' })
  320. try {
  321. for (const filePath of res.tempFilePaths) {
  322. const uploadRes = await uploadServiceRoleImage(filePath)
  323. if (uploadRes.code === 200) {
  324. this.form.certificateImages.push(uploadRes.data.url)
  325. }
  326. }
  327. uni.hideLoading()
  328. uni.showToast({ title: '上传成功', icon: 'success' })
  329. } catch (e) {
  330. uni.hideLoading()
  331. uni.showToast({ title: '上传失败', icon: 'none' })
  332. }
  333. }
  334. })
  335. },
  336. removeCert(idx) {
  337. this.form.certificateImages.splice(idx, 1)
  338. },
  339. getCertKey(idx) {
  340. return 'cert-' + idx
  341. },
  342. getRoleRowKey(rowIdx) {
  343. return 'role-row-' + rowIdx
  344. },
  345. openAddressPicker() {
  346. if (this.$refs.addressPicker) {
  347. this.$refs.addressPicker.open()
  348. }
  349. },
  350. onAddressChange(e) {
  351. this.form.province = e.province || ''
  352. this.form.city = e.city || ''
  353. this.form.district = e.district || ''
  354. this.form.street = e.street || ''
  355. this.addressText = e.fullName || ''
  356. },
  357. async handleSubmit() {
  358. // 提交前过滤已通过角色(防御:仅提交新增角色,不重复申请已开通角色)
  359. const newRoles = (this.selectedRoles || []).filter(r => this.approvedRoles.indexOf(r) === -1)
  360. if (newRoles.length === 0) {
  361. uni.showToast({ title: '请至少选择一个新增角色', icon: 'none' })
  362. return
  363. }
  364. if (!this.form.idCardFront || !this.form.idCardBack) {
  365. uni.showToast({ title: '请上传身份证正反面照片', icon: 'none' })
  366. return
  367. }
  368. if (!this.form.province) {
  369. uni.showToast({ title: '请选择联系地址', icon: 'none' })
  370. return
  371. }
  372. this.submitting = true
  373. uni.showLoading({ title: '提交中...' })
  374. try {
  375. const res = await submitServiceRoleApply({
  376. roles: newRoles,
  377. idCard: this.form.idCard,
  378. idCardImages: [this.form.idCardFront, this.form.idCardBack],
  379. certificateImages: this.form.certificateImages,
  380. province: this.form.province,
  381. city: this.form.city,
  382. district: this.form.district,
  383. street: this.form.street,
  384. addressDetail: this.form.addressDetail
  385. })
  386. uni.hideLoading()
  387. if (res.code === 200) {
  388. // 提交成功,刷新状态
  389. await this.checkExistingApply()
  390. if (!this.showStatusView) this.showStatusView = true
  391. } else {
  392. uni.showToast({ title: res.message || '提交失败', icon: 'none' })
  393. }
  394. } catch (e) {
  395. uni.hideLoading()
  396. uni.showToast({ title: '提交失败,请重试', icon: 'none' })
  397. } finally {
  398. this.submitting = false
  399. }
  400. },
  401. handleReapply() {
  402. this.applyRecord = null
  403. this.showStatusView = false
  404. this.selectedRoles = []
  405. this.addressText = ''
  406. this.form = {
  407. idCard: '',
  408. idCardFront: '',
  409. idCardBack: '',
  410. certificateImages: [],
  411. province: '',
  412. city: '',
  413. district: '',
  414. street: '',
  415. addressDetail: ''
  416. }
  417. },
  418. goToCenter() {
  419. // 活动服务商 → 活动管理页(管理 Tab 由权限控制);其余角色 → 供应商中心
  420. if (this.approvedRoles.indexOf('activity_provider') > -1) {
  421. uni.redirectTo({ url: '/pages/activity/index' })
  422. } else {
  423. uni.redirectTo({ url: '/pages/vendor/center' })
  424. }
  425. },
  426. handleAddRole() {
  427. // 保留 applyRecord(用于标记已通过角色),仅切到表单视图;身份证沿用历史预填不重传
  428. this.showStatusView = false
  429. this.selectedRoles = []
  430. uni.showToast({ title: '可多选新增角色', icon: 'none', duration: 2000 })
  431. }
  432. }
  433. }
  434. </script>
  435. <style lang="scss">
  436. .page {
  437. min-height: 100vh;
  438. background: linear-gradient(180deg, $uni-primary-pale 0%, $facade-fill-page 30%);
  439. padding: 0 $uni-space-page 120rpx;
  440. }
  441. /* ===== 状态展示区 ===== */
  442. .status-view {
  443. padding-top: 60rpx;
  444. display: flex;
  445. flex-direction: column;
  446. align-items: center;
  447. }
  448. .status-card {
  449. width: 100%;
  450. border-radius: 24rpx;
  451. padding: 60rpx 40rpx;
  452. text-align: center;
  453. margin-bottom: $uni-space-lg;
  454. }
  455. .status-card.status-pending {
  456. background: linear-gradient(135deg, $dim-wealth-tint, $status-warning-soft);
  457. border: 2rpx solid $status-warning-light;
  458. }
  459. .status-card.status-approved {
  460. background: linear-gradient(135deg, $status-success-tint-2, $status-success-soft-2);
  461. border: 2rpx solid #86EFAC;
  462. }
  463. .status-card.status-rejected {
  464. background: linear-gradient(135deg, $status-danger-tint-2, $status-danger-soft);
  465. border: 2rpx solid $status-danger-light-2;
  466. }
  467. .status-icon {
  468. font-size: calc($uni-font-size-5xl * var(--font-scale, 1));
  469. display: block;
  470. margin-bottom: 20rpx;
  471. }
  472. .status-title {
  473. font-size: calc(36rpx * var(--font-scale, 1));
  474. font-weight: bold;
  475. color: $facade-text-gray-800;
  476. display: block;
  477. margin-bottom: 12rpx;
  478. }
  479. .status-desc {
  480. font-size: calc(26rpx * var(--font-scale, 1));
  481. color: $facade-text-slate;
  482. line-height: 1.6;
  483. display: block;
  484. }
  485. .status-tip {
  486. background: $app-surface;
  487. border-radius: 16rpx;
  488. padding: 20rpx 28rpx;
  489. margin-bottom: 40rpx;
  490. width: 100%;
  491. box-sizing: border-box;
  492. }
  493. .status-tip text {
  494. font-size: calc(24rpx * var(--font-scale, 1));
  495. color: $status-warning-strong;
  496. }
  497. .reject-info {
  498. background: $app-surface;
  499. border-radius: 16rpx;
  500. padding: 28rpx;
  501. margin-bottom: 40rpx;
  502. width: 100%;
  503. box-sizing: border-box;
  504. }
  505. .reject-label {
  506. font-size: calc(24rpx * var(--font-scale, 1));
  507. color: $facade-text-gray-400;
  508. display: block;
  509. margin-bottom: 12rpx;
  510. }
  511. .reject-reason {
  512. font-size: calc(28rpx * var(--font-scale, 1));
  513. color: $status-danger-deep;
  514. line-height: 1.6;
  515. display: block;
  516. }
  517. .action-buttons {
  518. width: 100%;
  519. display: flex;
  520. flex-direction: column;
  521. gap: 20rpx;
  522. }
  523. .btn-reapply, .btn-center, .btn-back {
  524. width: 100%;
  525. height: 88rpx;
  526. line-height: 88rpx;
  527. border-radius: 24rpx;
  528. font-size: calc(30rpx * var(--font-scale, 1));
  529. text-align: center;
  530. border: none;
  531. }
  532. .btn-reapply {
  533. background: linear-gradient(135deg, $brand-primary, $brand-primary-light);
  534. color: $app-surface;
  535. }
  536. .btn-center {
  537. background: linear-gradient(135deg, $status-success, $status-success-light-3);
  538. color: $app-surface;
  539. }
  540. .btn-back {
  541. background: $facade-fill-gray-100;
  542. color: $facade-text-slate;
  543. }
  544. /* ===== 表单区 ===== */
  545. .header {
  546. text-align: center;
  547. padding: 50rpx 0 $uni-space-lg;
  548. }
  549. .title {
  550. font-size: calc(40rpx * var(--font-scale, 1));
  551. font-weight: bold;
  552. color: $facade-text-gray-800;
  553. display: block;
  554. }
  555. .subtitle {
  556. font-size: calc(26rpx * var(--font-scale, 1));
  557. color: $facade-text-gray-400;
  558. margin-top: 10rpx;
  559. display: block;
  560. }
  561. .section {
  562. background: $app-surface;
  563. border-radius: 24rpx;
  564. padding: $uni-space-lg;
  565. margin-bottom: 24rpx;
  566. box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.04);
  567. }
  568. .section-title {
  569. font-size: calc(28rpx * var(--font-scale, 1));
  570. font-weight: bold;
  571. margin-bottom: 24rpx;
  572. color: $facade-text-gray-700;
  573. }
  574. .required {
  575. color: $status-danger;
  576. margin-left: 4rpx;
  577. }
  578. /* 角色网格:固定三列
  579. 不使用 calc() 与 flex gap(旧版 iOS WebView 不支持 gap,calc 除法在不同机型上
  580. 会出现取整偏差导致换行)——改用「每行 3 个 flex:1 单元格 + 固定 rpx 间距」,
  581. 所有机型/分辨率下都严格等分三列 */
  582. .role-grid {
  583. display: flex;
  584. flex-direction: column;
  585. }
  586. .role-row {
  587. display: flex;
  588. flex-direction: row;
  589. justify-content: space-between;
  590. }
  591. .role-cell {
  592. /* flex:1 + 可收缩,保证同一行三等分,长文案不撑破列宽 */
  593. flex: 1;
  594. min-width: 0;
  595. box-sizing: border-box;
  596. }
  597. /* 单元格之间留白:左右各 8rpx,首尾行视情况抵消,保证总宽不溢出 */
  598. .role-cell:not(:first-child) {
  599. margin-left: 16rpx;
  600. }
  601. .role-row:not(:first-child) {
  602. margin-top: 20rpx;
  603. }
  604. .role-card {
  605. width: 100%;
  606. box-sizing: border-box;
  607. background: $facade-fill-gray-50;
  608. border-radius: 16rpx;
  609. padding: $uni-space-lg 0;
  610. display: flex;
  611. flex-direction: column;
  612. align-items: center;
  613. position: relative;
  614. border: 3rpx solid transparent;
  615. transition: border-color 0.2s, background-color 0.2s;
  616. }
  617. .role-card.selected {
  618. background: $uni-primary-pale;
  619. border-color: $brand-primary;
  620. }
  621. /* 已通过角色:置灰锁定,显示"已通过"徽标,不可勾选 */
  622. .role-card.approved {
  623. background: #f0f7f0;
  624. border-color: #7cc576;
  625. opacity: 0.85;
  626. }
  627. .approved-badge {
  628. position: absolute;
  629. top: 8rpx;
  630. right: 12rpx;
  631. color: #4a9b4a;
  632. font-size: calc(20rpx * var(--font-scale, 1));
  633. font-weight: bold;
  634. background: rgba(124, 197, 118, 0.18);
  635. border-radius: 8rpx;
  636. padding: 4rpx 10rpx;
  637. }
  638. .role-icon {
  639. font-size: calc(44rpx * var(--font-scale, 1));
  640. margin-bottom: 10rpx;
  641. }
  642. .role-name {
  643. font-size: calc(24rpx * var(--font-scale, 1));
  644. color: $facade-text-gray-700;
  645. font-weight: 500;
  646. /* 保证长角色名不换行撑高导致行高不一致 */
  647. white-space: nowrap;
  648. overflow: hidden;
  649. text-overflow: ellipsis;
  650. max-width: 100%;
  651. }
  652. .check-mark {
  653. position: absolute;
  654. top: 8rpx;
  655. right: 12rpx;
  656. color: $brand-primary;
  657. font-size: calc(32rpx * var(--font-scale, 1));
  658. font-weight: bold;
  659. }
  660. /* 联系地址入口行(与收件人地址页保持同一套视觉) */
  661. .address-row {
  662. display: flex;
  663. align-items: center;
  664. padding: 24rpx 24rpx;
  665. background: $facade-fill-ghost;
  666. border: 2rpx solid $facade-gray-200;
  667. border-radius: 16rpx;
  668. margin-bottom: 16rpx;
  669. }
  670. .address-label {
  671. font-size: calc(26rpx * var(--font-scale, 1));
  672. color: $facade-text-gray-700;
  673. width: 140rpx;
  674. flex-shrink: 0;
  675. }
  676. .address-value-wrap {
  677. flex: 1;
  678. display: flex;
  679. align-items: center;
  680. justify-content: flex-end;
  681. min-width: 0;
  682. }
  683. .address-value {
  684. font-size: calc(26rpx * var(--font-scale, 1));
  685. color: $facade-text-gray-700;
  686. text-align: right;
  687. overflow: hidden;
  688. text-overflow: ellipsis;
  689. white-space: nowrap;
  690. }
  691. .address-placeholder {
  692. font-size: calc(26rpx * var(--font-scale, 1));
  693. color: $facade-text-gray-400;
  694. text-align: right;
  695. }
  696. .address-arrow {
  697. font-size: calc(34rpx * var(--font-scale, 1));
  698. color: $facade-text-gray-400;
  699. margin-left: 8rpx;
  700. flex-shrink: 0;
  701. }
  702. /* 输入框 */
  703. .input {
  704. width: 100%;
  705. height: 72rpx;
  706. border: 2rpx solid $facade-gray-200;
  707. border-radius: 16rpx;
  708. padding: 0 24rpx;
  709. font-size: calc(26rpx * var(--font-scale, 1));
  710. box-sizing: border-box;
  711. margin-bottom: 16rpx;
  712. background: $facade-fill-ghost;
  713. }
  714. /* 图片上传 */
  715. .upload-row {
  716. display: flex;
  717. gap: 20rpx;
  718. }
  719. .upload-item {
  720. flex: 1;
  721. height: 200rpx;
  722. border: 3rpx dashed $app-border-strong;
  723. border-radius: 16rpx;
  724. display: flex;
  725. align-items: center;
  726. justify-content: center;
  727. overflow: hidden;
  728. background: $facade-fill-ghost;
  729. }
  730. .upload-placeholder {
  731. display: flex;
  732. flex-direction: column;
  733. align-items: center;
  734. }
  735. .upload-icon {
  736. font-size: calc(48rpx * var(--font-scale, 1));
  737. color: $facade-text-gray-400;
  738. }
  739. .upload-label {
  740. font-size: calc(22rpx * var(--font-scale, 1));
  741. color: $facade-text-gray-400;
  742. margin-top: 8rpx;
  743. }
  744. .upload-preview {
  745. width: 100%;
  746. height: 100%;
  747. }
  748. /* 证书列表 */
  749. .cert-list {
  750. display: flex;
  751. flex-wrap: wrap;
  752. gap: 16rpx;
  753. }
  754. .cert-item {
  755. width: 160rpx;
  756. height: 160rpx;
  757. position: relative;
  758. border-radius: 16rpx;
  759. overflow: hidden;
  760. }
  761. .cert-preview {
  762. width: 100%;
  763. height: 100%;
  764. }
  765. .cert-del {
  766. position: absolute;
  767. top: 4rpx;
  768. right: 4rpx;
  769. width: 36rpx;
  770. height: 36rpx;
  771. background: rgba(0,0,0,0.55);
  772. color: $app-surface;
  773. border-radius: 50%;
  774. text-align: center;
  775. line-height: 36rpx;
  776. font-size: calc(28rpx * var(--font-scale, 1));
  777. }
  778. .cert-add {
  779. width: 160rpx;
  780. height: 160rpx;
  781. border: 3rpx dashed $app-border-strong;
  782. border-radius: 16rpx;
  783. display: flex;
  784. flex-direction: column;
  785. align-items: center;
  786. justify-content: center;
  787. background: $facade-fill-ghost;
  788. }
  789. /* 提交按钮 */
  790. .submit-btn {
  791. width: 100%;
  792. height: 96rpx;
  793. line-height: 96rpx;
  794. background: linear-gradient(135deg, $brand-primary, $brand-primary-light);
  795. color: $app-surface;
  796. border-radius: 24rpx;
  797. font-size: calc(32rpx * var(--font-scale, 1));
  798. font-weight: 600;
  799. margin-top: 16rpx;
  800. border: none;
  801. box-shadow: 0 8rpx 24rpx rgba(249, 115, 22, 0.3);
  802. }
  803. .submit-btn[disabled] {
  804. opacity: 0.6;
  805. box-shadow: none;
  806. }
  807. .footer-hint {
  808. text-align: center;
  809. margin-top: 24rpx;
  810. }
  811. .footer-hint text {
  812. font-size: calc(24rpx * var(--font-scale, 1));
  813. color: $facade-text-gray-400;
  814. }
  815. .multi-role-hint {
  816. background: linear-gradient(135deg, $status-info-tint, $status-info-soft);
  817. border: 2rpx solid $tint-blue-line;
  818. border-radius: 16rpx;
  819. padding: 18rpx 24rpx;
  820. margin-bottom: 20rpx;
  821. }
  822. .multi-role-hint text {
  823. font-size: calc(26rpx * var(--font-scale, 1));
  824. color: $status-info-deep-3;
  825. }
  826. .btn-add-role {
  827. background: linear-gradient(135deg, $dim-wisdom, $dim-wisdom-light);
  828. color: $app-surface;
  829. }
  830. </style>