Browse Source

ft(health-main): 健康页重排「极致简单」主行动落地(删营销残留 + 折叠华为健康)

删访客态营销残留:
- 删 gh-demo 双雷达示例块(模板 + guestBodyDims/guestBodyScores/guestCogDims/guestCogScores/guestHasDemoConfig
  计算 + _guestRadarDims/_guestDemoScores 方法 + gh-demo* CSS,一并清除死代码)
- 删 gh-wuxing 相生相克长文(gh-rel/gh-chain/gh-node/gh-arrow/gh-sep 模板与 CSS + 营销文案),
  改为紧凑「五维速览」5 行维度入口(身/智/富/行/心,点击进维度详情)
- 访客态 onShow 不再拉取维度注册中心(示例雷达已删,接口调用移除)

主行动前置(登录态数据中心,占首屏):
- 上传报告改为品牌紫 hero 大入口 + BasePrimaryButton(立即上传),置首位
- 保留 3 测评 + 健康阅卷为采集区主行动载体

健康问卷入口合并:
- 健康阅卷(登录态)与 15 题自检(访客态)语义合并,全页仅 2 个 health-survey 入口
  (各态单一问卷入口,避免同屏两个问卷)

华为健康卡折叠:
- 「运动手环 · 华为健康」独立卡折叠为「数据来源」二级入口(dataSourceOpen 默认收起,不占首屏),
  绑定/同步/撤销能力保留(mock 角标与合规说明不丢失)

压缩:
- 雷达 height 520→400rpx(让主行动进首屏)
- 最近记录/推荐阅读预览 3→2(模板 slice + 接口 size)
- 痛点条压缩为一行

契约测试:
- 新增 __tests__/pages/health-main/healthMain.redesign.contract.test.js(22 断言,源码静态契约)
- 全量 jest:6 失败套件与改前基线完全一致(已知 TDD-RED + RecipeNoFallback ENOENT),无回归;新增 22 项通过

仅改 pages/health-main/index.vue(1262→1157 行)+ 新增契约测试;未碰其他三页 / Base* 原语 / api.js / pages.json。
Agnes Agent 2 hours ago
parent
commit
848427d3ac

+ 214 - 0
cfc-frontend/__tests__/pages/health-main/healthMain.redesign.contract.test.js

@@ -0,0 +1,214 @@
+/**
+ * 契约级单测(TDD)—— 健康页重排「极致简单」(主行动 = 上传报告/测评)
+ *
+ * 溯源:
+ *   需求:team-lead 健康页重排目标结构(fae577b3b 品牌紫地基之上)——
+ *     ① 主行动 = 上传报告大入口 + 3 测评 + 健康阅卷,占首屏;
+ *     ② 内部 5 tab + 雷达保留(品牌锚点),雷达压缩让主行动进首屏;
+ *     ③ 游客态删营销残留:gh-demo 双雷达示例 + gh-wuxing 相生相克长文 → 紧凑五维速览 5 行;
+ *     ④ 健康阅卷 与 15 题自检 语义合并(各态单一问卷入口);
+ *     ⑤ 华为健康卡折叠为「数据来源」二级入口,不占首屏;
+ *     ⑥ 最近记录 / 健康方案 / 推荐阅读 预览 3→2;
+ *     ⑦ 痛点条压缩为一行。
+ *   设计:cfc-frontend/pages/health-main/index.vue(仅此 1 文件;禁碰其他三页 / Base* / api.js / pages.json)
+ *
+ * 说明:沿项目「源码静态契约」范式(对齐 __tests__/pages/index-home.quickCompleteOverdue.test.js),
+ * 只读真实源码断言结构,不 mount 巨型 index.vue。
+ */
+import fs from 'fs'
+import path from 'path'
+
+const PAGE_PATH = path.join(__dirname, '../../../pages/health-main/index.vue')
+
+function loadPage() {
+  const src = fs.readFileSync(PAGE_PATH, 'utf8')
+  const tplStart = src.indexOf('<template>')
+  const tplEnd = src.indexOf('</template>')
+  const scrStart = src.indexOf('<script>')
+  const scrEnd = src.indexOf('</script>')
+  const styStart = src.indexOf('<style')
+  const style = src.slice(styStart)
+  return {
+    src,
+    template: src.slice(tplStart, tplEnd),
+    script: src.slice(scrStart, scrEnd),
+    style
+  }
+}
+
+function count(haystack, needle) {
+  if (typeof haystack !== 'string') return 0
+  let n = 0
+  let i = haystack.indexOf(needle)
+  while (i !== -1) {
+    n += 1
+    i = haystack.indexOf(needle, i + needle.length)
+  }
+  return n
+}
+
+describe('healthMain.redesign:健康页极致简单主行动结构', function () {
+  let page
+  beforeAll(function () {
+    page = loadPage()
+  })
+
+  describe('① 主行动 = 上传报告 + 3 测评 + 健康阅卷(占首屏)', function () {
+    test('上传报告为采集区首位:upload-hero 出现在在线测评卡之前', function () {
+      const heroIdx = page.template.indexOf('class="upload-hero"')
+      const quizIdx = page.template.indexOf('data-card-assessment')
+      expect(heroIdx).toBeGreaterThanOrEqual(0)
+      expect(quizIdx).toBeGreaterThanOrEqual(0)
+      expect(heroIdx).toBeLessThan(quizIdx)
+    })
+
+    test('上传报告主行动复用 Base* 原语(BasePrimaryButton),未新造平行原语', function () {
+      expect(page.script.indexOf("import BasePrimaryButton from '../../components/BasePrimaryButton.vue'") >= 0).toBe(true)
+      expect(page.template.indexOf('<BasePrimaryButton') >= 0).toBe(true)
+      expect(page.template.indexOf('class="upload-hero-btn"') >= 0).toBe(true)
+      // 绿色 mat-green 的旧卡片组件已不再引入
+      expect(page.script.indexOf("report-upload-card.vue") >= 0).toBe(false)
+      expect(page.script.indexOf('ReportUploadCard') >= 0).toBe(false)
+    })
+
+    test('3 项测评保留为采集区主行动之一(quizzes v-for)', function () {
+      expect(page.template.indexOf('v-for="quiz in quizzes"') >= 0).toBe(true)
+      expect(page.script.indexOf("code: 'cognitive'") >= 0).toBe(true)
+      expect(page.script.indexOf("code: 'mental'") >= 0).toBe(true)
+      expect(page.script.indexOf("code: 'relationship'") >= 0).toBe(true)
+    })
+
+    test('健康阅卷保留为采集区入口(健康问卷入口)', function () {
+      expect(page.template.indexOf('@click="goHealthReview"') >= 0).toBe(true)
+    })
+  })
+
+  describe('② 5 tab + 雷达保留并压缩(品牌锚点)', function () {
+    test('内部 5 tab 导航保留', function () {
+      expect(page.template.indexOf('v-for="tab in tabs"') >= 0).toBe(true)
+      expect(page.script.indexOf("code: 'body'") >= 0).toBe(true)
+      expect(page.script.indexOf("code: 'mental'") >= 0).toBe(true)
+    })
+
+    test('雷达压缩到 400rpx(原 520),让主行动进首屏;访客示例雷达已删(模板仅 1 处 RadarChart)', function () {
+      expect(page.template.indexOf('height="400"') >= 0).toBe(true)
+      expect(page.template.indexOf('height="520"') >= 0).toBe(false)
+      expect(count(page.template, '<RadarChart')).toBe(1)
+    })
+  })
+
+  describe('③ 游客态删营销残留(双雷达示例 + 相生相克长文)', function () {
+    test('模板与样式均已删除 gh-demo 双雷达示例块', function () {
+      expect(page.template.indexOf('gh-demo') >= 0).toBe(false)
+      expect(page.style.indexOf('.gh-demo') >= 0).toBe(false)
+    })
+
+    test('双雷达示例的 script 支撑(guest*Dims/Scores、_guestRadarDims/_guestDemoScores)一并删除,不留死代码', function () {
+      ;['guestBodyDims', 'guestBodyScores', 'guestCogDims', 'guestCogScores', 'guestHasDemoConfig', '_guestRadarDims', '_guestDemoScores'].forEach(function (name) {
+        expect(page.script.indexOf(name)).toBe(-1)
+      })
+    })
+
+    test('相生相克长文(gh-rel / gh-chain / gh-node / gh-sep / gh-arrow)模板与样式一并删除', function () {
+      ;['gh-rel', 'gh-chain', 'gh-node', 'gh-sep', 'gh-arrow'].forEach(function (name) {
+        expect(page.template.indexOf(name)).toBe(-1)
+        expect(page.style.indexOf('.' + name)).toBe(-1)
+      })
+      // 营销长文文案一并消失
+      ;['相生 · 前进', '相克 · 平衡', '身克富', '健康孕育智慧', '莫以健康换金钱'].forEach(function (text) {
+        expect(page.template.indexOf(text)).toBe(-1)
+      })
+    })
+
+    test('改为紧凑五维速览:5 个维度入口 + 5 条维度详情路由保留', function () {
+      expect(count(page.template, 'gh-row-info')).toBe(5)
+      ;["/pages/body-detail/index", "/pages/wisdom-detail/index", "/pages/wealth/index", '/pages/action-detail/member-action-detail', '/pages/mind-detail/index'].forEach(function (route) {
+        expect(page.template.indexOf(route)).toBeGreaterThanOrEqual(0)
+      })
+    })
+
+    test('访客态不再拉取维度注册中心(示例雷达已删,接口调用一并移除)', function () {
+      // onShow 未登录分支不再调用 ensureDimensionRegistry
+      const onShowBody = page.script.slice(page.script.indexOf('onShow()'))
+      const guestBranch = onShowBody.slice(onShowBody.indexOf('} else {'))
+      expect(guestBranch.indexOf('ensureDimensionRegistry')).toBe(-1)
+    })
+
+    test('痛点条保留(主动健康理念共鸣点)但压缩为一行', function () {
+      expect(page.template.indexOf('gh-pain') >= 0).toBe(true)
+      expect(page.style.indexOf('.gh-pain { margin: 0 32rpx 24rpx; display: flex; flex-direction: row; flex-wrap: wrap; align-items: baseline; padding: 18rpx 24rpx;') >= 0).toBe(true)
+    })
+
+    test('游客态保留:15 题自检 CTA + 待填调研 + 登录引导', function () {
+      expect(page.template.indexOf('15 题五维健康自检') >= 0).toBe(true)
+      expect(page.template.indexOf('v-for="(item, si) in pendingSurveys"') >= 0).toBe(true)
+      expect(page.template.indexOf('<LoginGuideCard') >= 0).toBe(true)
+    })
+  })
+
+  describe('④ 健康阅卷 与 15 题自检 合并为各态单一问卷入口', function () {
+    test('全页仅 2 个 health-survey 入口:游客态 15 题自检 + 登录态健康阅卷(不重复)', function () {
+      expect(count(page.script, '/pages/health/health-survey')).toBe(2)
+      expect(count(page.script, '_pendingSurveyUrl = url')).toBe(2)
+    })
+
+    test('模板未同时出现两个问卷入口(登录态 1 个 goHealthReview、访客态 1 个 goSelfTest)', function () {
+      expect(count(page.template, 'goHealthReview')).toBe(1)
+      expect(count(page.template, 'goSelfTest')).toBe(1)
+    })
+  })
+
+  describe('⑤ 华为健康卡折叠为「数据来源」二级入口(不占首屏)', function () {
+    test('模板不再有独立「运动手环 · 华为健康」卡(改为折叠数据来源行)', function () {
+      expect(page.template.indexOf('运动手环 · 华为健康')).toBe(-1)
+      expect(page.template.indexOf('class="data-card-actions"')).toBe(-1)
+      expect(page.template.indexOf('class="data-card-syncing"')).toBe(-1)
+    })
+
+    test('数据来源默认收起(dataSourceOpen 初始 false)+ 折叠开关,绑定/同步/撤销能力保留', function () {
+      expect(page.script.indexOf('dataSourceOpen: false') >= 0).toBe(true)
+      expect(page.script.indexOf('toggleDataSource: function() { this.dataSourceOpen = !this.dataSourceOpen }') >= 0).toBe(true)
+      expect(page.template.indexOf('v-if="dataSourceOpen"') >= 0).toBe(true)
+      ;['bindHuawei', 'syncHuawei', 'revokeHuawei'].forEach(function (fn) {
+        expect(page.template.indexOf(fn)).toBeGreaterThanOrEqual(0)
+      })
+    })
+
+    test('旧卡扩展样式 .data-card-actions / .data-card-syncing 一并删除', function () {
+      expect(page.style.indexOf('.data-card-actions')).toBe(-1)
+      expect(page.style.indexOf('.data-card-syncing')).toBe(-1)
+    })
+  })
+
+  describe('⑥ 预览条数 3→2(最近记录 / 推荐阅读)', function () {
+    test('最近记录只展示 2 条(模板 slice + 接口 size 同步压缩)', function () {
+      expect(page.template.indexOf('reports.slice(0, 2)') >= 0).toBe(true)
+      expect(page.template.indexOf('reports.slice(0, 3)')).toBe(-1)
+      expect(page.script.indexOf("getReportList('', 2)") >= 0).toBe(true)
+    })
+
+    test('推荐阅读只展示 2 条', function () {
+      expect(page.script.indexOf("getFeaturedArticles({ size: 2") >= 0).toBe(true)
+      expect(page.script.indexOf('list.slice(0, 2)') >= 0).toBe(true)
+      expect(page.script.indexOf('list.slice(0, 3)')).toBe(-1)
+    })
+  })
+
+  describe('工程硬约束', function () {
+    test('无可选链 ?./无 CSS Grid;:key 无表达式;不引其他三页共享原语之外的新组件', function () {
+      expect(/[\S]\?\.|\?\./.test(page.script)).toBe(false)
+      expect(/display:\s*grid/.test(page.style)).toBe(false)
+      const keys = page.template.match(/:key="([^"]+)"/g) || []
+      keys.forEach(function (k) {
+        expect(/[\+\-\*\/\(\)]/.test(k)).toBe(false)
+      })
+    })
+
+    test('华为健康 mock 角标 + 摘要文案保留(合规说明)', function () {
+      expect(page.template.indexOf('data-card-badge') >= 0).toBe(true)
+      expect(page.script.indexOf('huaweiSourceText') >= 0).toBe(true)
+      // 未绑定态用途说明仍覆盖 6 项数据(步数/距离/心率/睡眠/体重/身高)
+      expect(page.script.indexOf('步数/距离/心率/睡眠/体重/身高') >= 0).toBe(true)
+    })
+  })
+})

+ 78 - 183
cfc-frontend/pages/health-main/index.vue

@@ -1,7 +1,7 @@
 <template>
   <view class="container" :style="{ '--font-scale': fontScale }">
-    <!-- 通用登录浮层 -->
-    <login-sheet ref="loginSheet" @success="onSheetLoginSuccess" @open="onLoginSheetOpen" @close="onLoginSheetClose" />
+    <!-- 通用登录浮层(@open/@close 已随访客示例雷达移除一并删除) -->
+    <login-sheet ref="loginSheet" @success="onSheetLoginSuccess" />
     <block v-if="!isLoggedIn">
       <view class="gh-page">
         <!-- 页面头 / 品牌锚点 -->
@@ -44,67 +44,10 @@
           </view>
         </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>
-
-        <!-- 五维健康体系(完整版:全站唯一保留相生相克的一页) -->
+        <!-- 五维速览(删营销长文:相生相克长文 + 双雷达示例,改为紧凑 5 行维度入口) -->
         <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>
-              <view class="gh-arrow"></view>
-              <text class="gh-node gh-node-wisdom">智</text>
-              <view class="gh-arrow"></view>
-              <text class="gh-node gh-node-wealth">富</text>
-              <view class="gh-arrow"></view>
-              <text class="gh-node gh-node-action">行</text>
-              <view class="gh-arrow"></view>
-              <text class="gh-node gh-node-mind">心</text>
-              <view class="gh-arrow"></view>
-              <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-sep">·</text>
-              <text class="gh-node gh-node-wisdom">智克行</text>
-              <text class="gh-sep">·</text>
-              <text class="gh-node gh-node-wealth">富克心</text>
-              <text class="gh-sep">·</text>
-              <text class="gh-node gh-node-action">行克身</text>
-              <text class="gh-sep">·</text>
-              <text class="gh-node gh-node-mind">心克智</text>
-            </view>
-            <text class="gh-rel-hint">莫以健康换金钱,真诚胜过算计,财富服务家庭,关爱有度、大爱留白。</text>
-          </view>
+          <text class="gh-wuxing-sub">点开一个维度,从报告和测评里读懂家人。</text>
 
           <view class="gh-rows">
             <view class="gh-row gh-row--featured" @click="goPage('/pages/body-detail/index')">
@@ -173,7 +116,8 @@
       </view>
 
       <view class="section section-chart">
-        <RadarChart :dimensions="currentDimensions" :scores="currentScores || []" :fillColor="currentColor" :childName="selectedMemberName" :avgScores="currentAvgScores || []" width="640" height="520" />
+        <!-- 雷达高度压缩(520→400),让主行动(上传报告/测评)进入首屏 -->
+        <RadarChart :dimensions="currentDimensions" :scores="currentScores || []" :fillColor="currentColor" :childName="selectedMemberName" :avgScores="currentAvgScores || []" width="640" height="400" />
         <view class="chart-empty" v-if="chartIsEmpty">
           <text class="empty-text">{{ currentTabLabel }}数据待采集</text>
           <text class="empty-sub">完成测评或上传报告即可解锁{{ currentTabLabel }}数据</text>
@@ -187,13 +131,24 @@
         </view>
       </view>
 
+      <!-- 数据中心(极致简单:主行动 = 上传报告 + 测评,置顶承载) -->
       <view class="section section-data-collect">
-        <ReportUploadCard
-          title="上传报告"
-          desc="体检报告 · 菌群检测 · 认知测评 · 心理测评 · 情绪打卡"
-          :tags="['体检报告', '菌群检测', '认知测评', '心理测评', '情绪打卡']"
-          @click="goPage('/pages/health/report-upload')" />
+        <!-- 主行动大入口:上传报告(品牌紫 hero + BasePrimaryButton) -->
+        <view class="upload-hero" @click="goReportUpload">
+          <view class="upload-hero-row">
+            <view class="upload-hero-ic">
+              <view class="upload-hero-ic-svg"></view>
+            </view>
+            <view class="upload-hero-info">
+              <text class="upload-hero-title">上传健康报告</text>
+              <text class="upload-hero-desc">体检 · 菌群 · 认知 · 心理 · 情绪打卡</text>
+            </view>
+            <view class="upload-hero-chev"></view>
+          </view>
+          <BasePrimaryButton size="lg" block class="upload-hero-btn" @click.stop="goReportUpload">立即上传</BasePrimaryButton>
+        </view>
 
+        <!-- 在线测评(3 项) -->
         <view class="data-card data-card-assessment">
           <view class="data-card-head">
             <text class="data-card-title">在线测评</text>
@@ -212,7 +167,7 @@
           </view>
         </view>
 
-        <!-- 健康阅卷入口(HL-01):问卷式记录,多次填写以最后一次为准 -->
+        <!-- 健康阅卷(登录态唯一健康问卷入口,与访客态 15 题自检合并语义) -->
         <view class="data-card" @click="goHealthReview">
           <view class="data-card-icon">📝</view>
           <view class="data-card-info">
@@ -222,19 +177,25 @@
           <text class="data-card-arrow">›</text>
         </view>
 
-        <!-- 运动手环 · 华为健康(H2 契约 §4):未绑定 → 绑定入口;已绑定 → 摘要 + mock 角标 + 同步/撤销 -->
-        <view class="data-card">
+        <!-- 数据来源(华为健康折叠为二级入口,不占首屏) -->
+        <view class="data-card" @click="toggleDataSource">
           <view class="data-card-icon">⌚</view>
           <view class="data-card-info">
-            <text class="data-card-title">运动手环 · 华为健康<text v-if="huaweiMock" class="data-card-badge">mock</text></text>
-            <text class="data-card-desc">{{ huaweiDescText }}</text>
+            <text class="data-card-title">数据来源<text v-if="huaweiMock" class="data-card-badge">mock</text></text>
+            <text class="data-card-desc">{{ huaweiSourceText }}</text>
           </view>
-          <view v-if="huaweiBound && !huaweiSyncing" class="data-card-actions">
-            <button class="data-card-btn" @click.stop="syncHuawei">同步</button>
-            <button class="data-card-btn data-card-btn--ghost" @click.stop="revokeHuawei">撤销</button>
+          <text class="data-card-arrow">{{ dataSourceOpen ? '⌄' : '›' }}</text>
+        </view>
+        <view class="data-source-panel" v-if="dataSourceOpen">
+          <text class="data-source-desc">{{ huaweiDescText }}</text>
+          <view class="data-source-actions">
+            <view v-if="huaweiBound && !huaweiSyncing" class="data-source-btns">
+              <button class="data-card-btn" @click.stop="syncHuawei">同步</button>
+              <button class="data-card-btn data-card-btn--ghost" @click.stop="revokeHuawei">撤销</button>
+            </view>
+            <button v-else-if="!huaweiBound" class="data-card-btn" @click.stop="bindHuawei">绑定</button>
+            <text v-else class="data-source-syncing">同步中…</text>
           </view>
-          <button v-else-if="!huaweiBound" class="data-card-btn" @click.stop="bindHuawei">绑定</button>
-          <text v-else class="data-card-syncing">同步中…</text>
         </view>
       </view>
 
@@ -244,7 +205,7 @@
           <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-card" v-for="(report, idx) in reports.slice(0, 2)" :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>
@@ -291,7 +252,7 @@ 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 BasePrimaryButton from '../../components/BasePrimaryButton.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'
@@ -299,11 +260,9 @@ import shareMixin from '../../components/share-mixin.js'
 
 export default {
   mixins: [fontScaleMixin, shareMixin],
-  components: { LoginGuideCard, RadarChart, ArticleFeed, ReportUploadCard },
+  components: { LoginGuideCard, RadarChart, ArticleFeed, BasePrimaryButton },
   data() {
     return {
-      bodyColor: BrandColors.body,
-      wisdomColor: BrandColors.wisdom,
       isLoggedIn: !!uni.getStorageSync('token'),
       currentTab: 'body',
       selectedMemberName: '',
@@ -337,8 +296,8 @@ export default {
       wealthDetail: null,
       childrenList: [],
       relationshipEmpty: false,
-      // 登录浮层打开标志(打开期间隐藏演示雷达,避免原生 canvas 盖在浮层之上)
-      loginSheetVisible: false,
+      // 数据来源面板展开标志(华为健康卡折叠为二级入口,默认收起不占首屏)
+      dataSourceOpen: false,
       // 统一维度注册中心是否就绪(成功取到 tree 后由 ensureDimensionRegistry 置位)
       // 未就绪时主页雷达回落硬编码兜底,保证后端未上线 / 接口异常时页面不崩
       registryReady: false,
@@ -440,21 +399,11 @@ export default {
       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
+    // ── 数据来源摘要文案(折叠行展示:未绑定 / 已绑定 / 同步中,不占首屏) ──
+    huaweiSourceText: function() {
+      if (this.huaweiSyncing) return '华为运动健康 · 同步中'
+      if (this.huaweiBound) return '华为运动健康 · 已绑定'
+      return '华为运动健康 · 未绑定'
     },
     // ── 运动手环 · 华为健康卡片描述文案(H4 三态:未绑定 / 已绑定 / 同步中) ──
     // 未绑定态用途说明须覆盖 6 项数据(步数/距离/心率/睡眠/体重/身高),仅用于家庭健康档案展示(H4-4)
@@ -487,13 +436,7 @@ export default {
       })
     } else {
       this.pendingSurveys = []
-      // 访客态:示例雷达同样按注册中心配置渲染(无配置显示空态引导)
-      var self = this
-      ensureDimensionRegistry().then(function() {
-        self.registryReady = isRegistryReady()
-      }).catch(function() {
-        self.registryReady = false
-      })
+      // 访客态:已移除示例雷达(gh-demo),不再拉取维度注册中心
     }
   },
   methods: {
@@ -654,40 +597,12 @@ export default {
       }
       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 },
+    // 主行动:上传报告(品牌紫 hero + BasePrimaryButton 共用)
+    goReportUpload: function() { uni.navigateTo({ url: '/pages/health/report-upload' }) },
+    // 数据来源面板展开/收起(华为健康卡折叠为二级入口,不占首屏)
+    toggleDataSource: function() { this.dataSourceOpen = !this.dataSourceOpen },
     // 登录成功:刷新登录态数据(镜像 onShow 已登录分支)
     onLoginSuccess: function() {
       // 未登录点击「15题五维健康自检」→ 登录成功后续接跳转调研问卷
@@ -905,9 +820,9 @@ export default {
         var api = require('../../utils/api.js')
         var memberId = uni.getStorageSync('currentChildId') || uni.getStorageSync('currentMemberId') || uni.getStorageSync('userId') || ''
         // 最近记录:展示家庭所有成员的最近报告——不传 memberId,后端返回当前家庭全部报告
-        // (按报告日期倒序)取最近 3 条,卡片通过 childName/personName 区分成员。
+        // (按报告日期倒序)取最近 2 条(3→2 压缩预览),卡片通过 childName/personName 区分成员。
         // 下方维度/认知/心理等数据仍按当前选中成员(memberId)加载,不受此影响
-        api.getReportList('', 3).then(function(res) {
+        api.getReportList('', 2).then(function(res) {
           if (res.code === 200 && res.data) {
             var list = Array.isArray(res.data) ? res.data : (res.data.list || [])
             self.reports = list
@@ -920,10 +835,10 @@ export default {
         }).catch(function() {})
       }
       // 文章
-        api.getFeaturedArticles({ size: 3, dimensionCode: 'body' }).then(function(res) {
+        api.getFeaturedArticles({ size: 2, 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) || []
+            self.healthArticles = list.slice(0, 2) || []
           }
         }).catch(function() {})
         // 认知测评得分
@@ -1024,18 +939,33 @@ export default {
 .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; }
+/* 主行动大入口:上传报告(品牌紫 hero,一屏唯一主行动) */
+.upload-hero { background: linear-gradient(150deg, $brand-primary 0%, $brand-primary-dark 100%); border-radius: 24rpx; padding: 28rpx 28rpx 24rpx; margin-bottom: 16rpx; box-shadow: 0 6rpx 20rpx rgba(124, 58, 237, 0.22); }
+.upload-hero:active { opacity: 0.94; }
+.upload-hero-row { display: flex; align-items: center; }
+.upload-hero-ic { width: 88rpx; height: 88rpx; flex-shrink: 0; border-radius: 24rpx; background: rgba($app-surface, 0.18); display: flex; align-items: center; justify-content: center; }
+.upload-hero-ic-svg { width: 44rpx; height: 44rpx; background-color: transparent; background-repeat: no-repeat; background-position: center; background-size: 44rpx 44rpx; 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='%23FFFFFF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpolyline points='14 2 14 8 20 8'/%3E%3Cline x1='12' y1='18' x2='12' y2='12'/%3E%3Cpolyline points='9 15 12 12 15 15'/%3E%3C/svg%3E"); }
+.upload-hero-info { flex: 1; min-width: 0; margin-left: 24rpx; display: flex; flex-direction: column; }
+.upload-hero-title { font-size: calc(32rpx * var(--font-scale, 1)); font-weight: 800; color: $app-surface; letter-spacing: 1rpx; }
+.upload-hero-desc { font-size: calc(23rpx * var(--font-scale, 1)); color: rgba($app-surface, 0.88); margin-top: 6rpx; }
+.upload-hero-chev { width: 36rpx; height: 36rpx; flex-shrink: 0; margin-left: 12rpx; background-repeat: no-repeat; background-position: center; background-size: 36rpx 36rpx; 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='%23FFFFFF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='9 18 15 12 9 6'/%3E%3C/svg%3E"); }
+.upload-hero-btn { margin-top: 22rpx; background: $app-surface; color: $brand-primary; }
+/* 数据来源(华为健康)折叠二级面板 */
+.data-source-panel { background: $app-surface; border: 1rpx solid $app-border-subtle; border-radius: 24rpx; padding: 24rpx; margin: -4rpx 0 12rpx; }
+.data-source-desc { font-size: calc(22rpx * var(--font-scale, 1)); color: $facade-text-body; line-height: 1.6; display: block; }
+.data-source-actions { margin-top: 16rpx; }
+.data-source-btns { display: flex; align-items: center; }
+.data-source-syncing { font-size: calc(24rpx * var(--font-scale, 1)); color: $brand-primary; }
 .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; }
-/* 运动手环 · 华为健康(H2)卡片扩展 */
-.data-card-actions { display: flex; align-items: center; }
+/* 运动手环 · 华为健康(H2)卡片扩展:按钮样式供折叠面板复用 */
 .data-card-btn { flex-shrink: 0; margin-left: 16rpx; padding: 0 24rpx; height: 56rpx; line-height: 56rpx; border-radius: 28rpx; font-size: calc(24rpx * var(--font-scale, 1)); background: $brand-primary; color: $app-surface; border: none; }
 .data-card-btn--ghost { background: transparent; color: $brand-primary; border: 1rpx solid $brand-primary; }
 .data-card-badge { display: inline-block; margin-left: 8rpx; padding: 0 12rpx; border-radius: 16rpx; font-size: calc(18rpx * var(--font-scale, 1)); font-weight: normal; color: #b26a00; background: #fff3d6; vertical-align: middle; }
-.data-card-syncing { flex-shrink: 0; margin-left: 16rpx; padding: 0 20rpx; height: 56rpx; line-height: 56rpx; border-radius: 28rpx; font-size: calc(24rpx * var(--font-scale, 1)); color: $brand-primary; background: rgba(64, 116, 230, 0.08); }
 .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; }
@@ -1090,8 +1020,6 @@ $gh-cta-press-from: #A9330A;
 $gh-cta-press-to:   #962D08;
 $gh-white-16:  rgba($app-surface, 0.16);      // 橙底图标盘
 $gh-tint-soft: $tint-warm-soft;               // 暖白浅底 #FFF1E6
-$gh-wisdom-border: #E4E4F5;                   // 智维度徽章描边
-$gh-arrow-ink: $facade-text-slate;            // 相生箭头
 $gh-guide-bg-from: #FFF8F2;                   // 引导卡顶(暖白偏橙)
 $gh-guide-bg-to:   #FFFDFB;                   // 引导卡底
 
@@ -1106,7 +1034,6 @@ $gh-ic-wealth-bg: str-slice('#{$dim-wealth-deep}', 2);
 $gh-ic-action-bg: str-slice('#{$dim-action-deep}', 2);
 $gh-ic-mind-bg:   str-slice('#{$dim-mind-deep}', 2);
 $gh-white-bg:     str-slice('#{$app-surface}', 2);
-$gh-arrow-bg:     str-slice('#{$gh-arrow-ink}', 2);
 $gh-chev-bg:      str-slice('#{$facade-text-slate}', 2);
 $gh-file-bg:      str-slice('#{$dim-body-deep}', 2);
 
@@ -1118,8 +1045,8 @@ $gh-file-bg:      str-slice('#{$dim-body-deep}', 2);
 .gh-title { font-size: calc(52rpx * var(--font-scale, 1)); font-weight: 800; color: $facade-text-strong; line-height: 1.24; letter-spacing: 1rpx; margin-top: 12rpx; }
 .gh-sub { font-size: calc(26rpx * var(--font-scale, 1)); color: $facade-text-body; line-height: 1.7; margin-top: 12rpx; }
 
-/* 痛点条 */
-.gh-pain { margin: 0 32rpx 24rpx; display: flex; flex-direction: row; flex-wrap: wrap; align-items: baseline; padding: 24rpx 28rpx; background: $app-surface; border: 1rpx solid $app-border-subtle; border-radius: $uni-radius-lg; }
+/* 痛点条(压缩为一行:紧内边距,单行紧凑) */
+.gh-pain { margin: 0 32rpx 24rpx; display: flex; flex-direction: row; flex-wrap: wrap; align-items: baseline; padding: 18rpx 24rpx; background: $app-surface; border: 1rpx solid $app-border-subtle; border-radius: $uni-radius-lg; }
 .gh-pain-quote { font-size: calc(28rpx * var(--font-scale, 1)); font-weight: 800; color: $brand-primary; margin-right: 16rpx; white-space: nowrap; }
 .gh-pain-desc { font-size: calc(24rpx * var(--font-scale, 1)); color: $facade-text-body; line-height: 1.6; }
 
@@ -1170,43 +1097,11 @@ $gh-file-bg:      str-slice('#{$dim-body-deep}', 2);
 .gh-pending-sub { font-size: calc(22rpx * var(--font-scale, 1)); color: $facade-text-body; margin-top: 6rpx; }
 .gh-pending-tag { flex-shrink: 0; font-size: calc(22rpx * var(--font-scale, 1)); font-weight: 700; color: $brand-primary; background: $gh-tint-soft; border-radius: 999rpx; padding: 6rpx 20rpx; }
 
-/* 演示雷达(卡片化:每个雷达独立 surface card) */
-.gh-demo { margin: 0 32rpx 24rpx; display: flex; flex-direction: column; }
-.gh-demo-block { background: $app-surface; border: 1rpx solid $app-border-subtle; border-radius: $uni-radius-lg; padding: 28rpx 24rpx 16rpx; }
-.gh-demo-block + .gh-demo-block { margin-top: 20rpx; }
-.gh-demo-head { display: flex; flex-direction: row; align-items: center; }
-.gh-demo-name { font-size: calc(28rpx * var(--font-scale, 1)); font-weight: 700; color: $facade-text-strong; }
-.gh-demo-tag { font-size: calc(20rpx * var(--font-scale, 1)); color: $dim-body-deep; background: $dim-body-tint; border: 1rpx solid $app-border-subtle; border-radius: 999rpx; padding: 4rpx 16rpx; margin-left: 16rpx; font-weight: 600; }
-.gh-demo-block:nth-child(2) .gh-demo-tag { color: $dim-wisdom-deep; background: $dim-wisdom-tint; border-color: $gh-wisdom-border; }
-.gh-demo-empty { background: $app-surface; border: 1rpx solid $app-border-subtle; border-radius: $uni-radius-lg; padding: 96rpx 40rpx; 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; }
-.gh-demo-empty-sub { font-size: calc(24rpx * var(--font-scale, 1)); color: $facade-text-slate; margin-top: 16rpx; }
-
-/* 五维健康体系 */
+/* 五维速览(保留 5 行维度入口,删相生相克长文) */
 .gh-wuxing { margin: 0 32rpx 24rpx; background: $app-surface; border: 1rpx solid $app-border-subtle; border-radius: $uni-radius-lg; padding: 32rpx 28rpx; }
 .gh-wuxing-title { display: block; font-size: calc(32rpx * var(--font-scale, 1)); font-weight: 800; color: $facade-text-strong; line-height: 1.4; }
 .gh-wuxing-sub { display: block; font-size: calc(24rpx * var(--font-scale, 1)); color: $facade-text-body; line-height: 1.6; margin-top: 12rpx; }
 
-/* 相生 / 相克 */
-.gh-rel { margin-top: 24rpx; padding: 24rpx 24rpx 20rpx; border-radius: $uni-radius-lg; background: $app-bg; }
-.gh-rel-title { display: block; font-size: calc(24rpx * var(--font-scale, 1)); font-weight: 700; color: $facade-text-slate; letter-spacing: 1rpx; }
-.gh-chain { margin-top: 14rpx; display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; }
-.gh-node { font-size: calc(24rpx * var(--font-scale, 1)); font-weight: 700; }
-.gh-node-body { color: $dim-body-deep; }
-.gh-node-wisdom { color: $dim-wisdom-deep; }
-.gh-node-wealth { color: $dim-wealth-deep; }
-.gh-node-action { color: $dim-action-deep; }
-.gh-node-mind { color: $dim-mind-deep; }
-.gh-arrow {
-  width: 24rpx; height: 24rpx; margin: 0 8rpx; flex-shrink: 0;
-  background-repeat: no-repeat;
-  background-position: center;
-  background-size: 24rpx 24rpx;
-  background-image: gh-icon($gh-arrow-bg, '%3Cline x1=%225%22 y1=%2212%22 x2=%2219%22 y2=%2212%22/%3E%3Cpolyline points=%2212 5 19 12 12 19%22/%3E');
-}
-.gh-sep { font-size: calc(20rpx * var(--font-scale, 1)); color: $facade-text-slate; margin: 0 8rpx; }
-.gh-rel-hint { display: block; font-size: calc(22rpx * var(--font-scale, 1)); color: $facade-text-body; line-height: 1.65; margin-top: 14rpx; }
-
 /* 五行 rows(首尾身/心 featured 暖底高亮,破五卡等权) */
 .gh-rows { margin-top: 28rpx; display: flex; flex-direction: column; }
 .gh-row { display: flex; flex-direction: row; align-items: center; padding: 20rpx 12rpx; border: 1rpx solid $app-border-subtle; border-radius: $uni-radius-lg; background: $app-surface; }