index.vue 32 KB

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