| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031 |
- <template>
- <view class="container" :style="{ '--font-scale': fontScale }">
- <!-- 通用登录浮层 -->
- <login-sheet ref="loginSheet" @success="onSheetLoginSuccess" @open="onLoginSheetOpen" @close="onLoginSheetClose" />
- <block v-if="!isLoggedIn">
- <view class="gh-page">
- <!-- 页面头 -->
- <view class="gh-head">
- <text class="gh-eyebrow">浠艾福 · 家庭主动健康</text>
- <text class="gh-title">科学管理全家健康数据</text>
- <text class="gh-sub">把每个家人的健康数据,变成看得懂的结论。</text>
- </view>
- <!-- 痛点条 -->
- <view class="gh-pain">
- <text class="gh-pain-quote">指标正常 ≠ 健康</text>
- <text class="gh-pain-desc">家人反复生病,你扛了多少次了?</text>
- </view>
- <!-- 自检 hero CTA -->
- <view class="gh-cta" @click="goSelfTest">
- <view class="gh-cta-ic"></view>
- <view class="gh-cta-info">
- <text class="gh-cta-title">15 题五维健康自检</text>
- <text class="gh-cta-sub">约 20 秒,了解家人的健康概况</text>
- </view>
- <text class="gh-chev">›</text>
- </view>
- <!-- 本期待填调研(按周期计算,服务端返回 pending 列表) -->
- <view v-for="(item, si) in pendingSurveys" :key="si" class="gh-pending" @click="goSurveyFill(item)">
- <view class="gh-pending-ic"><text class="gh-pending-glyph">研</text></view>
- <view class="gh-pending-info">
- <text class="gh-pending-title">{{ item.title }}</text>
- <text class="gh-pending-sub">{{ cycleLabel(item.cycleType) }} · {{ item.periodStart }} 至 {{ item.periodEnd }}</text>
- </view>
- <text class="gh-pending-tag">待填写</text>
- </view>
- <!-- 演示雷达(登录浮层打开时隐藏:原生 canvas 会盖在浮层之上) -->
- <!-- 统一维度体系:示例雷达按注册中心配置取数(维度清单来自 useDimensionRegistry),无配置显示空态引导 -->
- <view class="gh-demo" v-if="!loginSheetVisible">
- <view v-if="guestBodyDims.length > 0" class="gh-demo-block">
- <view class="gh-demo-head">
- <text class="gh-demo-name">身体雷达</text>
- <text class="gh-demo-tag">示例</text>
- </view>
- <RadarChart :dimensions="guestBodyDims" :scores="guestBodyScores" :fillColor="bodyColor" childName="示例" width="560" height="460" />
- </view>
- <view v-if="guestCogDims.length > 0" class="gh-demo-block">
- <view class="gh-demo-head">
- <text class="gh-demo-name">认知雷达</text>
- <text class="gh-demo-tag">示例</text>
- </view>
- <RadarChart :dimensions="guestCogDims" :scores="guestCogScores" :fillColor="wisdomColor" childName="示例" width="560" height="460" />
- </view>
- <view v-if="!guestHasDemoConfig" class="gh-demo-empty">
- <text class="gh-demo-empty-text">健康雷达尚未配置</text>
- <text class="gh-demo-empty-sub">完成维度配置后即可查看示例效果</text>
- </view>
- </view>
- <!-- 五维健康体系 -->
- <view class="gh-wuxing">
- <text class="gh-wuxing-title">身 · 智 · 富 · 行 · 心,看得见的健康闭环</text>
- <text class="gh-wuxing-sub">五行相生相克,从报告和测评里,真正读懂家人的身体。</text>
- <view class="gh-rel">
- <text class="gh-rel-title">相生 · 前进</text>
- <view class="gh-chain">
- <text class="gh-node gh-node-body">身</text>
- <text class="gh-arrow">→</text>
- <text class="gh-node gh-node-wisdom">智</text>
- <text class="gh-arrow">→</text>
- <text class="gh-node gh-node-wealth">富</text>
- <text class="gh-arrow">→</text>
- <text class="gh-node gh-node-action">行</text>
- <text class="gh-arrow">→</text>
- <text class="gh-node gh-node-mind">心</text>
- <text class="gh-arrow">→</text>
- <text class="gh-node gh-node-body">身</text>
- </view>
- <text class="gh-rel-hint">健康孕育智慧,智慧创造价值,价值滋养关系,关系反哺心灵,心灵守护健康。</text>
- </view>
- <view class="gh-rel">
- <text class="gh-rel-title">相克 · 平衡</text>
- <view class="gh-chain">
- <text class="gh-node gh-node-body">身</text>
- <text class="gh-op">克</text>
- <text class="gh-node gh-node-wealth">富</text>
- <text class="gh-sep">·</text>
- <text class="gh-node gh-node-wisdom">智</text>
- <text class="gh-op">克</text>
- <text class="gh-node gh-node-action">行</text>
- <text class="gh-sep">·</text>
- <text class="gh-node gh-node-wealth">富</text>
- <text class="gh-op">克</text>
- <text class="gh-node gh-node-mind">心</text>
- <text class="gh-sep">·</text>
- <text class="gh-node gh-node-action">行</text>
- <text class="gh-op">克</text>
- <text class="gh-node gh-node-body">身</text>
- <text class="gh-sep">·</text>
- <text class="gh-node gh-node-mind">心</text>
- <text class="gh-op">克</text>
- <text class="gh-node gh-node-wisdom">智</text>
- </view>
- <text class="gh-rel-hint">莫以健康换金钱,真诚胜过算计,财富服务家庭,关爱有度、大爱留白。</text>
- </view>
- <view class="gh-rows">
- <view class="gh-row" @click="goPage('/pages/body-detail/index')">
- <view class="gh-ic gh-ic-body"><text class="gh-glyph">身</text></view>
- <view class="gh-row-info">
- <text class="gh-row-name">身 · 主动健康</text>
- <text class="gh-row-sub">读懂每一份报告,看见全家体质的变化</text>
- </view>
- <text class="gh-row-chev">›</text>
- </view>
- <view class="gh-row" @click="goPage('/pages/wisdom-detail/index')">
- <view class="gh-ic gh-ic-wisdom"><text class="gh-glyph">智</text></view>
- <view class="gh-row-info">
- <text class="gh-row-name">智 · 面向未来</text>
- <text class="gh-row-sub">一次测评,看见成员真实的专注与潜能</text>
- </view>
- <text class="gh-row-chev">›</text>
- </view>
- <view class="gh-row" @click="goPage('/pages/wealth/index')">
- <view class="gh-ic gh-ic-wealth"><text class="gh-glyph">富</text></view>
- <view class="gh-row-info">
- <text class="gh-row-name">富 · 利他创富</text>
- <text class="gh-row-sub">看懂健康与财富的关系,明白身体是最大的本钱</text>
- </view>
- <text class="gh-row-chev">›</text>
- </view>
- <view class="gh-row" @click="goPage('/pages/action-detail/member-action-detail')">
- <view class="gh-ic gh-ic-action"><text class="gh-glyph">行</text></view>
- <view class="gh-row-info">
- <text class="gh-row-name">行 · 人际和谐</text>
- <text class="gh-row-sub">看懂关系里的情绪,看见家人真实的需求</text>
- </view>
- <text class="gh-row-chev">›</text>
- </view>
- <view class="gh-row" @click="goPage('/pages/mind-detail/index')">
- <view class="gh-ic gh-ic-mind"><text class="gh-glyph">心</text></view>
- <view class="gh-row-info">
- <text class="gh-row-name">心 · 大爱相随</text>
- <text class="gh-row-sub">读懂情绪的信号,听懂家人没说出口的话</text>
- </view>
- <text class="gh-row-chev">›</text>
- </view>
- </view>
- </view>
- <!-- 登录引导 -->
- <view class="gh-guide">
- <LoginGuideCard
- title="登录后查看全家健康数据"
- :items="[
- '查看七维雷达图与健康报告解读',
- '完成测评获取个性化健康方案',
- '每日打卡追踪身体 / 情绪 / 认知趋势'
- ]" />
- </view>
- </view>
- </block>
- <block v-else>
- <view class="tab-bar">
- <view v-for="tab in tabs" :key="tab.code" class="tab-item" :class="{ active: currentTab === tab.code }" @click="switchTab(tab.code)">
- <text class="tab-icon">{{ tab.icon }}</text>
- <text class="tab-label">{{ tab.label }}</text>
- <view v-if="currentTab === tab.code" class="tab-underline" :style="{ background: tab.color }"></view>
- </view>
- </view>
- <view class="section section-chart">
- <RadarChart :dimensions="currentDimensions" :scores="currentScores || []" :fillColor="currentColor" :childName="selectedMemberName" :avgScores="currentAvgScores || []" width="640" height="520" />
- <view class="chart-empty" v-if="chartIsEmpty">
- <text class="empty-text">{{ currentTabLabel }}数据待采集</text>
- <text class="empty-sub">完成测评或上传报告即可解锁{{ currentTabLabel }}数据</text>
- </view>
- </view>
- <view class="section section-dc-header">
- <view class="dc-title-row">
- <text class="dc-icon">🔍</text>
- <text class="dc-title">看见 · 健康数据中心</text>
- </view>
- </view>
- <view class="section section-data-collect">
- <ReportUploadCard
- title="上传报告"
- desc="体检报告 · 菌群检测 · 认知测评 · 心理测评 · 情绪打卡"
- :tags="['体检报告', '菌群检测', '认知测评', '心理测评', '情绪打卡']"
- @click="goPage('/pages/health/report-upload')" />
- <view class="data-card data-card-assessment">
- <view class="data-card-head">
- <text class="data-card-title">在线测评</text>
- <text class="data-card-subtitle">多维度自测评估</text>
- </view>
- <view v-for="quiz in quizzes" :key="quiz.code" class="quiz-item">
- <view class="quiz-info">
- <text class="quiz-icon">{{ quiz.icon }}</text>
- <text class="quiz-label">{{ quiz.label }}</text>
- </view>
- <view v-if="quiz.score" class="quiz-score">
- <text class="score-value">{{ quiz.score }}</text>
- <text class="score-unit">分</text>
- </view>
- <button v-else class="quiz-btn" @click.stop="goQuiz(quiz.code)">开始</button>
- </view>
- </view>
- <!-- 健康阅卷入口(HL-01):问卷式记录,多次填写以最后一次为准 -->
- <view class="data-card" @click="goHealthReview">
- <view class="data-card-icon">📝</view>
- <view class="data-card-info">
- <text class="data-card-title">健康阅卷</text>
- <text class="data-card-desc">逐项填写健康问卷 · 多次填写保留历史记录</text>
- </view>
- <text class="data-card-arrow">›</text>
- </view>
- </view>
- <view class="section section-data-view">
- <view class="section-header">
- <text class="section-title">最近记录</text>
- <text class="section-more" @click="goPage('/pages/health/report-list')">查看全部 ›</text>
- </view>
- <view v-if="reports.length > 0">
- <view class="report-card" v-for="(report, idx) in reports.slice(0, 3)" :key="idx" @click="goReportDetail(report)">
- <view class="report-type-badge" :class="'badge-' + _reportTypeClass(report.reportType)">{{ _reportTypeLabel(report.reportType) }}</view>
- <view class="report-info">
- <text class="report-name">{{ report.childName || report.personName || '健康报告' }}</text>
- <text class="report-meta">{{ _formatReportDate(report.reportDate) }}{{ report.gutType ? ' · ' + report.gutType : '' }}</text>
- </view>
- <view class="report-score-wrap">
- <text v-if="report.overallScore != null" class="report-score">{{ report.overallScore }}</text>
- <text class="report-status" :class="'status-' + _statusClass(report.status)">{{ report.status === 'resolved' ? '已解析' : '待确认' }}</text>
- </view>
- <text class="report-arrow">›</text>
- </view>
- </view>
- <view v-else class="empty-hint">
- <text class="empty-text">暂无报告和测评结果</text>
- <text class="empty-sub">上传报告或完成测评,开始记录你的健康</text>
- </view>
- </view>
- <view class="section section-plan">
- <view class="plan-card">
- <view class="plan-head">
- <text class="plan-title">📋 健康方案</text>
- <button class="plan-btn" @click="goPlanSummary">{{ lastPlan ? '查看方案' : '生成新方案' }}</button>
- </view>
- <text v-if="lastPlan" class="plan-goal">{{ lastPlan }}</text>
- <text v-else class="plan-hint">选维度 + 选成员 + 设定目标 → 生成</text>
- </view>
- </view>
- <!-- 推荐阅读 -->
- <view class="section">
- <view class="section-header">
- <text class="section-title">📖 推荐阅读</text>
- <text class="section-more" @click="goMoreArticles">更多 ›</text>
- </view>
- <ArticleFeed :articles="healthArticles" @articleClick="goArticleDetail" />
- </view>
- </block>
- </view>
- </template>
- <script>
- import { BrandColors } from '../../utils/brand-colors.js'
- import LoginGuideCard from '../../components/LoginGuideCard.vue'
- import RadarChart from '../../components/RadarChart.vue'
- import ArticleFeed from '../../components/ArticleFeed.vue'
- import ReportUploadCard from '../../components/report-upload-card.vue'
- import { parseDate } from '../../utils/format.js'
- import { ensureDimensionRegistry, getRadarConfig, isRegistryReady, WEALTH_CHILD_LABEL } from '../../composables/useDimensionRegistry.js'
- import fontScaleMixin from '@/mixins/font-scale.js'
- import shareMixin from '../../components/share-mixin.js'
- export default {
- mixins: [fontScaleMixin, shareMixin],
- components: { LoginGuideCard, RadarChart, ArticleFeed, ReportUploadCard },
- data() {
- return {
- bodyColor: BrandColors.body,
- wisdomColor: BrandColors.wisdom,
- isLoggedIn: !!uni.getStorageSync('token'),
- currentTab: 'body',
- selectedMemberName: '',
- selectedMemberId: '',
- reports: [],
- lastPlan: '',
- lastPlanId: null,
- healthArticles: [],
- hasAiQHistory: false,
- pendingSurveys: [],
- tabs: [
- { code: 'body', label: '健康', icon: '🟠', color: BrandColors.body },
- { code: 'cognitive', label: '认知', icon: '🧠', color: BrandColors.wisdom },
- { code: 'wealth', label: '财富', icon: '💧', color: BrandColors.wealth },
- { code: 'relationship', label: '社会性', icon: '🤝', color: BrandColors.success },
- { code: 'mental', label: '心理', icon: '💖', color: BrandColors.mind }
- ],
- quizzes: [
- { code: 'cognitive', label: '认知能力测评', icon: '🧠', score: null },
- { code: 'mental', label: '心理健康测评', icon: '💖', score: null },
- { code: 'relationship', label: '关系质量测评', icon: '🤝', score: null }
- ],
- // 真实数据缓存
- bodyData: null,
- cognitiveData: null,
- cognitiveFamilyData: [],
- emiData: null,
- emiFamilyData: [],
- relationshipData: [],
- energySandbox: null,
- wealthDetail: null,
- childrenList: [],
- relationshipEmpty: false,
- // 登录浮层打开标志(打开期间隐藏演示雷达,避免原生 canvas 盖在浮层之上)
- loginSheetVisible: false,
- // 统一维度注册中心是否就绪(成功取到 tree 后由 ensureDimensionRegistry 置位)
- // 未就绪时主页雷达回落硬编码兜底,保证后端未上线 / 接口异常时页面不崩
- registryReady: false
- }
- },
- computed: {
- currentTabLabel: function() {
- var tab = this.tabs.filter(function(t) { return t.code === this.currentTab }.bind(this))[0]
- return tab ? tab.label : ''
- },
- currentColor: function() {
- var tab = this.tabs.filter(function(t) { return t.code === this.currentTab }.bind(this))[0]
- return tab ? tab.color : BrandColors.body
- },
- currentDimensions: function() {
- // 配置驱动:从统一维度注册中心 tree 取该 tab 根节点的 children 作为维度清单
- var config = getRadarConfig(this.currentTab)
- if (this.registryReady && config && config.length > 0) {
- var isChild = !!uni.getStorageSync('currentChildId')
- var self = this
- return config.map(function(c) {
- var label = c.label
- // 财富子维度在「成员(儿童)」语境下使用更贴近儿童的文案(与改造前字面量一致)
- if (self.currentTab === 'wealth' && isChild && WEALTH_CHILD_LABEL[c.code]) {
- label = WEALTH_CHILD_LABEL[c.code]
- }
- // label 供 RadarChart 画维度名;key 供(若有)点击透传;code 保留注册中心维度码
- return { label: label, key: c.code, code: c.code }
- })
- }
- // 过渡兜底:注册中心未就绪或某根无子维 → 回落现有硬编码清单(后端未上线 / 接口异常时页面不崩)
- return this._fallbackDimensions(this.currentTab)
- },
- currentScores: function() {
- if (this.chartIsEmpty) {
- var dims = this.currentDimensions, scores = []
- for (var i = 0; i < dims.length; i++) scores.push(0)
- return scores
- }
- // 配置驱动:与 currentDimensions 同源同序遍历注册中心配置,按 scoreField 取分
- var config = getRadarConfig(this.currentTab)
- if (this.registryReady && config && config.length > 0) {
- var self = this
- return config.map(function(c) {
- return self._readRegistryScore(self.currentTab, c.code, c.scoreField)
- })
- }
- // 过渡兜底:注册中心未就绪 → 回落现有硬编码取分逻辑(与改造前一致)
- return this._fallbackScores(this.currentTab)
- },
- currentAvgScores: function() {
- if (this.chartIsEmpty) return []
- if (this.currentTab === 'cognitive' && this.cognitiveFamilyData.length > 0) {
- var keys = ['memoryScore','attentionScore','logicScore','spatialScore','perceptionScore','focusScore','processingSpeedScore']
- var avgs = []
- for (var k = 0; k < keys.length; k++) {
- var sum = 0
- for (var i = 0; i < this.cognitiveFamilyData.length; i++) {
- var v = this.cognitiveFamilyData[i][keys[k]]
- if (typeof v === 'number' && v > 0) sum += v
- }
- avgs.push(Math.round(sum / this.cognitiveFamilyData.length))
- }
- return avgs
- }
- if (this.currentTab === 'mental' && this.emiFamilyData.length > 0) {
- var keys2 = ['opennessScore','conscientiousnessScore','extraversionScore','agreeablenessScore','neuroticismScore','driveAutonomy','driveCompetence','driveRelatedness','emotionStability','selfConceptOverall']
- var avgs2 = []
- for (var k2 = 0; k2 < keys2.length; k2++) {
- var sum2 = 0
- for (var i2 = 0; i2 < this.emiFamilyData.length; i2++) {
- var v2 = this.emiFamilyData[i2][keys2[k2]]
- if (typeof v2 === 'number' && v2 > 0) sum2 += v2
- }
- avgs2.push(Math.round(sum2 / this.emiFamilyData.length))
- }
- return avgs2
- }
- if (this.currentTab === 'relationship' && this.relationshipData.length > 0) {
- return [this._relScore('trustScore'), this._relScore('intimacyScore'), this._relScore('communicationScore'), this._relScore('totalScore'), 0]
- }
- if (this.currentTab === 'wealth' && this.wealthDetail) {
- var d = this.wealthDetail
- return [d.wealthSkill || 0, d.wealthAltruism || 0, d.wealthIncome || 0, d.wealthFx || 0]
- }
- return []
- },
- chartIsEmpty: function() {
- if (this.currentTab === 'body') return !this.bodyData || !this.bodyData.dimensions || this.bodyData.dimensions.length === 0
- if (this.currentTab === 'cognitive') return !this.cognitiveData || !this.cognitiveData.overallScore
- if (this.currentTab === 'mental') return !this.emiData || !this.emiData.overallScore
- if (this.currentTab === 'relationship') return !this.relationshipData || this.relationshipData.length === 0
- if (this.currentTab === 'wealth') return !this.wealthDetail
- var quiz = this.quizzes.filter(function(q) { return q.code === this.currentTab }.bind(this))[0]
- return !(quiz && quiz.score)
- },
- // ── 访客态示例雷达(统一维度体系):维度清单按注册中心配置取,无配置显示空态引导 ──
- guestBodyDims: function() {
- return this._guestRadarDims('body')
- },
- guestBodyScores: function() {
- return this._guestDemoScores(this.guestBodyDims)
- },
- guestCogDims: function() {
- return this._guestRadarDims('cognitive')
- },
- guestCogScores: function() {
- return this._guestDemoScores(this.guestCogDims)
- },
- guestHasDemoConfig: function() {
- return this.guestBodyDims.length > 0 || this.guestCogDims.length > 0
- }
- },
- onShow() {
- this.isLoggedIn = !!uni.getStorageSync('token')
- if (this.isLoggedIn) {
- var stored = uni.getStorageSync('currentChildId') || uni.getStorageSync('currentMemberId') || ''
- if (stored) {
- var n = parseInt(stored, 10)
- this.selectedMemberId = isNaN(n) ? stored : n
- this.selectedMemberName = uni.getStorageSync('currentChildName') || '成员'
- }
- this.loadHealthData()
- this.loadPlanList()
- this.loadPendingSurveys()
- // 触发统一维度注册中心树拉取(主页雷达配置驱动取数;失败则回落硬编码兜底)
- var self = this
- ensureDimensionRegistry().then(function() {
- self.registryReady = isRegistryReady()
- }).catch(function() {
- self.registryReady = false
- })
- } else {
- this.pendingSurveys = []
- // 访客态:示例雷达同样按注册中心配置渲染(无配置显示空态引导)
- var self = this
- ensureDimensionRegistry().then(function() {
- self.registryReady = isRegistryReady()
- }).catch(function() {
- self.registryReady = false
- })
- }
- },
- methods: {
- _cognitiveScore: function(key) {
- if (!this.cognitiveData) return 0
- var v = this.cognitiveData[key]
- return (typeof v === 'number' && v > 0) ? v : 0
- },
- _emiScore: function(key) {
- if (!this.emiData) return 0
- var v = this.emiData[key]
- return (typeof v === 'number' && v > 0) ? v : 0
- },
- _relScore: function(key) {
- if (!this.relationshipData || this.relationshipData.length === 0) return 0
- var total = 0, count = 0
- for (var i = 0; i < this.relationshipData.length; i++) {
- var item = this.relationshipData[i]
- if (item[key] != null) { total += Number(item[key]); count++ }
- }
- return count > 0 ? Math.round(total / count) : 0
- },
- _wealthScore: function(key) {
- if (!this.energySandbox) return 0
- var v = this.energySandbox[key]
- return (typeof v === 'number' && v > 0) ? v : 0
- },
- /**
- * 过渡兜底:返回某 tab 的硬编码维度清单(与改造前字面量一致)。
- * 仅当注册中心未就绪时使用,保证后端未上线 / 接口异常时页面不崩。
- * @param {string} tab
- * @returns {Array<{label:string,key:string}>}
- */
- _fallbackDimensions: function(tab) {
- if (tab === 'cognitive') {
- return [{ label:'记忆力',key:'memory'},{ label:'注意力',key:'attention'},{ label:'逻辑推理',key:'logic'},{ label:'空间想象',key:'spatial'},{ label:'感知能力',key:'perception'},{ label:'专注力',key:'focus'},{ label:'加工速度',key:'processingSpeed' }]
- }
- if (tab === 'mental') {
- return [{ label:'开放性',key:'openness'},{ label:'尽责性',key:'conscientiousness'},{ label:'外向性',key:'extraversion'},{ label:'宜人性',key:'agreeableness'},{ label:'神经质',key:'neuroticism'},{ label:'自主性',key:'driveAutonomy'},{ label:'胜任感',key:'driveCompetence'},{ label:'归属感',key:'driveRelatedness'},{ label:'情绪稳定性',key:'emotionStability'},{ label:'自我概念',key:'selfConceptOverall' }]
- }
- if (tab === 'relationship') {
- return [{ label:'亲子信任',key:'parentTrust'},{ label:'亲子亲密度',key:'parentIntimacy'},{ label:'沟通质量',key:'communication'},{ label:'关系健康度',key:'healthStatus'},{ label:'最近互动',key:'lastInteraction' }]
- }
- if (tab === 'wealth') {
- var isChild = !!uni.getStorageSync('currentChildId')
- if (isChild) {
- return [{ label:'学业能力',key:'skill'},{ label:'利他贡献',key:'altruism'},{ label:'积分积累',key:'income'},{ label:'财务素养',key:'fx' }]
- }
- return [{ label:'个人能力',key:'skill'},{ label:'利他贡献',key:'altruism'},{ label:'CF值积累',key:'income'},{ label:'财务素养',key:'fx' }]
- }
- return [{ label:'生长发育',key:'growth'},{ label:'睡眠质量',key:'sleep'},{ label:'视力健康',key:'vision'},{ label:'免疫力',key:'immunity'},{ label:'营养均衡',key:'nutrition'},{ label:'肠胃健康',key:'gut'},{ label:'运动活力',key:'exercise' }]
- },
- /**
- * 过渡兜底:返回某 tab 的硬编码取分(与改造前字面量一致)。
- * @param {string} tab
- * @returns {Array<number>}
- */
- _fallbackScores: function(tab) {
- if (tab === 'cognitive') {
- return [
- this._cognitiveScore('memoryScore'),
- this._cognitiveScore('attentionScore'),
- this._cognitiveScore('logicScore'),
- this._cognitiveScore('spatialScore'),
- this._cognitiveScore('perceptionScore'),
- this._cognitiveScore('focusScore'),
- this._cognitiveScore('processingSpeedScore')
- ]
- }
- if (tab === 'mental') {
- return [
- this._emiScore('opennessScore'),
- this._emiScore('conscientiousnessScore'),
- this._emiScore('extraversionScore'),
- this._emiScore('agreeablenessScore'),
- this._emiScore('neuroticismScore'),
- this._emiScore('driveAutonomy'),
- this._emiScore('driveCompetence'),
- this._emiScore('driveRelatedness'),
- this._emiScore('emotionStability'),
- this._emiScore('selfConceptOverall')
- ]
- }
- if (tab === 'relationship') {
- return [
- this._relScore('trustScore'),
- this._relScore('intimacyScore'),
- this._relScore('communicationScore'),
- this._relScore('totalScore'),
- 0
- ]
- }
- if (tab === 'wealth') {
- var d = this.wealthDetail
- if (!d) return [0, 0, 0, 0]
- return [d.wealthSkill || 0, d.wealthAltruism || 0, d.wealthIncome || 0, d.wealthFx || 0]
- }
- // body: 从 API 真实维度数据取分(无真实数据时由 chartIsEmpty 走零值空态,不再回落硬编码示例分)
- if (this.bodyData && this.bodyData.dimensions && this.bodyData.dimensions.length > 0) {
- return this.bodyData.dimensions.map(function(dItem) { return Number(dItem.score) || 0 })
- }
- return []
- },
- /**
- * 配置驱动取分:按 tab 与注册中心节点的 scoreField / code 从对应分数包取分。
- * 包缺失或值非数字 → 0(保持现有零填充行为)。与改造前取分口径逐一对齐。
- * @param {string} tab
- * @param {string} code 注册中心节点 code(body 类为 body.growth)
- * @param {string} scoreField legacyAlias 首元素(取分字段名)
- * @returns {number}
- */
- _readRegistryScore: function(tab, code, scoreField) {
- if (tab === 'body') {
- // body 维度按 dimension 字段匹配:兼容两种格式——
- // ① 当前后端 /api/dimension/overview 仍返回 legacy 码(growth/sleep/...,见 DimensionScoreServiceImpl.DIMENSIONS),
- // 此时与 legacyAlias 首元素(scoreField)匹配;
- // ② 后续后端迁移为统一码(body.growth/...)后,与注册中心节点 code 匹配。
- var dims = this.bodyData && this.bodyData.dimensions
- if (!dims || !dims.length) return 0
- for (var i = 0; i < dims.length; i++) {
- var dItem = dims[i]
- if (dItem && (dItem.dimension === code || dItem.dimension === scoreField)) {
- var v = Number(dItem.score)
- return (typeof v === 'number' && !isNaN(v)) ? v : 0
- }
- }
- return 0
- }
- if (tab === 'cognitive') {
- if (!this.cognitiveData) return 0
- var cv = this.cognitiveData[scoreField]
- return (typeof cv === 'number' && cv > 0) ? cv : 0
- }
- if (tab === 'mental') {
- if (!this.emiData) return 0
- var mv = this.emiData[scoreField]
- return (typeof mv === 'number' && mv > 0) ? mv : 0
- }
- if (tab === 'relationship') {
- // 最近互动是日期字段,恒为 0(与改造前字面量 0 一致)
- if (scoreField === 'lastInteractionAt') return 0
- if (!this.relationshipData || this.relationshipData.length === 0) return 0
- var total = 0, count = 0
- for (var r = 0; r < this.relationshipData.length; r++) {
- var item = this.relationshipData[r]
- if (item && item[scoreField] != null) {
- total += Number(item[scoreField])
- count++
- }
- }
- return count > 0 ? Math.round(total / count) : 0
- }
- if (tab === 'wealth') {
- var wd = this.wealthDetail
- if (!wd) return 0
- var wv = wd[scoreField]
- return (typeof wv === 'number' && wv > 0) ? wv : 0
- }
- return 0
- },
- /**
- * 访客演示雷达维度清单:按注册中心配置取(body→body 根、cognitive→wisdom 根),
- * 未就绪或无配置返回空数组(模板据此渲染空态引导文案)。
- * @param {string} tab
- * @returns {Array<{label:string,key:string,code:string}>}
- */
- _guestRadarDims: function(tab) {
- var config = getRadarConfig(tab)
- if (!this.registryReady || !config || config.length === 0) return []
- var dims = []
- for (var i = 0; i < config.length; i++) {
- var c = config[i]
- dims.push({ label: c.label, key: c.code, code: c.code })
- }
- return dims
- },
- /**
- * 访客演示雷达示例分数:按维度数量生成确定性示例分(非字面量数组),
- * 仅用于示例形状演示,无真实数据含义。替代原访客示例的硬编码分数数组。
- * @param {Array} dims
- * @returns {Array<number>}
- */
- _guestDemoScores: function(dims) {
- var scores = []
- for (var i = 0; i < dims.length; i++) {
- scores.push(72 - (i % 3) * 4)
- }
- return scores
- },
- switchTab: function(code) { this.currentTab = code },
- goPage: function(url) { uni.navigateTo({ url: url }) },
- // 登录浮层打开/关闭(隐藏演示雷达,规避原生 canvas 层级高于浮层的问题)
- onLoginSheetOpen: function() { this.loginSheetVisible = true },
- onLoginSheetClose: function() { this.loginSheetVisible = false },
- // 登录成功:刷新登录态数据(镜像 onShow 已登录分支)
- onLoginSuccess: function() {
- // 未登录点击「15题五维健康自检」→ 登录成功后续接跳转调研问卷
- if (this._pendingSurveyUrl) {
- var pendingUrl = this._pendingSurveyUrl
- this._pendingSurveyUrl = ''
- uni.navigateTo({ url: pendingUrl })
- return
- }
- this.isLoggedIn = true
- var stored = uni.getStorageSync('currentChildId') || uni.getStorageSync('currentMemberId') || ''
- if (stored) {
- var n = parseInt(stored, 10)
- this.selectedMemberId = isNaN(n) ? stored : n
- this.selectedMemberName = uni.getStorageSync('currentChildName') || '成员'
- }
- this.loadHealthData()
- this.loadPlanList()
- this.loadPendingSurveys()
- },
- goQuiz: function(code) {
- var url = '/pages/body-detail/dimension-questionnaire?dim=' + code
- if (this.selectedMemberId) url += '&memberId=' + this.selectedMemberId
- uni.navigateTo({ url: url })
- },
- goReportDetail: function(report) {
- if (!report || !report.id) return
- var type = report.reportType || 'gut_flora'
- var url
- if (type === 'dan') {
- url = '/pages/dan-assessment/report-result?reportId=' + report.id
- } else if (type === 'gut_flora') {
- url = '/pages/health/gut-flora-detail?reportId=' + report.id
- } else {
- url = '/pages/health/report-detail?reportType=' + type + '&reportId=' + report.id
- }
- uni.navigateTo({ url: url })
- },
- _reportTypeLabel: function(type) {
- var map = { gut_flora: '肠道', physical_exam: '体检', tongue: '舌诊', blood: '血液' }
- return map[type] || '健康报告'
- },
- _reportTypeClass: function(type) {
- var map = { gut_flora: 'gut', physical_exam: 'exam', tongue: 'tongue', blood: 'blood' }
- return map[type] || 'default'
- },
- _statusClass: function(status) {
- return status === 'resolved' ? 'resolved' : 'pending'
- },
- goSelfTest: function() {
- // 15题五维健康自检对应健康调研问卷,需登录后才能填写:未登录先弹出登录浮层
- var url = '/pages/health/health-survey?modules=basic,status,diet,disease,bowel,sleep,med,allergy'
- if (!uni.getStorageSync('token')) {
- this._pendingSurveyUrl = url
- this.openLoginSheet({ redirect: url })
- return
- }
- uni.navigateTo({ url: url })
- },
- goHealthReview: function() {
- // 健康阅卷(HL-01):问卷式记录,多次填写以最后一次为准;需登录后填写
- var url = '/pages/health/health-survey?source=health_review&entry=health_review'
- if (!uni.getStorageSync('token')) {
- this._pendingSurveyUrl = url
- this.openLoginSheet({ redirect: url })
- return
- }
- uni.navigateTo({ url: url })
- },
- // 拉取本期待填调研(服务端按 cycle_type 计算当前周期)
- loadPendingSurveys: function() {
- var self = this
- var api = require('../../utils/api.js')
- api.getSurveyStatus({}).then(function(res) {
- var list = (res && res.code === 200 && res.data) ? res.data : []
- var pending = []
- for (var i = 0; i < list.length; i++) {
- if (list[i] && list[i].status === 'pending') pending.push(list[i])
- }
- self.pendingSurveys = pending
- }).catch(function() { self.pendingSurveys = [] })
- },
- cycleLabel: function(cycleType) {
- var map = { weekly: '每周调研', biweekly: '双周调研', monthly: '每月调研' }
- return map[cycleType] || '定期调研'
- },
- goSurveyFill: function(item) {
- if (!item || !item.templateId) return
- var url = '/pages/health/survey-questionnaire?templateId=' + item.templateId +
- '&templateTitle=' + encodeURIComponent(item.title || '定期调研') +
- '&templateDimension=' + encodeURIComponent(item.dimension || '') +
- '&periodStart=' + (item.periodStart || '') +
- '&periodEnd=' + (item.periodEnd || '')
- uni.navigateTo({ url: url })
- },
- goPlanSummary: function() {
- uni.navigateTo({ url: '/pages/health/plan-list' })
- },
- loadHealthData: function() {
- var self = this
- try {
- var api = require('../../utils/api.js')
- var memberId = uni.getStorageSync('currentChildId') || uni.getStorageSync('currentMemberId') || uni.getStorageSync('userId') || ''
- // 最近记录:展示家庭所有成员的最近报告——不传 memberId,后端返回当前家庭全部报告
- // (按报告日期倒序)取最近 3 条,卡片通过 childName/personName 区分成员。
- // 下方维度/认知/心理等数据仍按当前选中成员(memberId)加载,不受此影响
- api.getReportList('', 3).then(function(res) {
- if (res.code === 200 && res.data) {
- var list = Array.isArray(res.data) ? res.data : (res.data.list || [])
- self.reports = list
- }
- }).catch(function() {})
- // 身体七维概览
- if (memberId) {
- api.getDimensionOverview({ memberId: memberId }).then(function(res) {
- if (res.code === 200 && res.data) self.bodyData = res.data
- }).catch(function() {})
- }
- // 文章
- api.getFeaturedArticles({ size: 3, dimensionCode: 'body' }).then(function(res) {
- if (res.code === 200 && res.data) {
- var list = Array.isArray(res.data) ? res.data : (res.data.records || [])
- self.healthArticles = list.slice(0, 3) || []
- }
- }).catch(function() {})
- // 认知测评得分
- if (memberId) {
- api.getCognitiveChildScores(memberId).then(function(res) {
- if (res.code === 200) self.cognitiveData = res.data || null
- }).catch(function() {})
- api.getCognitiveFamilyScores().then(function(res) {
- if (res.code === 200 && Array.isArray(res.data)) self.cognitiveFamilyData = res.data
- }).catch(function() {})
- }
- // EMI心理报告
- if (memberId) {
- api.getEmiReport(memberId).then(function(res) {
- if (res.code === 200) self.emiData = res.data || null
- }).catch(function() {})
- }
- // 关系质量评分
- api.getRelationshipScores().then(function(res) {
- if (res.code === 200 && Array.isArray(res.data) && res.data.length > 0) {
- self.relationshipData = res.data
- self.relationshipEmpty = false
- } else {
- self.relationshipEmpty = true
- }
- }).catch(function() { self.relationshipEmpty = true })
- // 财富子维度:沙盘里本人用 userId,成员用 family_members.id,不能混用 currentMemberId
- var childId = uni.getStorageSync('currentChildId')
- var wealthMemberId = childId || uni.getStorageSync('userId')
- var wealthMemberType = childId ? 'child' : 'parent'
- if (wealthMemberId) {
- api.getWealthDetail(wealthMemberId, wealthMemberType).then(function(res) {
- if (res.code === 200 && res.data) {
- self.wealthDetail = res.data
- }
- }).catch(function() {})
- }
- } catch (e) { console.error('加载健康数据失败', e) }
- },
- loadPlanList: function() {
- var self = this
- var api = require('../../utils/api.js')
- api.getHealthPlanList({}).then(function(res) {
- if (res && res.code === 200 && res.data) {
- var list = res.data.list || res.data
- var plans = Array.isArray(list) ? list : []
- if (plans.length > 0) {
- self.lastPlan = plans[0].goal || plans[0].memberName || '已有健康方案'
- self.lastPlanId = plans[0].id || null
- } else {
- self.lastPlan = ''
- self.lastPlanId = null
- }
- } else {
- self.lastPlan = ''
- self.lastPlanId = null
- }
- }).catch(function() {
- self.lastPlan = ''
- self.lastPlanId = null
- })
- },
- goArticleDetail: function(article) {
- var id = article && article.id || article
- uni.navigateTo({ url: '/pages/article-center/article-detail?id=' + id })
- },
- goMoreArticles: function() {
- uni.navigateTo({ url: '/pages/article-center/index?dimension=body' })
- },
- _formatReportDate: function(dateStr) {
- if (!dateStr) return ''
- // 后端返回 ISO 8601 (2026-08-15T14:30:00) 或 yyyy-MM-dd,统一截取前10位
- var s = String(dateStr)
- return s.length >= 10 ? s.substring(0, 10) : s
- },
- }
- }
- </script>
- <style scoped lang="scss">
- // 本页无色:全局令牌全覆盖($c-fill-warm $facade-fill-page 已提全局 $facade-fill-page)
- .container { background: $facade-fill-page; min-height: 100vh; padding-bottom: calc(160rpx + env(safe-area-inset-bottom)); }
- .section { margin: 16rpx 24rpx; }
- .tab-bar { display: flex; background: $app-surface; margin: 0 24rpx 16rpx; border-radius: 16rpx; padding: 8rpx; box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.06); }
- .tab-item { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 12rpx 0; position: relative; border-radius: 16rpx; }
- .tab-item.active { background: $facade-brand-tint; }
- .tab-icon { font-size: calc(32rpx * var(--font-scale, 1)); margin-bottom: 4rpx; }
- .tab-label { font-size: calc(26rpx * var(--font-scale, 1)); color: $facade-text-body; font-weight: 500; }
- .tab-item.active .tab-label { color: $facade-text-strong; font-weight: bold; }
- .tab-underline { width: 40rpx; height: 4rpx; border-radius: 8rpx; margin-top: 6rpx; }
- .section-chart { position: relative; margin: 0 24rpx 16rpx; }
- .chart-empty { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); text-align: center; z-index: 3; background: rgba($app-surface, 0.85); border-radius: 16rpx; padding: 20rpx $uni-space-page; }
- .chart-empty .empty-text { font-size: calc(28rpx * var(--font-scale, 1)); color: $facade-text-strong; font-weight: 500; display: block; }
- .chart-empty .empty-sub { font-size: calc(22rpx * var(--font-scale, 1)); color: $facade-text-muted; display: block; margin-top: 4rpx; }
- .section-dc-header { margin: 20rpx 24rpx 8rpx; }
- .dc-title-row { display: flex; align-items: center; }
- .dc-icon { font-size: calc(32rpx * var(--font-scale, 1)); margin-right: 8rpx; }
- .dc-title { font-size: calc(32rpx * var(--font-scale, 1)); font-weight: bold; color: $facade-text-strong; }
- .section-data-collect { margin: 8rpx 24rpx; }
- .data-card { display: flex; align-items: center; background: $app-surface; border-radius: 24rpx; padding: 24rpx; margin-bottom: 12rpx; box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.06); }
- .data-card-icon { width: 88rpx; height: 88rpx; border-radius: 24rpx; display: flex; align-items: center; justify-content: center; margin-right: 20rpx; font-size: calc(40rpx * var(--font-scale, 1)); }
- .data-card-info { flex: 1; }
- .data-card-title { font-size: calc(28rpx * var(--font-scale, 1)); font-weight: bold; color: $facade-text-strong; display: block; margin-bottom: 6rpx; }
- .data-card-desc { font-size: calc(22rpx * var(--font-scale, 1)); color: $facade-text-muted; }
- .data-card-arrow { font-size: calc(36rpx * var(--font-scale, 1)); color: $facade-text-ghost; }
- .data-card-assessment { flex-direction: column; align-items: stretch; padding: 24rpx; }
- .data-card-head { display: flex; align-items: center; margin-bottom: 16rpx; }
- .data-card-subtitle { font-size: calc(22rpx * var(--font-scale, 1)); color: $facade-text-muted; margin-left: 12rpx; }
- .quiz-item { display: flex; align-items: center; padding: 16rpx 0; border-top: 1rpx solid $facade-fill; }
- .quiz-item:first-of-type { border-top: none; }
- .quiz-info { display: flex; align-items: center; flex: 1; }
- .quiz-icon { font-size: calc(36rpx * var(--font-scale, 1)); margin-right: 16rpx; }
- .quiz-label { font-size: calc(28rpx * var(--font-scale, 1)); color: $facade-text-strong; }
- .quiz-score { display: flex; align-items: baseline; margin-right: 16rpx; }
- .score-value { font-size: calc(36rpx * var(--font-scale, 1)); font-weight: bold; color: $brand-primary; }
- .score-unit { font-size: calc(22rpx * var(--font-scale, 1)); color: $facade-text-muted; margin-left: 4rpx; }
- .quiz-btn { background: $brand-primary; color: $app-surface; font-size: calc(24rpx * var(--font-scale, 1)); border: none; border-radius: 24rpx; padding: 10rpx $uni-space-page; height: 56rpx; line-height: 36rpx; margin: 0; }
- .section-data-view { margin: 16rpx 24rpx; }
- .section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12rpx; }
- .section-title { font-size: calc(28rpx * var(--font-scale, 1)); font-weight: bold; color: $facade-text-strong; }
- .section-more { font-size: calc(24rpx * var(--font-scale, 1)); color: $brand-primary; }
- .report-card { display: flex; align-items: center; background: $app-surface; border-radius: 16rpx; padding: 16rpx 20rpx; margin-bottom: 10rpx; }
- .report-type-badge { font-size: calc(20rpx * var(--font-scale, 1)); padding: 4rpx 12rpx; border-radius: 8rpx; margin-right: 12rpx; flex-shrink: 0; font-weight: 600; }
- .report-type-badge.badge-gut { background: rgba($brand-primary, 0.12); color: $brand-primary; }
- .report-type-badge.badge-exam { background: rgba($dim-wisdom, 0.12); color: $dim-wisdom; }
- .report-type-badge.badge-tongue { background: rgba($dim-action, 0.12); color: $dim-action; }
- .report-type-badge.badge-blood { background: rgba($status-danger, 0.12); color: $status-danger; }
- .report-type-badge.badge-default { background: rgba($facade-text-slate, 0.12); color: $facade-text-slate; }
- .report-info { flex: 1; min-width: 0; }
- .report-name { font-size: calc(26rpx * var(--font-scale, 1)); color: $facade-text-strong; font-weight: 600; display: block; margin-bottom: 4rpx; }
- .report-meta { font-size: calc(20rpx * var(--font-scale, 1)); color: $facade-text-muted; display: block; }
- .report-score-wrap { display: flex; flex-direction: column; align-items: flex-end; margin-right: 8rpx; flex-shrink: 0; }
- .report-score { font-size: calc(32rpx * var(--font-scale, 1)); font-weight: bold; color: $brand-primary; line-height: 1; }
- .report-status { font-size: calc(20rpx * var(--font-scale, 1)); margin-top: 4rpx; }
- .report-status.status-resolved { color: $dim-action; }
- .report-status.status-pending { color: $dim-wealth; }
- .report-arrow { font-size: calc(28rpx * var(--font-scale, 1)); color: $facade-text-ghost; }
- .empty-hint { text-align: center; padding: $uni-space-lg 0; background: $app-surface; border-radius: 16rpx; }
- .empty-hint .empty-text { font-size: calc(26rpx * var(--font-scale, 1)); color: $facade-text-muted; display: block; }
- .empty-hint .empty-sub { font-size: calc(22rpx * var(--font-scale, 1)); color: $facade-text-ghost; display: block; margin-top: 6rpx; }
- .section-plan { margin: 8rpx 24rpx 16rpx; }
- .plan-card { background: $app-surface; border-radius: 24rpx; padding: 24rpx; box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.06); }
- .plan-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12rpx; }
- .plan-title { font-size: calc(28rpx * var(--font-scale, 1)); font-weight: bold; color: $facade-text-strong; }
- .plan-btn { background: linear-gradient(135deg, $brand-primary, $brand-primary-light); color: $app-surface; font-size: calc(24rpx * var(--font-scale, 1)); border: none; border-radius: 24rpx; padding: 10rpx 28rpx; height: 56rpx; line-height: 36rpx; margin: 0; }
- .plan-goal { font-size: calc(24rpx * var(--font-scale, 1)); color: $facade-text-body; line-height: 1.5; display: block; margin-top: 12rpx; }
- .plan-hint { font-size: calc(22rpx * var(--font-scale, 1)); color: $facade-text-muted; display: block; margin-top: 12rpx; }
- /* ===== 访客态(新暖调配色 · 令牌化) ===== */
- $gh-white: str-slice('#{$app-surface}', 2);
- .gh-page { background: $app-bg; min-height: 100vh; padding: 28rpx 0 40rpx; }
- /* 页面头 */
- .gh-head { margin: 0 32rpx 24rpx; display: flex; flex-direction: column; }
- .gh-eyebrow { font-size: calc(22rpx * var(--font-scale, 1)); font-weight: 600; color: $brand-primary; letter-spacing: 2rpx; }
- .gh-title { font-size: calc(46rpx * var(--font-scale, 1)); font-weight: 700; color: $facade-text-strong; line-height: 1.32; margin-top: 12rpx; }
- .gh-sub { font-size: calc(24rpx * var(--font-scale, 1)); color: $facade-text-body; line-height: 1.65; margin-top: 10rpx; }
- /* 痛点条 */
- .gh-pain { margin: 0 32rpx 24rpx; display: flex; flex-direction: row; flex-wrap: wrap; align-items: baseline; justify-content: space-between; }
- .gh-pain-quote { font-size: calc(30rpx * var(--font-scale, 1)); font-weight: 700; color: $brand-primary; }
- .gh-pain-desc { font-size: calc(24rpx * var(--font-scale, 1)); color: $facade-text-body; }
- /* 自检 hero CTA */
- .gh-cta { margin: 0 32rpx 24rpx; display: flex; flex-direction: row; align-items: center; padding: 28rpx; border-radius: 24rpx; background: linear-gradient(135deg, $brand-primary, $brand-primary-dark); box-shadow: 0 12rpx 32rpx rgba($brand-primary, 0.24); }
- .gh-cta:active { opacity: 0.9; }
- .gh-cta-ic {
- width: 88rpx; height: 88rpx; border-radius: 24rpx; flex-shrink: 0;
- background-color: rgba($app-surface, 0.18);
- background-repeat: no-repeat;
- background-position: center;
- background-size: 48rpx 48rpx;
- background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23#{$gh-white}' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M13 2 4 14h6l-1 8 9-12h-6l1-8z'/%3E%3C/svg%3E");
- }
- .gh-cta-info { flex: 1; min-width: 0; margin-left: 20rpx; display: flex; flex-direction: column; }
- .gh-cta-title { font-size: calc(30rpx * var(--font-scale, 1)); font-weight: 700; color: $app-surface; }
- .gh-cta-sub { font-size: calc(22rpx * var(--font-scale, 1)); color: rgba($app-surface, 0.82); margin-top: 6rpx; }
- .gh-chev { font-size: calc(36rpx * var(--font-scale, 1)); color: rgba($app-surface, 0.72); margin-left: 12rpx; }
- /* 待填调研 */
- .gh-pending { margin: 0 32rpx 20rpx; display: flex; flex-direction: row; align-items: center; padding: 24rpx; border-radius: 20rpx; background: $app-surface; border: 1rpx solid $app-border-subtle; }
- .gh-pending:active { opacity: 0.9; }
- .gh-pending-ic { width: 72rpx; height: 72rpx; border-radius: 20rpx; display: flex; flex-direction: row; align-items: center; justify-content: center; flex-shrink: 0; background: $dim-body-tint; }
- .gh-pending-glyph { font-size: calc(28rpx * var(--font-scale, 1)); font-weight: 700; color: $dim-body-deep; }
- .gh-pending-info { flex: 1; min-width: 0; margin-left: 20rpx; display: flex; flex-direction: column; }
- .gh-pending-title { font-size: calc(28rpx * var(--font-scale, 1)); font-weight: 600; color: $facade-text-strong; }
- .gh-pending-sub { font-size: calc(22rpx * var(--font-scale, 1)); color: $facade-text-body; margin-top: 6rpx; }
- .gh-pending-tag { flex-shrink: 0; margin-left: 12rpx; font-size: calc(20rpx * var(--font-scale, 1)); font-weight: 600; color: $brand-primary; background: rgba($brand-primary, 0.1); border-radius: 999rpx; padding: 6rpx 16rpx; }
- /* 演示雷达 */
- .gh-demo { margin: 0 32rpx 24rpx; background: $app-surface; border-radius: 24rpx; padding: 20rpx 12rpx 12rpx; border: 1rpx solid $app-border-subtle; }
- .gh-demo-block { margin-top: 12rpx; }
- .gh-demo-block:first-child { margin-top: 0; }
- .gh-demo-head { display: flex; flex-direction: row; align-items: center; justify-content: space-between; padding: 0 20rpx; margin: 12rpx 0 4rpx; }
- .gh-demo-name { font-size: calc(24rpx * var(--font-scale, 1)); font-weight: 600; color: $facade-text-strong; }
- .gh-demo-tag { font-size: calc(20rpx * var(--font-scale, 1)); color: $brand-primary; background: rgba($brand-primary, 0.1); border-radius: 8rpx; padding: 2rpx 12rpx; }
- .gh-demo-empty { padding: 72rpx 20rpx; display: flex; flex-direction: column; align-items: center; }
- .gh-demo-empty-text { font-size: calc(28rpx * var(--font-scale, 1)); color: $facade-text-strong; font-weight: 600; display: block; }
- .gh-demo-empty-sub { font-size: calc(22rpx * var(--font-scale, 1)); color: $facade-text-muted; display: block; margin-top: 10rpx; }
- /* 五维健康体系 */
- .gh-wuxing { margin: 0 32rpx 24rpx; background: $app-surface; border-radius: 24rpx; padding: 28rpx 24rpx; border: 1rpx solid $app-border-subtle; }
- .gh-wuxing-title { display: block; text-align: center; font-size: calc(30rpx * var(--font-scale, 1)); font-weight: 700; color: $facade-text-strong; line-height: 1.45; }
- .gh-wuxing-sub { display: block; text-align: center; font-size: calc(22rpx * var(--font-scale, 1)); color: $facade-text-body; line-height: 1.65; margin-top: 10rpx; }
- .gh-rel { margin-top: 24rpx; padding: 20rpx; border-radius: 20rpx; background: $app-bg; }
- .gh-rel-title { display: block; font-size: calc(24rpx * var(--font-scale, 1)); font-weight: 700; color: $facade-text-strong; margin-bottom: 12rpx; }
- .gh-chain { display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; }
- .gh-node { font-size: calc(22rpx * var(--font-scale, 1)); font-weight: 700; padding: 6rpx 14rpx; border-radius: 10rpx; }
- .gh-node-body { color: $dim-body-deep; background: $dim-body-tint; }
- .gh-node-wisdom { color: $dim-wisdom-deep; background: $dim-wisdom-tint; }
- .gh-node-wealth { color: $dim-wealth-deep; background: $dim-wealth-tint; }
- .gh-node-action { color: $dim-action-deep; background: $dim-action-tint; }
- .gh-node-mind { color: $dim-mind-deep; background: $dim-mind-tint; }
- .gh-arrow { font-size: calc(20rpx * var(--font-scale, 1)); color: $facade-text-ghost; margin: 0 6rpx; }
- .gh-op { font-size: calc(20rpx * var(--font-scale, 1)); color: $status-danger-deep; margin: 0 8rpx; }
- .gh-sep { font-size: calc(20rpx * var(--font-scale, 1)); color: $facade-text-ghost; margin: 0 8rpx; }
- .gh-rel-hint { display: block; font-size: calc(20rpx * var(--font-scale, 1)); color: $facade-text-body; line-height: 1.65; margin-top: 12rpx; }
- .gh-rows { margin-top: 24rpx; display: flex; flex-direction: column; }
- .gh-row { display: flex; flex-direction: row; align-items: center; padding: 20rpx 0; border-top: 1rpx solid $app-border-subtle; }
- .gh-row:first-child { border-top: none; padding-top: 4rpx; }
- .gh-row:active { opacity: 0.85; }
- .gh-ic { width: 76rpx; height: 76rpx; border-radius: 20rpx; display: flex; flex-direction: row; align-items: center; justify-content: center; flex-shrink: 0; }
- .gh-ic-body { background: $dim-body-tint; }
- .gh-ic-wisdom { background: $dim-wisdom-tint; }
- .gh-ic-wealth { background: $dim-wealth-tint; }
- .gh-ic-action { background: $dim-action-tint; }
- .gh-ic-mind { background: $dim-mind-tint; }
- .gh-glyph { font-size: calc(30rpx * var(--font-scale, 1)); font-weight: 700; }
- .gh-ic-body .gh-glyph { color: $dim-body-deep; }
- .gh-ic-wisdom .gh-glyph { color: $dim-wisdom-deep; }
- .gh-ic-wealth .gh-glyph { color: $dim-wealth-deep; }
- .gh-ic-action .gh-glyph { color: $dim-action-deep; }
- .gh-ic-mind .gh-glyph { color: $dim-mind-deep; }
- .gh-row-info { flex: 1; min-width: 0; margin-left: 20rpx; display: flex; flex-direction: column; }
- .gh-row-name { font-size: calc(28rpx * var(--font-scale, 1)); font-weight: 600; color: $facade-text-strong; }
- .gh-row-sub { font-size: calc(22rpx * var(--font-scale, 1)); color: $facade-text-body; line-height: 1.5; margin-top: 6rpx; }
- .gh-row-chev { font-size: calc(32rpx * var(--font-scale, 1)); color: $facade-text-ghost; margin-left: 12rpx; flex-shrink: 0; }
- .gh-guide { margin: 0 32rpx 8rpx; }
- </style>
|