index.vue 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845
  1. <template>
  2. <view class="container">
  3. <!-- TabTransition overlay -->
  4. <tab-transition v-if="showTabTransition" dimCode="wealth" ref="tabTransition" @close="showTabTransition = false" />
  5. <!-- 未登录时显示精简内容 -->
  6. <template v-if="!isLoggedIn">
  7. <PageBanner theme="wealth"
  8. tagline="利他创富 · 价值共享"
  9. quote="富足源于利他与坚持" />
  10. <!-- 推荐阅读 -->
  11. <ArticleBookshelf
  12. :articles="wealthArticles"
  13. :loading="articlesLoading"
  14. @articleClick="goArticleDetail"
  15. @moreArticles="goMoreArticles" />
  16. <!-- 登录引导 -->
  17. <view class="login-guide-section">
  18. <text class="login-guide-text">登录后查看财富能量、推广收益、邀请返利等更多内容</text>
  19. <button class="login-btn" @click="goLogin">登录 / 注册</button>
  20. </view>
  21. </template>
  22. <template v-else>
  23. <!-- 品牌头部 -->
  24. <PageBanner theme="wealth"
  25. tagline="利他创富 · 价值共享"
  26. quote="富足源于利他与坚持" />
  27. <!-- 家庭成员选择条 -->
  28. <FamilyMemberStrip
  29. v-if="isLoggedIn"
  30. :members="familyMembersVisible"
  31. :selectedMemberId="selectedMemberId"
  32. @select="onFamilyMemberSelect" />
  33. <!-- 模式切换 / 退出切换入口(家长未切时显示"切换到孩子视角";已切时显示"退出切换") -->
  34. <!-- 已切孩子态:点击"退出切换"回到家长模式 -->
  35. <view v-if="isSwitchedChild" class="exit-switch" @click="exitSwitch">
  36. <text>🔄 退出切换</text>
  37. </view>
  38. <!-- 家长且未切孩子态:此处展示"切换到孩子视角",点击完成模式切换 -->
  39. <view v-else class="exit-switch" @click="onSwitchMode">
  40. <text>👶 切换到孩子视角</text>
  41. </view>
  42. <!-- 身克富杠杆警告 -->
  43. <body-wealth-alert
  44. :status="bodyWealthStatus"
  45. :message="bodyWealthMessage"
  46. :showTip="true" />
  47. <!-- 财富子维度卡片 -->
  48. <wealth-sub-scores
  49. :role="role"
  50. :income="wealthIncome"
  51. :achievement="wealthAchievement"
  52. :network="wealthNetwork"
  53. :education="wealthEducation"
  54. :social="wealthSocial"
  55. :points="wealthPoints" />
  56. <!-- 心的子维度(仅孩子) -->
  57. <view class="section" v-if="role !== 'parent'">
  58. <view class="section-header">
  59. <text class="section-title">🔥 心的子维度</text>
  60. </view>
  61. <view class="sub-dim-grid heart-sub-dim">
  62. <view class="sub-dim-card" @click="childSubDimClick('emotion')">
  63. <text class="sub-dim-score">{{ heartEmotionStable || '-' }}</text>
  64. <text class="sub-dim-label">情绪稳定</text>
  65. <text class="sub-dim-desc">EMI情绪管理</text>
  66. </view>
  67. <view class="sub-dim-card" @click="childSubDimClick('understanding')">
  68. <text class="sub-dim-score">{{ heartUnderstanding || '-' }}</text>
  69. <text class="sub-dim-label">理解包容</text>
  70. <text class="sub-dim-desc">共情+社交适应</text>
  71. </view>
  72. <view class="sub-dim-card" @click="childSubDimClick('legacy')">
  73. <text class="sub-dim-score">{{ heartLegacy || '-' }}</text>
  74. <text class="sub-dim-label">传承传递</text>
  75. <text class="sub-dim-desc">未来开放</text>
  76. </view>
  77. </view>
  78. </view>
  79. <!-- 财富数据(仅家长) -->
  80. <view class="section" v-if="role === 'parent'">
  81. <view class="section-header">
  82. <text class="section-title">💰 财富数据</text>
  83. </view>
  84. <view class="wealth-card">
  85. <view class="wealth-item">
  86. <text class="wealth-value">{{ wealthData.totalEarnings || 0 }}</text>
  87. <text class="wealth-label">累计收益</text>
  88. </view>
  89. <view class="wealth-divider"></view>
  90. <view class="wealth-item">
  91. <text class="wealth-value">{{ wealthData.availableAmount || 0 }}</text>
  92. <text class="wealth-label">可提现</text>
  93. </view>
  94. <view class="wealth-divider"></view>
  95. <view class="wealth-item">
  96. <text class="wealth-value">{{ wealthData.referralCount || 0 }}</text>
  97. <text class="wealth-label">邀请人数</text>
  98. </view>
  99. </view>
  100. <!-- 邀请码复制 -->
  101. <view class="referral-code-bar" v-if="wealthData.referralCode" @click="copyReferralCode">
  102. <text class="referral-code-label">我的邀请码</text>
  103. <text class="referral-code-value">{{ wealthData.referralCode }}</text>
  104. <text class="referral-code-copy">复制</text>
  105. </view>
  106. </view>
  107. <!-- 增值服务入口 -->
  108. <view class="section">
  109. <view class="section-header">
  110. <text class="section-title">🚀 增值服务</text>
  111. </view>
  112. <view class="service-grid">
  113. <view class="service-item" @click="goToCheckin">
  114. <text class="service-icon">📝</text>
  115. <text class="service-label">记账打卡</text>
  116. </view>
  117. <view class="service-item" @click="goToInsurance">
  118. <text class="service-icon">🛡️</text>
  119. <text class="service-label">保单管理</text>
  120. </view>
  121. <view class="service-item" @click="goToCreator">
  122. <text class="service-icon">🎨</text>
  123. <text class="service-label">创客中心</text>
  124. </view>
  125. </view>
  126. </view>
  127. <!-- 消费中心 -->
  128. <view class="section">
  129. <view class="section-header">
  130. <text class="section-title">🛍️ 消费中心</text>
  131. </view>
  132. <view class="service-grid">
  133. <view class="service-item" @click="goToShop">
  134. <text class="service-icon">🏪</text>
  135. <text class="service-label">商城首页</text>
  136. </view>
  137. <view class="service-item" @click="goToCart">
  138. <text class="service-icon">🛒</text>
  139. <text class="service-label">购物车</text>
  140. </view>
  141. <view class="service-item" @click="goToOrders">
  142. <text class="service-icon">📋</text>
  143. <text class="service-label">我的订单</text>
  144. </view>
  145. <view class="service-item" @click="goToAfterSales">
  146. <text class="service-icon">🔄</text>
  147. <text class="service-label">售后服务</text>
  148. </view>
  149. </view>
  150. </view>
  151. <!-- 商品推荐 -->
  152. <DimensionProducts
  153. dimensionCode="wealth"
  154. :familyId="activeChildId"
  155. :products="dimensionProducts"
  156. title="推荐商品"
  157. @productClick="goProductDetail"
  158. @moreProducts="goMoreProducts" />
  159. <!-- 推荐活动 -->
  160. <DimensionActivities
  161. dimensionCode="wealth"
  162. :activities="dimensionActivities"
  163. :isLoggedIn="isLoggedIn"
  164. @activityClick="goActivityDetail"
  165. @moreActivities="goMoreActivities" />
  166. <!-- 推荐阅读 -->
  167. <ArticleBookshelf
  168. :articles="wealthArticles"
  169. :loading="articlesLoading"
  170. @articleClick="goArticleDetail"
  171. @moreArticles="goMoreArticles" />
  172. <!-- 底部菜单 -->
  173. <view class="menu-list">
  174. <view class="menu-item" @click="goToProfile">
  175. <text>👤 个人中心</text>
  176. <text class="arrow">›</text>
  177. </view>
  178. <view class="menu-item" @click="goToPointsLogs">
  179. <text>📊 积分记录</text>
  180. <text class="arrow">›</text>
  181. </view>
  182. <view class="menu-item logout-item" @click="logout">
  183. <text>🚪 退出登录</text>
  184. <text class="arrow">›</text>
  185. </view>
  186. </view>
  187. </template>
  188. </view>
  189. </template>
  190. <script>
  191. import TabTransition from '../../components/tab-transition.vue'
  192. import PageBanner from '../../components/PageBanner.vue'
  193. import ArticleBookshelf from '../../components/ArticleBookshelf.vue'
  194. import DimensionProducts from '../../components/DimensionProducts.vue'
  195. import DimensionActivities from '../../components/DimensionActivities.vue'
  196. import WealthSubScores from '../../components/WealthSubScores.vue'
  197. import BodyWealthAlert from '../../components/BodyWealthAlert.vue'
  198. import FamilyMemberStrip from '../../components/FamilyMemberStrip.vue'
  199. import {
  200. verifyPassword,
  201. getChildren,
  202. getWealthDetail,
  203. getReferralCode,
  204. getReferralSummary,
  205. getCommissionSummary,
  206. getVisibleFamilyMembers,
  207. getFeaturedArticles,
  208. getActivityList,
  209. getProductsByDomain
  210. } from '../../utils/api.js'
  211. export default {
  212. components: { TabTransition, PageBanner, DimensionProducts, DimensionActivities, WealthSubScores, BodyWealthAlert, FamilyMemberStrip, ArticleBookshelf },
  213. data() {
  214. return {
  215. showTabTransition: true,
  216. isLoggedIn: false,
  217. role: 'parent',
  218. isSwitchedChild: false,
  219. // 五维评分
  220. bodyScore: 0,
  221. mindScore: 0,
  222. wisdomScore: 0,
  223. actionScore: 0,
  224. wealthScore: 0,
  225. // 心的子维度(仅孩子有真实数据)
  226. heartEmotionStable: null,
  227. heartUnderstanding: null,
  228. heartLegacy: null,
  229. // 子维度 - parent
  230. wealthIncome: null,
  231. wealthAchievement: null,
  232. wealthNetwork: null,
  233. // 子维度 - child
  234. wealthEducation: null,
  235. wealthSocial: null,
  236. wealthPoints: null,
  237. // 身克富杠杆
  238. bodyWealthStatus: 'normal',
  239. bodyWealthMessage: '',
  240. // 财富数据
  241. wealthData: {
  242. totalEarnings: 0,
  243. availableAmount: 0,
  244. referralCount: 0,
  245. referralCode: ''
  246. },
  247. children: [],
  248. familyMembersVisible: [],
  249. selectedMemberId: null,
  250. wealthArticles: [],
  251. articlesLoading: false,
  252. dimensionActivities: [],
  253. dimensionProducts: []
  254. }
  255. },
  256. computed: {
  257. activeChildId() {
  258. if (this.role === 'child') {
  259. return uni.getStorageSync('currentChildId')
  260. }
  261. return ''
  262. }
  263. },
  264. onShow() {
  265. this.showTabTransition = true
  266. var token = uni.getStorageSync('token')
  267. if (!token) {
  268. this.isLoggedIn = false
  269. this._watchPageReady()
  270. return
  271. }
  272. this.isLoggedIn = true
  273. var currentRole = uni.getStorageSync('currentRole') || uni.getStorageSync('role') || 'parent'
  274. if (currentRole === 'teacher') {
  275. uni.redirectTo({ url: '/pages/teacher/teacher-profile' })
  276. return
  277. }
  278. this.role = currentRole
  279. this.isSwitchedChild = uni.getStorageSync('isSwitchedChild') || false
  280. this.loadChildren()
  281. this.loadWealthDetail()
  282. this.loadWealthData()
  283. this.loadFamilyMembersVisible()
  284. this.loadWealthArticles()
  285. this.loadDimensionActivities()
  286. this.loadDimensionProducts()
  287. this._watchPageReady()
  288. },
  289. methods: {
  290. onFamilyMemberSelect(member) {
  291. this.selectedMemberId = member.id
  292. },
  293. goProductDetail: function(prod) {
  294. if (!prod || !prod.id) return
  295. uni.navigateTo({ url: '/pages/discover-detail/product-detail/product-detail?id=' + prod.id })
  296. },
  297. goMoreProducts: function() {
  298. uni.navigateTo({ url: '/pages/shop/index' })
  299. },
  300. loadDimensionActivities: function() {
  301. var self = this
  302. getActivityList({ dimensionCode: 'wealth', page: 1, size: 3 }).then(function(res) {
  303. if (res && res.data) {
  304. var list = Array.isArray(res.data) ? res.data : (res.data.records || [])
  305. self.dimensionActivities = list.slice(0, 3)
  306. }
  307. }).catch(function() { self.dimensionActivities = [] })
  308. },
  309. loadDimensionProducts: function() {
  310. var self = this
  311. getProductsByDomain('wealth', 1, 4).then(function(res) {
  312. if (res && res.data) {
  313. var list = Array.isArray(res.data) ? res.data : (res.data.records || [])
  314. self.dimensionProducts = list.slice(0, 4)
  315. }
  316. }).catch(function() { self.dimensionProducts = [] })
  317. },
  318. goActivityDetail: function(act) {
  319. if (!act || !act.id) return
  320. uni.navigateTo({ url: '/pages/activity/activity-detail/activity-detail?id=' + act.id })
  321. },
  322. goMoreActivities: function() {
  323. uni.navigateTo({ url: '/pages/discover/index?type=activity' })
  324. },
  325. loadWealthArticles: function() {
  326. var self = this
  327. self.articlesLoading = true
  328. getFeaturedArticles({ size: 5 }).then(function(res) {
  329. if (res.code === 200 && res.data) {
  330. var list = Array.isArray(res.data) ? res.data : (res.data.records || [])
  331. var result = []
  332. for (var i = 0; i < list.length; i++) {
  333. var a = list[i]
  334. if (a.relatedDimensions && a.relatedDimensions.indexOf('wealth') !== -1) {
  335. result.push(a)
  336. }
  337. }
  338. self.wealthArticles = result.length > 0 ? result.slice(0, 5) : list.slice(0, 5)
  339. }
  340. }).catch(function() {
  341. self.wealthArticles = []
  342. }).then(function() {
  343. self.articlesLoading = false
  344. })
  345. },
  346. goArticleDetail: function(article) {
  347. var id = article && article.id ? article.id : article
  348. uni.navigateTo({ url: '/pages/article-center/article-detail?id=' + id })
  349. },
  350. goMoreArticles: function() {
  351. uni.navigateTo({ url: '/pages/article-center/index?dimension=wealth' })
  352. },
  353. loadFamilyMembersVisible() {
  354. var self = this
  355. getVisibleFamilyMembers().then(function(res) {
  356. self.familyMembersVisible = res.data || []
  357. }).catch(function(e) {
  358. console.log('获取可见家庭成员失败', e)
  359. self.familyMembersVisible = []
  360. })
  361. },
  362. goLogin() {
  363. uni.navigateTo({ url: '/pages/login/login' })
  364. },
  365. _watchPageReady() {
  366. var self = this
  367. this.$nextTick(function() {
  368. if (self.$refs.tabTransition) self.$refs.tabTransition.markReady()
  369. })
  370. },
  371. async loadChildren() {
  372. try {
  373. var res = await getChildren()
  374. this.children = res.data || []
  375. } catch (e) {
  376. console.error('获取孩子列表失败', e)
  377. }
  378. },
  379. async loadWealthDetail() {
  380. var memberId = null
  381. var memberType = this.role
  382. if (this.role === 'child') {
  383. memberId = uni.getStorageSync('currentChildId')
  384. if (!memberId && this.children.length > 0) {
  385. memberId = this.children[0].id
  386. }
  387. } else {
  388. memberId = uni.getStorageSync('userId')
  389. }
  390. if (!memberId) return
  391. try {
  392. var res = await getWealthDetail(memberId, memberType)
  393. if (res && res.data) {
  394. var d = res.data
  395. this.wealthScore = d.wealthScore || 0
  396. if (memberType === 'parent') {
  397. this.wealthIncome = d.wealthIncome
  398. this.wealthAchievement = d.wealthAchievement
  399. this.wealthNetwork = d.wealthNetwork
  400. } else {
  401. this.wealthEducation = d.wealthEducation
  402. this.wealthSocial = d.wealthSocial
  403. this.wealthPoints = d.wealthPoints
  404. this.heartEmotionStable = d.heartEmotionStable
  405. this.heartUnderstanding = d.heartUnderstanding
  406. this.heartLegacy = d.heartLegacy
  407. }
  408. // 身克富杠杆状态
  409. this.bodyWealthStatus = d.bodyWealthStatus || 'normal'
  410. this.bodyWealthMessage = d.bodyWealthMessage || ''
  411. }
  412. } catch (e) {
  413. console.error('获取富维度详情失败', e)
  414. }
  415. },
  416. async loadWealthData() {
  417. if (this.role !== 'parent') return
  418. try {
  419. var codeRes = await getReferralCode()
  420. if (codeRes && codeRes.code === 200 && codeRes.data) {
  421. this.wealthData.referralCode = codeRes.data.code || codeRes.data || ''
  422. }
  423. } catch (e) {
  424. console.error('获取邀请码失败', e)
  425. }
  426. try {
  427. var summaryRes = await getReferralSummary()
  428. if (summaryRes && summaryRes.code === 200 && summaryRes.data) {
  429. this.wealthData.referralCount = summaryRes.data.totalCount || summaryRes.data.count || 0
  430. }
  431. } catch (e) {
  432. console.error('获取邀请统计失败', e)
  433. }
  434. try {
  435. var commissionRes = await getCommissionSummary()
  436. if (commissionRes && commissionRes.code === 200 && commissionRes.data) {
  437. this.wealthData.totalEarnings = commissionRes.data.totalEarnings || 0
  438. this.wealthData.availableAmount = commissionRes.data.availableAmount || 0
  439. }
  440. } catch (e) {
  441. console.error('获取佣金统计失败', e)
  442. }
  443. },
  444. copyReferralCode() {
  445. if (!this.wealthData.referralCode) return
  446. uni.setClipboardData({
  447. data: this.wealthData.referralCode,
  448. success: function() {
  449. uni.showToast({ title: '邀请码已复制', icon: 'success' })
  450. }
  451. })
  452. },
  453. onSwitchMode() {
  454. if (this.role === 'child') {
  455. this.exitSwitch()
  456. return
  457. }
  458. // parent → switch to child
  459. if (this.children.length === 0) {
  460. this.loadChildren()
  461. if (this.children.length === 0) {
  462. uni.showModal({
  463. title: '提示',
  464. content: '您还没有添加孩子,请先在家庭成员中添加',
  465. success: function(res) {
  466. if (res.confirm) {
  467. uni.navigateTo({ url: '/pages/profile-extra/family-members' })
  468. }
  469. }
  470. })
  471. return
  472. }
  473. }
  474. if (this.children.length === 1) {
  475. this.$store.commit('switchToChild', this.children[0].id)
  476. this.role = 'child'
  477. this.isSwitchedChild = true
  478. uni.showToast({ title: '已切换为孩子模式', icon: 'success' })
  479. return
  480. }
  481. var self = this
  482. uni.showActionSheet({
  483. itemList: this.children.map(function(c) { return c.nickname }),
  484. success: function(res) {
  485. var selectedChild = self.children[res.tapIndex]
  486. self.$store.commit('switchToChild', selectedChild.id)
  487. self.role = 'child'
  488. self.isSwitchedChild = true
  489. uni.showToast({ title: '已切换为' + selectedChild.nickname + '模式', icon: 'success' })
  490. }
  491. })
  492. },
  493. exitSwitch() {
  494. if (!this.isSwitchedChild) return
  495. var self = this
  496. uni.showModal({
  497. title: '退出切换',
  498. content: '请输入家长密码以确认退出',
  499. editable: true,
  500. success: function(res) {
  501. if (res.confirm && res.content) {
  502. verifyPassword(res.content).then(function(result) {
  503. if (result.code === 200) {
  504. uni.removeStorageSync('isSwitchedChild')
  505. uni.removeStorageSync('currentChildId')
  506. self.isSwitchedChild = false
  507. self.role = 'parent'
  508. if (self.$store && self.$store.commit) {
  509. self.$store.commit('switchBackToParent')
  510. }
  511. uni.showToast({ title: '已退出切换', icon: 'success' })
  512. setTimeout(function() {
  513. uni.reLaunch({ url: '/pages/index-home/index' })
  514. }, 1000)
  515. } else {
  516. uni.showToast({ title: '密码错误', icon: 'none' })
  517. }
  518. }).catch(function() {
  519. uni.showToast({ title: '验证失败', icon: 'none' })
  520. })
  521. }
  522. }
  523. })
  524. },
  525. logout() {
  526. uni.showModal({
  527. title: '退出登录',
  528. content: '确定要退出登录吗?',
  529. success: function(res) {
  530. if (res.confirm) {
  531. uni.clearStorageSync()
  532. uni.reLaunch({ url: '/pages/login/login' })
  533. }
  534. }
  535. })
  536. },
  537. goToProfile() {
  538. uni.navigateTo({ url: '/pages/profile/profile' })
  539. },
  540. goToCheckin() {
  541. uni.navigateTo({ url: '/pages/wealth-sub/checkin' })
  542. },
  543. goToInsurance() {
  544. uni.navigateTo({ url: '/pages/wealth-sub/insurance-list' })
  545. },
  546. goToCreator() {
  547. uni.navigateTo({ url: '/pages/promotion/index' })
  548. },
  549. goToPointsLogs() {
  550. uni.navigateTo({ url: '/pages/points/points' })
  551. },
  552. goToShop() {
  553. uni.navigateTo({ url: '/pages/shop/index/index' })
  554. },
  555. goToCart() {
  556. uni.navigateTo({ url: '/pages/shop/cart/cart' })
  557. },
  558. goToOrders() {
  559. uni.navigateTo({ url: '/pages/shop/order-list/order-list' })
  560. },
  561. goToAfterSales() {
  562. uni.navigateTo({ url: '/pages/shop/after-sales/after-sales' })
  563. },
  564. goToIncome() {
  565. uni.navigateTo({ url: '/pages/promotion/commission' })
  566. },
  567. goToAchievements() {
  568. uni.navigateTo({ url: '/pages/rewards/badge' })
  569. },
  570. goToNetwork() {
  571. uni.navigateTo({ url: '/pages/promotion/team' })
  572. },
  573. childSubDimClick(key) {
  574. var routes = {
  575. education: '/pages/assessment/results',
  576. social: '/pages/activity/index',
  577. points: '/pages/shop/index',
  578. emotion: '/pages/mind-detail/emotion-report',
  579. understanding: '/pages/mind-detail/emotion-trend',
  580. legacy: '/pages/wishes/index'
  581. }
  582. var url = routes[key]
  583. if (url) {
  584. uni.navigateTo({ url: url })
  585. }
  586. }
  587. }
  588. }
  589. </script>
  590. <style scoped>
  591. .container {
  592. min-height: 100vh;
  593. background: #f5f7fa;
  594. padding-bottom: 120rpx;
  595. }
  596. .section {
  597. margin: 20rpx 30rpx;
  598. }
  599. .section-header {
  600. display: flex;
  601. justify-content: space-between;
  602. align-items: center;
  603. margin-bottom: 20rpx;
  604. }
  605. .section-title {
  606. font-size: 30rpx;
  607. font-weight: bold;
  608. color: #333;
  609. }
  610. .section-more {
  611. font-size: 24rpx;
  612. color: #999;
  613. }
  614. /* 切换区域 */
  615. .switch-section {
  616. margin: 0 30rpx 20rpx;
  617. }
  618. .btn-switch {
  619. background: linear-gradient(135deg, #F59E0B, #FBBF24);
  620. color: #fff;
  621. font-size: 26rpx;
  622. padding: 16rpx 0;
  623. border-radius: 40rpx;
  624. text-align: center;
  625. line-height: 1.5;
  626. }
  627. /* 财富数据卡片 */
  628. .wealth-card {
  629. background: #fff;
  630. border-radius: 20rpx;
  631. padding: 30rpx 20rpx;
  632. display: flex;
  633. align-items: center;
  634. box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.06);
  635. }
  636. .wealth-item {
  637. flex: 1;
  638. display: flex;
  639. flex-direction: column;
  640. align-items: center;
  641. }
  642. .wealth-value {
  643. font-size: 40rpx;
  644. font-weight: bold;
  645. color: #F97316;
  646. }
  647. .wealth-label {
  648. font-size: 24rpx;
  649. color: #999;
  650. margin-top: 8rpx;
  651. }
  652. .wealth-divider {
  653. width: 1rpx;
  654. height: 60rpx;
  655. background: #f0f0f0;
  656. }
  657. /* 邀请码复制条 */
  658. .referral-code-bar {
  659. display: flex;
  660. align-items: center;
  661. background: #fff;
  662. margin-top: 16rpx;
  663. border-radius: 16rpx;
  664. padding: 24rpx 30rpx;
  665. box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.06);
  666. }
  667. .referral-code-label {
  668. font-size: 26rpx;
  669. color: #666;
  670. margin-right: 16rpx;
  671. }
  672. .referral-code-value {
  673. flex: 1;
  674. font-size: 30rpx;
  675. font-weight: bold;
  676. color: #F59E0B;
  677. letter-spacing: 2rpx;
  678. }
  679. .referral-code-copy {
  680. font-size: 24rpx;
  681. color: #fff;
  682. background: linear-gradient(135deg, #F59E0B, #FBBF24);
  683. padding: 8rpx 24rpx;
  684. border-radius: 20rpx;
  685. }
  686. /* 三子维度卡片 */
  687. .sub-dim-grid {
  688. display: flex;
  689. }
  690. .sub-dim-card {
  691. flex: 1;
  692. margin-right: 16rpx;
  693. background: #fff;
  694. border-radius: 16rpx;
  695. padding: 24rpx 16rpx;
  696. display: flex;
  697. flex-direction: column;
  698. align-items: center;
  699. box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.06);
  700. }
  701. .sub-dim-card:last-child {
  702. margin-right: 0;
  703. }
  704. .sub-dim-score {
  705. font-size: 48rpx;
  706. font-weight: bold;
  707. color: #F59E0B;
  708. }
  709. .heart-sub-dim .sub-dim-score {
  710. color: #FF6B9D;
  711. }
  712. .sub-dim-label {
  713. font-size: 24rpx;
  714. color: #333;
  715. margin-top: 8rpx;
  716. font-weight: 500;
  717. }
  718. .sub-dim-desc {
  719. font-size: 20rpx;
  720. color: #999;
  721. margin-top: 4rpx;
  722. }
  723. /* 增值服务 */
  724. .service-grid {
  725. display: flex;
  726. flex-wrap: wrap;
  727. background: #fff;
  728. border-radius: 20rpx;
  729. padding: 24rpx 16rpx;
  730. box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.06);
  731. }
  732. .service-item {
  733. width: 25%;
  734. display: flex;
  735. flex-direction: column;
  736. align-items: center;
  737. padding: 16rpx 0;
  738. }
  739. .service-icon {
  740. font-size: 48rpx;
  741. margin-bottom: 8rpx;
  742. }
  743. .service-label {
  744. font-size: 22rpx;
  745. color: #666;
  746. }
  747. /* 底部菜单 */
  748. .menu-list {
  749. margin: 30rpx 30rpx 0;
  750. background: #fff;
  751. border-radius: 16rpx;
  752. }
  753. .menu-item {
  754. padding: 30rpx;
  755. border-bottom: 1rpx solid #f0f0f0;
  756. display: flex;
  757. justify-content: space-between;
  758. font-size: 28rpx;
  759. }
  760. .menu-item:last-child {
  761. border-bottom: none;
  762. }
  763. .arrow {
  764. color: #ccc;
  765. font-size: 32rpx;
  766. }
  767. .logout-item {
  768. color: #EF4444;
  769. }
  770. /* 未登录 */
  771. .login-guide-section {
  772. display: flex;
  773. flex-direction: column;
  774. align-items: center;
  775. padding: 60rpx 40rpx;
  776. margin: 30rpx;
  777. background: #fff;
  778. border-radius: 20rpx;
  779. box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.06);
  780. }
  781. .login-guide-text {
  782. font-size: 26rpx;
  783. color: #999;
  784. text-align: center;
  785. margin-bottom: 30rpx;
  786. line-height: 1.6;
  787. }
  788. .login-guide-section .login-btn {
  789. width: 60%;
  790. height: 80rpx;
  791. line-height: 80rpx;
  792. background: linear-gradient(135deg, #5B9BD5, #3A7CC4);
  793. color: #fff;
  794. font-size: 30rpx;
  795. font-weight: bold;
  796. border-radius: 40rpx;
  797. text-align: center;
  798. border: none;
  799. }
  800. .login-prompt .login-btn::after {
  801. border: none;
  802. }
  803. /* 退出切换 */
  804. .exit-switch {
  805. margin: 20rpx 30rpx 0;
  806. padding: 16rpx 24rpx;
  807. background: #FEF3C7;
  808. border-radius: 12rpx;
  809. text-align: center;
  810. font-size: 26rpx;
  811. color: #92400E;
  812. }
  813. </style>