index.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691
  1. <template>
  2. <view>
  3. <!-- 品牌启动页(冷启动时覆盖全屏) -->
  4. <view class="splash-overlay" v-if="showSplash">
  5. <view class="splash-content">
  6. <view class="splash-logo-mark">
  7. <text class="splash-logo-char">浠</text>
  8. </view>
  9. <text class="splash-brand-name">浠艾福</text>
  10. <!-- 五维图标行 -->
  11. <view class="splash-dims-row">
  12. <view
  13. v-for="(item, index) in splashDimList"
  14. :key="item.code"
  15. class="splash-dim-item"
  16. :style="'animation-delay:' + (0.8 + index * 0.25) + 's'"
  17. >
  18. <view class="splash-dim-circle" :style="'background:' + hexToRgba(item.color, 0.25)">
  19. <text class="splash-dim-icon">{{ item.icon }}</text>
  20. </view>
  21. <text class="splash-dim-label">{{ item.name }}</text>
  22. </view>
  23. </view>
  24. <text class="splash-tagline">给全家的一站式幸福提案</text>
  25. <view class="splash-loading">
  26. <view class="splash-dot splash-dot--1"></view>
  27. <view class="splash-dot splash-dot--2"></view>
  28. <view class="splash-dot splash-dot--3"></view>
  29. </view>
  30. </view>
  31. </view>
  32. <!-- 未登录态 — 发现页/引流内容,直接内嵌,不跳转 -->
  33. <view v-if="!currentRole" class="discover-container">
  34. <!-- 品牌头部 -->
  35. <PageBanner theme="home"
  36. tagline="家庭健康成长俱乐部"
  37. quote="给全家的一站式幸福提案" />
  38. <!-- 五行沙盘预览 -->
  39. <wuxing-sandbox mode="preview" badgeText="登录查看完整报告" @point-click="handleLogin" />
  40. <!-- 活动/商品推荐 -->
  41. <view class="recommend-section">
  42. <view class="section-header">
  43. <text class="section-title">🔥 热门推荐</text>
  44. <text class="section-more" @click="goShop">查看更多 ›</text>
  45. </view>
  46. <scroll-view scroll-x enable-flex show-scrollbar="false" class="type-filter-scroll">
  47. <view
  48. v-for="item in typeList"
  49. :key="item.value"
  50. :class="['filter-chip', currentType === item.value ? 'active' : '']"
  51. @click="onTypeChange(item.value)"
  52. >
  53. {{ item.label }}
  54. </view>
  55. </scroll-view>
  56. <view v-if="loading" class="loading-state">
  57. <text class="loading-text">加载中...</text>
  58. </view>
  59. <view v-else-if="products.length === 0" class="empty-state">
  60. <text class="empty-text">暂无商品,去商城看看吧</text>
  61. </view>
  62. <view v-else class="product-grid">
  63. <view
  64. v-for="item in products"
  65. :key="item.id"
  66. class="product-card"
  67. @click="handleLogin()"
  68. >
  69. <image class="product-cover" :src="item.coverImage || '/static/default-product.png'" mode="aspectFill" />
  70. <view class="product-info">
  71. <text class="product-name">{{ item.name }}</text>
  72. <view class="product-price-row">
  73. <!-- 游客不显示价格 -->
  74. <text class="product-price-login">登录查看</text>
  75. </view>
  76. </view>
  77. </view>
  78. </view>
  79. </view>
  80. <!-- 五维全景幸福矩阵 -->
  81. <view class="why-section">
  82. <view class="section-header">
  83. <text class="section-title">🌏 五维全景幸福矩阵 — 给全家的一站式幸福提案</text>
  84. </view>
  85. <view class="dim-matrix">
  86. <view
  87. v-for="dim in dimList" :key="dim.code"
  88. class="dim-card"
  89. :style="'border-left:6rpx solid ' + dim.color"
  90. @click="handleLogin"
  91. >
  92. <view class="dim-icon-circle" :style="'background:' + dim.bgColor">
  93. <text class="dim-icon">{{ dim.icon }}</text>
  94. </view>
  95. <view class="dim-tag" :style="'color:' + dim.color + ';background:' + dim.bgColor">{{ dim.name }} · {{ dim.title }}</view>
  96. <text class="dim-desc">{{ dim.desc }}</text>
  97. </view>
  98. </view>
  99. <!-- 五维能量环装饰 -->
  100. <view class="dim-energy-row">
  101. <view
  102. v-for="c in energyDotColors" :key="c"
  103. class="energy-dot"
  104. :style="'background:' + c"
  105. ></view>
  106. </view>
  107. </view>
  108. <!-- 底部登录按钮 -->
  109. <view class="login-footer">
  110. <button class="login-btn" @click="handleLogin">登录 / 注册</button>
  111. <text class="login-footer-text">登录即表示同意《用户协议》和《隐私政策》</text>
  112. </view>
  113. <!-- 底部占位 -->
  114. <view style="height: 120rpx;"></view>
  115. </view>
  116. <!-- 登录态 — 按角色渲染(带淡入淡出过渡)-->
  117. <view v-else class="role-switch-wrapper">
  118. <transition name="fade" mode="out-in">
  119. <parent-index v-if="currentRole === 'parent'" key="parent" />
  120. <child-index v-else-if="currentRole === 'child'" key="child" />
  121. <!-- teacher-index 已废弃,教师功能折入 parent-index -->
  122. <view v-else class="loading-container" key="loading">
  123. <text>加载中...</text>
  124. </view>
  125. </transition>
  126. </view>
  127. </view>
  128. </template>
  129. <script>
  130. import ParentIndex from './parent-index.vue'
  131. import ChildIndex from './child-index.vue'
  132. // TeacherIndex 已废弃,教师功能折入 parent-index
  133. import PageBanner from '../../components/PageBanner.vue'
  134. import WuxingSandbox from '../../components/wuxing-sandbox.vue'
  135. import { acceptParentInvite, productList } from '../../utils/api.js'
  136. var DIMENSIONS = [
  137. { code: 'body', name: '身', icon: '🌏', color: '#8D6E63', bgColor: 'rgba(141,110,99,0.15)', title: '主动健康', desc: '用最适合的方法,从根源调理家人体质,畅享高质量长寿生活' },
  138. { code: 'mind', name: '心', icon: '🔥', color: '#FF6B35', bgColor: 'rgba(255,107,53,0.15)', title: '大爱传承', desc: '将长辈陪护升华为家族纽带,让家风温暖代代相传' },
  139. { code: 'wisdom', name: '智', icon: '⚡', color: '#FFD700', bgColor: 'rgba(255,215,0,0.15)', title: '赋能未来', desc: '专业测评与素质培养,开启孩子面向未来的大智慧' },
  140. { code: 'action', name: '行', icon: '🌿', color: '#4CAF50', bgColor: 'rgba(76,175,80,0.15)', title: '知行合一', desc: '在亲子户外与沙龙中,让健康生活方式真正知行合一' },
  141. { code: 'wealth', name: '富', icon: '💧', color: '#42A5F5', bgColor: 'rgba(66,165,245,0.15)', title: '利他创富', desc: '依托创客生态,在利他分享中实现家庭第二收入曲线' }
  142. ]
  143. export default {
  144. components: {
  145. ParentIndex,
  146. ChildIndex,
  147. PageBanner,
  148. WuxingSandbox
  149. },
  150. data() {
  151. // 从 storage 预取登录态/角色,确保首次渲染即正确(WeChat 渲染层/逻辑层分离架构下 onLoad 执行前已渲染)
  152. var _token = uni.getStorageSync('token')
  153. var _currentRole = ''
  154. if (_token) {
  155. _currentRole = uni.getStorageSync('currentRole') || uni.getStorageSync('role') || ''
  156. }
  157. return {
  158. currentRole: _currentRole,
  159. showSplash: false,
  160. typeList: [
  161. { label: '全部', value: '' },
  162. { label: '活动', value: 'activity' },
  163. { label: '课程', value: 'course' },
  164. { label: '实物', value: 'physical' },
  165. { label: '数字', value: 'digital' },
  166. { label: '服务', value: 'service' }
  167. ],
  168. currentType: '',
  169. products: [],
  170. loading: false
  171. }
  172. },
  173. onLoad(options) {
  174. // 冷启动检查:是否已展示品牌启动页
  175. if (!uni.getStorageSync('_splashReady') && !this.showSplash) {
  176. this.showSplash = true
  177. // 立即标记已展示,防止 reLaunch 等场景下重复触发 splash
  178. uni.setStorageSync('_splashReady', true)
  179. var self = this
  180. setTimeout(function() {
  181. self.showSplash = false
  182. }, 2500)
  183. // 不因 splash 阻塞初始化逻辑 — splash 仅是视觉遮盖层
  184. }
  185. this._doInit(options)
  186. },
  187. onShow() {
  188. // 始终执行初始化,不因 splash 状态跳过,确保登录态变更后及时切换视图
  189. this._doInit()
  190. },
  191. methods: {
  192. _doInit(options) {
  193. options = options || {}
  194. if (!this.isLoggedIn()) {
  195. this.currentRole = ''
  196. if (!this.showSplash) {
  197. this.loadProducts()
  198. }
  199. return
  200. }
  201. this.syncRoleAndTabBar()
  202. if (options.inviteCode && options.type === 'parent_invite') {
  203. this.handleParentInvite(options.inviteCode)
  204. } else {
  205. var storedCode = uni.getStorageSync('inviteCode')
  206. var storedType = uni.getStorageSync('inviteType')
  207. if (storedCode && storedType === 'parent_invite') {
  208. this.handleParentInvite(storedCode)
  209. uni.removeStorageSync('inviteCode')
  210. uni.removeStorageSync('inviteType')
  211. }
  212. }
  213. },
  214. isLoggedIn() {
  215. return !!uni.getStorageSync('token')
  216. },
  217. normalizeCurrentRole() {
  218. const role = uni.getStorageSync('role') || 'parent'
  219. const currentRole = uni.getStorageSync('currentRole')
  220. if (!currentRole) {
  221. return role
  222. }
  223. // 非规划师账号不允许落到规划师首页
  224. if (currentRole === 'teacher' && role !== 'teacher') {
  225. return role
  226. }
  227. // 只有家长账号允许切换到孩子视角
  228. if (currentRole === 'child' && role !== 'parent') {
  229. return role
  230. }
  231. return currentRole
  232. },
  233. syncRoleAndTabBar() {
  234. this.currentRole = this.normalizeCurrentRole()
  235. uni.setStorageSync('currentRole', this.currentRole)
  236. },
  237. // ===== 发现页 / 未登录态方法 =====
  238. loadProducts() {
  239. this.loading = true
  240. var params = { page: 1, size: 10 }
  241. if (this.currentType) {
  242. params.productType = this.currentType
  243. }
  244. productList(params).then(function(res) {
  245. this.loading = false
  246. if (res.code === 200 && res.data) {
  247. this.products = res.data.records || []
  248. }
  249. }.bind(this)).catch(function() {
  250. this.loading = false
  251. }.bind(this))
  252. },
  253. onTypeChange(value) {
  254. this.currentType = value
  255. this.loadProducts()
  256. },
  257. goShop() {
  258. uni.navigateTo({ url: '/pages/action/index' })
  259. },
  260. goDetail(id) {
  261. uni.navigateTo({ url: '/pages/discover/product-detail/product-detail?id=' + id })
  262. },
  263. handleLogin() {
  264. uni.navigateTo({ url: '/pages/login/login?redirect=' + encodeURIComponent('/pages/index/index') })
  265. },
  266. async handleParentInvite(code) {
  267. // 延迟显示,等待登录完成
  268. setTimeout(async () => {
  269. const hasToken = uni.getStorageSync('token')
  270. if (!hasToken) {
  271. // 未登录,先去登录
  272. uni.reLaunch({
  273. url: '/pages/login/login?inviteCode=' + code
  274. })
  275. return
  276. }
  277. // 已登录,显示确认框
  278. uni.showModal({
  279. title: '加入家庭',
  280. content: '您已被邀请加入家庭,是否接受?',
  281. success: async (res) => {
  282. if (res.confirm) {
  283. try {
  284. uni.showLoading({ title: '加入中...' })
  285. const result = await acceptParentInvite(code)
  286. uni.hideLoading()
  287. if (result.code === 200) {
  288. const { familyId, role, token } = result.data
  289. uni.setStorageSync('familyId', familyId)
  290. uni.setStorageSync('role', role)
  291. uni.setStorageSync('token', token)
  292. uni.showToast({ title: '加入成功', icon: 'success' })
  293. // 刷新页面
  294. setTimeout(() => {
  295. uni.reLaunch({ url: '/pages/index/index' })
  296. }, 1500)
  297. }
  298. } catch (e) {
  299. uni.hideLoading()
  300. uni.showToast({ title: e.message || '加入失败', icon: 'none' })
  301. }
  302. }
  303. }
  304. })
  305. }, 500)
  306. },
  307. hexToRgba: function(hex, alpha) {
  308. var r = parseInt(hex.slice(1, 3), 16)
  309. var g = parseInt(hex.slice(3, 5), 16)
  310. var b = parseInt(hex.slice(5, 7), 16)
  311. return 'rgba(' + r + ',' + g + ',' + b + ',' + alpha + ')'
  312. }
  313. },
  314. computed: {
  315. dimList: function() {
  316. return DIMENSIONS
  317. },
  318. splashDimList: function() {
  319. return DIMENSIONS
  320. },
  321. energyDotColors: function() {
  322. return ['#8D6E63', '#FF6B35', '#FFD700', '#4CAF50', '#42A5F5']
  323. }
  324. }
  325. }
  326. </script>
  327. <style>
  328. .discover-container {
  329. min-height: 100vh;
  330. background: #f5f7fa;
  331. padding-bottom: 100rpx;
  332. }
  333. /* ===== 推荐 ===== */
  334. .recommend-section {
  335. margin: 20rpx 30rpx;
  336. }
  337. .section-header {
  338. display: flex;
  339. justify-content: space-between;
  340. align-items: center;
  341. margin-bottom: 20rpx;
  342. }
  343. .section-title {
  344. font-size: 30rpx;
  345. font-weight: bold;
  346. color: #333;
  347. }
  348. .section-more {
  349. font-size: 24rpx;
  350. color: #5B9BD5;
  351. }
  352. .type-filter-scroll {
  353. white-space: nowrap;
  354. margin-bottom: 20rpx;
  355. }
  356. .filter-chip {
  357. display: inline-block;
  358. padding: 8rpx 24rpx;
  359. font-size: 24rpx;
  360. color: #666;
  361. background: #f0f0f0;
  362. border-radius: 30rpx;
  363. margin-right: 16rpx;
  364. }
  365. .filter-chip.active {
  366. background: #5B9BD5;
  367. color: #fff;
  368. }
  369. .loading-state,
  370. .empty-state {
  371. display: flex;
  372. justify-content: center;
  373. padding: 60rpx 0;
  374. }
  375. .loading-text,
  376. .empty-text {
  377. font-size: 26rpx;
  378. color: #999;
  379. }
  380. .product-grid {
  381. display: flex;
  382. flex-wrap: wrap;
  383. justify-content: space-between;
  384. }
  385. .product-card {
  386. width: 48%;
  387. background: #fff;
  388. border-radius: 16rpx;
  389. overflow: hidden;
  390. margin-bottom: 20rpx;
  391. box-shadow: 0 2rpx 8rpx rgba(0,0,0,0.06);
  392. }
  393. .product-cover {
  394. width: 100%;
  395. height: 200rpx;
  396. background: #f0f0f0;
  397. }
  398. .product-info {
  399. padding: 14rpx;
  400. }
  401. .product-name {
  402. display: block;
  403. font-size: 26rpx;
  404. color: #333;
  405. margin-bottom: 10rpx;
  406. overflow: hidden;
  407. text-overflow: ellipsis;
  408. white-space: nowrap;
  409. }
  410. .product-price-row {
  411. display: flex;
  412. align-items: baseline;
  413. }
  414. .product-price {
  415. font-size: 28rpx;
  416. color: #5B9BD5;
  417. font-weight: bold;
  418. margin-right: 10rpx;
  419. }
  420. .product-price-login {
  421. font-size: 24rpx;
  422. color: #999;
  423. }
  424. .product-member {
  425. font-size: 20rpx;
  426. color: #999;
  427. }
  428. /* ===== 五维全景幸福矩阵 ===== */
  429. .why-section {
  430. margin: 30rpx;
  431. }
  432. .dim-matrix {
  433. display: flex;
  434. flex-wrap: wrap;
  435. gap: 20rpx;
  436. justify-content: center;
  437. }
  438. .dim-card {
  439. width: calc(33.33% - 14rpx);
  440. box-sizing: border-box;
  441. background: #fff;
  442. border-radius: 20rpx;
  443. padding: 28rpx 16rpx 24rpx;
  444. display: flex;
  445. flex-direction: column;
  446. align-items: center;
  447. text-align: center;
  448. box-shadow: 0 4rpx 20rpx rgba(0,0,0,0.06);
  449. transition: transform 0.2s ease, box-shadow 0.2s ease;
  450. position: relative;
  451. overflow: hidden;
  452. }
  453. .dim-card:active {
  454. transform: scale(0.96);
  455. box-shadow: 0 2rpx 8rpx rgba(0,0,0,0.1);
  456. }
  457. .dim-icon-circle {
  458. width: 72rpx;
  459. height: 72rpx;
  460. border-radius: 50%;
  461. display: flex;
  462. align-items: center;
  463. justify-content: center;
  464. margin-bottom: 14rpx;
  465. flex-shrink: 0;
  466. }
  467. .dim-icon {
  468. font-size: 36rpx;
  469. line-height: 1;
  470. }
  471. .dim-tag {
  472. font-size: 22rpx;
  473. font-weight: 600;
  474. padding: 4rpx 14rpx;
  475. border-radius: 20rpx;
  476. margin-bottom: 10rpx;
  477. max-width: 100%;
  478. overflow: hidden;
  479. text-overflow: ellipsis;
  480. white-space: nowrap;
  481. }
  482. .dim-desc {
  483. font-size: 20rpx;
  484. color: #888;
  485. line-height: 1.5;
  486. display: -webkit-box;
  487. -webkit-line-clamp: 2;
  488. -webkit-box-orient: vertical;
  489. overflow: hidden;
  490. }
  491. /* 五维能量环 */
  492. .dim-energy-row {
  493. display: flex;
  494. justify-content: center;
  495. gap: 12rpx;
  496. margin-top: 24rpx;
  497. opacity: 0.5;
  498. }
  499. .energy-dot {
  500. width: 10rpx;
  501. height: 10rpx;
  502. border-radius: 50%;
  503. }
  504. /* ===== 底部登录 ===== */
  505. .login-footer {
  506. margin: 40rpx 30rpx;
  507. display: flex;
  508. flex-direction: column;
  509. align-items: center;
  510. }
  511. .login-btn {
  512. width: 100%;
  513. height: 88rpx;
  514. line-height: 88rpx;
  515. background: linear-gradient(135deg, #5B9BD5, #3A7CC4);
  516. color: #fff;
  517. font-size: 32rpx;
  518. font-weight: bold;
  519. border-radius: 44rpx;
  520. text-align: center;
  521. border: none;
  522. }
  523. .login-btn::after {
  524. border: none;
  525. }
  526. .login-footer-text {
  527. font-size: 20rpx;
  528. color: #bbb;
  529. margin-top: 16rpx;
  530. }
  531. /* ===== 加载占位 ===== */
  532. .loading-container {
  533. display: flex;
  534. justify-content: center;
  535. align-items: center;
  536. height: 100vh;
  537. }
  538. /* ===== 品牌启动页覆盖 ===== */
  539. .splash-overlay {
  540. position: fixed;
  541. top: 0;
  542. left: 0;
  543. right: 0;
  544. bottom: 0;
  545. display: flex;
  546. align-items: center;
  547. justify-content: center;
  548. background: linear-gradient(160deg, #FFF7ED 0%, #F97316 100%);
  549. z-index: 9999;
  550. }
  551. .splash-content {
  552. display: flex;
  553. flex-direction: column;
  554. align-items: center;
  555. opacity: 0;
  556. animation: splash-fade-in 0.8s ease forwards;
  557. }
  558. @keyframes splash-fade-in {
  559. from { opacity: 0; transform: translateY(20rpx); }
  560. to { opacity: 1; transform: translateY(0); }
  561. }
  562. .splash-logo-mark {
  563. width: 144rpx;
  564. height: 144rpx;
  565. border-radius: 36rpx;
  566. background: rgba(255,255,255,0.3);
  567. display: flex;
  568. align-items: center;
  569. justify-content: center;
  570. margin-bottom: 24rpx;
  571. }
  572. .splash-logo-char {
  573. font-size: 72rpx;
  574. font-weight: 700;
  575. color: #FFFFFF;
  576. line-height: 1;
  577. }
  578. .splash-brand-name {
  579. font-size: 56rpx;
  580. font-weight: 700;
  581. color: #FFFFFF;
  582. letter-spacing: 8rpx;
  583. margin-bottom: 12rpx;
  584. text-shadow: 0 2rpx 12rpx rgba(0,0,0,0.1);
  585. }
  586. .splash-tagline {
  587. font-size: 28rpx;
  588. color: rgba(255,255,255,0.85);
  589. letter-spacing: 4rpx;
  590. font-weight: 400;
  591. }
  592. .splash-loading {
  593. position: absolute;
  594. bottom: 120rpx;
  595. left: 0;
  596. right: 0;
  597. display: flex;
  598. justify-content: center;
  599. align-items: center;
  600. gap: 12rpx;
  601. }
  602. .splash-dot {
  603. width: 14rpx;
  604. height: 14rpx;
  605. border-radius: 50%;
  606. background: rgba(255,255,255,0.6);
  607. animation: splash-dot-bounce 1.4s ease-in-out infinite both;
  608. }
  609. .splash-dot--1 { animation-delay: -0.32s; }
  610. .splash-dot--2 { animation-delay: -0.16s; }
  611. .splash-dot--3 { animation-delay: 0s; }
  612. @keyframes splash-dot-bounce {
  613. 0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  614. 40% { transform: scale(1); opacity: 1; }
  615. }
  616. /* ===== 五维图标行 ===== */
  617. .splash-dims-row {
  618. display: flex;
  619. flex-direction: row;
  620. align-items: center;
  621. justify-content: center;
  622. gap: 16rpx;
  623. margin: 16rpx 0 20rpx;
  624. }
  625. .splash-dim-item {
  626. display: flex;
  627. flex-direction: column;
  628. align-items: center;
  629. gap: 6rpx;
  630. opacity: 0;
  631. transform: translateY(20rpx);
  632. animation: splash-dim-enter 0.4s ease forwards;
  633. }
  634. .splash-dim-circle {
  635. width: 64rpx;
  636. height: 64rpx;
  637. border-radius: 50%;
  638. display: flex;
  639. align-items: center;
  640. justify-content: center;
  641. }
  642. .splash-dim-icon {
  643. font-size: 28rpx;
  644. line-height: 1;
  645. color: #FFFFFF;
  646. }
  647. .splash-dim-label {
  648. font-size: 18rpx;
  649. color: rgba(255, 255, 255, 0.7);
  650. line-height: 1;
  651. }
  652. @keyframes splash-dim-enter {
  653. from { opacity: 0; transform: translateY(20rpx); }
  654. to { opacity: 1; transform: translateY(0); }
  655. }
  656. /* ===== 角色切换淡入淡出 ===== */
  657. .role-switch-wrapper {
  658. width: 100%;
  659. min-height: 100vh;
  660. }
  661. .fade-enter-active,
  662. .fade-leave-active {
  663. transition: opacity 0.3s ease;
  664. }
  665. .fade-enter,
  666. .fade-leave-to {
  667. opacity: 0;
  668. }
  669. </style>