index.vue 29 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048
  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. <view class="brand-strap">
  12. <text class="brand-strap-text">分享价值,收获财富</text>
  13. </view>
  14. <!-- 月度引导语 -->
  15. <view class="monthly-guidance" v-if="!isLoggedIn">
  16. <text class="guidance-icon">💧</text>
  17. <text class="guidance-text">{{ monthlyGuidance }}</text>
  18. </view>
  19. <!-- 登录引导 -->
  20. <view class="login-guide-section">
  21. <LoginGuideCard
  22. title="解锁财富能量与推广收益"
  23. :items="[
  24. '查看家庭财富能量仪表盘与推广收益',
  25. '管理邀请返利,开通会员享专属折扣',
  26. '浏览商城精选商品,一键加入购物车'
  27. ]" />
  28. </view>
  29. <!-- 商城精选预览(无需登录) -->
  30. <view class="section">
  31. <view class="section-header">
  32. <text class="section-title">🛍️ 商城精选</text>
  33. <text class="section-more" @click="goToShop">查看全部 ›</text>
  34. </view>
  35. <scroll-view scroll-x class="product-scroll" show-scrollbar="false">
  36. <view class="product-list">
  37. <view class="product-card" v-for="(item, idx) in guestProducts" :key="idx" @click="goProductDetail(item.id)">
  38. <image class="product-img" :src="getImageUrl(item.coverImage || item.image) || '/static/default-product.png'" mode="aspectFill" />
  39. <text class="product-name">{{ item.name }}</text>
  40. <text class="product-price">¥{{ item.price || 0 }}</text>
  41. </view>
  42. </view>
  43. </scroll-view>
  44. </view>
  45. </template>
  46. <template v-else>
  47. <!-- 品牌头部 -->
  48. <PageBanner theme="wealth"
  49. tagline="利他创富 · 价值共享"
  50. quote="富足源于利他与坚持" />
  51. <!-- 家庭成员选择条 -->
  52. <FamilyMemberStrip
  53. v-if="currentView === 'self' && isLoggedIn"
  54. :members="familyMembersVisible"
  55. :selectedMemberId="selectedMemberId"
  56. @select="onFamilyMemberSelect"
  57. @removed="loadFamilyMembersVisible" />
  58. <!-- 身克富杠杆警告 -->
  59. <body-wealth-alert
  60. :status="bodyWealthStatus"
  61. :message="bodyWealthMessage"
  62. :showTip="true" />
  63. <!-- 财富能量环 -->
  64. <WealthEnergyRing
  65. :score="wealthScore"
  66. :delta="deltaPercent" />
  67. <!-- 财富成长 -->
  68. <view class="section stream-section">
  69. <view class="section-header">
  70. <text class="section-title">💰 财富成长</text>
  71. <text class="section-sub">记录家庭财富积累过程,看到每月的成长变化</text>
  72. </view>
  73. <view class="stream-stages">
  74. <view
  75. class="stage-card"
  76. :class="{ active: stage.key === currentStage }"
  77. v-for="stage in streamStages"
  78. :key="stage.key">
  79. <text class="stage-icon">{{ stage.icon }}</text>
  80. <text class="stage-name">{{ stage.name }}</text>
  81. <text class="stage-desc">{{ stage.desc }}</text>
  82. <text class="stage-range">{{ stage.range }}</text>
  83. </view>
  84. </view>
  85. <view class="stream-water">
  86. <view class="stream-water-fill" :style="{ width: wealthScore + '%' }"></view>
  87. </view>
  88. <text class="stream-percent">水位 {{ wealthScore }}%</text>
  89. <text class="stream-tip">{{ streamTip }}</text>
  90. </view>
  91. <!-- 子维度水滴 -->
  92. <wealth-sub-scores
  93. :role="role"
  94. :skill="wealthSkill"
  95. :altruism="wealthAltruism"
  96. :income="wealthIncome"
  97. :fx="wealthFx" />
  98. <!-- 子维度评分表 -->
  99. <dimension-sub-dims
  100. v-if="isLoggedIn && wealthSubDims.length > 0"
  101. title="💧 财富维度构成"
  102. subtitle="家庭财富能量的各个方面"
  103. accent-color="#F59E0B"
  104. :dims="wealthSubDims" />
  105. <!-- 财富数据卡(家长) -->
  106. <view class="section" v-if="role === 'parent'">
  107. <view class="disc-card">
  108. <text class="disc-label">💰 累计收益</text>
  109. <text class="disc-value">¥{{ wealthData.totalEarnings || 0 }}</text>
  110. <text class="disc-sub">较上月 ↑ {{ deltaPercent }}%</text>
  111. </view>
  112. <view class="disc-sub-row">
  113. <view class="disc-sub-card" @click="goToIncome">
  114. <text class="disc-sub-label">可提现</text>
  115. <text class="disc-sub-value">¥{{ wealthData.availableAmount || 0 }}</text>
  116. <text class="disc-sub-action">提现 →</text>
  117. </view>
  118. <view class="disc-sub-card" @click="goToAchievements">
  119. <text class="disc-sub-label">邀请人数</text>
  120. <text class="disc-sub-value">{{ wealthData.referralCount || 0 }}人</text>
  121. <text class="disc-sub-action">邀请 →</text>
  122. </view>
  123. </view>
  124. <view class="referral-code-bar" v-if="wealthData.referralCode" @click="copyReferralCode">
  125. <text class="referral-code-label">我的邀请码</text>
  126. <text class="referral-code-value">{{ wealthData.referralCode }}</text>
  127. <text class="referral-code-copy">复制</text>
  128. </view>
  129. </view>
  130. <!-- 财富数据卡(孩子) -->
  131. <view class="section" v-else>
  132. <view class="child-wealth-card">
  133. <view class="child-wealth-item">
  134. <text class="child-wealth-icon">⭐</text>
  135. <text class="child-wealth-value">{{ wealthIncome || 0 }}</text>
  136. <text class="child-wealth-label">累计积分</text>
  137. </view>
  138. <view class="child-wealth-item">
  139. <text class="child-wealth-icon">📝</text>
  140. <text class="child-wealth-value">{{ taskPercent }}%</text>
  141. <text class="child-wealth-label">任务完成</text>
  142. </view>
  143. <view class="child-wealth-item">
  144. <text class="child-wealth-icon">🏆</text>
  145. <text class="child-wealth-value">{{ badgeCount }}</text>
  146. <text class="child-wealth-label">已获徽章</text>
  147. </view>
  148. </view>
  149. <view class="child-trend">
  150. <text class="child-trend-title">📊 本周成长趋势</text>
  151. <view class="child-trend-bars">
  152. <view class="trend-bar" v-for="(h, i) in weekTrend" :key="i" :style="{ height: h + '%' }"></view>
  153. </view>
  154. <view class="child-trend-days">
  155. <text class="trend-day" v-for="(d, i) in weekDays" :key="i">{{ d }}</text>
  156. </view>
  157. </view>
  158. </view>
  159. <!-- 保单管理 -->
  160. <view class="section" v-if="insuranceLoaded">
  161. <view class="section-header">
  162. <text class="section-title">🛡️ 保单管理</text>
  163. <text class="section-more" @click="goToInsuranceList">查看更多 ›</text>
  164. </view>
  165. <view class="insurance-card" v-if="insuranceList.length === 0">
  166. <view class="insurance-empty">
  167. <text class="insurance-empty-icon">📋</text>
  168. <text class="insurance-empty-text">暂无保单</text>
  169. </view>
  170. </view>
  171. <view class="insurance-card" v-else>
  172. <view class="insurance-item" v-for="(item, idx) in insuranceList" :key="idx" @click="goToInsuranceList">
  173. <view class="insurance-item-header">
  174. <text class="insurance-item-name">{{ item.policyName }}</text>
  175. <text class="insurance-item-status" :class="'status-' + item.status">{{ getPolicyStatusLabel(item.status) }}</text>
  176. </view>
  177. <view class="insurance-item-row">
  178. <text class="insurance-item-label">保险公司</text>
  179. <text class="insurance-item-value">{{ item.insuranceCompany || '未知' }}</text>
  180. </view>
  181. <view class="insurance-item-row">
  182. <text class="insurance-item-label">被保人</text>
  183. <text class="insurance-item-value">{{ item.insuredPerson }}</text>
  184. </view>
  185. </view>
  186. </view>
  187. </view>
  188. <!-- 富维度介绍卡片 -->
  189. <DimensionIntroCard dimCode="wealth" v-if="isLoggedIn" learn-more-url="/pages/wealth/dimension-intro" />
  190. </template>
  191. </view>
  192. </template>
  193. <script>
  194. import TabTransition from '../../components/tab-transition.vue'
  195. import PageBanner from '../../components/PageBanner.vue'
  196. import WealthEnergyRing from '../../components/WealthEnergyRing.vue'
  197. import WealthSubScores from '../../components/WealthSubScores.vue'
  198. import BodyWealthAlert from '../../components/BodyWealthAlert.vue'
  199. import FamilyMemberStrip from '../../components/FamilyMemberStrip.vue'
  200. import DimensionIntroCard from '../../components/DimensionIntroCard.vue'
  201. import DimensionSubDims from '../../components/DimensionSubDims.vue'
  202. import {
  203. getChildren,
  204. getWealthDetail,
  205. getReferralCode,
  206. getReferralSummary,
  207. getCommissionSummary,
  208. getFamilyMemberList,
  209. getInsuranceList,
  210. productList
  211. } from '../../utils/api.js'
  212. import nav from '../../utils/nav.js'
  213. import config from '../../config.js'
  214. export default {
  215. components: { TabTransition, PageBanner, WealthEnergyRing, WealthSubScores, BodyWealthAlert, FamilyMemberStrip, DimensionIntroCard, DimensionSubDims },
  216. data() {
  217. return {
  218. showTabTransition: true,
  219. isLoggedIn: false,
  220. role: 'parent',
  221. // 五维评分
  222. wealthScore: 0,
  223. // 子维度 - 利他创富四维(家长/孩子共用字段)
  224. wealthSkill: null,
  225. wealthAltruism: null,
  226. wealthIncome: null,
  227. wealthFx: null,
  228. // 子维度汇总(DimensionSubDims 用)
  229. wealthSubDims: [],
  230. // 身克富杠杆
  231. bodyWealthStatus: 'normal',
  232. bodyWealthMessage: '',
  233. // 财富数据
  234. wealthData: {
  235. totalEarnings: 0,
  236. availableAmount: 0,
  237. referralCount: 0,
  238. referralCode: ''
  239. },
  240. // 财富成长
  241. deltaPercent: 5.2,
  242. streamStages: [
  243. { key: 'start', icon: '💧', name: '起步', desc: '新人阶段', range: '0-30%' },
  244. { key: 'mid', icon: '🌊', name: '汇流', desc: '成长阶段', range: '30-70%' },
  245. { key: 'surge', icon: '🌊🌊', name: '奔涌', desc: '达人阶段', range: '70-100%' }
  246. ],
  247. // 孩子数据
  248. taskPercent: 0,
  249. badgeCount: 0,
  250. weekTrend: [30, 40, 35, 50, 60, 55, 70],
  251. weekDays: ['一', '二', '三', '四', '五', '六', '日'],
  252. // 服务列表
  253. serviceList: [
  254. { icon: '📝', label: '记账打卡', action: 'goToCheckin' },
  255. { icon: '🛡️', label: '保单管理', action: 'goToInsurance' },
  256. { icon: '🎨', label: '创客中心', action: 'goToCreator' },
  257. { icon: '🏪', label: '商城首页', action: 'goToShop' },
  258. { icon: '🛒', label: '购物车', action: 'goToCart' },
  259. { icon: '📋', label: '我的订单', action: 'goToOrders' },
  260. { icon: '🔄', label: '售后服务', action: 'goToAfterSales' },
  261. { icon: '📊', label: '收益中心', action: 'goToIncome' },
  262. { icon: '💎', label: '家庭CF值', action: 'goToFamilyCf' }
  263. ],
  264. children: [],
  265. familyMembersVisible: [],
  266. selectedMemberId: null,
  267. guestProducts: [],
  268. // 保单列表
  269. insuranceList: [],
  270. insuranceLoaded: false,
  271. }
  272. },
  273. computed: {
  274. activeChildId() {
  275. if (this.role === 'child') {
  276. return uni.getStorageSync('currentChildId')
  277. }
  278. return ''
  279. },
  280. currentStage() {
  281. var s = this.wealthScore
  282. if (s >= 70) return 'surge'
  283. if (s >= 30) return 'mid'
  284. return 'start'
  285. },
  286. streamTip() {
  287. var s = this.wealthScore
  288. if (s >= 70) return '🎉 已是富足达人,继续引领全家成长!'
  289. if (s >= 30) return '💡 坚持分享,下一阶段"奔涌"在望'
  290. return '🌱 从今天开始,迈出创富第一步'
  291. }
  292. },
  293. onShow() {
  294. this.showTabTransition = true
  295. var token = uni.getStorageSync('token')
  296. if (!token) {
  297. this.isLoggedIn = false
  298. this.loadGuestProducts()
  299. this._watchPageReady()
  300. return
  301. }
  302. this.isLoggedIn = true
  303. var currentRole = uni.getStorageSync('currentRole') || uni.getStorageSync('role') || 'parent'
  304. if (currentRole === 'teacher') {
  305. uni.redirectTo({ url: '/pages/teacher/teacher-profile' })
  306. return
  307. }
  308. this.role = currentRole
  309. this.loadChildren()
  310. this.loadWealthDetail()
  311. this.loadWealthData()
  312. this.loadFamilyMembersVisible()
  313. this.loadInsuranceList()
  314. this._watchPageReady()
  315. },
  316. /** 每月引导语 */
  317. monthlyGuidance: function() {
  318. var month = new Date().getMonth()
  319. var messages = [
  320. '一月:理财从记账开始,养习惯',
  321. '二月:新年规划,梳理家庭收支',
  322. '三月:春耕时节,播种财富种子',
  323. '四月:清明踏青,规划家庭支出',
  324. '五月:劳动节后,复盘收支状况',
  325. '六月:年中复盘,调整财富目标',
  326. '七月:暑期规划,优化家庭消费',
  327. '八月:开学季,教育专项规划',
  328. '九月:金秋收获,检视推广收益',
  329. '十月:国庆消费,理性理财',
  330. '十一月:年终冲刺,盘点年度收益',
  331. '十二月:年度总结,规划来年财富'
  332. ]
  333. return messages[month] || messages[0]
  334. },
  335. methods: {
  336. onFamilyMemberSelect(member) {
  337. this.selectedMemberId = member.id
  338. },
  339. loadFamilyMembersVisible() {
  340. var self = this
  341. getFamilyMemberList({ visibleOnly: true }).then(function(res) {
  342. self.familyMembersVisible = res.data || []
  343. }).catch(function(e) {
  344. console.log('获取可见家庭成员失败', e)
  345. self.familyMembersVisible = []
  346. })
  347. },
  348. loadInsuranceList() {
  349. var self = this
  350. this.insuranceLoaded = false
  351. getInsuranceList({}).then(function(res) {
  352. if (res && res.code === 200) {
  353. self.insuranceList = (res.data || []).slice(0, 3)
  354. }
  355. self.insuranceLoaded = true
  356. }).catch(function() {
  357. self.insuranceLoaded = true
  358. })
  359. },
  360. getPolicyStatusLabel: function(status) {
  361. var map = { active: '有效', expired: '已过期', cancelled: '已取消' }
  362. return map[status] || status || '未知'
  363. },
  364. goLogin() {
  365. uni.navigateTo({ url: '/pages/login/login' })
  366. },
  367. _watchPageReady() {
  368. var self = this
  369. this.$nextTick(function() {
  370. if (self.$refs.tabTransition) self.$refs.tabTransition.markReady()
  371. })
  372. },
  373. async loadChildren() {
  374. try {
  375. var res = await getChildren()
  376. this.children = res.data || []
  377. } catch (e) {
  378. console.error('获取孩子列表失败', e)
  379. }
  380. },
  381. async loadWealthDetail() {
  382. var memberId = null
  383. var memberType = this.role
  384. if (this.role === 'child') {
  385. memberId = uni.getStorageSync('currentChildId')
  386. if (!memberId && this.children.length > 0) {
  387. memberId = this.children[0].id
  388. }
  389. } else {
  390. memberId = uni.getStorageSync('userId')
  391. }
  392. if (!memberId) return
  393. try {
  394. var res = await getWealthDetail(memberId, memberType)
  395. if (res && res.data) {
  396. var d = res.data
  397. this.wealthScore = d.wealthScore || 0
  398. // 利他创富四子维度(家长/孩子共用字段)
  399. this.wealthSkill = d.wealthSkill
  400. this.wealthAltruism = d.wealthAltruism
  401. this.wealthIncome = d.wealthIncome
  402. this.wealthFx = d.wealthFx
  403. // 身克富杠杆状态
  404. this.bodyWealthStatus = d.bodyWealthStatus || 'normal'
  405. this.bodyWealthMessage = d.bodyWealthMessage || ''
  406. // 子维度汇总(供 DimensionSubDims 使用)
  407. if (memberType === 'parent') {
  408. this.wealthSubDims = [
  409. { label: '个人能力', score: this.wealthSkill || 0, desc: '服务商资质与成长学习' },
  410. { label: '利他贡献', score: this.wealthAltruism || 0, desc: '邀请分享帮助他人' },
  411. { label: 'CF值积累', score: this.wealthIncome || 0, desc: '家庭第二收入曲线' },
  412. { label: '财务素养', score: this.wealthFx || 0, desc: '记账理财储蓄习惯' }
  413. ]
  414. } else {
  415. this.wealthSubDims = [
  416. { label: '学业能力', score: this.wealthSkill || 0, desc: '测评成绩与进步趋势' },
  417. { label: '利他贡献', score: this.wealthAltruism || 0, desc: '帮助他人与分享' },
  418. { label: '积分积累', score: this.wealthIncome || 0, desc: '完成任务获取积分' },
  419. { label: '财务素养', score: this.wealthFx || 0, desc: '财商学习与储蓄习惯' }
  420. ]
  421. }
  422. }
  423. } catch (e) {
  424. console.error('获取富维度详情失败', e)
  425. }
  426. },
  427. async loadWealthData() {
  428. if (this.role !== 'parent') return
  429. try {
  430. var codeRes = await getReferralCode()
  431. if (codeRes && codeRes.code === 200 && codeRes.data) {
  432. this.wealthData.referralCode = codeRes.data.code || codeRes.data || ''
  433. }
  434. } catch (e) {
  435. console.error('获取邀请码失败', e)
  436. }
  437. try {
  438. var summaryRes = await getReferralSummary()
  439. if (summaryRes && summaryRes.code === 200 && summaryRes.data) {
  440. this.wealthData.referralCount = summaryRes.data.totalCount || summaryRes.data.count || 0
  441. }
  442. } catch (e) {
  443. console.error('获取邀请统计失败', e)
  444. }
  445. try {
  446. var commissionRes = await getCommissionSummary()
  447. if (commissionRes && commissionRes.code === 200 && commissionRes.data) {
  448. this.wealthData.totalEarnings = commissionRes.data.totalEarnings || 0
  449. this.wealthData.availableAmount = commissionRes.data.availableAmount || 0
  450. }
  451. } catch (e) {
  452. console.error('获取佣金统计失败', e)
  453. }
  454. },
  455. copyReferralCode() {
  456. if (!this.wealthData.referralCode) return
  457. uni.setClipboardData({
  458. data: this.wealthData.referralCode,
  459. success: function() {
  460. uni.showToast({ title: '邀请码已复制', icon: 'success' })
  461. }
  462. })
  463. },
  464. logout() {
  465. uni.showModal({
  466. title: '退出登录',
  467. content: '确定要退出登录吗?',
  468. success: function(res) {
  469. if (res.confirm) {
  470. uni.clearStorageSync()
  471. uni.reLaunch({ url: '/pages/login/login' })
  472. }
  473. }
  474. })
  475. },
  476. goToCheckin() {
  477. uni.navigateTo({ url: '/pages/wealth-sub/checkin' })
  478. },
  479. goToInsurance() {
  480. uni.navigateTo({ url: '/pages/wealth-sub/insurance-list' })
  481. },
  482. goToInsuranceList: function() {
  483. uni.navigateTo({ url: '/pages/wealth-sub/insurance-list' })
  484. },
  485. goToCreator() {
  486. uni.navigateTo({ url: '/pages/promotion/index' })
  487. },
  488. goToShop() {
  489. uni.navigateTo({ url: '/pages/shop/index/index' })
  490. },
  491. goToOrders() {
  492. uni.navigateTo({ url: '/pages/shop/order-list/order-list' })
  493. },
  494. goToAfterSales() {
  495. uni.navigateTo({ url: '/pages/shop/after-sales/after-sales' })
  496. },
  497. goToIncome() {
  498. uni.navigateTo({ url: '/pages/promotion/commission' })
  499. },
  500. goToFamilyCf() {
  501. uni.navigateTo({ url: '/pages/wealth-cf/index' })
  502. },
  503. goToAchievements() {
  504. uni.navigateTo({ url: '/pages/rewards/badge' })
  505. },
  506. goToNetwork() {
  507. uni.navigateTo({ url: '/pages/promotion/team' })
  508. },
  509. goToCart() {
  510. uni.navigateTo({ url: '/pages/shop/cart/cart' })
  511. },
  512. loadGuestProducts() {
  513. var self = this
  514. productList({ page: 1, size: 4, sort: 'sales' }).then(function(res) {
  515. if (res.code === 200 && res.data && res.data.records) {
  516. self.guestProducts = res.data.records.slice(0, 4)
  517. }
  518. }).catch(function() {})
  519. },
  520. goProductDetail(id) {
  521. uni.navigateTo({ url: '/pages/shop/detail/detail?id=' + id })
  522. },
  523. getImageUrl: function(path) {
  524. return config.API_BASE_URL + path
  525. },
  526. onServiceClick(action) {
  527. if (this[action]) {
  528. this[action]()
  529. }
  530. }
  531. }
  532. }
  533. </script>
  534. .view-toggle {
  535. display: flex;
  536. margin: 20rpx 30rpx;
  537. background: rgba(255,255,255,0.12);
  538. border-radius: 12rpx;
  539. padding: 6rpx;
  540. }
  541. .toggle-btn {
  542. flex: 1;
  543. text-align: center;
  544. padding: 12rpx 0;
  545. border-radius: 8rpx;
  546. font-size: 26rpx;
  547. color: rgba(255,255,255,0.65);
  548. }
  549. .toggle-btn.active {
  550. background: rgba(255,255,255,0.22);
  551. color: #fff;
  552. font-weight: 600;
  553. }
  554. /* 页面说明 */
  555. .section-sub {
  556. font-size: 22rpx;
  557. color: rgba(255,255,255,0.55);
  558. margin-top: 6rpx;
  559. display: block;
  560. }
  561. /* 得分解读卡片 */
  562. .score-explain-card {
  563. margin: 20rpx 30rpx;
  564. padding: 28rpx 24rpx;
  565. background: rgba(255,255,255,0.1);
  566. border-radius: 20rpx;
  567. border: 1rpx solid rgba(255,255,255,0.15);
  568. }
  569. .explain-header {
  570. display: flex;
  571. align-items: center;
  572. margin-bottom: 14rpx;
  573. }
  574. .explain-icon {
  575. font-size: 36rpx;
  576. margin-right: 10rpx;
  577. }
  578. .explain-title {
  579. font-size: 28rpx;
  580. font-weight: 600;
  581. color: #fff;
  582. }
  583. .explain-text {
  584. font-size: 26rpx;
  585. color: rgba(255,255,255,0.8);
  586. line-height: 1.6;
  587. }
  588. <style scoped>
  589. .container {
  590. min-height: 100vh;
  591. background: #f5f7fa;
  592. padding-bottom: 120rpx;
  593. }
  594. .section {
  595. margin: 20rpx 30rpx;
  596. }
  597. .section-header {
  598. display: flex;
  599. justify-content: space-between;
  600. align-items: center;
  601. margin-bottom: 20rpx;
  602. }
  603. .section-title {
  604. font-size: 30rpx;
  605. font-weight: bold;
  606. color: #333;
  607. }
  608. .section-more {
  609. font-size: 24rpx;
  610. color: #999;
  611. }
  612. /* 财富成长 */
  613. .stream-section {
  614. background: #fff;
  615. border-radius: 20rpx;
  616. padding: 24rpx;
  617. box-shadow: 0 2rpx 8rpx rgba(0,0,0,0.08);
  618. }
  619. .stream-stages {
  620. display: flex;
  621. justify-content: space-between;
  622. margin-bottom: 20rpx;
  623. }
  624. .stage-card {
  625. flex: 1;
  626. margin: 0 8rpx;
  627. padding: 20rpx;
  628. border-radius: 16rpx;
  629. background: #F5F9FC;
  630. display: flex;
  631. flex-direction: column;
  632. align-items: center;
  633. }
  634. .stage-card.active {
  635. background: #FFF7ED;
  636. border: 2rpx solid #FBBF24;
  637. }
  638. .stage-icon {
  639. font-size: 44rpx;
  640. }
  641. .stage-name {
  642. font-size: 26rpx;
  643. font-weight: bold;
  644. color: #333;
  645. margin-top: 8rpx;
  646. }
  647. .stage-desc {
  648. font-size: 20rpx;
  649. color: #999;
  650. margin-top: 4rpx;
  651. }
  652. .stage-range {
  653. font-size: 20rpx;
  654. color: #F59E0B;
  655. margin-top: 4rpx;
  656. }
  657. .stream-water {
  658. height: 20rpx;
  659. border-radius: 10rpx;
  660. background: #FEF3C7;
  661. overflow: hidden;
  662. }
  663. .stream-water-fill {
  664. height: 100%;
  665. border-radius: 10rpx;
  666. background: linear-gradient(90deg, #F59E0B, #FBBF24);
  667. transition: width 0.8s ease;
  668. }
  669. .stream-percent {
  670. display: block;
  671. text-align: right;
  672. font-size: 22rpx;
  673. color: #F59E0B;
  674. margin-top: 8rpx;
  675. }
  676. .stream-tip {
  677. display: block;
  678. text-align: center;
  679. font-size: 24rpx;
  680. color: #92400E;
  681. margin-top: 12rpx;
  682. }
  683. /* 财富数据主卡 */
  684. .disc-card {
  685. background: linear-gradient(135deg, #FFF7ED, #FEF3C7);
  686. border-radius: 20rpx;
  687. padding: 30rpx;
  688. margin-bottom: 16rpx;
  689. display: flex;
  690. flex-direction: column;
  691. }
  692. .disc-label {
  693. font-size: 26rpx;
  694. color: #92400E;
  695. }
  696. .disc-value {
  697. font-size: 56rpx;
  698. font-weight: bold;
  699. color: #F59E0B;
  700. margin-top: 8rpx;
  701. }
  702. .disc-sub {
  703. font-size: 24rpx;
  704. color: #B45309;
  705. margin-top: 8rpx;
  706. }
  707. .disc-sub-row {
  708. display: flex;
  709. margin-bottom: 16rpx;
  710. }
  711. .disc-sub-card {
  712. flex: 1;
  713. background: #fff;
  714. border-radius: 16rpx;
  715. padding: 24rpx;
  716. display: flex;
  717. flex-direction: column;
  718. box-shadow: 0 2rpx 8rpx rgba(0,0,0,0.06);
  719. }
  720. .disc-sub-card:first-child {
  721. margin-right: 8rpx;
  722. }
  723. .disc-sub-card:last-child {
  724. margin-left: 8rpx;
  725. }
  726. .disc-sub-label {
  727. font-size: 24rpx;
  728. color: #999;
  729. }
  730. .disc-sub-value {
  731. font-size: 36rpx;
  732. font-weight: bold;
  733. color: #333;
  734. margin-top: 8rpx;
  735. }
  736. .disc-sub-action {
  737. font-size: 22rpx;
  738. color: #F59E0B;
  739. margin-top: 8rpx;
  740. }
  741. /* 孩子财富卡 */
  742. .child-wealth-card {
  743. display: flex;
  744. background: #fff;
  745. border-radius: 20rpx;
  746. padding: 24rpx 0;
  747. box-shadow: 0 2rpx 8rpx rgba(0,0,0,0.08);
  748. }
  749. .child-wealth-item {
  750. flex: 1;
  751. display: flex;
  752. flex-direction: column;
  753. align-items: center;
  754. }
  755. .child-wealth-icon {
  756. font-size: 44rpx;
  757. }
  758. .child-wealth-value {
  759. font-size: 36rpx;
  760. font-weight: bold;
  761. color: #F59E0B;
  762. margin-top: 8rpx;
  763. }
  764. .child-wealth-label {
  765. font-size: 22rpx;
  766. color: #999;
  767. margin-top: 4rpx;
  768. }
  769. .child-trend {
  770. margin-top: 16rpx;
  771. background: #fff;
  772. border-radius: 20rpx;
  773. padding: 24rpx;
  774. box-shadow: 0 2rpx 8rpx rgba(0,0,0,0.08);
  775. }
  776. .child-trend-title {
  777. font-size: 26rpx;
  778. color: #333;
  779. font-weight: bold;
  780. }
  781. .child-trend-bars {
  782. display: flex;
  783. align-items: flex-end;
  784. height: 120rpx;
  785. margin-top: 16rpx;
  786. }
  787. .trend-bar {
  788. flex: 1;
  789. margin: 0 6rpx;
  790. background: linear-gradient(180deg, #FBBF24, #F59E0B);
  791. border-radius: 6rpx 6rpx 0 0;
  792. }
  793. .child-trend-days {
  794. display: flex;
  795. margin-top: 8rpx;
  796. }
  797. .trend-day {
  798. flex: 1;
  799. text-align: center;
  800. font-size: 20rpx;
  801. color: #999;
  802. }
  803. /* 邀请码复制条 */
  804. .referral-code-bar {
  805. display: flex;
  806. align-items: center;
  807. background: #fff;
  808. margin-top: 16rpx;
  809. border-radius: 16rpx;
  810. padding: 24rpx 30rpx;
  811. box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.06);
  812. }
  813. .referral-code-label {
  814. font-size: 26rpx;
  815. color: #666;
  816. margin-right: 16rpx;
  817. }
  818. .referral-code-value {
  819. flex: 1;
  820. font-size: 30rpx;
  821. font-weight: bold;
  822. color: #F59E0B;
  823. letter-spacing: 2rpx;
  824. }
  825. .referral-code-copy {
  826. font-size: 24rpx;
  827. color: #fff;
  828. background: linear-gradient(135deg, #F59E0B, #FBBF24);
  829. padding: 8rpx 24rpx;
  830. border-radius: 20rpx;
  831. }
  832. /* 服务入口 */
  833. .service-grid {
  834. display: flex;
  835. flex-wrap: wrap;
  836. background: #fff;
  837. border-radius: 20rpx;
  838. padding: 24rpx 16rpx;
  839. box-shadow: 0 2rpx 8rpx rgba(0,0,0,0.08);
  840. }
  841. .service-item {
  842. width: 25%;
  843. display: flex;
  844. flex-direction: column;
  845. align-items: center;
  846. padding: 16rpx 0;
  847. }
  848. .service-icon-wrap {
  849. width: 88rpx;
  850. height: 88rpx;
  851. border-radius: 24rpx;
  852. background: #FFF7ED;
  853. display: flex;
  854. align-items: center;
  855. justify-content: center;
  856. margin-bottom: 8rpx;
  857. }
  858. .service-icon {
  859. font-size: 40rpx;
  860. }
  861. .service-label {
  862. font-size: 22rpx;
  863. color: #666;
  864. }
  865. .logout-item {
  866. color: #EF4444;
  867. }
  868. /* 未登录 */
  869. .login-guide-section {
  870. display: flex;
  871. flex-direction: column;
  872. align-items: center;
  873. padding: 60rpx 40rpx;
  874. margin: 30rpx;
  875. background: #fff;
  876. border-radius: 20rpx;
  877. box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.06);
  878. }
  879. .login-guide-text {
  880. font-size: 26rpx;
  881. color: #999;
  882. text-align: center;
  883. margin-bottom: 30rpx;
  884. line-height: 1.6;
  885. }
  886. .login-guide-section .login-btn {
  887. width: 60%;
  888. height: 80rpx;
  889. line-height: 80rpx;
  890. background: linear-gradient(135deg, #5B9BD5, #3A7CC4);
  891. color: #fff;
  892. font-size: 30rpx;
  893. font-weight: bold;
  894. border-radius: 40rpx;
  895. text-align: center;
  896. border: none;
  897. }
  898. .login-prompt .login-btn::after {
  899. border: none;
  900. }
  901. /* 品牌定位语 */
  902. .brand-strap {
  903. margin: 16rpx 30rpx 0;
  904. padding: 20rpx 28rpx;
  905. background: linear-gradient(135deg, #FFFBEB, rgba(245,158,11,0.12));
  906. border-radius: 16rpx;
  907. border-left: 4rpx solid #F59E0B;
  908. }
  909. .brand-strap-text {
  910. font-size: 26rpx;
  911. color: #92400E;
  912. font-weight: 500;
  913. }
  914. /* 商城精选预览 */
  915. .product-scroll {
  916. white-space: nowrap;
  917. padding: 0 30rpx;
  918. }
  919. .product-list {
  920. display: inline-flex;
  921. gap: 20rpx;
  922. }
  923. .product-card {
  924. width: 220rpx;
  925. flex-shrink: 0;
  926. background: #fff;
  927. border-radius: 16rpx;
  928. overflow: hidden;
  929. box-shadow: 0 2rpx 8rpx rgba(0,0,0,0.06);
  930. }
  931. .product-img {
  932. width: 220rpx;
  933. height: 220rpx;
  934. background: #f5f5f5;
  935. }
  936. .product-name {
  937. display: block;
  938. padding: 12rpx 12rpx 4rpx;
  939. font-size: 24rpx;
  940. color: #333;
  941. overflow: hidden;
  942. text-overflow: ellipsis;
  943. white-space: nowrap;
  944. }
  945. .product-price {
  946. display: block;
  947. padding: 4rpx 12rpx 12rpx;
  948. font-size: 26rpx;
  949. font-weight: bold;
  950. color: #F59E0B;
  951. }
  952. /* 保单管理 */
  953. .insurance-card {
  954. background: #fff;
  955. border-radius: 20rpx;
  956. padding: 24rpx;
  957. box-shadow: 0 2rpx 8rpx rgba(0,0,0,0.08);
  958. }
  959. .insurance-empty {
  960. display: flex;
  961. flex-direction: column;
  962. align-items: center;
  963. padding: 40rpx 0;
  964. }
  965. .insurance-empty-icon { font-size: 60rpx; }
  966. .insurance-empty-text { font-size: 24rpx; color: #999; margin-top: 12rpx; }
  967. .insurance-item {
  968. padding: 16rpx 0;
  969. border-bottom: 1rpx solid #f5f5f5;
  970. }
  971. .insurance-item:last-child { border-bottom: none; }
  972. .insurance-item-header {
  973. display: flex;
  974. justify-content: space-between;
  975. align-items: center;
  976. margin-bottom: 8rpx;
  977. }
  978. .insurance-item-name {
  979. font-size: 26rpx;
  980. font-weight: 600;
  981. color: #333;
  982. }
  983. .insurance-item-status {
  984. font-size: 20rpx;
  985. padding: 4rpx 12rpx;
  986. border-radius: 8rpx;
  987. }
  988. .insurance-item-status.status-active { background: #DCFCE7; color: #16A34A; }
  989. .insurance-item-status.status-expired { background: #FEF2F2; color: #DC2626; }
  990. .insurance-item-status.status-cancelled { background: #F5F5F5; color: #999; }
  991. .insurance-item-row {
  992. display: flex;
  993. justify-content: space-between;
  994. padding: 4rpx 0;
  995. }
  996. .insurance-item-label { font-size: 22rpx; color: #999; }
  997. .insurance-item-value { font-size: 22rpx; color: #666; }
  998. </style>
  999. /* 月度引导语 */
  1000. .monthly-guidance {
  1001. margin: 0 30rpx 20rpx;
  1002. background: linear-gradient(135deg, #FFFBEB, rgba(245,158,11,0.1));
  1003. border-radius: 16rpx;
  1004. padding: 20rpx 24rpx;
  1005. display: flex;
  1006. align-items: center;
  1007. gap: 12rpx;
  1008. }
  1009. .guidance-icon { font-size: 32rpx; flex-shrink: 0; }
  1010. .guidance-text { font-size: 26rpx; color: #F59E0B; font-weight: 500; }