index.vue 32 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142
  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="getInsightKey('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="getInsightKey('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. getInsightKey(prefix, idx) { return prefix + idx },
  374. onFamilyMemberSelect(member) {
  375. this.selectedMemberId = member.id
  376. },
  377. loadFamilyMembersVisible() {
  378. var self = this
  379. getFamilyMemberList({ visibleOnly: true }).then(function(res) {
  380. self.familyMembersVisible = res.data || []
  381. }).catch(function(e) {
  382. console.log('获取可见家庭成员失败', e)
  383. self.familyMembersVisible = []
  384. })
  385. },
  386. loadInsuranceList() {
  387. var self = this
  388. this.insuranceLoaded = false
  389. getInsuranceList({}).then(function(res) {
  390. if (res && res.code === 200) {
  391. self.insuranceList = (res.data || []).slice(0, 3)
  392. }
  393. self.insuranceLoaded = true
  394. }).catch(function() {
  395. self.insuranceLoaded = true
  396. })
  397. },
  398. getPolicyStatusLabel: function(status) {
  399. var map = { active: '有效', expired: '已过期', cancelled: '已取消' }
  400. return map[status] || status || '未知'
  401. },
  402. goLogin() {
  403. uni.navigateTo({ url: '/pages/login/login' })
  404. },
  405. _watchPageReady() {
  406. var self = this
  407. this.$nextTick(function() {
  408. if (self.$refs.tabTransition) self.$refs.tabTransition.markReady()
  409. })
  410. },
  411. async loadChildren() {
  412. try {
  413. var res = await getChildren()
  414. this.children = res.data || []
  415. } catch (e) {
  416. console.error('获取孩子列表失败', e)
  417. }
  418. },
  419. async loadWealthDetail() {
  420. var memberId = null
  421. var memberType = this.role
  422. if (this.role === 'child') {
  423. memberId = uni.getStorageSync('currentChildId')
  424. if (!memberId && this.children.length > 0) {
  425. memberId = this.children[0].id
  426. }
  427. } else {
  428. memberId = uni.getStorageSync('userId')
  429. }
  430. if (!memberId) return
  431. try {
  432. var res = await getWealthDetail(memberId, memberType)
  433. if (res && res.data) {
  434. var d = res.data
  435. this.wealthScore = d.wealthScore || 0
  436. // 利他创富四子维度(家长/孩子共用字段)
  437. this.wealthSkill = d.wealthSkill
  438. this.wealthAltruism = d.wealthAltruism
  439. this.wealthIncome = d.wealthIncome
  440. this.wealthFx = d.wealthFx
  441. // 身克富杠杆状态
  442. this.bodyWealthStatus = d.bodyWealthStatus || 'normal'
  443. this.bodyWealthMessage = d.bodyWealthMessage || ''
  444. // 子维度汇总(供 DimensionSubDims 使用)
  445. if (memberType === 'parent') {
  446. this.wealthSubDims = [
  447. { label: '个人能力', score: this.wealthSkill || 0, desc: '服务商资质与成长学习' },
  448. { label: '利他贡献', score: this.wealthAltruism || 0, desc: '邀请分享帮助他人' },
  449. { label: 'CF值积累', score: this.wealthIncome || 0, desc: '家庭第二收入曲线' },
  450. { label: '财务素养', score: this.wealthFx || 0, desc: '记账理财储蓄习惯' }
  451. ]
  452. } else {
  453. this.wealthSubDims = [
  454. { label: '学业能力', score: this.wealthSkill || 0, desc: '测评成绩与进步趋势' },
  455. { label: '利他贡献', score: this.wealthAltruism || 0, desc: '帮助他人与分享' },
  456. { label: '积分积累', score: this.wealthIncome || 0, desc: '完成任务获取积分' },
  457. { label: '财务素养', score: this.wealthFx || 0, desc: '财商学习与储蓄习惯' }
  458. ]
  459. }
  460. }
  461. } catch (e) {
  462. console.error('获取富维度详情失败', e)
  463. }
  464. },
  465. async loadWealthData() {
  466. if (this.role !== 'parent') return
  467. try {
  468. var codeRes = await getReferralCode()
  469. if (codeRes && codeRes.code === 200 && codeRes.data) {
  470. this.wealthData.referralCode = codeRes.data.code || codeRes.data || ''
  471. }
  472. } catch (e) {
  473. console.error('获取邀请码失败', e)
  474. }
  475. try {
  476. var summaryRes = await getReferralSummary()
  477. if (summaryRes && summaryRes.code === 200 && summaryRes.data) {
  478. this.wealthData.referralCount = summaryRes.data.totalCount || summaryRes.data.count || 0
  479. }
  480. } catch (e) {
  481. console.error('获取邀请统计失败', e)
  482. }
  483. try {
  484. var commissionRes = await getCommissionSummary()
  485. if (commissionRes && commissionRes.code === 200 && commissionRes.data) {
  486. this.wealthData.totalEarnings = commissionRes.data.totalEarnings || 0
  487. this.wealthData.availableAmount = commissionRes.data.availableAmount || 0
  488. }
  489. } catch (e) {
  490. console.error('获取佣金统计失败', e)
  491. }
  492. },
  493. copyReferralCode() {
  494. if (!this.wealthData.referralCode) return
  495. uni.setClipboardData({
  496. data: this.wealthData.referralCode,
  497. success: function() {
  498. uni.showToast({ title: '邀请码已复制', icon: 'success' })
  499. }
  500. })
  501. },
  502. logout() {
  503. uni.showModal({
  504. title: '退出登录',
  505. content: '确定要退出登录吗?',
  506. success: function(res) {
  507. if (res.confirm) {
  508. uni.clearStorageSync()
  509. uni.reLaunch({ url: '/pages/login/login' })
  510. }
  511. }
  512. })
  513. },
  514. goToCheckin() {
  515. uni.navigateTo({ url: '/pages/wealth-sub/checkin' })
  516. },
  517. goToInsurance() {
  518. uni.navigateTo({ url: '/pages/wealth-sub/insurance-list' })
  519. },
  520. goToInsuranceList: function() {
  521. uni.navigateTo({ url: '/pages/wealth-sub/insurance-list' })
  522. },
  523. goToCreator() {
  524. uni.navigateTo({ url: '/pages/promotion/index' })
  525. },
  526. goToShop() {
  527. uni.navigateTo({ url: '/pages/shop/index/index' })
  528. },
  529. goToOrders() {
  530. uni.navigateTo({ url: '/pages/shop/order-list/order-list' })
  531. },
  532. goToAfterSales() {
  533. uni.navigateTo({ url: '/pages/shop/after-sales/after-sales' })
  534. },
  535. goToIncome() {
  536. uni.navigateTo({ url: '/pages/promotion/commission' })
  537. },
  538. goToFamilyCf() {
  539. uni.navigateTo({ url: '/pages/wealth-cf/index' })
  540. },
  541. goToAchievements() {
  542. uni.navigateTo({ url: '/pages/rewards/badge' })
  543. },
  544. goToNetwork() {
  545. uni.navigateTo({ url: '/pages/promotion/team' })
  546. },
  547. goToCart() {
  548. uni.navigateTo({ url: '/pages/shop/cart/cart' })
  549. },
  550. loadGuestProducts() {
  551. var self = this
  552. productList({ page: 1, size: 4, sort: 'sales' }).then(function(res) {
  553. if (res.code === 200 && res.data && res.data.records) {
  554. self.guestProducts = res.data.records.slice(0, 4)
  555. }
  556. }).catch(function() {})
  557. },
  558. goProductDetail(id) {
  559. uni.navigateTo({ url: '/pages/shop/detail/detail?id=' + id })
  560. },
  561. getImageUrl: function(path) {
  562. return config.API_BASE_URL + path
  563. },
  564. onServiceClick(action) {
  565. if (this[action]) {
  566. this[action]()
  567. }
  568. }
  569. }
  570. }
  571. </script>
  572. .view-toggle {
  573. display: flex;
  574. margin: 20rpx 30rpx;
  575. background: rgba(255,255,255,0.12);
  576. border-radius: 12rpx;
  577. padding: 6rpx;
  578. }
  579. .toggle-btn {
  580. flex: 1;
  581. text-align: center;
  582. padding: 12rpx 0;
  583. border-radius: 8rpx;
  584. font-size: 26rpx;
  585. color: rgba(255,255,255,0.65);
  586. }
  587. .toggle-btn.active {
  588. background: rgba(255,255,255,0.22);
  589. color: #fff;
  590. font-weight: 600;
  591. }
  592. /* 页面说明 */
  593. .section-sub {
  594. font-size: 22rpx;
  595. color: rgba(255,255,255,0.55);
  596. margin-top: 6rpx;
  597. display: block;
  598. }
  599. /* 得分解读卡片 */
  600. .score-explain-card {
  601. margin: 20rpx 30rpx;
  602. padding: 28rpx 24rpx;
  603. background: rgba(255,255,255,0.1);
  604. border-radius: 20rpx;
  605. border: 1rpx solid rgba(255,255,255,0.15);
  606. }
  607. .explain-header {
  608. display: flex;
  609. align-items: center;
  610. margin-bottom: 14rpx;
  611. }
  612. .explain-icon {
  613. font-size: 36rpx;
  614. margin-right: 10rpx;
  615. }
  616. .explain-title {
  617. font-size: 28rpx;
  618. font-weight: 600;
  619. color: #fff;
  620. }
  621. .explain-text {
  622. font-size: 26rpx;
  623. color: rgba(255,255,255,0.8);
  624. line-height: 1.6;
  625. }
  626. <style scoped>
  627. .container {
  628. min-height: 100vh;
  629. background: #f5f7fa;
  630. padding-bottom: 120rpx;
  631. }
  632. .section {
  633. margin: 20rpx 30rpx;
  634. }
  635. .section-header {
  636. display: flex;
  637. justify-content: space-between;
  638. align-items: center;
  639. margin-bottom: 20rpx;
  640. }
  641. .section-title {
  642. font-size: 30rpx;
  643. font-weight: bold;
  644. color: #333;
  645. }
  646. .section-more {
  647. font-size: 24rpx;
  648. color: #999;
  649. }
  650. /* 财富成长 */
  651. .stream-section {
  652. background: #fff;
  653. border-radius: 20rpx;
  654. padding: 24rpx;
  655. box-shadow: 0 2rpx 8rpx rgba(0,0,0,0.08);
  656. }
  657. .stream-stages {
  658. display: flex;
  659. justify-content: space-between;
  660. margin-bottom: 20rpx;
  661. }
  662. .stage-card {
  663. flex: 1;
  664. margin: 0 8rpx;
  665. padding: 20rpx;
  666. border-radius: 16rpx;
  667. background: #F5F9FC;
  668. display: flex;
  669. flex-direction: column;
  670. align-items: center;
  671. }
  672. .stage-card.active {
  673. background: #FFF7ED;
  674. border: 2rpx solid #FBBF24;
  675. }
  676. .stage-icon {
  677. font-size: 44rpx;
  678. }
  679. .stage-name {
  680. font-size: 26rpx;
  681. font-weight: bold;
  682. color: #333;
  683. margin-top: 8rpx;
  684. }
  685. .stage-desc {
  686. font-size: 20rpx;
  687. color: #999;
  688. margin-top: 4rpx;
  689. }
  690. .stage-range {
  691. font-size: 20rpx;
  692. color: #F59E0B;
  693. margin-top: 4rpx;
  694. }
  695. .stream-water {
  696. height: 20rpx;
  697. border-radius: 10rpx;
  698. background: #FEF3C7;
  699. overflow: hidden;
  700. }
  701. .stream-water-fill {
  702. height: 100%;
  703. border-radius: 10rpx;
  704. background: linear-gradient(90deg, #F59E0B, #FBBF24);
  705. transition: width 0.8s ease;
  706. }
  707. .stream-percent {
  708. display: block;
  709. text-align: right;
  710. font-size: 22rpx;
  711. color: #F59E0B;
  712. margin-top: 8rpx;
  713. }
  714. .stream-tip {
  715. display: block;
  716. text-align: center;
  717. font-size: 24rpx;
  718. color: #92400E;
  719. margin-top: 12rpx;
  720. }
  721. /* 财富数据主卡 */
  722. .disc-card {
  723. background: linear-gradient(135deg, #FFF7ED, #FEF3C7);
  724. border-radius: 20rpx;
  725. padding: 30rpx;
  726. margin-bottom: 16rpx;
  727. display: flex;
  728. flex-direction: column;
  729. }
  730. .disc-label {
  731. font-size: 26rpx;
  732. color: #92400E;
  733. }
  734. .disc-value {
  735. font-size: 56rpx;
  736. font-weight: bold;
  737. color: #F59E0B;
  738. margin-top: 8rpx;
  739. }
  740. .disc-sub {
  741. font-size: 24rpx;
  742. color: #B45309;
  743. margin-top: 8rpx;
  744. }
  745. .disc-sub-row {
  746. display: flex;
  747. margin-bottom: 16rpx;
  748. }
  749. .disc-sub-card {
  750. flex: 1;
  751. background: #fff;
  752. border-radius: 16rpx;
  753. padding: 24rpx;
  754. display: flex;
  755. flex-direction: column;
  756. box-shadow: 0 2rpx 8rpx rgba(0,0,0,0.06);
  757. }
  758. .disc-sub-card:first-child {
  759. margin-right: 8rpx;
  760. }
  761. .disc-sub-card:last-child {
  762. margin-left: 8rpx;
  763. }
  764. .disc-sub-label {
  765. font-size: 24rpx;
  766. color: #999;
  767. }
  768. .disc-sub-value {
  769. font-size: 36rpx;
  770. font-weight: bold;
  771. color: #333;
  772. margin-top: 8rpx;
  773. }
  774. .disc-sub-action {
  775. font-size: 22rpx;
  776. color: #F59E0B;
  777. margin-top: 8rpx;
  778. }
  779. /* 孩子财富卡 */
  780. .child-wealth-card {
  781. display: flex;
  782. background: #fff;
  783. border-radius: 20rpx;
  784. padding: 24rpx 0;
  785. box-shadow: 0 2rpx 8rpx rgba(0,0,0,0.08);
  786. }
  787. .child-wealth-item {
  788. flex: 1;
  789. display: flex;
  790. flex-direction: column;
  791. align-items: center;
  792. }
  793. .child-wealth-icon {
  794. font-size: 44rpx;
  795. }
  796. .child-wealth-value {
  797. font-size: 36rpx;
  798. font-weight: bold;
  799. color: #F59E0B;
  800. margin-top: 8rpx;
  801. }
  802. .child-wealth-label {
  803. font-size: 22rpx;
  804. color: #999;
  805. margin-top: 4rpx;
  806. }
  807. .child-trend {
  808. margin-top: 16rpx;
  809. background: #fff;
  810. border-radius: 20rpx;
  811. padding: 24rpx;
  812. box-shadow: 0 2rpx 8rpx rgba(0,0,0,0.08);
  813. }
  814. .child-trend-title {
  815. font-size: 26rpx;
  816. color: #333;
  817. font-weight: bold;
  818. }
  819. .child-trend-bars {
  820. display: flex;
  821. align-items: flex-end;
  822. height: 120rpx;
  823. margin-top: 16rpx;
  824. }
  825. .trend-bar {
  826. flex: 1;
  827. margin: 0 6rpx;
  828. background: linear-gradient(180deg, #FBBF24, #F59E0B);
  829. border-radius: 6rpx 6rpx 0 0;
  830. }
  831. .child-trend-days {
  832. display: flex;
  833. margin-top: 8rpx;
  834. }
  835. .trend-day {
  836. flex: 1;
  837. text-align: center;
  838. font-size: 20rpx;
  839. color: #999;
  840. }
  841. /* 邀请码复制条 */
  842. .referral-code-bar {
  843. display: flex;
  844. align-items: center;
  845. background: #fff;
  846. margin-top: 16rpx;
  847. border-radius: 16rpx;
  848. padding: 24rpx 30rpx;
  849. box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.06);
  850. }
  851. .referral-code-label {
  852. font-size: 26rpx;
  853. color: #666;
  854. margin-right: 16rpx;
  855. }
  856. .referral-code-value {
  857. flex: 1;
  858. font-size: 30rpx;
  859. font-weight: bold;
  860. color: #F59E0B;
  861. letter-spacing: 2rpx;
  862. }
  863. .referral-code-copy {
  864. font-size: 24rpx;
  865. color: #fff;
  866. background: linear-gradient(135deg, #F59E0B, #FBBF24);
  867. padding: 8rpx 24rpx;
  868. border-radius: 20rpx;
  869. }
  870. /* 服务入口 */
  871. .service-grid {
  872. display: flex;
  873. flex-wrap: wrap;
  874. background: #fff;
  875. border-radius: 20rpx;
  876. padding: 24rpx 16rpx;
  877. box-shadow: 0 2rpx 8rpx rgba(0,0,0,0.08);
  878. }
  879. .service-item {
  880. width: 25%;
  881. display: flex;
  882. flex-direction: column;
  883. align-items: center;
  884. padding: 16rpx 0;
  885. }
  886. .service-icon-wrap {
  887. width: 88rpx;
  888. height: 88rpx;
  889. border-radius: 24rpx;
  890. background: #FFF7ED;
  891. display: flex;
  892. align-items: center;
  893. justify-content: center;
  894. margin-bottom: 8rpx;
  895. }
  896. .service-icon {
  897. font-size: 40rpx;
  898. }
  899. .service-label {
  900. font-size: 22rpx;
  901. color: #666;
  902. }
  903. .logout-item {
  904. color: #EF4444;
  905. }
  906. /* 未登录 */
  907. .login-guide-section {
  908. display: flex;
  909. flex-direction: column;
  910. align-items: center;
  911. padding: 60rpx 40rpx;
  912. margin: 30rpx;
  913. background: #fff;
  914. border-radius: 20rpx;
  915. box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.06);
  916. }
  917. .login-guide-text {
  918. font-size: 26rpx;
  919. color: #999;
  920. text-align: center;
  921. margin-bottom: 30rpx;
  922. line-height: 1.6;
  923. }
  924. .login-guide-section .login-btn {
  925. width: 60%;
  926. height: 80rpx;
  927. line-height: 80rpx;
  928. background: linear-gradient(135deg, #5B9BD5, #3A7CC4);
  929. color: #fff;
  930. font-size: 30rpx;
  931. font-weight: bold;
  932. border-radius: 40rpx;
  933. text-align: center;
  934. border: none;
  935. }
  936. .login-prompt .login-btn::after {
  937. border: none;
  938. }
  939. /* 品牌定位语 */
  940. .brand-strap {
  941. margin: 16rpx 30rpx 0;
  942. padding: 20rpx 28rpx;
  943. background: linear-gradient(135deg, #FFFBEB, rgba(245,158,11,0.12));
  944. border-radius: 16rpx;
  945. border-left: 4rpx solid #F59E0B;
  946. }
  947. .brand-strap-text {
  948. font-size: 26rpx;
  949. color: #92400E;
  950. font-weight: 500;
  951. }
  952. /* 商城精选预览 */
  953. .product-scroll {
  954. white-space: nowrap;
  955. padding: 0 30rpx;
  956. }
  957. .product-list {
  958. display: inline-flex;
  959. gap: 20rpx;
  960. }
  961. .product-card {
  962. width: 220rpx;
  963. flex-shrink: 0;
  964. background: #fff;
  965. border-radius: 16rpx;
  966. overflow: hidden;
  967. box-shadow: 0 2rpx 8rpx rgba(0,0,0,0.06);
  968. }
  969. .product-img {
  970. width: 220rpx;
  971. height: 220rpx;
  972. background: #f5f5f5;
  973. }
  974. .product-name {
  975. display: block;
  976. padding: 12rpx 12rpx 4rpx;
  977. font-size: 24rpx;
  978. color: #333;
  979. overflow: hidden;
  980. text-overflow: ellipsis;
  981. white-space: nowrap;
  982. }
  983. .product-price {
  984. display: block;
  985. padding: 4rpx 12rpx 12rpx;
  986. font-size: 26rpx;
  987. font-weight: bold;
  988. color: #F59E0B;
  989. }
  990. /* 保单管理 */
  991. .insurance-card {
  992. background: #fff;
  993. border-radius: 20rpx;
  994. padding: 24rpx;
  995. box-shadow: 0 2rpx 8rpx rgba(0,0,0,0.08);
  996. }
  997. .insurance-empty {
  998. display: flex;
  999. flex-direction: column;
  1000. align-items: center;
  1001. padding: 40rpx 0;
  1002. }
  1003. .insurance-empty-icon { font-size: 60rpx; }
  1004. .insurance-empty-text { font-size: 24rpx; color: #999; margin-top: 12rpx; }
  1005. .insurance-item {
  1006. padding: 16rpx 0;
  1007. border-bottom: 1rpx solid #f5f5f5;
  1008. }
  1009. .insurance-item:last-child { border-bottom: none; }
  1010. .insurance-item-header {
  1011. display: flex;
  1012. justify-content: space-between;
  1013. align-items: center;
  1014. margin-bottom: 8rpx;
  1015. }
  1016. .insurance-item-name {
  1017. font-size: 26rpx;
  1018. font-weight: 600;
  1019. color: #333;
  1020. }
  1021. .insurance-item-status {
  1022. font-size: 20rpx;
  1023. padding: 4rpx 12rpx;
  1024. border-radius: 8rpx;
  1025. }
  1026. .insurance-item-status.status-active { background: #DCFCE7; color: #16A34A; }
  1027. .insurance-item-status.status-expired { background: #FEF2F2; color: #DC2626; }
  1028. .insurance-item-status.status-cancelled { background: #F5F5F5; color: #999; }
  1029. .insurance-item-row {
  1030. display: flex;
  1031. justify-content: space-between;
  1032. padding: 4rpx 0;
  1033. }
  1034. .insurance-item-label { font-size: 22rpx; color: #999; }
  1035. .insurance-item-value { font-size: 22rpx; color: #666; }
  1036. /* ===== 财富强项与提升卡片 ===== */
  1037. .wealth-insight {
  1038. background: #fff;
  1039. border-radius: 20rpx;
  1040. padding: 24rpx;
  1041. }
  1042. .insight-group {
  1043. margin-bottom: 16rpx;
  1044. }
  1045. .insight-group-title {
  1046. font-size: 26rpx;
  1047. font-weight: 600;
  1048. color: #333;
  1049. margin-bottom: 10rpx;
  1050. display: block;
  1051. }
  1052. .insight-item {
  1053. display: flex;
  1054. align-items: center;
  1055. padding: 12rpx 16rpx;
  1056. background: #FFFBEB;
  1057. border-radius: 12rpx;
  1058. margin-bottom: 8rpx;
  1059. }
  1060. .insight-item-name {
  1061. flex: 1;
  1062. font-size: 26rpx;
  1063. color: #333;
  1064. }
  1065. .insight-item-score {
  1066. font-size: 24rpx;
  1067. color: #666;
  1068. margin-right: 12rpx;
  1069. }
  1070. .insight-item-tag {
  1071. font-size: 20rpx;
  1072. padding: 4rpx 16rpx;
  1073. border-radius: 8rpx;
  1074. font-weight: 500;
  1075. }
  1076. .insight-item-tag.tag-strong {
  1077. background: #D1FAE5;
  1078. color: #059669;
  1079. }
  1080. .insight-item-tag.tag-improve {
  1081. background: #FEF3C7;
  1082. color: #D97706;
  1083. }
  1084. .insight-tip {
  1085. padding: 12rpx 16rpx;
  1086. background: #FFFBEB;
  1087. border-radius: 12rpx;
  1088. }
  1089. .insight-tip-text {
  1090. font-size: 22rpx;
  1091. color: #F59E0B;
  1092. }
  1093. </style>
  1094. /* 月度引导语 */
  1095. .monthly-guidance {
  1096. margin: 0 30rpx 20rpx;
  1097. background: linear-gradient(135deg, #FFFBEB, rgba(245,158,11,0.1));
  1098. border-radius: 16rpx;
  1099. padding: 20rpx 24rpx;
  1100. display: flex;
  1101. align-items: center;
  1102. gap: 12rpx;
  1103. }
  1104. .guidance-icon { font-size: 32rpx; flex-shrink: 0; }
  1105. .guidance-text { font-size: 26rpx; color: #F59E0B; font-weight: 500; }