join.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810
  1. <template>
  2. <view class="page">
  3. <!-- 加载中 -->
  4. <view class="loading" v-if="loading">
  5. <view class="loading-icon">⏳</view>
  6. <text class="loading-text">加载中...</text>
  7. </view>
  8. <!-- 邀请信息卡片 -->
  9. <view class="invite-card" v-if="!loading && inviteInfo">
  10. <view class="invite-header">
  11. <view class="invite-icon">🏠</view>
  12. <text class="invite-title">家庭邀请</text>
  13. </view>
  14. <view class="invite-body">
  15. <image
  16. class="inviter-avatar"
  17. :src="(inviteInfo.inviterAvatar || '/static/default-avatar.png')"
  18. mode="aspectFill"
  19. ></image>
  20. <text class="family-name">{{ inviteInfo.familyName }}</text>
  21. <text class="inviter" v-if="inviteInfo.inviterName">
  22. 邀请人:{{ inviteInfo.inviterName }}
  23. </text>
  24. <text class="member-count">
  25. 已有 {{ inviteInfo.memberCount }} 位家庭成员
  26. </text>
  27. </view>
  28. <!-- 未登录:显示登录按钮 -->
  29. <view class="action-area" v-if="!isLoggedIn">
  30. <button class="btn btn-primary" @tap="handleWechatLogin" :disabled="loginLoading">
  31. <text v-if="!loginLoading">微信一键登录并加入家庭</text>
  32. <text v-else>登录中...</text>
  33. </button>
  34. <text class="tip-text">登录后即可申请加入此家庭</text>
  35. </view>
  36. <!-- 已登录:显示关系选择 -->
  37. <view class="action-area" v-if="isLoggedIn && !accepted && !requestSubmitted">
  38. <!-- 已有家庭时显示合并选项 -->
  39. <view class="family-warning" v-if="familyStatus && familyStatus.inFamily">
  40. <text class="warning-icon">⚠️</text>
  41. <text class="warning-text">
  42. 您当前已加入「{{ familyStatus.familyName }}」家庭,加入新家庭可选择合并(成员将一起迁移)或拒绝
  43. </text>
  44. </view>
  45. <!-- 关系选择 -->
  46. <view class="form-group">
  47. <text class="form-label">您在家庭中的身份</text>
  48. <picker @change="onFamilyRoleChange" :value="familyRoleIndex" :range="familyRoleOptions">
  49. <view class="picker-select">
  50. <text>{{ familyRoleOptions[familyRoleIndex] || '请选择您的身份' }}</text>
  51. <text class="picker-arrow">›</text>
  52. </view>
  53. </picker>
  54. </view>
  55. <!-- 已有家庭时显示合并勾选框 -->
  56. <view class="form-group" v-if="familyStatus && familyStatus.inFamily">
  57. <label class="checkbox-label" @tap="toggleMerge">
  58. <view class="checkbox" :class="{ checked: mergeFamily }">
  59. <text v-if="mergeFamily">✓</text>
  60. </view>
  61. <text>合并家庭(我的家庭成员将一起迁入新家庭)</text>
  62. </label>
  63. </view>
  64. <button class="btn btn-primary" @tap="handleSubmitRequest" :disabled="acceptLoading">
  65. <text v-if="!acceptLoading">提交申请</text>
  66. <text v-else>提交中...</text>
  67. </button>
  68. </view>
  69. <!-- 已提交申请,等待审批 -->
  70. <view class="pending-card" v-if="requestSubmitted && !accepted">
  71. <view class="pending-icon">🕐</view>
  72. <text class="pending-title">申请已提交</text>
  73. <text class="pending-text">等待邀请人确认</text>
  74. <text class="pending-hint">通常几分钟内会有回复</text>
  75. <button class="btn btn-outline btn-cancel-request" @tap="onCancelRequest">取消申请</button>
  76. </view>
  77. <!-- 申请被拒绝 -->
  78. <view class="error-area" v-if="requestSubmitted && requestStatus === 'rejected'">
  79. <view class="error-icon">❌</view>
  80. <text class="error-text-main">申请已被拒绝</text>
  81. <text class="error-text-sub" v-if="rejectMessage">{{ rejectMessage }}</text>
  82. <button class="btn btn-outline" @tap="goHome">返回首页</button>
  83. </view>
  84. <!-- 加入成功 -->
  85. <view class="success-area" v-if="accepted">
  86. <view class="success-icon">✅</view>
  87. <text class="success-text">加入成功!</text>
  88. <text class="success-sub">欢迎加入「{{ inviteInfo.familyName }}」</text>
  89. <button class="btn btn-primary" @tap="goHome">进入首页</button>
  90. </view>
  91. </view>
  92. <!-- 推广码绑定卡片 -->
  93. <view class="invite-card" v-if="!loading && refCode && !bindDone">
  94. <view class="invite-header">
  95. <view class="invite-icon">🤝</view>
  96. <text class="invite-title">推广绑定</text>
  97. </view>
  98. <view class="invite-body">
  99. <text class="member-count">推荐人推广码:{{ refCode }}</text>
  100. </view>
  101. <view class="action-area" v-if="isLoggedIn">
  102. <button class="btn btn-primary" @tap="bindRef" :disabled="bindLoading">
  103. <text v-if="!bindLoading">绑定推荐人</text>
  104. <text v-else>绑定中...</text>
  105. </button>
  106. <text class="tip-text">绑定后该推荐人后续消费时记入其家庭公共账户</text>
  107. </view>
  108. <view class="action-area" v-else>
  109. <button class="btn btn-primary" @tap="handleWechatLogin" :disabled="loginLoading">
  110. <text v-if="!loginLoading">微信一键登录</text>
  111. <text v-else>登录中...</text>
  112. </button>
  113. <text class="tip-text">登录后可绑定推荐人</text>
  114. </view>
  115. </view>
  116. <!-- 推广码绑定成功 -->
  117. <view class="invite-card" v-if="!loading && refCode && bindDone">
  118. <view class="success-area">
  119. <view class="success-icon">✅</view>
  120. <text class="success-text">绑定成功</text>
  121. <text class="success-sub">已绑定推荐人,可进入首页探索</text>
  122. <button class="btn btn-primary" @tap="goHome">进入首页</button>
  123. </view>
  124. </view>
  125. <!-- 邀请无效 -->
  126. <view class="error-card" v-if="!loading && error">
  127. <view class="error-icon">❌</view>
  128. <text class="error-text">{{ error }}</text>
  129. <button class="btn btn-outline" @tap="goHome">返回首页</button>
  130. </view>
  131. </view>
  132. </template>
  133. <script>
  134. import { validateInvitation, checkUserFamily, bindReferral, requestJoinByCode, getMyPendingRequest, cancelMyJoinRequest } from '@/utils/api.js'
  135. export default {
  136. data() {
  137. return {
  138. token: '',
  139. refCode: '',
  140. bindLoading: false,
  141. bindDone: false,
  142. loading: true,
  143. loginLoading: false,
  144. acceptLoading: false,
  145. isLoggedIn: false,
  146. inviteInfo: null,
  147. familyStatus: null,
  148. familyRoleIndex: 0,
  149. mergeFamily: false,
  150. accepted: false,
  151. requestSubmitted: false,
  152. requestStatus: '',
  153. requestId: null,
  154. requestTimer: null,
  155. rejectMessage: '',
  156. error: '',
  157. familyRoleOptions: ['爸爸', '妈妈', '爷爷', '奶奶', '姥爷', '姥姥', '其他']
  158. }
  159. },
  160. onLoad(query) {
  161. // 邀请码(推荐人)统一解析:query.inviteCode / query.refCode / 场景值 ref=xxx
  162. // 分享链接用 inviteCode,落地页内部用 refCode,二维码场景值用 ref= 前缀
  163. var refCode = query.refCode || query.inviteCode || ''
  164. if (!refCode && query.scene) {
  165. var refScene = decodeURIComponent(query.scene)
  166. if (refScene.indexOf('ref=') === 0) {
  167. refCode = refScene.substring(4)
  168. }
  169. }
  170. // token(家庭邀请):优先从 query 参数,其次从场景值
  171. var token = query.token || query.inviteToken || ''
  172. if (!token) {
  173. var scene = query.scene
  174. if (scene) {
  175. var sceneDecoded = decodeURIComponent(scene)
  176. // 新格式:JSON 场景值 {"t":"TOKEN"}
  177. if (sceneDecoded.indexOf('{') === 0) {
  178. try {
  179. var sceneObj = JSON.parse(sceneDecoded)
  180. token = sceneObj.t || sceneObj.token || ''
  181. } catch (e) {
  182. token = ''
  183. }
  184. } else if (sceneDecoded.indexOf('invite=') === 0) {
  185. // 旧格式兼容
  186. token = sceneDecoded.substring(7)
  187. } else if (sceneDecoded.indexOf('ref=') === 0) {
  188. // 推广码场景值(ref=xxx),已在上方解析为 refCode,不作为 token
  189. token = ''
  190. } else if (sceneDecoded.length === 6) {
  191. // 裸邀请码场景值(InviteController 生成的二维码 scene=referralCode,6位)
  192. // 归为推广码,不作为家庭 token
  193. refCode = refCode || sceneDecoded
  194. token = ''
  195. } else {
  196. token = sceneDecoded
  197. }
  198. }
  199. }
  200. if (!token && !refCode) {
  201. // 兼容旧分享链接(promotion/index.vue 旧版 onShareAppMessage 不带参数)
  202. // 无有效邀请信息时跳转首页,不显示"邀请链接无效"死页面
  203. uni.reLaunch({ url: '/pages/index-home/index' })
  204. return
  205. }
  206. if (refCode) {
  207. // 推广码模式:仅存储 refCode,无需校验邀请
  208. this.refCode = refCode
  209. this.loading = false
  210. this.checkLoginStatus()
  211. return
  212. }
  213. this.token = token
  214. this.checkLoginStatus()
  215. this.validateToken()
  216. },
  217. onShow() {
  218. // 从登录页返回时重新检查登录状态
  219. if (this.token) {
  220. this.checkLoginStatus()
  221. if (!this.inviteInfo) {
  222. this.validateToken()
  223. }
  224. }
  225. },
  226. onUnload() {
  227. if (this.requestTimer) {
  228. clearInterval(this.requestTimer)
  229. this.requestTimer = null
  230. }
  231. },
  232. methods: {
  233. checkLoginStatus() {
  234. var token = uni.getStorageSync('token')
  235. this.isLoggedIn = !!token
  236. if (this.isLoggedIn) {
  237. this.checkFamily()
  238. }
  239. },
  240. async validateToken() {
  241. this.loading = true
  242. try {
  243. var res = await validateInvitation(this.token)
  244. if (res && res.data) {
  245. this.inviteInfo = res.data
  246. // 已登录用户进入落地页:回显已有的待确认申请(避免重复显示提交表单)
  247. if (this.isLoggedIn) {
  248. this.checkExistingRequest()
  249. }
  250. } else {
  251. this.error = '邀请已失效'
  252. }
  253. } catch (e) {
  254. this.error = e.message || '邀请验证失败'
  255. }
  256. this.loading = false
  257. },
  258. async checkFamily() {
  259. try {
  260. var res = await checkUserFamily()
  261. if (res && res.data) {
  262. this.familyStatus = res.data
  263. // 已在家庭内:同步 familyId 到 store(hasFamily getter 依赖)
  264. if (res.data.inFamily && res.data.familyId) {
  265. this.$store && this.$store.commit('setFamilyId', res.data.familyId)
  266. uni.setStorageSync('familyId', res.data.familyId)
  267. }
  268. // 如果已经在目标家庭,直接显示成功
  269. if (this.inviteInfo && this.familyStatus.inFamily && this.familyStatus.familyId === this.inviteInfo.familyId) {
  270. this.accepted = true
  271. } else if (!this.familyStatus.inFamily && this.inviteInfo) {
  272. // 已登录且不在目标家庭:回显已有申请状态,避免重复显示提交表单
  273. this.checkExistingRequest()
  274. }
  275. }
  276. } catch (e) {
  277. console.log('检查家庭状态失败', e)
  278. }
  279. },
  280. async handleWechatLogin() {
  281. this.loginLoading = true
  282. try {
  283. var that = this
  284. // 微信登录
  285. var loginRes = await new Promise(function(resolve, reject) {
  286. uni.login({
  287. provider: 'weixin',
  288. success: function(res) {
  289. resolve(res)
  290. },
  291. fail: function(err) {
  292. reject(err)
  293. }
  294. })
  295. })
  296. var code = loginRes.code
  297. if (!code) {
  298. uni.showToast({ title: '登录失败', icon: 'none' })
  299. this.loginLoading = false
  300. return
  301. }
  302. // 调起微信登录
  303. var { wechatLogin } = require('@/utils/api.js')
  304. var res = await wechatLogin(code, {})
  305. if (res && res.data) {
  306. // 保存登录信息
  307. var data = res.data
  308. uni.setStorageSync('token', data.token)
  309. uni.setStorageSync('userId', data.userId)
  310. uni.setStorageSync('role', data.role)
  311. uni.setStorageSync('currentRole', data.role)
  312. uni.setStorageSync('isSwitchedChild', false)
  313. uni.setStorageSync('isSwitchedTeacher', false)
  314. if (data.openid) {
  315. uni.setStorageSync('openid', data.openid)
  316. }
  317. that.$store && that.$store.commit('setToken', data.token)
  318. that.$store && that.$store.commit('setFamilyId', data.familyId)
  319. this.isLoggedIn = true
  320. uni.showToast({ title: '登录成功', icon: 'success' })
  321. // 兼容旧分享链接:登录成功后自动绑定推广码(与 login.vue 流程一致)
  322. if (this.refCode && !this.bindDone) {
  323. await this.bindRef()
  324. }
  325. // 重新检查家庭状态
  326. await this.checkFamily()
  327. }
  328. } catch (e) {
  329. uni.showToast({ title: '登录失败', icon: 'none' })
  330. console.log('微信登录失败', e)
  331. }
  332. this.loginLoading = false
  333. },
  334. onFamilyRoleChange(e) {
  335. this.familyRoleIndex = e.detail.value
  336. },
  337. toggleMerge() {
  338. this.mergeFamily = !this.mergeFamily
  339. },
  340. async handleSubmitRequest() {
  341. var familyRole = this.familyRoleOptions[this.familyRoleIndex] || ''
  342. if (!familyRole) {
  343. uni.showToast({ title: '请选择您在家庭中的身份', icon: 'none' })
  344. return
  345. }
  346. this.acceptLoading = true
  347. try {
  348. var res = await requestJoinByCode(this.token, familyRole)
  349. if (res && res.code === 200) {
  350. this.requestSubmitted = true
  351. this.requestStatus = 'pending'
  352. this.requestId = (res.data && res.data.id) || null
  353. this.acceptLoading = false
  354. uni.showToast({ title: '申请已提交,等待邀请人确认', icon: 'success' })
  355. this.startPolling()
  356. } else {
  357. this.acceptLoading = false
  358. uni.showToast({ title: res.message || '提交失败', icon: 'none' })
  359. }
  360. } catch (e) {
  361. this.acceptLoading = false
  362. uni.showToast({ title: e.message || '提交失败', icon: 'none' })
  363. }
  364. },
  365. startPolling() {
  366. var self = this
  367. if (this.requestTimer) {
  368. clearInterval(this.requestTimer)
  369. }
  370. this.requestTimer = setInterval(function() {
  371. if (self.accepted || self.requestStatus === 'rejected') {
  372. clearInterval(self.requestTimer)
  373. self.requestTimer = null
  374. return
  375. }
  376. self.checkRequestStatus()
  377. }, 5000)
  378. },
  379. async checkRequestStatus() {
  380. try {
  381. var res = await getMyPendingRequest()
  382. if (res && res.code === 200 && res.data) {
  383. var requestData = res.data
  384. this.requestId = requestData.id || this.requestId
  385. this.requestStatus = requestData.status || 'pending'
  386. if (this.requestStatus === 'approved') {
  387. clearInterval(this.requestTimer)
  388. this.requestTimer = null
  389. this.accepted = true
  390. uni.setStorageSync('familyId', this.inviteInfo.familyId)
  391. uni.setStorageSync('currentFamilyId', this.inviteInfo.familyId)
  392. // 审批通过后同步 familyId 到 store(hasFamily getter 依赖)
  393. this.$store && this.$store.commit('setFamilyId', this.inviteInfo.familyId)
  394. uni.showToast({ title: '加入家庭成功', icon: 'success' })
  395. } else if (this.requestStatus === 'rejected') {
  396. clearInterval(this.requestTimer)
  397. this.requestTimer = null
  398. this.rejectMessage = requestData.adminComment || ''
  399. uni.showToast({ title: '申请已被拒绝', icon: 'none' })
  400. }
  401. }
  402. } catch (e) {
  403. console.log('轮询请求状态失败', e)
  404. }
  405. },
  406. async checkExistingRequest() {
  407. // 回显守卫:仅在已登录、未提交、未成功且不在目标家庭时查询
  408. if (!this.inviteInfo || this.requestSubmitted || this.accepted) return
  409. if (this.familyStatus && this.familyStatus.inFamily && this.familyStatus.familyId === this.inviteInfo.familyId) return
  410. try {
  411. var res = await getMyPendingRequest()
  412. if (res && res.code === 200 && res.data && res.data.status === 'pending') {
  413. var requestData = res.data
  414. if (requestData.targetFamilyId && requestData.targetFamilyId !== this.inviteInfo.familyId) return
  415. this.requestId = requestData.id || null
  416. this.requestSubmitted = true
  417. this.requestStatus = 'pending'
  418. this.startPolling()
  419. }
  420. } catch (e) {
  421. console.log('回显加入申请状态失败', e)
  422. }
  423. },
  424. onCancelRequest() {
  425. var self = this
  426. uni.showModal({
  427. title: '取消申请',
  428. content: '确定取消本次加入申请吗?',
  429. success: function(mr) {
  430. if (mr.confirm) {
  431. self.doCancelRequest()
  432. }
  433. }
  434. })
  435. },
  436. async doCancelRequest() {
  437. if (!this.requestId) {
  438. uni.showToast({ title: '未找到申请记录', icon: 'none' })
  439. return
  440. }
  441. try {
  442. var res = await cancelMyJoinRequest(this.requestId)
  443. if (res && res.code === 200) {
  444. if (this.requestTimer) {
  445. clearInterval(this.requestTimer)
  446. this.requestTimer = null
  447. }
  448. this.requestSubmitted = false
  449. this.requestStatus = ''
  450. this.requestId = null
  451. uni.showToast({ title: '已取消申请', icon: 'success' })
  452. } else {
  453. uni.showToast({ title: (res && res.message) || '取消失败', icon: 'none' })
  454. }
  455. } catch (e) {
  456. uni.showToast({ title: e.message || '取消失败', icon: 'none' })
  457. }
  458. },
  459. goHome() {
  460. uni.reLaunch({ url: '/pages/index-home/index' })
  461. },
  462. async bindRef() {
  463. if (!this.refCode) {
  464. uni.showToast({ title: '推广码为空', icon: 'none' })
  465. return
  466. }
  467. this.bindLoading = true
  468. try {
  469. var res = await bindReferral(this.refCode)
  470. if (res && res.code === 200) {
  471. this.bindDone = true
  472. uni.showToast({ title: '绑定成功', icon: 'success' })
  473. } else {
  474. uni.showToast({ title: (res && res.message) || '绑定失败', icon: 'none' })
  475. }
  476. } catch (e) {
  477. uni.showToast({ title: e.message || '绑定失败', icon: 'none' })
  478. }
  479. this.bindLoading = false
  480. }
  481. }
  482. }
  483. </script>
  484. <style scoped>
  485. .page {
  486. padding: 32rpx;
  487. min-height: 100vh;
  488. background: linear-gradient(135deg, #FFF7ED 0%, #FEF3C7 100%);
  489. display: flex;
  490. flex-direction: column;
  491. align-items: center;
  492. }
  493. .loading {
  494. display: flex;
  495. flex-direction: column;
  496. align-items: center;
  497. justify-content: center;
  498. min-height: 60vh;
  499. }
  500. .loading-icon {
  501. font-size: 80rpx;
  502. margin-bottom: 20rpx;
  503. }
  504. .loading-text {
  505. color: #666;
  506. font-size: 28rpx;
  507. }
  508. .invite-card {
  509. width: 100%;
  510. max-width: 600rpx;
  511. background: #FFFFFF;
  512. border-radius: 24rpx;
  513. padding: 40rpx;
  514. box-shadow: 0 8rpx 32rpx rgba(0, 0, 0, 0.08);
  515. margin-top: 10vh;
  516. }
  517. .invite-header {
  518. display: flex;
  519. flex-direction: column;
  520. align-items: center;
  521. margin-bottom: 32rpx;
  522. }
  523. .invite-icon {
  524. font-size: 80rpx;
  525. margin-bottom: 16rpx;
  526. }
  527. .invite-title {
  528. font-size: 32rpx;
  529. font-weight: 700;
  530. color: #1E293B;
  531. }
  532. .invite-body {
  533. display: flex;
  534. flex-direction: column;
  535. align-items: center;
  536. margin-bottom: 40rpx;
  537. padding: 24rpx;
  538. background: #FFF7ED;
  539. border-radius: 16rpx;
  540. }
  541. .family-name {
  542. font-size: 40rpx;
  543. font-weight: 700;
  544. color: #F97316;
  545. margin-bottom: 12rpx;
  546. }
  547. .inviter {
  548. font-size: 28rpx;
  549. color: #64748B;
  550. margin-bottom: 8rpx;
  551. }
  552. .inviter-avatar {
  553. width: 80rpx;
  554. height: 80rpx;
  555. border-radius: 50%;
  556. margin-bottom: 12rpx;
  557. background: #F1F5F9;
  558. }
  559. .member-count {
  560. font-size: 24rpx;
  561. color: #94A3B8;
  562. }
  563. .action-area {
  564. display: flex;
  565. flex-direction: column;
  566. gap: 16rpx;
  567. }
  568. .family-warning {
  569. display: flex;
  570. align-items: flex-start;
  571. padding: 20rpx;
  572. background: #FEF3C7;
  573. border-radius: 12rpx;
  574. gap: 12rpx;
  575. }
  576. .warning-icon {
  577. font-size: 32rpx;
  578. flex-shrink: 0;
  579. }
  580. .warning-text {
  581. font-size: 24rpx;
  582. color: #92400E;
  583. line-height: 1.5;
  584. }
  585. .form-group {
  586. margin-bottom: 20rpx;
  587. }
  588. .form-label {
  589. display: block;
  590. font-size: 28rpx;
  591. color: #374151;
  592. margin-bottom: 12rpx;
  593. font-weight: 500;
  594. }
  595. .picker-select {
  596. display: flex;
  597. justify-content: space-between;
  598. align-items: center;
  599. padding: 24rpx 28rpx;
  600. background: #F9FAFB;
  601. border: 2rpx solid #E5E7EB;
  602. border-radius: 16rpx;
  603. font-size: 28rpx;
  604. color: #1E293B;
  605. }
  606. .picker-arrow {
  607. font-size: 36rpx;
  608. color: #9CA3AF;
  609. }
  610. .checkbox-label {
  611. display: flex;
  612. align-items: center;
  613. gap: 12rpx;
  614. font-size: 26rpx;
  615. color: #4B5563;
  616. }
  617. .checkbox {
  618. width: 36rpx;
  619. height: 36rpx;
  620. border: 2rpx solid #D1D5DB;
  621. border-radius: 8rpx;
  622. display: flex;
  623. align-items: center;
  624. justify-content: center;
  625. flex-shrink: 0;
  626. }
  627. .checkbox.checked {
  628. background: #F97316;
  629. border-color: #F97316;
  630. color: #FFFFFF;
  631. font-size: 24rpx;
  632. font-weight: 700;
  633. }
  634. .btn {
  635. width: 100%;
  636. padding: 28rpx;
  637. border-radius: 16rpx;
  638. font-size: 30rpx;
  639. font-weight: 600;
  640. text-align: center;
  641. border: none;
  642. }
  643. .btn-primary {
  644. background: linear-gradient(135deg, #F97316, #EA580C);
  645. color: #FFFFFF;
  646. }
  647. .btn-primary:disabled {
  648. opacity: 0.6;
  649. }
  650. .btn-outline {
  651. background: #FFFFFF;
  652. color: #F97316;
  653. border: 2rpx solid #F97316;
  654. }
  655. .tip-text {
  656. font-size: 24rpx;
  657. color: #94A3B8;
  658. text-align: center;
  659. }
  660. .success-area {
  661. display: flex;
  662. flex-direction: column;
  663. align-items: center;
  664. gap: 16rpx;
  665. }
  666. .success-icon {
  667. font-size: 80rpx;
  668. }
  669. .success-text {
  670. font-size: 36rpx;
  671. font-weight: 700;
  672. color: #16A34A;
  673. }
  674. .success-sub {
  675. font-size: 28rpx;
  676. color: #6B7280;
  677. margin-bottom: 24rpx;
  678. }
  679. .error-card {
  680. width: 100%;
  681. max-width: 600rpx;
  682. background: #FFFFFF;
  683. border-radius: 24rpx;
  684. padding: 60rpx 40rpx;
  685. display: flex;
  686. flex-direction: column;
  687. align-items: center;
  688. gap: 20rpx;
  689. margin-top: 10vh;
  690. }
  691. .error-icon {
  692. font-size: 80rpx;
  693. }
  694. .error-text {
  695. font-size: 30rpx;
  696. color: #6B7280;
  697. text-align: center;
  698. }
  699. .pending-card {
  700. display: flex;
  701. flex-direction: column;
  702. align-items: center;
  703. gap: 12rpx;
  704. padding: 40rpx;
  705. background: #FEF3C7;
  706. border-radius: 20rpx;
  707. margin-top: 20rpx;
  708. }
  709. .pending-icon {
  710. font-size: 72rpx;
  711. }
  712. .pending-title {
  713. font-size: 32rpx;
  714. font-weight: 700;
  715. color: #92400E;
  716. }
  717. .pending-text {
  718. font-size: 28rpx;
  719. color: #78350F;
  720. }
  721. .pending-hint {
  722. font-size: 24rpx;
  723. color: #A16207;
  724. }
  725. .error-area {
  726. display: flex;
  727. flex-direction: column;
  728. align-items: center;
  729. gap: 12rpx;
  730. padding: 40rpx;
  731. background: #FEF2F2;
  732. border-radius: 20rpx;
  733. margin-top: 20rpx;
  734. }
  735. .error-text-main {
  736. font-size: 32rpx;
  737. font-weight: 700;
  738. color: #DC2626;
  739. }
  740. .error-text-sub {
  741. font-size: 26rpx;
  742. color: #991B1B;
  743. margin-bottom: 20rpx;
  744. }
  745. </style>