|
|
@@ -18,7 +18,7 @@
|
|
|
</view>
|
|
|
|
|
|
<!-- 自检 hero CTA -->
|
|
|
- <view class="gh-cta" @click="goSelfTest">
|
|
|
+ <view class="gh-cta" @click="goSelfTest" aria-label="15 题五维健康自检">
|
|
|
<view class="gh-cta-ic"></view>
|
|
|
<view class="gh-cta-info">
|
|
|
<text class="gh-cta-title">15 题五维健康自检</text>
|
|
|
@@ -108,15 +108,15 @@
|
|
|
|
|
|
<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>
|
|
|
+ <view v-for="tab in tabs" :key="tab.code" class="tab-item" :class="{ active: currentTab === tab.code }" @click="switchTab(tab.code)" :aria-label="tab.label">
|
|
|
+ <view class="tab-icon" :class="'hic-' + tab.icon"></view>
|
|
|
<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">
|
|
|
- <!-- 雷达高度压缩(520→400),让主行动(上传报告/测评)进入首屏 -->
|
|
|
+ <!-- 雷达高度压缩(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>
|
|
|
@@ -126,7 +126,7 @@
|
|
|
|
|
|
<view class="section section-dc-header">
|
|
|
<view class="dc-title-row">
|
|
|
- <text class="dc-icon">🔍</text>
|
|
|
+ <view class="dc-icon hdc-search"></view>
|
|
|
<text class="dc-title">看见 · 健康数据中心</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
@@ -156,20 +156,20 @@
|
|
|
</view>
|
|
|
<view v-for="quiz in quizzes" :key="quiz.code" class="quiz-item">
|
|
|
<view class="quiz-info">
|
|
|
- <text class="quiz-icon">{{ quiz.icon }}</text>
|
|
|
+ <view class="quiz-icon" :class="'qic-' + quiz.icon"></view>
|
|
|
<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>
|
|
|
+ <button v-else class="quiz-btn" @click.stop="goQuiz(quiz.code)" :aria-label="'开始' + quiz.label">开始</button>
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
|
<!-- 健康阅卷(登录态唯一健康问卷入口,与访客态 15 题自检合并语义) -->
|
|
|
<view class="data-card" @click="goHealthReview">
|
|
|
- <view class="data-card-icon">📝</view>
|
|
|
+ <view class="data-card-icon hc-pen"></view>
|
|
|
<view class="data-card-info">
|
|
|
<text class="data-card-title">健康阅卷</text>
|
|
|
<text class="data-card-desc">逐项填写健康问卷 · 多次填写保留历史记录</text>
|
|
|
@@ -179,7 +179,7 @@
|
|
|
|
|
|
<!-- 数据来源(华为健康折叠为二级入口,不占首屏) -->
|
|
|
<view class="data-card" @click="toggleDataSource">
|
|
|
- <view class="data-card-icon">⌚</view>
|
|
|
+ <view class="data-card-icon hc-watch"></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">{{ huaweiSourceText }}</text>
|
|
|
@@ -227,18 +227,24 @@
|
|
|
<view class="section section-plan">
|
|
|
<view class="plan-card">
|
|
|
<view class="plan-head">
|
|
|
- <text class="plan-title">📋 健康方案</text>
|
|
|
+ <view class="plan-head-title">
|
|
|
+ <view class="hc-plan"></view>
|
|
|
+ <text class="plan-title">健康方案</text>
|
|
|
+ </view>
|
|
|
<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>
|
|
|
+ <text v-else class="plan-hint">选维度 + 选成员 + 设定目标 › 生成</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
|
<!-- 推荐阅读 -->
|
|
|
<view class="section">
|
|
|
<view class="section-header">
|
|
|
- <text class="section-title">📖 推荐阅读</text>
|
|
|
+ <view class="section-title-wrap">
|
|
|
+ <view class="hc-book"></view>
|
|
|
+ <text class="section-title">推荐阅读</text>
|
|
|
+ </view>
|
|
|
<text class="section-more" @click="goMoreArticles">更多 ›</text>
|
|
|
</view>
|
|
|
<ArticleFeed :articles="healthArticles" @articleClick="goArticleDetail" />
|
|
|
@@ -272,16 +278,16 @@ export default {
|
|
|
healthArticles: [],
|
|
|
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 }
|
|
|
+ { code: 'body', label: '健康', icon: 'body', color: BrandColors.body },
|
|
|
+ { code: 'cognitive', label: '认知', icon: 'cognitive', color: BrandColors.wisdom },
|
|
|
+ { code: 'wealth', label: '财富', icon: 'wealth', color: BrandColors.wealth },
|
|
|
+ { code: 'relationship', label: '社会性', icon: 'relationship', color: BrandColors.success },
|
|
|
+ { code: 'mental', label: '心理', icon: 'mental', color: BrandColors.mind }
|
|
|
],
|
|
|
quizzes: [
|
|
|
- { code: 'cognitive', label: '认知能力测评', icon: '🧠', score: null },
|
|
|
- { code: 'mental', label: '心理健康测评', icon: '💖', score: null },
|
|
|
- { code: 'relationship', label: '关系质量测评', icon: '🤝', score: null }
|
|
|
+ { code: 'cognitive', label: '认知能力测评', icon: 'cognitive', score: null },
|
|
|
+ { code: 'mental', label: '心理健康测评', icon: 'mental', score: null },
|
|
|
+ { code: 'relationship', label: '关系质量测评', icon: 'relationship', score: null }
|
|
|
],
|
|
|
// 真实数据缓存
|
|
|
bodyData: null,
|
|
|
@@ -331,7 +337,7 @@ export default {
|
|
|
return { label: label, key: c.code, code: c.code }
|
|
|
})
|
|
|
}
|
|
|
- // 过渡兜底:注册中心未就绪或某根无子维 → 回落现有硬编码清单(后端未上线 / 接口异常时页面不崩)
|
|
|
+ // 过渡兜底:注册中心未就绪或某根无子维 -> 回落现有硬编码清单(后端未上线 / 接口异常时页面不崩)
|
|
|
return this._fallbackDimensions(this.currentTab)
|
|
|
},
|
|
|
currentScores: function() {
|
|
|
@@ -348,7 +354,7 @@ export default {
|
|
|
return self._readRegistryScore(self.currentTab, c.code, c.scoreField)
|
|
|
})
|
|
|
}
|
|
|
- // 过渡兜底:注册中心未就绪 → 回落现有硬编码取分逻辑(与改造前一致)
|
|
|
+ // 过渡兜底:注册中心未就绪 -> 回落现有硬编码取分逻辑(与改造前一致)
|
|
|
return this._fallbackScores(this.currentTab)
|
|
|
},
|
|
|
currentAvgScores: function() {
|
|
|
@@ -535,7 +541,7 @@ export default {
|
|
|
},
|
|
|
/**
|
|
|
* 配置驱动取分:按 tab 与注册中心节点的 scoreField / code 从对应分数包取分。
|
|
|
- * 包缺失或值非数字 → 0(保持现有零填充行为)。与改造前取分口径逐一对齐。
|
|
|
+ * 包缺失或值非数字 -> 0(保持现有零填充行为)。与改造前取分口径逐一对齐。
|
|
|
* @param {string} tab
|
|
|
* @param {string} code 注册中心节点 code(body 类为 body.growth)
|
|
|
* @param {string} scoreField legacyAlias 首元素(取分字段名)
|
|
|
@@ -598,7 +604,7 @@ export default {
|
|
|
toggleDataSource: function() { this.dataSourceOpen = !this.dataSourceOpen },
|
|
|
// 登录成功:刷新登录态数据(镜像 onShow 已登录分支)
|
|
|
onLoginSuccess: function() {
|
|
|
- // 未登录点击「15题五维健康自检」→ 登录成功后续接跳转调研问卷
|
|
|
+ // 未登录点击「15题五维健康自检」-> 登录成功后续接跳转调研问卷
|
|
|
if (this._pendingSurveyUrl) {
|
|
|
var pendingUrl = this._pendingSurveyUrl
|
|
|
this._pendingSurveyUrl = ''
|
|
|
@@ -683,7 +689,7 @@ export default {
|
|
|
// 接口异常不阻塞主页,保持当前状态
|
|
|
})
|
|
|
},
|
|
|
- // 绑定:取 authUrl → 判 mock/real(判据=authUrl 是否含华为授权域名,非 mode 字段)
|
|
|
+ // 绑定:取 authUrl -> 判 mock/real(判据=authUrl 是否含华为授权域名,非 mode 字段)
|
|
|
bindHuawei: function() {
|
|
|
var self = this
|
|
|
if (!uni.getStorageSync('token')) {
|
|
|
@@ -717,7 +723,7 @@ export default {
|
|
|
uni.showToast({ title: '获取授权链接失败', icon: 'none' })
|
|
|
})
|
|
|
},
|
|
|
- // 手动同步(接口3,空 dataType=全量 5 类):同步中→结果按 dataType 分型给具体错误文案(H4-1)
|
|
|
+ // 手动同步(接口3,空 dataType=全量 5 类):同步中->结果按 dataType 分型给具体错误文案(H4-1)
|
|
|
syncHuawei: function() {
|
|
|
var self = this
|
|
|
self.huaweiSyncing = true
|
|
|
@@ -813,7 +819,7 @@ export default {
|
|
|
var api = require('../../utils/api.js')
|
|
|
var memberId = uni.getStorageSync('currentChildId') || uni.getStorageSync('currentMemberId') || uni.getStorageSync('userId') || ''
|
|
|
// 最近记录:展示家庭所有成员的最近报告——不传 memberId,后端返回当前家庭全部报告
|
|
|
- // (按报告日期倒序)取最近 2 条(3→2 压缩预览),卡片通过 childName/personName 区分成员。
|
|
|
+ // (按报告日期倒序)取最近 2 条(3->2 压缩预览),卡片通过 childName/personName 区分成员。
|
|
|
// 下方维度/认知/心理等数据仍按当前选中成员(memberId)加载,不受此影响
|
|
|
api.getReportList('', 2).then(function(res) {
|
|
|
if (res.code === 200 && res.data) {
|
|
|
@@ -919,7 +925,7 @@ export default {
|
|
|
.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-icon { width: 40rpx; height: 40rpx; margin-bottom: 4rpx; background-repeat: no-repeat; background-position: center; background-size: 40rpx 40rpx; }
|
|
|
.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; }
|
|
|
@@ -929,7 +935,7 @@ export default {
|
|
|
.chart-empty .empty-sub { font-size: calc(22rpx * var(--font-scale, 1)); color: $facade-text-body; 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-icon { width: 30rpx; height: 30rpx; margin-right: 8rpx; background-repeat: no-repeat; background-position: center; background-size: 30rpx 30rpx; }
|
|
|
.dc-title { font-size: calc(32rpx * var(--font-scale, 1)); font-weight: bold; color: $facade-text-strong; }
|
|
|
.section-data-collect { margin: 8rpx 24rpx; }
|
|
|
/* 主行动大入口:上传报告(品牌紫 hero,一屏唯一主行动) */
|
|
|
@@ -950,7 +956,7 @@ export default {
|
|
|
.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-icon { width: 88rpx; height: 88rpx; border-radius: 24rpx; display: flex; align-items: center; justify-content: center; margin-right: 20rpx; background-repeat: no-repeat; background-position: center; background-size: 44rpx 44rpx; }
|
|
|
.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-body; }
|
|
|
@@ -965,7 +971,7 @@ export default {
|
|
|
.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-icon { width: 44rpx; height: 44rpx; margin-right: 16rpx; background-repeat: no-repeat; background-position: center; background-size: 44rpx 44rpx; }
|
|
|
.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; }
|
|
|
@@ -1030,6 +1036,35 @@ $gh-white-bg: str-slice('#{$app-surface}', 2);
|
|
|
$gh-chev-bg: str-slice('#{$facade-text-slate}', 2);
|
|
|
$gh-file-bg: str-slice('#{$dim-body-deep}', 2);
|
|
|
|
|
|
+// ===== 登录态图标(同 gh-icon data-URI 方案;原 emoji 换为内联 SVG)=====
|
|
|
+$hi-body: str-slice('#{$dim-body-deep}', 2);
|
|
|
+$hi-wisdom: str-slice('#{$dim-wisdom-deep}', 2);
|
|
|
+$hi-wealth: str-slice('#{$dim-wealth-deep}', 2);
|
|
|
+$hi-action: str-slice('#{$dim-action-deep}', 2);
|
|
|
+$hi-mind: str-slice('#{$dim-mind-deep}', 2);
|
|
|
+$hi-brand: str-slice('#{$brand-primary}', 2);
|
|
|
+$hi-slate: str-slice('#{$facade-text-slate}', 2);
|
|
|
+$hi-strong: str-slice('#{$facade-text-strong}', 2);
|
|
|
+
|
|
|
+// 维度 tab 图标(原彩色圆点 emoji 换为维度色线形图标)
|
|
|
+.hic-body { background-image: gh-icon($hi-body, '%3Cpath d=%22M3 12h4l2-6 4 12 2-6h6%22/%3E'); }
|
|
|
+.hic-cognitive { background-image: gh-icon($hi-wisdom, '%3Cpath d=%22M9 18h6%22/%3E%3Cpath d=%22M10 21h4%22/%3E%3Cpath d=%22M12 3a6 6 0 0 0-4 10.5c.7.7 1 1.5 1 2.5h6c0-1 .3-1.8 1-2.5A6 6 0 0 0 12 3z%22/%3E'); }
|
|
|
+.hic-wealth { background-image: gh-icon($hi-wealth, '%3Ccircle cx=%2212%22 cy=%2212%22 r=%229%22/%3E%3Cpath d=%22M12 7v10%22/%3E%3Cpath d=%22M9.5 9.5h5%22/%3E%3Cpath d=%22M9.5 14.5h5%22/%3E'); }
|
|
|
+.hic-relationship { background-image: gh-icon($hi-action, '%3Cpath d=%22M17 21v-2a4 4 0 0 0-4-4H7a4 4 0 0 0-4 4v2%22/%3E%3Ccircle cx=%2210%22 cy=%227%22 r=%224%22/%3E%3Cpath d=%22M22 21v-2a4 4 0 0 0-3-3.87%22/%3E%3Cpath d=%22M16 3.13a4 4 0 0 1 0 7.75%22/%3E'); }
|
|
|
+.hic-mental { background-image: gh-icon($hi-mind, '%3Cpath d=%22M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z%22/%3E'); }
|
|
|
+// 测评图标(认知/心理/社会性)
|
|
|
+.qic-cognitive { background-image: gh-icon($hi-wisdom, '%3Cpath d=%22M9 18h6%22/%3E%3Cpath d=%22M10 21h4%22/%3E%3Cpath d=%22M12 3a6 6 0 0 0-4 10.5c.7.7 1 1.5 1 2.5h6c0-1 .3-1.8 1-2.5A6 6 0 0 0 12 3z%22/%3E'); }
|
|
|
+.qic-mental { background-image: gh-icon($hi-mind, '%3Cpath d=%22M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z%22/%3E'); }
|
|
|
+.qic-relationship { background-image: gh-icon($hi-action, '%3Cpath d=%22M17 21v-2a4 4 0 0 0-4-4H7a4 4 0 0 0-4 4v2%22/%3E%3Ccircle cx=%2210%22 cy=%227%22 r=%224%22/%3E%3Cpath d=%22M22 21v-2a4 4 0 0 0-3-3.87%22/%3E%3Cpath d=%22M16 3.13a4 4 0 0 1 0 7.75%22/%3E'); }
|
|
|
+// 静态图标(搜索/阅卷/手表/方案/阅读)
|
|
|
+.hdc-search { background-image: gh-icon($hi-brand, '%3Ccircle cx=%2211%22 cy=%2211%22 r=%227%22/%3E%3Cpath d=%22M21 21l-4.3-4.3%22/%3E'); }
|
|
|
+.hc-pen { background-image: gh-icon($hi-brand, '%3Cpath d=%22M12 20h9%22/%3E%3Cpath d=%22M16.5 3.5a2.1 2.1 0 0 1 3 3L7 19l-4 1 1-4z%22/%3E'); }
|
|
|
+.hc-watch { background-image: gh-icon($hi-brand, '%3Ccircle cx=%2212%22 cy=%2212%22 r=%226%22/%3E%3Cpath d=%22M12 10v2l1.5 1.5%22/%3E%3Cpath d=%22M9 2h6%22/%3E%3Cpath d=%22M9 22h6%22/%3E%3Cpath d=%22M10 2v3%22/%3E%3Cpath d=%22M10 19v3%22/%3E'); }
|
|
|
+.hc-plan { width: 26rpx; height: 26rpx; flex-shrink: 0; margin-right: 8rpx; background-repeat: no-repeat; background-position: center; background-size: 26rpx 26rpx; background-image: gh-icon($hi-brand, '%3Crect x=%224%22 y=%225%22 width=%2216%22 height=%2215%22 rx=%222%22/%3E%3Cpath d=%22M8 10h8%22/%3E%3Cpath d=%22M8 14h8%22/%3E%3Cpath d=%22M8 18h5%22/%3E'); }
|
|
|
+.hc-book { width: 26rpx; height: 26rpx; flex-shrink: 0; margin-right: 8rpx; background-repeat: no-repeat; background-position: center; background-size: 26rpx 26rpx; background-image: gh-icon($hi-brand, '%3Cpath d=%22M4 19.5A2.5 2.5 0 0 1 6.5 17H20%22/%3E%3Cpath d=%22M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2z%22/%3E'); }
|
|
|
+.plan-head-title { display: flex; align-items: center; }
|
|
|
+.section-title-wrap { display: flex; align-items: center; }
|
|
|
+
|
|
|
.gh-page { background: $app-bg; min-height: 100vh; padding: 28rpx 0 40rpx; }
|
|
|
|
|
|
/* 页面头 / 品牌锚点 */
|