| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184 |
- <template>
- <view class="container">
- <!-- TabTransition overlay -->
- <tab-transition v-if="showTabTransition" dimCode="wealth" ref="tabTransition" @close="showTabTransition = false" />
- <!-- 未登录时显示精简内容 -->
- <template v-if="!isLoggedIn">
- <!-- 品牌定位语 -->
- <view class="brand-strap">
- <text class="brand-strap-text">分享价值,收获财富</text>
- </view>
- <!-- 月度引导语 -->
- <view class="monthly-guidance" v-if="!isLoggedIn">
- <text class="guidance-icon">💧</text>
- <text class="guidance-text">{{ monthlyGuidance }}</text>
- </view>
- <!-- 登录引导 -->
- <view class="login-guide-section">
- <LoginGuideCard
- title="解锁财富能量与推广收益"
- :items="[
- '查看家庭财富能量仪表盘与推广收益',
- '管理邀请返利,开通会员享专属折扣',
- '浏览商城精选商品,一键加入购物车'
- ]" />
- </view>
- <!-- 商城精选预览(无需登录) -->
- <view class="section">
- <view class="section-header">
- <text class="section-title">🛍️ 商城精选</text>
- <text class="section-more" @click="goToShop">查看全部 ›</text>
- </view>
- <scroll-view scroll-x class="product-scroll" show-scrollbar="false">
- <view class="product-list">
- <view class="product-card" v-for="(item, idx) in guestProducts" :key="idx" @click="goProductDetail(item.id)">
- <image class="product-img" :src="getImageUrl(item.coverImage || item.image) || '/static/default-product.png'" mode="aspectFill" />
- <text class="product-name">{{ item.name }}</text>
- <text class="product-price">¥{{ item.price || 0 }}</text>
- </view>
- </view>
- </scroll-view>
- </view>
- </template>
- <template v-else>
- <!-- 家庭成员选择条 -->
- <FamilyMemberStrip
- v-if="currentView === 'self' && isLoggedIn"
- :members="familyMembersVisible"
- :selectedMemberId="selectedMemberId"
- @select="onFamilyMemberSelect"
- @removed="loadFamilyMembersVisible" />
- <!-- 五维能量条 -->
- <FamilyEnergyBar
- v-if="isLoggedIn && sandboxData"
- dimensionCode="wealth"
- :sandboxData="sandboxData"
- :dualDimension="dualDimension" />
- <!-- 身克富杠杆警告 -->
- <body-wealth-alert
- :status="bodyWealthStatus"
- :message="bodyWealthMessage"
- :showTip="true" />
- <!-- 财富能量环 -->
- <WealthEnergyRing
- :score="wealthScore"
- :delta="deltaPercent" />
- <!-- 财富成长 -->
- <view class="section stream-section">
- <view class="section-header">
- <text class="section-title">💰 财富成长</text>
- <text class="section-sub">记录家庭财富积累过程,看到每月的成长变化</text>
- </view>
- <view class="stream-stages">
- <view
- class="stage-card"
- :class="{ active: stage.key === currentStage }"
- v-for="stage in streamStages"
- :key="stage.key">
- <text class="stage-icon">{{ stage.icon }}</text>
- <text class="stage-name">{{ stage.name }}</text>
- <text class="stage-desc">{{ stage.desc }}</text>
- <text class="stage-range">{{ stage.range }}</text>
- </view>
- </view>
- <view class="stream-water">
- <view class="stream-water-fill" :style="{ width: wealthScore + '%' }"></view>
- </view>
- <text class="stream-percent">水位 {{ wealthScore }}%</text>
- <text class="stream-tip">{{ streamTip }}</text>
- </view>
- <!-- 子维度水滴 -->
- <wealth-sub-scores
- :role="role"
- :skill="wealthSkill"
- :altruism="wealthAltruism"
- :income="wealthIncome"
- :fx="wealthFx" />
- <!-- 子维度评分表 -->
- <dimension-sub-dims
- v-if="isLoggedIn && wealthSubDims.length > 0"
- title="💧 财富维度构成"
- subtitle="家庭财富能量的各个方面"
- accent-color="#F59E0B"
- :dims="wealthSubDims" />
- <!-- 财富强项与提升 -->
- <view class="section wealth-insight" v-if="isLoggedIn && wealthSubDims.length > 0 && (wealthStrengths.length > 0 || wealthImproves.length > 0)">
- <view class="section-header">
- <text class="section-title">📈 财富强项与提升</text>
- </view>
- <view class="insight-group" v-if="wealthStrengths.length > 0">
- <text class="insight-group-title">💪 财富强项</text>
- <view class="insight-item" v-for="(item, idx) in wealthStrengths" :key="getInsightKey('s', idx)">
- <text class="insight-item-name">{{ item.label }}</text>
- <text class="insight-item-score">{{ item.score }}分</text>
- <text class="insight-item-tag tag-strong">强项</text>
- </view>
- </view>
- <view class="insight-group" v-if="wealthImproves.length > 0">
- <text class="insight-group-title">🌱 提升空间</text>
- <view class="insight-item" v-for="(item, idx) in wealthImproves" :key="getInsightKey('i', idx)">
- <text class="insight-item-name">{{ item.label }}</text>
- <text class="insight-item-score">{{ item.score }}分</text>
- <text class="insight-item-tag tag-improve">待提升</text>
- </view>
- </view>
- <view class="insight-tip" v-if="wealthStrengths.length > 0 && wealthImproves.length > 0">
- <text class="insight-tip-text">保持优势项,薄弱项可通过参与活动与任务逐步积累</text>
- </view>
- </view>
- <!-- 财富数据卡(家长) -->
- <view class="section" v-if="role === 'parent'">
- <view class="disc-card">
- <text class="disc-label">💰 累计收益</text>
- <text class="disc-value">¥{{ wealthData.totalEarnings || 0 }}</text>
- <text class="disc-sub">较上月 ↑ {{ deltaPercent }}%</text>
- </view>
- <view class="disc-sub-row">
- <view class="disc-sub-card" @click="goToIncome">
- <text class="disc-sub-label">可提现</text>
- <text class="disc-sub-value">¥{{ wealthData.availableAmount || 0 }}</text>
- <text class="disc-sub-action">提现 →</text>
- </view>
- <view class="disc-sub-card" @click="goToAchievements">
- <text class="disc-sub-label">邀请人数</text>
- <text class="disc-sub-value">{{ wealthData.referralCount || 0 }}人</text>
- <text class="disc-sub-action">邀请 →</text>
- </view>
- </view>
- <view class="referral-code-bar" v-if="wealthData.referralCode" @click="copyReferralCode">
- <text class="referral-code-label">我的邀请码</text>
- <text class="referral-code-value">{{ wealthData.referralCode }}</text>
- <text class="referral-code-copy">复制</text>
- </view>
- </view>
- <!-- 财富数据卡(孩子) -->
- <view class="section" v-else>
- <view class="child-wealth-card">
- <view class="child-wealth-item">
- <text class="child-wealth-icon">⭐</text>
- <text class="child-wealth-value">{{ wealthIncome || 0 }}</text>
- <text class="child-wealth-label">累计积分</text>
- </view>
- <view class="child-wealth-item">
- <text class="child-wealth-icon">📝</text>
- <text class="child-wealth-value">{{ taskPercent }}%</text>
- <text class="child-wealth-label">任务完成</text>
- </view>
- <view class="child-wealth-item">
- <text class="child-wealth-icon">🏆</text>
- <text class="child-wealth-value">{{ badgeCount }}</text>
- <text class="child-wealth-label">已获徽章</text>
- </view>
- </view>
- <view class="child-trend">
- <text class="child-trend-title">📊 本周成长趋势</text>
- <view class="child-trend-bars">
- <view class="trend-bar" v-for="(h, i) in weekTrend" :key="i" :style="{ height: h + '%' }"></view>
- </view>
- <view class="child-trend-days">
- <text class="trend-day" v-for="(d, i) in weekDays" :key="i">{{ d }}</text>
- </view>
- </view>
- </view>
- <!-- 保单管理 -->
- <view class="section" v-if="insuranceLoaded">
- <view class="section-header">
- <text class="section-title">🛡️ 保单管理</text>
- <text class="section-more" @click="goToInsuranceList">查看更多 ›</text>
- </view>
- <view class="insurance-card" v-if="insuranceList.length === 0">
- <view class="insurance-empty">
- <text class="insurance-empty-icon">📋</text>
- <text class="insurance-empty-text">暂无保单</text>
- </view>
- </view>
- <view class="insurance-card" v-else>
- <view class="insurance-item" v-for="(item, idx) in insuranceList" :key="idx" @click="goToInsuranceList">
- <view class="insurance-item-header">
- <text class="insurance-item-name">{{ item.policyName }}</text>
- <text class="insurance-item-status" :class="'status-' + item.status">{{ getPolicyStatusLabel(item.status) }}</text>
- </view>
- <view class="insurance-item-row">
- <text class="insurance-item-label">保险公司</text>
- <text class="insurance-item-value">{{ item.insuranceCompany || '未知' }}</text>
- </view>
- <view class="insurance-item-row">
- <text class="insurance-item-label">被保人</text>
- <text class="insurance-item-value">{{ item.insuredPerson }}</text>
- </view>
- </view>
- </view>
- </view>
- <!-- 富维度介绍卡片 -->
- <DimensionIntroCard dimCode="wealth" v-if="isLoggedIn" learn-more-url="/pages/wealth/dimension-intro" />
- </template>
- </view>
- </template>
- <script>
- import TabTransition from '../../components/tab-transition.vue'
- import WealthEnergyRing from '../../components/WealthEnergyRing.vue'
- import WealthSubScores from '../../components/WealthSubScores.vue'
- import BodyWealthAlert from '../../components/BodyWealthAlert.vue'
- import FamilyMemberStrip from '../../components/FamilyMemberStrip.vue'
- import FamilyEnergyBar from '../../components/FamilyEnergyBar.vue'
- import DimensionIntroCard from '../../components/DimensionIntroCard.vue'
- import DimensionSubDims from '../../components/DimensionSubDims.vue'
- import {
- getChildren,
- getWealthDetail,
- getReferralCode,
- getReferralSummary,
- getCommissionSummary,
- getFamilyMemberList,
- getInsuranceList,
- getFamilyEnergySandbox,
- getEnergyOverview,
- productList
- } from '../../utils/api.js'
- import nav from '../../utils/nav.js'
- import config from '../../config.js'
- export default {
- components: { TabTransition, WealthEnergyRing, WealthSubScores, BodyWealthAlert, FamilyMemberStrip, FamilyEnergyBar, DimensionIntroCard, DimensionSubDims },
- data() {
- return {
- showTabTransition: true,
- isLoggedIn: false,
- role: 'parent',
- // 五维评分
- wealthScore: 0,
- // 子维度 - 利他创富四维(家长/孩子共用字段)
- wealthSkill: null,
- wealthAltruism: null,
- wealthIncome: null,
- wealthFx: null,
- // 子维度汇总(DimensionSubDims 用)
- wealthSubDims: [],
- // 身克富杠杆
- bodyWealthStatus: 'normal',
- bodyWealthMessage: '',
- // 财富数据
- wealthData: {
- totalEarnings: 0,
- availableAmount: 0,
- referralCount: 0,
- referralCode: ''
- },
- // 财富成长
- deltaPercent: 5.2,
- streamStages: [
- { key: 'start', icon: '💧', name: '起步', desc: '新人阶段', range: '0-30%' },
- { key: 'mid', icon: '🌊', name: '汇流', desc: '成长阶段', range: '30-70%' },
- { key: 'surge', icon: '🌊🌊', name: '奔涌', desc: '达人阶段', range: '70-100%' }
- ],
- // 孩子数据
- taskPercent: 0,
- badgeCount: 0,
- weekTrend: [30, 40, 35, 50, 60, 55, 70],
- weekDays: ['一', '二', '三', '四', '五', '六', '日'],
- // 服务列表
- serviceList: [
- { icon: '📝', label: '记账打卡', action: 'goToCheckin' },
- { icon: '🛡️', label: '保单管理', action: 'goToInsurance' },
- { icon: '🎨', label: '创客中心', action: 'goToCreator' },
- { icon: '🏪', label: '商城首页', action: 'goToShop' },
- { icon: '🛒', label: '购物车', action: 'goToCart' },
- { icon: '📋', label: '我的订单', action: 'goToOrders' },
- { icon: '🔄', label: '售后服务', action: 'goToAfterSales' },
- { icon: '📊', label: '收益中心', action: 'goToIncome' },
- { icon: '💎', label: '家庭CF值', action: 'goToFamilyCf' }
- ],
- children: [],
- familyMembersVisible: [],
- selectedMemberId: null,
- guestProducts: [],
- // 五维能量条数据
- sandboxData: null,
- dualDimension: null,
- // 保单列表
- insuranceList: [],
- insuranceLoaded: false,
- }
- },
- computed: {
- activeChildId() {
- if (this.role === 'child') {
- return uni.getStorageSync('currentChildId')
- }
- return ''
- },
- currentStage() {
- var s = this.wealthScore
- if (s >= 70) return 'surge'
- if (s >= 30) return 'mid'
- return 'start'
- },
- streamTip() {
- var s = this.wealthScore
- if (s >= 70) return '🎉 已是富足达人,继续引领全家成长!'
- if (s >= 30) return '💡 坚持分享,下一阶段"奔涌"在望'
- return '🌱 从今天开始,迈出创富第一步'
- },
- /** 财富强项:wealthSubDims 中得分 ≥75 的维度 */
- wealthStrengths() {
- var result = []
- for (var i = 0; i < this.wealthSubDims.length; i++) {
- var d = this.wealthSubDims[i]
- var s = Number(d.score)
- if (s >= 75) result.push({ label: d.label, score: s })
- }
- return result
- },
- /** 财富提升空间:wealthSubDims 中 0<得分<60 的维度 */
- wealthImproves() {
- var result = []
- for (var i = 0; i < this.wealthSubDims.length; i++) {
- var d = this.wealthSubDims[i]
- var s = Number(d.score)
- if (s > 0 && s < 60) result.push({ label: d.label, score: s })
- }
- return result
- }
- },
- onShow() {
- this.showTabTransition = true
- var token = uni.getStorageSync('token')
- if (!token) {
- this.isLoggedIn = false
- this.loadGuestProducts()
- this._watchPageReady()
- return
- }
- this.isLoggedIn = true
- var currentRole = uni.getStorageSync('currentRole') || uni.getStorageSync('role') || 'parent'
- if (currentRole === 'teacher') {
- uni.redirectTo({ url: '/pages/teacher/teacher-profile' })
- return
- }
- this.role = currentRole
- this.loadChildren()
- this.loadWealthDetail()
- this.loadWealthData()
- this.loadFamilyMembersVisible()
- this.loadInsuranceList()
- this.loadSandboxData()
- this.loadEnergyData()
- this._watchPageReady()
- },
- /** 每月引导语 */
- monthlyGuidance: function() {
- var month = new Date().getMonth()
- var messages = [
- '一月:理财从记账开始,养习惯',
- '二月:新年规划,梳理家庭收支',
- '三月:春耕时节,播种财富种子',
- '四月:清明踏青,规划家庭支出',
- '五月:劳动节后,复盘收支状况',
- '六月:年中复盘,调整财富目标',
- '七月:暑期规划,优化家庭消费',
- '八月:开学季,教育专项规划',
- '九月:金秋收获,检视推广收益',
- '十月:国庆消费,理性理财',
- '十一月:年终冲刺,盘点年度收益',
- '十二月:年度总结,规划来年财富'
- ]
- return messages[month] || messages[0]
- },
- methods: {
- getInsightKey(prefix, idx) { return prefix + idx },
- onFamilyMemberSelect(member) {
- this.selectedMemberId = member.id
- },
- loadFamilyMembersVisible() {
- var self = this
- getFamilyMemberList({ visibleOnly: true }).then(function(res) {
- self.familyMembersVisible = res.data || []
- }).catch(function(e) {
- console.log('获取可见家庭成员失败', e)
- self.familyMembersVisible = []
- })
- },
- loadInsuranceList() {
- var self = this
- this.insuranceLoaded = false
- getInsuranceList({}).then(function(res) {
- if (res && res.code === 200) {
- self.insuranceList = (res.data || []).slice(0, 3)
- }
- self.insuranceLoaded = true
- }).catch(function() {
- self.insuranceLoaded = true
- })
- },
- getPolicyStatusLabel: function(status) {
- var map = { active: '有效', expired: '已过期', cancelled: '已取消' }
- return map[status] || status || '未知'
- },
- goLogin() {
- uni.navigateTo({ url: '/pages/login/login' })
- },
- _watchPageReady() {
- var self = this
- this.$nextTick(function() {
- if (self.$refs.tabTransition) self.$refs.tabTransition.markReady()
- })
- },
- async loadChildren() {
- try {
- var res = await getChildren()
- this.children = res.data || []
- } catch (e) {
- console.error('获取孩子列表失败', e)
- }
- },
- async loadWealthDetail() {
- var memberId = null
- var memberType = this.role
- if (this.role === 'child') {
- memberId = uni.getStorageSync('currentChildId')
- if (!memberId && this.children.length > 0) {
- memberId = this.children[0].id
- }
- } else {
- memberId = uni.getStorageSync('userId')
- }
- if (!memberId) return
- try {
- var res = await getWealthDetail(memberId, memberType)
- if (res && res.data) {
- var d = res.data
- this.wealthScore = d.wealthScore || 0
- // 利他创富四子维度(家长/孩子共用字段)
- this.wealthSkill = d.wealthSkill
- this.wealthAltruism = d.wealthAltruism
- this.wealthIncome = d.wealthIncome
- this.wealthFx = d.wealthFx
- // 身克富杠杆状态
- this.bodyWealthStatus = d.bodyWealthStatus || 'normal'
- this.bodyWealthMessage = d.bodyWealthMessage || ''
- // 子维度汇总(供 DimensionSubDims 使用)
- if (memberType === 'parent') {
- this.wealthSubDims = [
- { label: '个人能力', score: this.wealthSkill || 0, desc: '服务商资质与成长学习' },
- { label: '利他贡献', score: this.wealthAltruism || 0, desc: '邀请分享帮助他人' },
- { label: 'CF值积累', score: this.wealthIncome || 0, desc: '家庭第二收入曲线' },
- { label: '财务素养', score: this.wealthFx || 0, desc: '记账理财储蓄习惯' }
- ]
- } else {
- this.wealthSubDims = [
- { label: '学业能力', score: this.wealthSkill || 0, desc: '测评成绩与进步趋势' },
- { label: '利他贡献', score: this.wealthAltruism || 0, desc: '帮助他人与分享' },
- { label: '积分积累', score: this.wealthIncome || 0, desc: '完成任务获取积分' },
- { label: '财务素养', score: this.wealthFx || 0, desc: '财商学习与储蓄习惯' }
- ]
- }
- }
- } catch (e) {
- console.error('获取富维度详情失败', e)
- }
- },
- loadSandboxData: function() {
- var self = this
- getFamilyEnergySandbox().then(function(res) {
- if (res && res.data) self.sandboxData = res.data
- }).catch(function() {})
- },
- loadEnergyData: function() {
- var self = this
- var memberId = uni.getStorageSync('userId') || null
- if (!memberId) return
- getEnergyOverview(memberId).then(function(res) {
- if (res && res.data) {
- var dims = res.data.dimensions
- if (dims && dims.length > 0) {
- for (var i = 0; i < dims.length; i++) {
- if (dims[i].code === 'wealth') {
- self.dualDimension = dims[i]
- break
- }
- }
- }
- }
- }).catch(function() {})
- },
- goToMemberDetail: function(memberId) {
- uni.navigateTo({ url: '/pages/wealth-detail/member-wealth-detail?memberId=' + memberId })
- },
- async loadWealthData() {
- if (this.role !== 'parent') return
- try {
- var codeRes = await getReferralCode()
- if (codeRes && codeRes.code === 200 && codeRes.data) {
- this.wealthData.referralCode = codeRes.data.code || codeRes.data || ''
- }
- } catch (e) {
- console.error('获取邀请码失败', e)
- }
- try {
- var summaryRes = await getReferralSummary()
- if (summaryRes && summaryRes.code === 200 && summaryRes.data) {
- this.wealthData.referralCount = summaryRes.data.totalCount || summaryRes.data.count || 0
- }
- } catch (e) {
- console.error('获取邀请统计失败', e)
- }
- try {
- var commissionRes = await getCommissionSummary()
- if (commissionRes && commissionRes.code === 200 && commissionRes.data) {
- this.wealthData.totalEarnings = commissionRes.data.totalEarnings || 0
- this.wealthData.availableAmount = commissionRes.data.availableAmount || 0
- }
- } catch (e) {
- console.error('获取佣金统计失败', e)
- }
- },
- copyReferralCode() {
- if (!this.wealthData.referralCode) return
- uni.setClipboardData({
- data: this.wealthData.referralCode,
- success: function() {
- uni.showToast({ title: '邀请码已复制', icon: 'success' })
- }
- })
- },
- logout() {
- uni.showModal({
- title: '退出登录',
- content: '确定要退出登录吗?',
- success: function(res) {
- if (res.confirm) {
- uni.clearStorageSync()
- uni.reLaunch({ url: '/pages/login/login' })
- }
- }
- })
- },
- goToCheckin() {
- uni.navigateTo({ url: '/pages/wealth-sub/checkin' })
- },
- goToInsurance() {
- uni.navigateTo({ url: '/pages/wealth-sub/insurance-list' })
- },
- goToInsuranceList: function() {
- uni.navigateTo({ url: '/pages/wealth-sub/insurance-list' })
- },
- goToCreator() {
- uni.navigateTo({ url: '/pages/promotion/index' })
- },
- goToShop() {
- uni.navigateTo({ url: '/pages/shop/index/index' })
- },
- goToOrders() {
- uni.navigateTo({ url: '/pages/shop/order-list/order-list' })
- },
- goToAfterSales() {
- uni.navigateTo({ url: '/pages/shop/after-sales/after-sales' })
- },
- goToIncome() {
- uni.navigateTo({ url: '/pages/promotion/commission' })
- },
- goToFamilyCf() {
- uni.navigateTo({ url: '/pages/wealth-cf/index' })
- },
- goToAchievements() {
- uni.navigateTo({ url: '/pages/rewards/badge' })
- },
- goToNetwork() {
- uni.navigateTo({ url: '/pages/promotion/team' })
- },
- goToCart() {
- uni.navigateTo({ url: '/pages/shop/cart/cart' })
- },
- loadGuestProducts() {
- var self = this
- productList({ page: 1, size: 4, sort: 'sales' }).then(function(res) {
- if (res.code === 200 && res.data && res.data.records) {
- self.guestProducts = res.data.records.slice(0, 4)
- }
- }).catch(function() {})
- },
- goProductDetail(id) {
- uni.navigateTo({ url: '/pages/shop/detail/detail?id=' + id })
- },
- getImageUrl: function(path) {
- return config.API_BASE_URL + path
- },
- onServiceClick(action) {
- if (this[action]) {
- this[action]()
- }
- }
- }
- }
- </script>
- .view-toggle {
- display: flex;
- margin: 20rpx 30rpx;
- background: rgba(255,255,255,0.12);
- border-radius: 12rpx;
- padding: 6rpx;
- }
- .toggle-btn {
- flex: 1;
- text-align: center;
- padding: 12rpx 0;
- border-radius: 8rpx;
- font-size: 26rpx;
- color: rgba(255,255,255,0.65);
- }
- .toggle-btn.active {
- background: rgba(255,255,255,0.22);
- color: #fff;
- font-weight: 600;
- }
- /* 页面说明 */
- .section-sub {
- font-size: 22rpx;
- color: rgba(255,255,255,0.55);
- margin-top: 6rpx;
- display: block;
- }
- /* 得分解读卡片 */
- .score-explain-card {
- margin: 20rpx 30rpx;
- padding: 28rpx 24rpx;
- background: rgba(255,255,255,0.1);
- border-radius: 20rpx;
- border: 1rpx solid rgba(255,255,255,0.15);
- }
- .explain-header {
- display: flex;
- align-items: center;
- margin-bottom: 14rpx;
- }
- .explain-icon {
- font-size: 36rpx;
- margin-right: 10rpx;
- }
- .explain-title {
- font-size: 28rpx;
- font-weight: 600;
- color: #fff;
- }
- .explain-text {
- font-size: 26rpx;
- color: rgba(255,255,255,0.8);
- line-height: 1.6;
- }
- <style scoped>
- .container {
- min-height: 100vh;
- background: #f5f7fa;
- padding-bottom: 120rpx;
- }
- .section {
- margin: 20rpx 30rpx;
- }
- .section-header {
- display: flex;
- justify-content: space-between;
- align-items: center;
- margin-bottom: 20rpx;
- }
- .section-title {
- font-size: 30rpx;
- font-weight: bold;
- color: #333;
- }
- .section-more {
- font-size: 24rpx;
- color: #999;
- }
- /* 财富成长 */
- .stream-section {
- background: #fff;
- border-radius: 20rpx;
- padding: 24rpx;
- box-shadow: 0 2rpx 8rpx rgba(0,0,0,0.08);
- }
- .stream-stages {
- display: flex;
- justify-content: space-between;
- margin-bottom: 20rpx;
- }
- .stage-card {
- flex: 1;
- margin: 0 8rpx;
- padding: 20rpx;
- border-radius: 16rpx;
- background: #F5F9FC;
- display: flex;
- flex-direction: column;
- align-items: center;
- }
- .stage-card.active {
- background: #FFF7ED;
- border: 2rpx solid #FBBF24;
- }
- .stage-icon {
- font-size: 44rpx;
- }
- .stage-name {
- font-size: 26rpx;
- font-weight: bold;
- color: #333;
- margin-top: 8rpx;
- }
- .stage-desc {
- font-size: 20rpx;
- color: #999;
- margin-top: 4rpx;
- }
- .stage-range {
- font-size: 20rpx;
- color: #F59E0B;
- margin-top: 4rpx;
- }
- .stream-water {
- height: 20rpx;
- border-radius: 10rpx;
- background: #FEF3C7;
- overflow: hidden;
- }
- .stream-water-fill {
- height: 100%;
- border-radius: 10rpx;
- background: linear-gradient(90deg, #F59E0B, #FBBF24);
- transition: width 0.8s ease;
- }
- .stream-percent {
- display: block;
- text-align: right;
- font-size: 22rpx;
- color: #F59E0B;
- margin-top: 8rpx;
- }
- .stream-tip {
- display: block;
- text-align: center;
- font-size: 24rpx;
- color: #92400E;
- margin-top: 12rpx;
- }
- /* 财富数据主卡 */
- .disc-card {
- background: linear-gradient(135deg, #FFF7ED, #FEF3C7);
- border-radius: 20rpx;
- padding: 30rpx;
- margin-bottom: 16rpx;
- display: flex;
- flex-direction: column;
- }
- .disc-label {
- font-size: 26rpx;
- color: #92400E;
- }
- .disc-value {
- font-size: 56rpx;
- font-weight: bold;
- color: #F59E0B;
- margin-top: 8rpx;
- }
- .disc-sub {
- font-size: 24rpx;
- color: #B45309;
- margin-top: 8rpx;
- }
- .disc-sub-row {
- display: flex;
- margin-bottom: 16rpx;
- }
- .disc-sub-card {
- flex: 1;
- background: #fff;
- border-radius: 16rpx;
- padding: 24rpx;
- display: flex;
- flex-direction: column;
- box-shadow: 0 2rpx 8rpx rgba(0,0,0,0.06);
- }
- .disc-sub-card:first-child {
- margin-right: 8rpx;
- }
- .disc-sub-card:last-child {
- margin-left: 8rpx;
- }
- .disc-sub-label {
- font-size: 24rpx;
- color: #999;
- }
- .disc-sub-value {
- font-size: 36rpx;
- font-weight: bold;
- color: #333;
- margin-top: 8rpx;
- }
- .disc-sub-action {
- font-size: 22rpx;
- color: #F59E0B;
- margin-top: 8rpx;
- }
- /* 孩子财富卡 */
- .child-wealth-card {
- display: flex;
- background: #fff;
- border-radius: 20rpx;
- padding: 24rpx 0;
- box-shadow: 0 2rpx 8rpx rgba(0,0,0,0.08);
- }
- .child-wealth-item {
- flex: 1;
- display: flex;
- flex-direction: column;
- align-items: center;
- }
- .child-wealth-icon {
- font-size: 44rpx;
- }
- .child-wealth-value {
- font-size: 36rpx;
- font-weight: bold;
- color: #F59E0B;
- margin-top: 8rpx;
- }
- .child-wealth-label {
- font-size: 22rpx;
- color: #999;
- margin-top: 4rpx;
- }
- .child-trend {
- margin-top: 16rpx;
- background: #fff;
- border-radius: 20rpx;
- padding: 24rpx;
- box-shadow: 0 2rpx 8rpx rgba(0,0,0,0.08);
- }
- .child-trend-title {
- font-size: 26rpx;
- color: #333;
- font-weight: bold;
- }
- .child-trend-bars {
- display: flex;
- align-items: flex-end;
- height: 120rpx;
- margin-top: 16rpx;
- }
- .trend-bar {
- flex: 1;
- margin: 0 6rpx;
- background: linear-gradient(180deg, #FBBF24, #F59E0B);
- border-radius: 6rpx 6rpx 0 0;
- }
- .child-trend-days {
- display: flex;
- margin-top: 8rpx;
- }
- .trend-day {
- flex: 1;
- text-align: center;
- font-size: 20rpx;
- color: #999;
- }
- /* 邀请码复制条 */
- .referral-code-bar {
- display: flex;
- align-items: center;
- background: #fff;
- margin-top: 16rpx;
- border-radius: 16rpx;
- padding: 24rpx 30rpx;
- box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.06);
- }
- .referral-code-label {
- font-size: 26rpx;
- color: #666;
- margin-right: 16rpx;
- }
- .referral-code-value {
- flex: 1;
- font-size: 30rpx;
- font-weight: bold;
- color: #F59E0B;
- letter-spacing: 2rpx;
- }
- .referral-code-copy {
- font-size: 24rpx;
- color: #fff;
- background: linear-gradient(135deg, #F59E0B, #FBBF24);
- padding: 8rpx 24rpx;
- border-radius: 20rpx;
- }
- /* 服务入口 */
- .service-grid {
- display: flex;
- flex-wrap: wrap;
- background: #fff;
- border-radius: 20rpx;
- padding: 24rpx 16rpx;
- box-shadow: 0 2rpx 8rpx rgba(0,0,0,0.08);
- }
- .service-item {
- width: 25%;
- display: flex;
- flex-direction: column;
- align-items: center;
- padding: 16rpx 0;
- }
- .service-icon-wrap {
- width: 88rpx;
- height: 88rpx;
- border-radius: 24rpx;
- background: #FFF7ED;
- display: flex;
- align-items: center;
- justify-content: center;
- margin-bottom: 8rpx;
- }
- .service-icon {
- font-size: 40rpx;
- }
- .service-label {
- font-size: 22rpx;
- color: #666;
- }
- .logout-item {
- color: #EF4444;
- }
- /* 未登录 */
- .login-guide-section {
- display: flex;
- flex-direction: column;
- align-items: center;
- padding: 60rpx 40rpx;
- margin: 30rpx;
- background: #fff;
- border-radius: 20rpx;
- box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.06);
- }
- .login-guide-text {
- font-size: 26rpx;
- color: #999;
- text-align: center;
- margin-bottom: 30rpx;
- line-height: 1.6;
- }
- .login-guide-section .login-btn {
- width: 60%;
- height: 80rpx;
- line-height: 80rpx;
- background: linear-gradient(135deg, #5B9BD5, #3A7CC4);
- color: #fff;
- font-size: 30rpx;
- font-weight: bold;
- border-radius: 40rpx;
- text-align: center;
- border: none;
- }
- .login-prompt .login-btn::after {
- border: none;
- }
- /* 品牌定位语 */
- .brand-strap {
- margin: 16rpx 30rpx 0;
- padding: 20rpx 28rpx;
- background: linear-gradient(135deg, #FFFBEB, rgba(245,158,11,0.12));
- border-radius: 16rpx;
- border-left: 4rpx solid #F59E0B;
- }
- .brand-strap-text {
- font-size: 26rpx;
- color: #92400E;
- font-weight: 500;
- }
- /* 商城精选预览 */
- .product-scroll {
- white-space: nowrap;
- padding: 0 30rpx;
- }
- .product-list {
- display: inline-flex;
- gap: 20rpx;
- }
- .product-card {
- width: 220rpx;
- flex-shrink: 0;
- background: #fff;
- border-radius: 16rpx;
- overflow: hidden;
- box-shadow: 0 2rpx 8rpx rgba(0,0,0,0.06);
- }
- .product-img {
- width: 220rpx;
- height: 220rpx;
- background: #f5f5f5;
- }
- .product-name {
- display: block;
- padding: 12rpx 12rpx 4rpx;
- font-size: 24rpx;
- color: #333;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- .product-price {
- display: block;
- padding: 4rpx 12rpx 12rpx;
- font-size: 26rpx;
- font-weight: bold;
- color: #F59E0B;
- }
- /* 保单管理 */
- .insurance-card {
- background: #fff;
- border-radius: 20rpx;
- padding: 24rpx;
- box-shadow: 0 2rpx 8rpx rgba(0,0,0,0.08);
- }
- .insurance-empty {
- display: flex;
- flex-direction: column;
- align-items: center;
- padding: 40rpx 0;
- }
- .insurance-empty-icon { font-size: 60rpx; }
- .insurance-empty-text { font-size: 24rpx; color: #999; margin-top: 12rpx; }
- .insurance-item {
- padding: 16rpx 0;
- border-bottom: 1rpx solid #f5f5f5;
- }
- .insurance-item:last-child { border-bottom: none; }
- .insurance-item-header {
- display: flex;
- justify-content: space-between;
- align-items: center;
- margin-bottom: 8rpx;
- }
- .insurance-item-name {
- font-size: 26rpx;
- font-weight: 600;
- color: #333;
- }
- .insurance-item-status {
- font-size: 20rpx;
- padding: 4rpx 12rpx;
- border-radius: 8rpx;
- }
- .insurance-item-status.status-active { background: #DCFCE7; color: #16A34A; }
- .insurance-item-status.status-expired { background: #FEF2F2; color: #DC2626; }
- .insurance-item-status.status-cancelled { background: #F5F5F5; color: #999; }
- .insurance-item-row {
- display: flex;
- justify-content: space-between;
- padding: 4rpx 0;
- }
- .insurance-item-label { font-size: 22rpx; color: #999; }
- .insurance-item-value { font-size: 22rpx; color: #666; }
- /* ===== 财富强项与提升卡片 ===== */
- .wealth-insight {
- background: #fff;
- border-radius: 20rpx;
- padding: 24rpx;
- }
- .insight-group {
- margin-bottom: 16rpx;
- }
- .insight-group-title {
- font-size: 26rpx;
- font-weight: 600;
- color: #333;
- margin-bottom: 10rpx;
- display: block;
- }
- .insight-item {
- display: flex;
- align-items: center;
- padding: 12rpx 16rpx;
- background: #FFFBEB;
- border-radius: 12rpx;
- margin-bottom: 8rpx;
- }
- .insight-item-name {
- flex: 1;
- font-size: 26rpx;
- color: #333;
- }
- .insight-item-score {
- font-size: 24rpx;
- color: #666;
- margin-right: 12rpx;
- }
- .insight-item-tag {
- font-size: 20rpx;
- padding: 4rpx 16rpx;
- border-radius: 8rpx;
- font-weight: 500;
- }
- .insight-item-tag.tag-strong {
- background: #D1FAE5;
- color: #059669;
- }
- .insight-item-tag.tag-improve {
- background: #FEF3C7;
- color: #D97706;
- }
- .insight-tip {
- padding: 12rpx 16rpx;
- background: #FFFBEB;
- border-radius: 12rpx;
- }
- .insight-tip-text {
- font-size: 22rpx;
- color: #F59E0B;
- }
- </style>
- /* 月度引导语 */
- .monthly-guidance {
- margin: 0 30rpx 20rpx;
- background: linear-gradient(135deg, #FFFBEB, rgba(245,158,11,0.1));
- border-radius: 16rpx;
- padding: 20rpx 24rpx;
- display: flex;
- align-items: center;
- gap: 12rpx;
- }
- .guidance-icon { font-size: 32rpx; flex-shrink: 0; }
- .guidance-text { font-size: 26rpx; color: #F59E0B; font-weight: 500; }
|