join.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795
  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. // token:优先从 query 参数,其次从场景值
  162. var token = query.token || query.inviteToken || ''
  163. if (!token) {
  164. var scene = query.scene
  165. if (scene) {
  166. var sceneDecoded = decodeURIComponent(scene)
  167. // 新格式:JSON 场景值 {"t":"TOKEN"}
  168. if (sceneDecoded.indexOf('{') === 0) {
  169. try {
  170. var sceneObj = JSON.parse(sceneDecoded)
  171. token = sceneObj.t || sceneObj.token || ''
  172. } catch (e) {
  173. token = ''
  174. }
  175. } else if (sceneDecoded.indexOf('invite=') === 0) {
  176. // 旧格式兼容
  177. token = sceneDecoded.substring(7)
  178. } else {
  179. token = sceneDecoded
  180. }
  181. }
  182. }
  183. // refCode:query.refCode 或场景值(ref=xxx)— 推广码注册绑定
  184. var refCode = query.refCode || ''
  185. if (!refCode && query.scene) {
  186. var refScene = decodeURIComponent(query.scene)
  187. if (refScene.indexOf('ref=') === 0) {
  188. refCode = refScene.substring(4)
  189. }
  190. }
  191. if (!token && !refCode) {
  192. this.error = '邀请链接无效'
  193. this.loading = false
  194. return
  195. }
  196. if (refCode) {
  197. // 推广码模式:仅存储 refCode,无需校验邀请
  198. this.refCode = refCode
  199. this.loading = false
  200. this.checkLoginStatus()
  201. return
  202. }
  203. this.token = token
  204. this.checkLoginStatus()
  205. this.validateToken()
  206. },
  207. onShow() {
  208. // 从登录页返回时重新检查登录状态
  209. if (this.token) {
  210. this.checkLoginStatus()
  211. if (!this.inviteInfo) {
  212. this.validateToken()
  213. }
  214. }
  215. },
  216. onUnload() {
  217. if (this.requestTimer) {
  218. clearInterval(this.requestTimer)
  219. this.requestTimer = null
  220. }
  221. },
  222. methods: {
  223. checkLoginStatus() {
  224. var token = uni.getStorageSync('token')
  225. this.isLoggedIn = !!token
  226. if (this.isLoggedIn) {
  227. this.checkFamily()
  228. }
  229. },
  230. async validateToken() {
  231. this.loading = true
  232. try {
  233. var res = await validateInvitation(this.token)
  234. if (res && res.data) {
  235. this.inviteInfo = res.data
  236. // 已登录用户进入落地页:回显已有的待确认申请(避免重复显示提交表单)
  237. if (this.isLoggedIn) {
  238. this.checkExistingRequest()
  239. }
  240. } else {
  241. this.error = '邀请已失效'
  242. }
  243. } catch (e) {
  244. this.error = e.message || '邀请验证失败'
  245. }
  246. this.loading = false
  247. },
  248. async checkFamily() {
  249. try {
  250. var res = await checkUserFamily()
  251. if (res && res.data) {
  252. this.familyStatus = res.data
  253. // 已在家庭内:同步 familyId 到 store(hasFamily getter 依赖)
  254. if (res.data.inFamily && res.data.familyId) {
  255. this.$store && this.$store.commit('setFamilyId', res.data.familyId)
  256. uni.setStorageSync('familyId', res.data.familyId)
  257. }
  258. // 如果已经在目标家庭,直接显示成功
  259. if (this.inviteInfo && this.familyStatus.inFamily && this.familyStatus.familyId === this.inviteInfo.familyId) {
  260. this.accepted = true
  261. } else if (!this.familyStatus.inFamily && this.inviteInfo) {
  262. // 已登录且不在目标家庭:回显已有申请状态,避免重复显示提交表单
  263. this.checkExistingRequest()
  264. }
  265. }
  266. } catch (e) {
  267. console.log('检查家庭状态失败', e)
  268. }
  269. },
  270. async handleWechatLogin() {
  271. this.loginLoading = true
  272. try {
  273. var that = this
  274. // 微信登录
  275. var loginRes = await new Promise(function(resolve, reject) {
  276. uni.login({
  277. provider: 'weixin',
  278. success: function(res) {
  279. resolve(res)
  280. },
  281. fail: function(err) {
  282. reject(err)
  283. }
  284. })
  285. })
  286. var code = loginRes.code
  287. if (!code) {
  288. uni.showToast({ title: '登录失败', icon: 'none' })
  289. this.loginLoading = false
  290. return
  291. }
  292. // 调起微信登录
  293. var { wechatLogin } = require('@/utils/api.js')
  294. var res = await wechatLogin(code, {})
  295. if (res && res.data) {
  296. // 保存登录信息
  297. var data = res.data
  298. uni.setStorageSync('token', data.token)
  299. uni.setStorageSync('userId', data.userId)
  300. uni.setStorageSync('role', data.role)
  301. uni.setStorageSync('currentRole', data.role)
  302. uni.setStorageSync('isSwitchedChild', false)
  303. uni.setStorageSync('isSwitchedTeacher', false)
  304. if (data.openid) {
  305. uni.setStorageSync('openid', data.openid)
  306. }
  307. that.$store && that.$store.commit('setToken', data.token)
  308. that.$store && that.$store.commit('setFamilyId', data.familyId)
  309. this.isLoggedIn = true
  310. uni.showToast({ title: '登录成功', icon: 'success' })
  311. // 重新检查家庭状态
  312. await this.checkFamily()
  313. }
  314. } catch (e) {
  315. uni.showToast({ title: '登录失败', icon: 'none' })
  316. console.log('微信登录失败', e)
  317. }
  318. this.loginLoading = false
  319. },
  320. onFamilyRoleChange(e) {
  321. this.familyRoleIndex = e.detail.value
  322. },
  323. toggleMerge() {
  324. this.mergeFamily = !this.mergeFamily
  325. },
  326. async handleSubmitRequest() {
  327. var familyRole = this.familyRoleOptions[this.familyRoleIndex] || ''
  328. if (!familyRole) {
  329. uni.showToast({ title: '请选择您在家庭中的身份', icon: 'none' })
  330. return
  331. }
  332. this.acceptLoading = true
  333. try {
  334. var res = await requestJoinByCode(this.token, familyRole)
  335. if (res && res.code === 200) {
  336. this.requestSubmitted = true
  337. this.requestStatus = 'pending'
  338. this.requestId = (res.data && res.data.id) || null
  339. this.acceptLoading = false
  340. uni.showToast({ title: '申请已提交,等待邀请人确认', icon: 'success' })
  341. this.startPolling()
  342. } else {
  343. this.acceptLoading = false
  344. uni.showToast({ title: res.message || '提交失败', icon: 'none' })
  345. }
  346. } catch (e) {
  347. this.acceptLoading = false
  348. uni.showToast({ title: e.message || '提交失败', icon: 'none' })
  349. }
  350. },
  351. startPolling() {
  352. var self = this
  353. if (this.requestTimer) {
  354. clearInterval(this.requestTimer)
  355. }
  356. this.requestTimer = setInterval(function() {
  357. if (self.accepted || self.requestStatus === 'rejected') {
  358. clearInterval(self.requestTimer)
  359. self.requestTimer = null
  360. return
  361. }
  362. self.checkRequestStatus()
  363. }, 5000)
  364. },
  365. async checkRequestStatus() {
  366. try {
  367. var res = await getMyPendingRequest()
  368. if (res && res.code === 200 && res.data) {
  369. var requestData = res.data
  370. this.requestId = requestData.id || this.requestId
  371. this.requestStatus = requestData.status || 'pending'
  372. if (this.requestStatus === 'approved') {
  373. clearInterval(this.requestTimer)
  374. this.requestTimer = null
  375. this.accepted = true
  376. uni.setStorageSync('familyId', this.inviteInfo.familyId)
  377. uni.setStorageSync('currentFamilyId', this.inviteInfo.familyId)
  378. // 审批通过后同步 familyId 到 store(hasFamily getter 依赖)
  379. this.$store && this.$store.commit('setFamilyId', this.inviteInfo.familyId)
  380. uni.showToast({ title: '加入家庭成功', icon: 'success' })
  381. } else if (this.requestStatus === 'rejected') {
  382. clearInterval(this.requestTimer)
  383. this.requestTimer = null
  384. this.rejectMessage = requestData.adminComment || ''
  385. uni.showToast({ title: '申请已被拒绝', icon: 'none' })
  386. }
  387. }
  388. } catch (e) {
  389. console.log('轮询请求状态失败', e)
  390. }
  391. },
  392. async checkExistingRequest() {
  393. // 回显守卫:仅在已登录、未提交、未成功且不在目标家庭时查询
  394. if (!this.inviteInfo || this.requestSubmitted || this.accepted) return
  395. if (this.familyStatus && this.familyStatus.inFamily && this.familyStatus.familyId === this.inviteInfo.familyId) return
  396. try {
  397. var res = await getMyPendingRequest()
  398. if (res && res.code === 200 && res.data && res.data.status === 'pending') {
  399. var requestData = res.data
  400. if (requestData.targetFamilyId && requestData.targetFamilyId !== this.inviteInfo.familyId) return
  401. this.requestId = requestData.id || null
  402. this.requestSubmitted = true
  403. this.requestStatus = 'pending'
  404. this.startPolling()
  405. }
  406. } catch (e) {
  407. console.log('回显加入申请状态失败', e)
  408. }
  409. },
  410. onCancelRequest() {
  411. var self = this
  412. uni.showModal({
  413. title: '取消申请',
  414. content: '确定取消本次加入申请吗?',
  415. success: function(mr) {
  416. if (mr.confirm) {
  417. self.doCancelRequest()
  418. }
  419. }
  420. })
  421. },
  422. async doCancelRequest() {
  423. if (!this.requestId) {
  424. uni.showToast({ title: '未找到申请记录', icon: 'none' })
  425. return
  426. }
  427. try {
  428. var res = await cancelMyJoinRequest(this.requestId)
  429. if (res && res.code === 200) {
  430. if (this.requestTimer) {
  431. clearInterval(this.requestTimer)
  432. this.requestTimer = null
  433. }
  434. this.requestSubmitted = false
  435. this.requestStatus = ''
  436. this.requestId = null
  437. uni.showToast({ title: '已取消申请', icon: 'success' })
  438. } else {
  439. uni.showToast({ title: (res && res.message) || '取消失败', icon: 'none' })
  440. }
  441. } catch (e) {
  442. uni.showToast({ title: e.message || '取消失败', icon: 'none' })
  443. }
  444. },
  445. goHome() {
  446. uni.reLaunch({ url: '/pages/index-home/index' })
  447. },
  448. async bindRef() {
  449. if (!this.refCode) {
  450. uni.showToast({ title: '推广码为空', icon: 'none' })
  451. return
  452. }
  453. this.bindLoading = true
  454. try {
  455. var res = await bindReferral(this.refCode)
  456. if (res && res.code === 200) {
  457. this.bindDone = true
  458. uni.showToast({ title: '绑定成功', icon: 'success' })
  459. } else {
  460. uni.showToast({ title: (res && res.message) || '绑定失败', icon: 'none' })
  461. }
  462. } catch (e) {
  463. uni.showToast({ title: e.message || '绑定失败', icon: 'none' })
  464. }
  465. this.bindLoading = false
  466. }
  467. }
  468. }
  469. </script>
  470. <style scoped>
  471. .page {
  472. padding: 32rpx;
  473. min-height: 100vh;
  474. background: linear-gradient(135deg, #FFF7ED 0%, #FEF3C7 100%);
  475. display: flex;
  476. flex-direction: column;
  477. align-items: center;
  478. }
  479. .loading {
  480. display: flex;
  481. flex-direction: column;
  482. align-items: center;
  483. justify-content: center;
  484. min-height: 60vh;
  485. }
  486. .loading-icon {
  487. font-size: 80rpx;
  488. margin-bottom: 20rpx;
  489. }
  490. .loading-text {
  491. color: #666;
  492. font-size: 28rpx;
  493. }
  494. .invite-card {
  495. width: 100%;
  496. max-width: 600rpx;
  497. background: #FFFFFF;
  498. border-radius: 24rpx;
  499. padding: 40rpx;
  500. box-shadow: 0 8rpx 32rpx rgba(0, 0, 0, 0.08);
  501. margin-top: 10vh;
  502. }
  503. .invite-header {
  504. display: flex;
  505. flex-direction: column;
  506. align-items: center;
  507. margin-bottom: 32rpx;
  508. }
  509. .invite-icon {
  510. font-size: 80rpx;
  511. margin-bottom: 16rpx;
  512. }
  513. .invite-title {
  514. font-size: 32rpx;
  515. font-weight: 700;
  516. color: #1E293B;
  517. }
  518. .invite-body {
  519. display: flex;
  520. flex-direction: column;
  521. align-items: center;
  522. margin-bottom: 40rpx;
  523. padding: 24rpx;
  524. background: #FFF7ED;
  525. border-radius: 16rpx;
  526. }
  527. .family-name {
  528. font-size: 40rpx;
  529. font-weight: 700;
  530. color: #F97316;
  531. margin-bottom: 12rpx;
  532. }
  533. .inviter {
  534. font-size: 28rpx;
  535. color: #64748B;
  536. margin-bottom: 8rpx;
  537. }
  538. .inviter-avatar {
  539. width: 80rpx;
  540. height: 80rpx;
  541. border-radius: 50%;
  542. margin-bottom: 12rpx;
  543. background: #F1F5F9;
  544. }
  545. .member-count {
  546. font-size: 24rpx;
  547. color: #94A3B8;
  548. }
  549. .action-area {
  550. display: flex;
  551. flex-direction: column;
  552. gap: 16rpx;
  553. }
  554. .family-warning {
  555. display: flex;
  556. align-items: flex-start;
  557. padding: 20rpx;
  558. background: #FEF3C7;
  559. border-radius: 12rpx;
  560. gap: 12rpx;
  561. }
  562. .warning-icon {
  563. font-size: 32rpx;
  564. flex-shrink: 0;
  565. }
  566. .warning-text {
  567. font-size: 24rpx;
  568. color: #92400E;
  569. line-height: 1.5;
  570. }
  571. .form-group {
  572. margin-bottom: 20rpx;
  573. }
  574. .form-label {
  575. display: block;
  576. font-size: 28rpx;
  577. color: #374151;
  578. margin-bottom: 12rpx;
  579. font-weight: 500;
  580. }
  581. .picker-select {
  582. display: flex;
  583. justify-content: space-between;
  584. align-items: center;
  585. padding: 24rpx 28rpx;
  586. background: #F9FAFB;
  587. border: 2rpx solid #E5E7EB;
  588. border-radius: 16rpx;
  589. font-size: 28rpx;
  590. color: #1E293B;
  591. }
  592. .picker-arrow {
  593. font-size: 36rpx;
  594. color: #9CA3AF;
  595. }
  596. .checkbox-label {
  597. display: flex;
  598. align-items: center;
  599. gap: 12rpx;
  600. font-size: 26rpx;
  601. color: #4B5563;
  602. }
  603. .checkbox {
  604. width: 36rpx;
  605. height: 36rpx;
  606. border: 2rpx solid #D1D5DB;
  607. border-radius: 8rpx;
  608. display: flex;
  609. align-items: center;
  610. justify-content: center;
  611. flex-shrink: 0;
  612. }
  613. .checkbox.checked {
  614. background: #F97316;
  615. border-color: #F97316;
  616. color: #FFFFFF;
  617. font-size: 24rpx;
  618. font-weight: 700;
  619. }
  620. .btn {
  621. width: 100%;
  622. padding: 28rpx;
  623. border-radius: 16rpx;
  624. font-size: 30rpx;
  625. font-weight: 600;
  626. text-align: center;
  627. border: none;
  628. }
  629. .btn-primary {
  630. background: linear-gradient(135deg, #F97316, #EA580C);
  631. color: #FFFFFF;
  632. }
  633. .btn-primary:disabled {
  634. opacity: 0.6;
  635. }
  636. .btn-outline {
  637. background: #FFFFFF;
  638. color: #F97316;
  639. border: 2rpx solid #F97316;
  640. }
  641. .tip-text {
  642. font-size: 24rpx;
  643. color: #94A3B8;
  644. text-align: center;
  645. }
  646. .success-area {
  647. display: flex;
  648. flex-direction: column;
  649. align-items: center;
  650. gap: 16rpx;
  651. }
  652. .success-icon {
  653. font-size: 80rpx;
  654. }
  655. .success-text {
  656. font-size: 36rpx;
  657. font-weight: 700;
  658. color: #16A34A;
  659. }
  660. .success-sub {
  661. font-size: 28rpx;
  662. color: #6B7280;
  663. margin-bottom: 24rpx;
  664. }
  665. .error-card {
  666. width: 100%;
  667. max-width: 600rpx;
  668. background: #FFFFFF;
  669. border-radius: 24rpx;
  670. padding: 60rpx 40rpx;
  671. display: flex;
  672. flex-direction: column;
  673. align-items: center;
  674. gap: 20rpx;
  675. margin-top: 10vh;
  676. }
  677. .error-icon {
  678. font-size: 80rpx;
  679. }
  680. .error-text {
  681. font-size: 30rpx;
  682. color: #6B7280;
  683. text-align: center;
  684. }
  685. .pending-card {
  686. display: flex;
  687. flex-direction: column;
  688. align-items: center;
  689. gap: 12rpx;
  690. padding: 40rpx;
  691. background: #FEF3C7;
  692. border-radius: 20rpx;
  693. margin-top: 20rpx;
  694. }
  695. .pending-icon {
  696. font-size: 72rpx;
  697. }
  698. .pending-title {
  699. font-size: 32rpx;
  700. font-weight: 700;
  701. color: #92400E;
  702. }
  703. .pending-text {
  704. font-size: 28rpx;
  705. color: #78350F;
  706. }
  707. .pending-hint {
  708. font-size: 24rpx;
  709. color: #A16207;
  710. }
  711. .error-area {
  712. display: flex;
  713. flex-direction: column;
  714. align-items: center;
  715. gap: 12rpx;
  716. padding: 40rpx;
  717. background: #FEF2F2;
  718. border-radius: 20rpx;
  719. margin-top: 20rpx;
  720. }
  721. .error-text-main {
  722. font-size: 32rpx;
  723. font-weight: 700;
  724. color: #DC2626;
  725. }
  726. .error-text-sub {
  727. font-size: 26rpx;
  728. color: #991B1B;
  729. margin-bottom: 20rpx;
  730. }
  731. </style>