|
|
@@ -84,33 +84,6 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
|
- <!-- ① 了解区 — 自测大卡(首屏,引导"从了解开始") -->
|
|
|
- <view class="self-test-card" @click="goSelfTest">
|
|
|
- <view class="self-test-head">
|
|
|
- <text class="self-test-icon">⚡</text>
|
|
|
- <view class="self-test-info">
|
|
|
- <text class="self-test-title">{{ selfTestTitle }}</text>
|
|
|
- <text class="self-test-sub">{{ selfTestSub }}</text>
|
|
|
- <text v-if="pendingSurveys.length > 0" class="self-test-badge">有 {{ pendingSurveys.length }} 项调研待填</text>
|
|
|
- </view>
|
|
|
- <text class="self-test-arrow">›</text>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
-
|
|
|
- <!-- ①.b 行动引导条 — Next Best Action(仅登录态展示,定位"现在该做的一件事") -->
|
|
|
- <view v-if="nextBestAction" class="guide-bar" :class="'guide-bar-' + nextBestAction.color" @click="onGuideTap(nextBestAction)">
|
|
|
- <view class="guide-bar-icon-wrap">
|
|
|
- <text class="guide-bar-icon">{{ nextBestAction.icon }}</text>
|
|
|
- </view>
|
|
|
- <view class="guide-bar-info">
|
|
|
- <text class="guide-bar-title">{{ nextBestAction.title }}</text>
|
|
|
- <text class="guide-bar-sub">{{ nextBestAction.sub }}</text>
|
|
|
- </view>
|
|
|
- <view class="guide-bar-btn">
|
|
|
- <text class="guide-bar-btn-text">{{ nextBestAction.btn }} ›</text>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
-
|
|
|
<!-- ② 发现区 — 能量沙盘 — Canvas 五行星图(未测评时显示引导卡) -->
|
|
|
|
|
|
<GateLock v-if="sandboxLocked && sandboxLockGate" :gate="sandboxLockGate" />
|
|
|
@@ -697,92 +670,6 @@ membershipDays: 0,
|
|
|
if (this.isLifetime) return '已拥有'
|
|
|
return this.isMember ? '立即续费' : '立即开通'
|
|
|
},
|
|
|
- // 自测大卡:已有数据(沙盘解锁)显示"再次了解",否则显示引导文案
|
|
|
- selfTestTitle: function() {
|
|
|
- return this.sandboxData ? '再次了解 · 看看变化' : '先花 1 分钟,了解全家健康状况'
|
|
|
- },
|
|
|
- selfTestSub: function() {
|
|
|
- if (this.sandboxData) {
|
|
|
- return '已完成健康自检 · 点击再次填写'
|
|
|
- }
|
|
|
- return '4 步健康问卷 · 生成个性化方案 · 解锁能量沙盘'
|
|
|
- },
|
|
|
- // ===== Next Best Action 引导条(C 方案)=====
|
|
|
- // 优先级:沙盘未解锁 > 待填调研 > 待办任务 > 未读通知 > 默认引导
|
|
|
- // 只展示当前最该做的一件事,未登录态不展示
|
|
|
- nextBestAction: function() {
|
|
|
- if (!this.currentRole) return null
|
|
|
- // 1) 沙盘未解锁 — 最高优先级,引导完成自检
|
|
|
- if (this.sandboxLocked) {
|
|
|
- return {
|
|
|
- type: 'self-check',
|
|
|
- icon: '⚡',
|
|
|
- title: '先完成健康自检',
|
|
|
- sub: '4 步问卷,解锁全家能量报告',
|
|
|
- btn: '去自检',
|
|
|
- color: 'orange'
|
|
|
- }
|
|
|
- }
|
|
|
- // 2) 家庭成员为空 — 新用户关键动作,引导添加成员/家人
|
|
|
- if (this.membersChecked && this.familyMembersVisible && this.familyMembersVisible.length <= 1) {
|
|
|
- return {
|
|
|
- type: 'add-member',
|
|
|
- icon: '👨👩👧',
|
|
|
-title: '添加家庭成员',
|
|
|
- sub: '邀请家人加入,全家一起开启健康管理',
|
|
|
- btn: '去添加',
|
|
|
- color: 'blue'
|
|
|
- }
|
|
|
- }
|
|
|
- // 3) 待填调研 — 定期调研是用户的实际行动邀请
|
|
|
- if (this.pendingSurveys && this.pendingSurveys.length > 0) {
|
|
|
- return {
|
|
|
- type: 'survey',
|
|
|
- icon: '📝',
|
|
|
- title: '有 ' + this.pendingSurveys.length + ' 项调研待填',
|
|
|
- sub: '填完解锁下一阶段内容',
|
|
|
- btn: '去填写',
|
|
|
- color: 'blue'
|
|
|
- }
|
|
|
- }
|
|
|
- // 4) 家庭待办任务 — 用户已完成自检后的执行路径
|
|
|
- if (this.familyTodoCount > 0) {
|
|
|
- return {
|
|
|
- type: 'task',
|
|
|
- icon: '🎯',
|
|
|
- title: '今天有 ' + this.familyTodoCount + ' 项家庭任务',
|
|
|
- sub: '完成可累积成长分',
|
|
|
- btn: '去完成',
|
|
|
- color: 'green'
|
|
|
- }
|
|
|
- }
|
|
|
- // 5) 未读通知 — 私域触达优先
|
|
|
- var unreadCount = 0
|
|
|
- if (this.notices && this.notices.length) {
|
|
|
- for (var i = 0; i < this.notices.length; i++) {
|
|
|
- if (this.notices[i] && this.notices[i].unread) unreadCount++
|
|
|
- }
|
|
|
- }
|
|
|
- if (unreadCount > 0) {
|
|
|
- return {
|
|
|
- type: 'notice',
|
|
|
- icon: '📬',
|
|
|
- title: '有 ' + unreadCount + ' 条新消息',
|
|
|
- sub: '家庭动态、通知、待办提醒',
|
|
|
- btn: '查看',
|
|
|
- color: 'purple'
|
|
|
- }
|
|
|
- }
|
|
|
- // 6) 默认引导 — 已完成所有任务,指向任务中心
|
|
|
- return {
|
|
|
- type: 'default',
|
|
|
- icon: '✨',
|
|
|
- title: '今日任务已清空',
|
|
|
- sub: '去任务中心看看,保持成长节奏',
|
|
|
- btn: '逛一逛',
|
|
|
- color: 'gray'
|
|
|
- }
|
|
|
- },
|
|
|
// ===== ⓪.b 问候条数据(设计稿 §2)=====
|
|
|
// 头像组:最多展示 4 个成员头像,超出显示 +N
|
|
|
greetAvatarMembers: function() {
|
|
|
@@ -1844,25 +1731,6 @@ title: '添加家庭成员',
|
|
|
self.pendingSurveys = pending
|
|
|
}).catch(function() { self.pendingSurveys = [] })
|
|
|
},
|
|
|
- goSelfTest: function() {
|
|
|
- var firstPending = null
|
|
|
- for (var i = 0; i < this.pendingSurveys.length; i++) {
|
|
|
- var s = this.pendingSurveys[i]
|
|
|
- if (s && s.templateId) { firstPending = s; break }
|
|
|
- }
|
|
|
- if (firstPending) {
|
|
|
- var url = '/pages/health/survey-questionnaire?templateId=' + firstPending.templateId +
|
|
|
- '&templateTitle=' + encodeURIComponent(firstPending.title || '定期调研') +
|
|
|
- '&templateDimension=' + encodeURIComponent(firstPending.dimension || '') +
|
|
|
- '&periodStart=' + (firstPending.periodStart || '') +
|
|
|
- '&periodEnd=' + (firstPending.periodEnd || '')
|
|
|
- uni.navigateTo({ url: url })
|
|
|
- } else {
|
|
|
- // 无待填调研 → 进入独立综合调研页(仅调研不生成方案;会员门槛由调研页 onLoad 把关)
|
|
|
- uni.navigateTo({ url: '/pages/health/health-survey?modules=basic,status,diet,disease,bowel,sleep,med,allergy' })
|
|
|
- }
|
|
|
- },
|
|
|
- // ===== ⓪.b 问候条 — 通知入口 =====
|
|
|
goNotifications: function() {
|
|
|
uni.navigateTo({ url: '/pages/profile/my-messages' })
|
|
|
},
|
|
|
@@ -1877,39 +1745,6 @@ title: '添加家庭成员',
|
|
|
}
|
|
|
},
|
|
|
// ===== Next Best Action 引导条点击 =====
|
|
|
- onGuideTap: function(action) {
|
|
|
- if (!action) return
|
|
|
- switch (action.type) {
|
|
|
- case 'self-check':
|
|
|
- this.goSelfTest()
|
|
|
- break
|
|
|
- case 'survey':
|
|
|
- // 跳转到第一个待填调研
|
|
|
- if (this.pendingSurveys && this.pendingSurveys.length > 0) {
|
|
|
- var s = this.pendingSurveys[0]
|
|
|
- uni.navigateTo({
|
|
|
- url: '/pages/health/survey-questionnaire?templateId=' + s.templateId +
|
|
|
- '&templateTitle=' + encodeURIComponent(s.title || '定期调研') +
|
|
|
- '&templateDimension=' + encodeURIComponent(s.dimension || '') +
|
|
|
- '&periodStart=' + (s.periodStart || '') +
|
|
|
- '&periodEnd=' + (s.periodEnd || '')
|
|
|
- })
|
|
|
- }
|
|
|
- break
|
|
|
- case 'add-member':
|
|
|
- this.navTo('/pages/profile-extra/family-members')
|
|
|
- break
|
|
|
- case 'task':
|
|
|
- this.navTo('/pages/tasks/tasks')
|
|
|
- break
|
|
|
- case 'notice':
|
|
|
- this.navTo('/pages/profile/profile')
|
|
|
- break
|
|
|
- case 'default':
|
|
|
- this.navTo('/pages/tasks/tasks')
|
|
|
- break
|
|
|
- }
|
|
|
- },
|
|
|
loadSelfCheckStatus: function() {
|
|
|
var self = this
|
|
|
getSelfCheckStatus().then(function(res) {
|
|
|
@@ -3189,85 +3024,6 @@ $c-warm-tint: #FFF3E7;
|
|
|
.btn, .greet-bar { transition-duration: 0.01ms !important; }
|
|
|
}
|
|
|
|
|
|
-/* ===== ① 了解区 — 自测大卡(引导"从了解开始") ===== */
|
|
|
-.self-test-card {
|
|
|
- margin: 20rpx $uni-space-lg 16rpx;
|
|
|
- background: linear-gradient(135deg, $brand-primary, $brand-primary-light);
|
|
|
- border-radius: 24rpx;
|
|
|
- padding: 24rpx 28rpx;
|
|
|
-}
|
|
|
-.self-test-head { display: flex; align-items: center; }
|
|
|
-.self-test-icon { font-size: calc(40rpx * var(--font-scale, 1)); margin-right: 16rpx; }
|
|
|
-.self-test-info { flex: 1; }
|
|
|
-.self-test-title { font-size: calc(28rpx * var(--font-scale, 1)); font-weight: bold; color: $app-surface; display: block; }
|
|
|
-.self-test-sub { font-size: calc(22rpx * var(--font-scale, 1)); color: rgba($app-surface, 0.8); display: block; margin-top: 4rpx; }
|
|
|
-.self-test-arrow { font-size: calc(36rpx * var(--font-scale, 1)); color: rgba($app-surface, 0.7); }
|
|
|
-
|
|
|
-/* ===== ①.b 行动引导条 — Next Best Action ===== */
|
|
|
-.guide-bar {
|
|
|
- margin: 0 $uni-space-lg 16rpx;
|
|
|
- border-radius: 24rpx;
|
|
|
- padding: 18rpx 24rpx;
|
|
|
- display: flex;
|
|
|
- flex-direction: row;
|
|
|
- align-items: center;
|
|
|
- box-shadow: 0 2rpx 8rpx rgba(0,0,0,0.04);
|
|
|
-}
|
|
|
-.guide-bar-icon-wrap {
|
|
|
- width: 72rpx;
|
|
|
- height: 72rpx;
|
|
|
- border-radius: 16rpx;
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- justify-content: center;
|
|
|
- margin-right: 16rpx;
|
|
|
- flex-shrink: 0;
|
|
|
-}
|
|
|
-.guide-bar-icon { font-size: calc(34rpx * var(--font-scale, 1)); }
|
|
|
-.guide-bar-info { flex: 1; min-width: 0; }
|
|
|
-.guide-bar-title { font-size: calc(27rpx * var(--font-scale, 1)); font-weight: bold; display: block; }
|
|
|
-.guide-bar-sub { font-size: calc(21rpx * var(--font-scale, 1)); margin-top: 3rpx; display: block; }
|
|
|
-.guide-bar-btn {
|
|
|
- flex-shrink: 0;
|
|
|
- margin-left: 12rpx;
|
|
|
- padding: 8rpx 20rpx;
|
|
|
- border-radius: 999rpx;
|
|
|
- font-size: calc(22rpx * var(--font-scale, 1));
|
|
|
- font-weight: bold;
|
|
|
-}
|
|
|
-.guide-bar-btn-text { }
|
|
|
-
|
|
|
-/* 颜色主题 — 低饱和背景 + 深色文字,不抢自测卡风头 */
|
|
|
-.guide-bar-orange { background: $c-warm-tint; border: 1rpx solid rgba($brand-primary, 0.18); }
|
|
|
-.guide-bar-orange .guide-bar-icon-wrap { background: rgba($brand-primary, 0.14); }
|
|
|
-.guide-bar-orange .guide-bar-title { color: $c-brand-ink-2; }
|
|
|
-.guide-bar-orange .guide-bar-sub { color: $c-brand-ink-3; }
|
|
|
-.guide-bar-orange .guide-bar-btn { background: linear-gradient(135deg, $brand-primary, $brand-primary-light); color: $app-surface; }
|
|
|
-
|
|
|
-.guide-bar-blue { background: $c-wisdom-tint; border: 1rpx solid rgba($dim-wisdom, 0.18); }
|
|
|
-.guide-bar-blue .guide-bar-icon-wrap { background: rgba($dim-wisdom, 0.12); }
|
|
|
-.guide-bar-blue .guide-bar-title { color: $c-wisdom-ink; }
|
|
|
-.guide-bar-blue .guide-bar-sub { color: $c-wisdom-mid; }
|
|
|
-.guide-bar-blue .guide-bar-btn { background: linear-gradient(135deg, $dim-wisdom, $c-wisdom-light); color: $app-surface; }
|
|
|
-
|
|
|
-.guide-bar-green { background: $c-action-tint; border: 1rpx solid rgba($dim-action, 0.18); }
|
|
|
-.guide-bar-green .guide-bar-icon-wrap { background: rgba($dim-action, 0.12); }
|
|
|
-.guide-bar-green .guide-bar-title { color: $c-action-ink; }
|
|
|
-.guide-bar-green .guide-bar-sub { color: $c-action-mid; }
|
|
|
-.guide-bar-green .guide-bar-btn { background: linear-gradient(135deg, $dim-action, $c-action-light); color: $app-surface; }
|
|
|
-
|
|
|
-.guide-bar-purple { background: $c-violet-tint; border: 1rpx solid rgba($facade-violet, 0.18); }
|
|
|
-.guide-bar-purple .guide-bar-icon-wrap { background: rgba($facade-violet, 0.12); }
|
|
|
-.guide-bar-purple .guide-bar-title { color: $c-violet-ink; }
|
|
|
-.guide-bar-purple .guide-bar-sub { color: $c-violet-mid; }
|
|
|
-.guide-bar-purple .guide-bar-btn { background: linear-gradient(135deg, $brand-primary, $brand-primary-light); color: $app-surface; }
|
|
|
-
|
|
|
-.guide-bar-gray { background: $c-fill-slate; border: 1rpx solid rgba($c-text-slate, 0.15); }
|
|
|
-.guide-bar-gray .guide-bar-icon-wrap { background: rgba($c-text-slate, 0.10); }
|
|
|
-.guide-bar-gray .guide-bar-title { color: $c-ink-slate; }
|
|
|
-.guide-bar-gray .guide-bar-sub { color: $c-text-slate; }
|
|
|
-.guide-bar-gray .guide-bar-btn { background: linear-gradient(135deg, $app-text-subtle, $app-border); color: $app-surface; }
|
|
|
-
|
|
|
/* ===== 快捷功能入口(单排,6个横向排列) ===== */
|
|
|
.quick-bar {
|
|
|
display: flex;
|
|
|
@@ -3413,5 +3169,4 @@ $c-warm-tint: #FFF3E7;
|
|
|
.challenge-add-btn::after {
|
|
|
border: none;
|
|
|
}
|
|
|
-.self-test-badge { display: inline-block; align-self: flex-start; margin-top: 8rpx; font-size: calc(20rpx * var(--font-scale, 1)); color: $brand-primary; background: rgba($brand-primary, 0.1); padding: 4rpx 14rpx; border-radius: 999rpx; }
|
|
|
</style>
|