فهرست منبع

小程序美化第4轮: 首页汇总同行+6快捷+补打/未达成+推荐商品/最新活动, 成长页能量沙盘, 健康页提亮+推荐商品, 任务页家庭挑战入口, 应用库四列深色选中

Agnes Agent 7 ساعت پیش
والد
کامیت
a89513e357

+ 4 - 2
cfc-frontend/components/DimensionActivities.vue

@@ -6,7 +6,7 @@
         <view class="section-icon-wrap">
           <text class="section-icon">🎯</text>
         </view>
-        <text class="section-title">推荐活动</text>
+        <text class="section-title">{{ title }}</text>
       </view>
       <view class="section-more" @click="$emit('moreActivities')">
         <text class="section-more-text">更多</text>
@@ -103,7 +103,9 @@ var DIMENSION_MAP = {
 export default {
   props: {
     activities: { type: Array, default: function() { return [] } },
-    isLoggedIn: { type: Boolean, default: false }
+    isLoggedIn: { type: Boolean, default: false },
+    // 区块标题:默认「推荐活动」;首页/发现页可传「最新活动」等
+    title: { type: String, default: '推荐活动' }
   },
   data: function() {
     return {

+ 98 - 151
cfc-frontend/pages/growth-main/index.vue

@@ -161,27 +161,31 @@
         </view>
       </view>
 
-      <!-- 成长历史记录(按日期分组 · 预览压缩:最多 3 组 × 3 条) -->
-      <view class="section history-group-section">
+      <!-- 能量沙盘(2026-12-05 廖总:原首页沙盘迁入本页) -->
+      <view class="section">
         <view class="section-header">
           <view class="section-header-title">
-            <view class="gi-calendar"></view>
-            <text class="section-title">成长历史记录</text>
-          </view>
-          <text class="section-more" @click="goMoreHistory" v-if="dateGroups.length > 0">查看全部 ›</text>
-        </view>
-        <BaseEmpty v-if="dateGroups.length === 0" compact title="暂无记录,去记录第一笔成长吧" />
-        <view v-else class="history-group-list">
-          <view class="history-group" v-for="group in dateGroups" :key="group.date">
-            <view class="history-group-title">
-              <text class="history-group-date">{{ group.date }}</text>
-              <text class="history-group-count">{{ group.records.length }} 条</text>
-            </view>
-            <view class="history-group-item" v-for="(rec, idx) in group.records" :key="getHistoryItemKey(group.date, idx)">
-              <text class="history-group-item-title">{{ getHistoryItemTitle(rec) }}</text>
-            </view>
+            <view class="gi-chart"></view>
+            <text class="section-title">能量沙盘</text>
           </view>
         </view>
+        <GateLock v-if="sandboxLocked && sandboxLockGate" :gate="sandboxLockGate" />
+        <WuxingSandbox
+          v-else-if="sandboxData"
+          mode="live"
+          :scores="familySandboxScores"
+          :overallScore="familySandboxOverall"
+          :members="familySandboxMembers"
+          :personalData="sandboxPersonalData"
+          :dimensions="energyDimensions"
+          :totalEnergy="totalEnergy"
+          :totalHealthIndex="totalHealthIndex"
+          :currentView="currentSandboxView"
+          :familyUnlocked="familyUnlocked"
+          :memberCount="1"
+          @view-change="onSandboxViewChange"
+          showDimensionBar
+          starHeight="340rpx" />
       </view>
 
       <!-- 推荐阅读(2 条预览) -->
@@ -203,23 +207,50 @@
 
 <script>
 import LoginGuideCard from '../../components/LoginGuideCard.vue'
-import BaseEmpty from '../../components/BaseEmpty.vue'
 import ArticleFeed from '../../components/ArticleFeed.vue'
-import { healthCheckinList, getHealthMealList, getGrowthRecommendations, getExerciseRecords, getSleepRecords, getEmotionCheckinList, getCheckinList, getTodayTasks, reportAppEnter, getGrowthRecordList } from '../../utils/api.js'
-import { parseDate, recordDateOf } from '../../utils/format.js'
+import WuxingSandbox from '../../components/wuxing-sandbox.vue'
+import GateLock from '../../components/gate-lock.vue'
+import { healthCheckinList, getHealthMealList, getGrowthRecommendations, getExerciseRecords, getSleepRecords, getEmotionCheckinList, getCheckinList, getTodayTasks, reportAppEnter, getEnergySandbox, getEnergyOverview } from '../../utils/api.js'
+import { recordDateOf } from '../../utils/format.js'
 import fontScaleMixin from '@/mixins/font-scale.js'
 import shareMixin from '../../components/share-mixin.js'
 export default {
   mixins: [fontScaleMixin, shareMixin],
-  components: { LoginGuideCard, BaseEmpty, ArticleFeed },
+  components: { LoginGuideCard, ArticleFeed, WuxingSandbox, GateLock },
   data() { return { memberId: '', todayDate: '', hasIncomplete: false, incompleteCount: 0, progressItems: [], todayTaskList: [], streakDays: 0,
       healthArticles: [],
       growthArticles: [],
-      dateGroups: [],
+      // 五维能量沙盘(2026-12-05 由首页迁入)
+      sandboxData: null,
+      sandboxPersonalData: null,
+      sandboxFamilyData: null,
+      sandboxLocked: false,
+      sandboxLockGate: null,
+      currentSandboxView: 'personal',
+      familyUnlocked: false,
+      energyDimensions: [],
+      totalEnergy: 0,
+      totalHealthIndex: 0,
       isLoggedIn: false } },
   computed: {
     doneCount: function() { var c = 0; for (var i = 0; i < this.progressItems.length; i++) if (this.progressItems[i] && this.progressItems[i].done) c++; return c },
     totalCount: function() { return this.progressItems.length },
+    familySandboxScores: function() {
+      var d = this.sandboxFamilyData || {}
+      return {
+        body: d.bodyScore || 0,
+        mind: d.mindScore || 0,
+        wisdom: d.wisdomScore || 0,
+        action: d.actionScore || 0,
+        wealth: d.wealthScore || 0
+      }
+    },
+    familySandboxOverall: function() {
+      return this.sandboxFamilyData ? (this.sandboxFamilyData.overallScore || 0) : 0
+    },
+    familySandboxMembers: function() {
+      return this.sandboxFamilyData ? (this.sandboxFamilyData.members || []) : []
+    },
     recommendArticles: function() {
       var arr = []
       if (this.healthArticles && this.healthArticles.length > 0) arr = arr.concat(this.healthArticles)
@@ -286,7 +317,6 @@ export default {
     goToGames: function() { uni.navigateTo({ url: '/pages/games/list' }) },
     goToArticle: function(article) { var id = article && article.id ? article.id : article; if (!id) return; uni.navigateTo({ url: '/pages/article-center/article-detail?id=' + id }) },
     goMoreArticles: function() { uni.navigateTo({ url: '/pages/article-center/index?dimension=action' }) },
-    goMoreHistory: function() { uni.navigateTo({ url: '/pages/growth/history' }) },
     // 登录成功:刷新登录态数据(镜像 onShow 已登录分支)
     onLoginSuccess: function() {
       this.isLoggedIn = true
@@ -295,86 +325,56 @@ export default {
       this.todayDate = now.getFullYear() + '-' + this.pad(now.getMonth() + 1) + '-' + this.pad(now.getDate())
       this.loadAllData()
     },
-    /** 按日期分组(变更B):把打卡/档案记录流按业务日期 recordDate>startTime>sleepTime>checkinDate>createdAt
-     *  分组合并——同日合并、分组键 yyyy-MM-dd、多日倒序(新在前)、无有效日期的记录平稳跳过 */
-    groupByDate: function(records) {
-      var list = Array.isArray(records) ? records : []
-      var map = {}
-      var order = []
-      for (var i = 0; i < list.length; i++) {
-        var r = list[i]
-        if (!r) continue
-        var key = this.recordDateKeyOf(r)
-        if (!key) continue
-        if (!map[key]) {
-          map[key] = { date: key, records: [] }
-          order.push(key)
-        }
-        map[key].records.push(r)
-      }
-      order.sort(function(a, b) { return a < b ? 1 : -1 })
-      var groups = []
-      for (var j = 0; j < order.length; j++) {
-        groups.push(map[order[j]])
-      }
-      return groups
-    },
-    getHistoryItemKey: function(dateKey, idx) { return dateKey + '-' + idx },
-    getHistoryItemTitle: function(rec) {
-      if (!rec) return ''
-      var t = rec.recordTitle || rec.name || rec.note || rec.mood || rec.content || ''
-      if (t) return t
-      if (rec.type) return rec.type
-      return '记录'
-    },
-    /** 单条记录的业务日期键(分组口径):recordDate>startTime>sleepTime>checkinDate,
-     *  无效业务日期(空串/无法解析,如手填 'not-a-date')视为无日期记录予以跳过;不取 createdAt 兜底 */
-    recordDateKeyOf: function(rec) {
-      if (!rec) return ''
-      var fields = ['recordDate', 'startTime', 'sleepTime', 'checkinDate']
-      for (var i = 0; i < fields.length; i++) {
-        var key = fields[i]
-        var v = rec[key]
-        if (v === null || v === undefined || v === '') continue
-        var d = parseDate(v)
-        if (!d) continue
-        return d.getFullYear() + '-' + this.pad(d.getMonth() + 1) + '-' + this.pad(d.getDate())
-      }
-      return ''
-    },
-    /** 成长历史记录加载:档案列表与全部打卡记录汇成一条记录流,按日期分组存入 dateGroups。
-     *  极致简单:本页只取预览(最多 3 个日期分组 × 每组 3 条),完整记录走 /pages/growth/history */
-    async loadGrowthHistoryGroups() {
-      var self = this
-      var streams = []
-      try {
-        var gRes = await getGrowthRecordList()
-        if (gRes && gRes.code === 200 && Array.isArray(gRes.data)) streams = streams.concat(gRes.data)
-      } catch(e) {}
-      var checkinStreams = [
-        getHealthMealList(self.memberId ? { memberId: self.memberId } : {}),
-        getExerciseRecords(self.memberId ? { memberId: self.memberId } : {}),
-        getSleepRecords(self.memberId ? { memberId: self.memberId } : {}),
-        getEmotionCheckinList({ page: 1, size: 50, memberId: self.memberId || undefined }),
-        getCheckinList(self.memberId ? { memberId: self.memberId } : {})
-      ]
-      var results = await Promise.all(checkinStreams.map(function(p) { return p.catch(function() { return null }) }))
-      for (var i = 0; i < results.length; i++) {
-        var res = results[i]
-        if (res && res.code === 200 && Array.isArray(res.data)) streams = streams.concat(res.data)
-      }
-      var groups = self.groupByDate(streams)
-      // 预览上限:最多 3 个日期分组,每组最多 3 条(完整记录走历史页)
-      self.dateGroups = groups.slice(0, 3).map(function(g) {
-        return { date: g.date, records: g.records.slice(0, 3) }
-      })
-    },
     async loadAllData() {
       var self = this
       try { await self.loadProgressItems() } catch(e) {}
       try { await self.loadGrowthRecommendations() } catch(e) {}
       try { await self.loadMilestones() } catch(e) {}
-      try { await self.loadGrowthHistoryGroups() } catch(e) {}
+      try { await self.loadEnergyOverview() } catch(e) {}
+      try { await self.loadSandboxData() } catch(e) {}
+    },
+    /** 能量概览:供沙盘右上角总能量/健康指数展示 */
+    async loadEnergyOverview() {
+      var memberId = this.memberId || uni.getStorageSync('currentChildId') || uni.getStorageSync('currentMemberId')
+      if (!memberId) return
+      var self = this
+      getEnergyOverview(memberId).then(function(res) {
+        if (res && res.data) {
+          self.energyDimensions = res.data.dimensions || []
+          self.totalEnergy = res.data.totalEnergy || 0
+          self.totalHealthIndex = res.data.totalHealthIndex || 0
+        }
+      }).catch(function(e) { console.log('获取能量概览失败', e) })
+    },
+    /** 五维能量沙盘:个人/全家视角(未解锁时后端回 gate,交由 GateLock 渲染自检引导) */
+    loadSandboxData: function() {
+      var self = this
+      var memberId = this.memberId || uni.getStorageSync('currentChildId') || uni.getStorageSync('currentMemberId') || null
+      getEnergySandbox(this.currentSandboxView, memberId).then(function(res) {
+        if (res && res.data) {
+          var d = res.data
+          if (d.locked) {
+            self.sandboxLocked = true
+            self.sandboxLockGate = d.gate || null
+            self.sandboxData = null
+            self.sandboxPersonalData = null
+            self.sandboxFamilyData = null
+          } else {
+            self.sandboxLocked = false
+            self.sandboxLockGate = null
+            self.sandboxPersonalData = d.personalData || null
+            self.sandboxFamilyData = d.familyData || null
+            self.sandboxData = self.currentSandboxView === 'family' ? (d.familyData || null) : (d.personalData || null)
+            self.familyUnlocked = d.familyUnlocked || false
+          }
+        }
+      }).catch(function() {})
+    },
+    /** 切换沙盘个人/全家视角(本地切换,不重新请求) */
+    onSandboxViewChange: function(view) {
+      if (view === this.currentSandboxView) return
+      this.currentSandboxView = view
+      this.sandboxData = view === 'family' ? (this.sandboxFamilyData || null) : (this.sandboxPersonalData || null)
     },
     async loadProgressItems() {
       var self = this
@@ -801,59 +801,6 @@ $gg-tint-soft: $tint-warm-soft;               // 暖白浅底 #FFF1E6
   margin-left: 12rpx;
 }
 
-// ---- 成长历史记录(日期分组预览 · 修复:模板已引用 .history-group-* 但无样式定义,未套用;现按卡片规范补齐) ----
-.history-group-section { margin-top: 20rpx; }
-.history-group-list {
-  background: $app-surface;
-  border-radius: 24rpx;
-  padding: 8rpx 24rpx;
-  box-shadow: 0 2rpx 16rpx rgba(0,0,0,0.05);
-}
-.history-group { padding: 18rpx 0; }
-.history-group + .history-group { border-top: 1rpx solid $app-border-subtle; }
-.history-group-title {
-  display: flex;
-  align-items: center;
-  justify-content: space-between;
-  margin-bottom: 8rpx;
-}
-.history-group-date {
-  font-size: calc(24rpx * var(--font-scale, 1));
-  font-weight: 700;
-  color: $facade-text-strong;
-}
-.history-group-count {
-  font-size: calc(20rpx * var(--font-scale, 1));
-  color: $facade-text-body;
-  background: $facade-fill-2;
-  border-radius: 999rpx;
-  padding: 2rpx 14rpx;
-  font-weight: 500;
-}
-.history-group-item {
-  display: flex;
-  align-items: center;
-  padding: 8rpx 0;
-}
-.history-group-item::before {
-  content: '';
-  width: 10rpx;
-  height: 10rpx;
-  border-radius: 50%;
-  background: $brand-primary;
-  flex-shrink: 0;
-  margin-right: 14rpx;
-}
-.history-group-item-title {
-  flex: 1;
-  min-width: 0;
-  font-size: calc(24rpx * var(--font-scale, 1));
-  color: $facade-text-body;
-  overflow: hidden;
-  white-space: nowrap;
-  text-overflow: ellipsis;
-}
-
 // ---- 通用 section-header ----
 .section-header {
   display: flex;

+ 29 - 16
cfc-frontend/pages/health-main/index.vue

@@ -238,16 +238,20 @@
         </view>
       </view>
 
-      <!-- 推荐阅读 -->
+      <!-- 推荐商品(2026-12-05 廖总:原推荐阅读位改放推荐商品) -->
       <view class="section">
         <view class="section-header">
           <view class="section-title-wrap">
-            <view class="hc-book"></view>
-            <text class="section-title">推荐阅读</text>
+            <view class="hc-cart"></view>
+            <text class="section-title">推荐商品</text>
           </view>
-          <text class="section-more" @click="goMoreArticles">更多 ›</text>
+          <text class="section-more" @click="goMoreProducts">更多 ›</text>
         </view>
-        <ArticleFeed :articles="healthArticles" @articleClick="goArticleDetail" />
+        <DimensionProducts
+          :is-logged-in="isLoggedIn"
+          title="推荐商品"
+          @productClick="onProductClick"
+          @moreProducts="goMoreProducts" />
       </view>
     </block>
   </view>
@@ -257,7 +261,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 DimensionProducts from '../../components/DimensionProducts.vue'
 import BasePrimaryButton from '../../components/BasePrimaryButton.vue'
 import { ensureDimensionRegistry, getRadarConfig, isRegistryReady, WEALTH_CHILD_LABEL } from '../../composables/useDimensionRegistry.js'
 import fontScaleMixin from '@/mixins/font-scale.js'
@@ -265,7 +269,7 @@ import shareMixin from '../../components/share-mixin.js'
 
 export default {
   mixins: [fontScaleMixin, shareMixin],
-  components: { LoginGuideCard, RadarChart, ArticleFeed, BasePrimaryButton },
+  components: { LoginGuideCard, RadarChart, DimensionProducts, BasePrimaryButton },
   data() {
     return {
       isLoggedIn: !!uni.getStorageSync('token'),
@@ -907,6 +911,14 @@ export default {
     goMoreArticles: function() {
       uni.navigateTo({ url: '/pages/article-center/index?dimension=body' })
     },
+    /** 推荐商品点击 → 商品详情 */
+    onProductClick: function(prod) {
+      if (!prod || !prod.id) return
+      uni.navigateTo({ url: '/pages/discover-detail/product-detail/product-detail?id=' + prod.id })
+    },
+    goMoreProducts: function() {
+      uni.navigateTo({ url: '/pages/discover/index' })
+    },
     _formatReportDate: function(dateStr) {
       if (!dateStr) return ''
       // 后端返回 ISO 8601 (2026-08-15T14:30:00) 或 yyyy-MM-dd,统一截取前10位
@@ -939,16 +951,16 @@ export default {
 .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(249, 115, 22, 0.22); }
+.upload-hero { background: linear-gradient(150deg, $brand-primary-tint-2 0%, $facade-brand-tint 100%); border-radius: 24rpx; padding: 28rpx 28rpx 24rpx; margin-bottom: 16rpx; box-shadow: 0 6rpx 20rpx rgba(249, 115, 22, 0.14); }
 .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-ic { width: 88rpx; height: 88rpx; flex-shrink: 0; border-radius: 24rpx; background: $brand-primary-soft; 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='%23F97316' 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; }
+.upload-hero-title { font-size: calc(32rpx * var(--font-scale, 1)); font-weight: 800; color: $brand-primary-deep; letter-spacing: 1rpx; }
+.upload-hero-desc { font-size: calc(23rpx * var(--font-scale, 1)); color: rgba($brand-primary-deep, 0.78); 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='%23F97316' 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: $brand-primary; color: $app-surface; }
 /* 数据来源(华为健康)折叠二级面板 */
 .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; }
@@ -977,7 +989,7 @@ export default {
 .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-body; 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: 0 $uni-space-page; min-height: 88rpx; line-height: 88rpx; box-sizing: border-box; margin: 0; }
+.quiz-btn { background: $brand-primary-soft; color: $brand-primary-deep; font-size: calc(24rpx * var(--font-scale, 1)); border: 1rpx solid $brand-primary-light-2; border-radius: 24rpx; padding: 0 $uni-space-page; min-height: 88rpx; line-height: 88rpx; box-sizing: border-box; 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; }
@@ -1005,7 +1017,7 @@ export default {
 .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, $uni-primary-dark); color: $app-surface; font-size: calc(24rpx * var(--font-scale, 1)); border: none; border-radius: 24rpx; padding: 0 28rpx; min-height: 88rpx; line-height: 88rpx; box-sizing: border-box; margin: 0; }
+.plan-btn { background: $brand-primary-soft; color: $brand-primary-deep; font-size: calc(24rpx * var(--font-scale, 1)); border: 1rpx solid $brand-primary-light-2; border-radius: 24rpx; padding: 0 28rpx; min-height: 88rpx; line-height: 88rpx; box-sizing: border-box; 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-body; display: block; margin-top: 12rpx; }
 /* ===== 访客态(设计稿 page-health 落地 · 令牌化) ===== */
@@ -1062,6 +1074,7 @@ $hi-strong: str-slice('#{$facade-text-strong}', 2);
 .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'); }
+.hc-cart    { 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, '%3Ccircle cx=%229%22 cy=%2221%22 r=%221%22/%3E%3Ccircle cx=%2220%22 cy=%2221%22 r=%221%22/%3E%3Cpath d=%22M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6%22/%3E'); }
 .plan-head-title { display: flex; align-items: center; }
 .section-title-wrap { display: flex; align-items: center; }
 

+ 58 - 5
cfc-frontend/pages/home/app-library.vue

@@ -25,15 +25,21 @@
       </view>
     </view>
 
-    <!-- 可配置的功能 -->
+    <!-- 可配置的功能(四列显示,选中用深色) -->
     <view class="section" v-if="configurableApps.length > 0">
       <view class="section-title">可配置的功能</view>
+      <view class="configurable-tip">快捷区最多显示 6 个,已选 {{ quickApps.length }} 个</view>
       <view class="configurable-list">
-        <view class="configurable-item" v-for="app in configurableApps" :key="app.key" @click="toggleApp(app.key)">
+        <view
+          class="configurable-item"
+          :class="{ 'configurable-item--selected': isAppInQuickApps(app.key) }"
+          v-for="app in configurableApps"
+          :key="app.key"
+          @click="toggleApp(app.key)">
           <view class="configurable-icon">{{ app.icon }}</view>
           <view class="configurable-detail">
             <text class="configurable-name">{{ app.name }}</text>
-            <view v-if="isAppInQuickApps(app.key)" class="status-badge">已在快捷区</view>
+            <view v-if="isAppInQuickApps(app.key)" class="status-badge status-badge--selected">已在快捷区</view>
             <view v-else class="status-badge">不在快捷区</view>
           </view>
         </view>
@@ -156,6 +162,14 @@ export default {
     },
     toggleApp: function(appKey) {
       var isInQuick = this.isAppInQuickApps(appKey)
+      // 快捷区最多显示 6 个:超 6 时先提醒,不直接入池(2026-12-05 廖总)
+      if (!isInQuick) {
+        var lockedCount = (this.myShortcuts || []).filter(function(s) { return s && s.locked === 1 }).length
+        if (lockedCount >= 6) {
+          uni.showToast({ title: '快捷区最多显示 6 个,请先移出一个再添加', icon: 'none', duration: 2200 })
+          return
+        }
+      }
       var items = []
       // 保留其他已配置项,更新当前项
       var existingItems = this.myShortcuts.map(function(s) { return { appKey: s.appKey, locked: s.locked, sortOrder: s.sortOrder } })
@@ -236,8 +250,7 @@ export default {
   flex-wrap: wrap;
   gap: 16rpx;
 }
-.fixed-item,
-.configurable-item {
+.fixed-item {
   width: calc(50% - 8rpx);
   background: $app-surface;
   border-radius: 16rpx;
@@ -245,6 +258,24 @@ export default {
   box-sizing: border-box;
   position: relative;
 }
+/* 可配置功能:四列网格(2026-12-05 廖总) */
+.configurable-item {
+  width: calc(25% - 12rpx);
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  gap: 8rpx;
+  background: $app-surface;
+  border-radius: 16rpx;
+  padding: 18rpx 12rpx;
+  box-sizing: border-box;
+  position: relative;
+  text-align: center;
+}
+/* 选中态:深色底 + 浅字 */
+.configurable-item--selected {
+  background: $facade-text-strong;
+}
 .fixed-info,
 .configurable-detail {
   display: flex;
@@ -268,6 +299,16 @@ export default {
   font-weight: bold;
   color: $facade-text-strong;
 }
+.configurable-item .configurable-name {
+  font-size: calc(22rpx * var(--font-scale, 1));
+  white-space: nowrap;
+  overflow: hidden;
+  text-overflow: ellipsis;
+  max-width: 100%;
+}
+.configurable-item--selected .configurable-name {
+  color: $app-surface;
+}
 .fixed-desc,
 .configurable-desc {
   font-size: calc(20rpx * var(--font-scale, 1));
@@ -289,6 +330,18 @@ export default {
   color: $facade-text-muted;
   margin-top: 8rpx;
 }
+.status-badge--selected {
+  color: $app-surface;
+}
+.configurable-item--selected .configurable-icon {
+  background: rgba(255, 255, 255, 0.16);
+}
+/* 四列区说明:快捷区上限 6 个 */
+.configurable-tip {
+  font-size: calc(22rpx * var(--font-scale, 1));
+  color: $facade-text-muted;
+  margin: -8rpx 0 16rpx 8rpx;
+}
 .empty-state {
   padding: 120rpx 40rpx;
   text-align: center;

+ 117 - 78
cfc-frontend/pages/index-home/index.vue

@@ -89,6 +89,8 @@
           <view class="todo-head-title-wrap">
             <text class="todo-title">当前待办</text>
             <view v-if="todoCount > 0" class="todo-count-badge">{{ todoCount }}</view>
+            <!-- 全家待办 / 家庭挑战 汇总:与「当前待办」同行(2026-12-05 廖总) -->
+            <text v-if="todoSummaryLine" class="todo-head-summary" @click="goTasksPage">{{ todoSummaryLine }}</text>
           </view>
           <text class="section-more" @click="goTasksPage">全部 ›</text>
         </view>
@@ -106,8 +108,10 @@
               <text class="todo-item-meta" v-if="!task._isOverdue">+{{ task.points }}CF</text>
               <text class="todo-item-meta todo-item-meta--overdue" v-else>已超期</text>
             </view>
-            <view v-if="task._isOverdue" class="todo-overdue-tag">已超期</view>
+            <!-- 超期任务:补打(可补交但不发 CF);需未达成处理的:加「未达成」按钮 -->
+            <button v-if="task._isOverdue" class="btn-quick-complete btn-quick-complete--makeup" @click.stop="quickCompleteTask(task)">补打</button>
             <button v-else class="btn-quick-complete" @click.stop="quickCompleteTask(task)">{{ task._isLinked ? '去完成' : (task.requireInput === 1 ? '去填写' : '完成') }}</button>
+            <button v-if="task._canNotAchieve" class="btn-not-achieved" @click.stop="markNotAchieved(task)">未达成</button>
           </view>
         </view>
 
@@ -117,12 +121,6 @@
           <image class="todo-more-arrow" :src="svgAssets.misc.chevronDown" mode="aspectFit" />
         </view>
 
-        <!-- 全家待办 / 家庭挑战 汇总行 -->
-        <view v-if="todoSummaryLine" class="todo-summary" @click="goTasksPage">
-          <text class="todo-summary-text">{{ todoSummaryLine }}</text>
-          <text class="todo-summary-arrow">›</text>
-        </view>
-
         <!-- 全部完成空态 -->
         <BaseEmpty
           v-if="!hasPendingTasks && familyTodoCount === 0 && activeChallenges.length === 0"
@@ -163,15 +161,17 @@
       </view>
     </view>
 
-    <!-- ⑤ 推荐阅读(2 条预览) -->
+    <!-- ⑤ 最新活动(2026-12-05 廖总:原推荐阅读位改为最新活动,无数据时组件内部降级) -->
     <view class="section">
       <view class="section-header">
-        <text class="section-title">推荐阅读</text>
-        <text class="section-more" @click="goMoreArticles">更多 ›</text>
+        <text class="section-title">最新活动</text>
+        <text class="section-more" @click="goMoreActivities">更多 ›</text>
       </view>
-      <ArticleFeed
-        :articles="actionArticles"
-        @articleClick="goArticleDetail" />
+      <DimensionActivities
+        title="最新活动"
+        :is-logged-in="isLoggedIn()"
+        @activityClick="onActivityClick"
+        @moreActivities="goMoreActivities" />
     </view>
 
     <!-- ⑥ 会员入口:折叠为一行文字入口(非会员 / 快到期才显示) -->
@@ -183,24 +183,18 @@
     <!-- ⓪ 新手成长礼包进度条(仅当有未领完奖励才显示,组件内部判定) -->
     <OnboardingProgressBar ref="onboardingProgress" />
 
-    <!-- ⑦ 五维能量沙盘(品牌锚点,压缩高度) -->
-    <GateLock v-if="sandboxLocked && sandboxLockGate" :gate="sandboxLockGate" />
-    <WuxingSandbox
-      v-else-if="sandboxData"
-      mode="live"
-      :scores="familySandboxScores"
-      :overallScore="familySandboxOverall"
-      :members="familySandboxMembers"
-      :personalData="sandboxPersonalData"
-      :dimensions="energyDimensions"
-      :totalEnergy="totalEnergy"
-      :totalHealthIndex="totalHealthIndex"
-      :currentView="currentSandboxView"
-      :familyUnlocked="familyUnlocked"
-      :memberCount="familyMembersVisible.length"
-      @view-change="onSandboxViewChange"
-      showDimensionBar
-      starHeight="340rpx" />
+    <!-- ⑦ 推荐商品(2026-12-05 廖总:原能量沙盘位改放推荐商品) -->
+    <view class="section">
+      <view class="section-header">
+        <text class="section-title">推荐商品</text>
+        <text class="section-more" @click="goMoreProducts">更多 ›</text>
+      </view>
+      <DimensionProducts
+        :is-logged-in="isLoggedIn()"
+        title="推荐商品"
+        @productClick="onProductClick"
+        @moreProducts="goMoreProducts" />
+    </view>
 
     <!-- 底部占位 -->
     <view class="bottom-spacer" style="height: 40rpx;"></view>
@@ -367,10 +361,9 @@
 
 <script>
 import store from '../../store/index.js'
-import WuxingSandbox from '../../components/wuxing-sandbox.vue'
-import GateLock from '../../components/gate-lock.vue'
 import FamilyFeed from '../../components/FamilyFeed.vue'
-import ArticleFeed from '../../components/ArticleFeed.vue'
+import DimensionActivities from '../../components/DimensionActivities.vue'
+import DimensionProducts from '../../components/DimensionProducts.vue'
 import BaseCard from '../../components/BaseCard.vue'
 import BasePrimaryButton from '../../components/BasePrimaryButton.vue'
 import BaseEmpty from '../../components/BaseEmpty.vue'
@@ -419,15 +412,14 @@ var DEFAULT_QUICK_KEYS = ['task', 'diet', 'shop', 'cart']
 // 频度候选黑名单:营销/低频入口不在首页快捷区自动出现(用户显式锁定的除外;members 成员入口与问候条家庭入口重复,改默认让位 shop)
 var HOME_QUICK_BLOCK = { circle: true, membership: true }
 // 快捷区最大格数(极致简单:≤4 格)
-var QUICK_MAX = 4
+var QUICK_MAX = 6
 
 export default {
   mixins: [fontScaleMixin],
-components: {
-    WuxingSandbox,
-    GateLock,
+  components: {
+    DimensionActivities,
+    DimensionProducts,
     FamilyFeed,
-    ArticleFeed,
     BaseCard,
     BasePrimaryButton,
     BaseEmpty,
@@ -584,7 +576,7 @@ membershipDays: 0,
     todoSummaryLine: function() {
       var parts = []
       if (this.familyTodoCount > 0) parts.push('全家待办 ' + this.familyTodoCount + ' 项')
-      if (this.activeChallenges && this.activeChallenges.length > 0) parts.push('家庭挑战 ' + this.activeChallenges.length + ' 个进行中')
+      if (this.activeChallenges && this.activeChallenges.length > 0) parts.push('家庭挑战 ' + this.activeChallenges.length + ' 个')
       return parts.join(' · ')
     },
     actionArticles: function() {
@@ -1133,6 +1125,8 @@ membershipDays: 0,
             if (t.actionType && ['minigame', 'focus', 'survey', 'article', 'activity', 'cart', 'order', 'diet', 'sleep', 'exercise'].indexOf(t.actionType) >= 0) {
               t._isLinked = true
             }
+            // 未达成:与 pages/tasks/tasks.vue 同口径(pending/in_progress、非起步型、非填写式、非联动跳转)
+            t._canNotAchieve = t.status === 'pending' && !t.startRequired && t.requireInput !== 1 && !t.actionType
             return true
           })
           // 排序(2026-12-05 廖总):首页默认只显示前 3 条 → 快到期/已超期的排最前;
@@ -1589,6 +1583,29 @@ membershipDays: 0,
       this.activeInputTask = null
       this.inputContent = ''
     },
+    /** 未达成:以 achieved=0 提交完成(不计奖励),与 tasks.vue「未达成」同口径 */
+    markNotAchieved: function(task) {
+      var self = this
+      if (!task || !task.id) return
+      uni.showModal({
+        title: '标记未达成',
+        content: '确认将「' + (task.title || '该任务') + '」记录为未达成?',
+        success: function(r) {
+          if (!r.confirm) return
+          var memberId = task.familyMemberId || null
+          completeTaskApi(task.id, memberId, '', '', 'text', 0).then(function(res) {
+            if (res && res.code === 200) {
+              uni.showToast({ title: '已记录未达成', icon: 'none' })
+              self.loadTodayTasks()
+            } else {
+              uni.showToast({ title: (res && res.message) || '操作失败', icon: 'none' })
+            }
+          }).catch(function() {
+            uni.showToast({ title: '操作失败,请重试', icon: 'none' })
+          })
+        }
+      })
+    },
     submitWithInput: async function() {
       var self = this
       var task = this.activeInputTask
@@ -1750,6 +1767,22 @@ membershipDays: 0,
     navTo: function(url) {
       nav.goPage(url)
     },
+    /** 推荐商品点击 → 商品详情 */
+    onProductClick: function(prod) {
+      if (!prod || !prod.id) return
+      uni.navigateTo({ url: '/pages/discover-detail/product-detail/product-detail?id=' + prod.id })
+    },
+    goMoreProducts: function() {
+      uni.navigateTo({ url: '/pages/discover/index' })
+    },
+    /** 最新活动点击 → 活动详情 */
+    onActivityClick: function(act) {
+      if (!act || !act.id) return
+      uni.navigateTo({ url: '/pages/activity/activity-detail/activity-detail?id=' + act.id })
+    },
+    goMoreActivities: function() {
+      uni.navigateTo({ url: '/pages/discover/index' })
+    },
     // 当前待办主行动:进入任务页
     goTasksPage: function() {
       this.navTo('/pages/tasks/tasks')
@@ -2398,6 +2431,17 @@ $c-violet-mid:    $violet-700;
   display: flex;
   flex-direction: row;
   align-items: center;
+  flex: 1;
+  min-width: 0;
+  overflow: hidden;
+}
+.todo-head-summary {
+  margin-left: 12rpx;
+  font-size: calc(22rpx * var(--font-scale, 1));
+  color: $facade-text-body;
+  white-space: nowrap;
+  overflow: hidden;
+  text-overflow: ellipsis;
 }
 .todo-title {
   font-size: calc(32rpx * var(--font-scale, 1));
@@ -2454,42 +2498,8 @@ $c-violet-mid:    $violet-700;
   color: $status-danger-strong;
   font-weight: bold;
 }
-.todo-overdue-tag {
-  margin-left: 16rpx;
-  padding: 8rpx 20rpx;
-  background: $status-danger-tint;
-  color: $status-danger-strong;
-  font-size: calc(24rpx * var(--font-scale, 1));
-  font-weight: bold;
-  border-radius: 24rpx;
-  flex-shrink: 0;
-  line-height: 1;
-  height: 44rpx;
-  display: flex;
-  align-items: center;
-}
-.todo-summary {
-  margin-top: 16rpx;
-  display: flex;
-  flex-direction: row;
-  align-items: center;
-  justify-content: space-between;
-  padding: 16rpx 4rpx;
-  min-height: 88rpx;
-  border-top: 1rpx solid $uni-border-subtle;
-  cursor: pointer;
-}
-.todo-summary:active {
-  opacity: 0.8;
-}
-.todo-summary-text {
-  font-size: calc(24rpx * var(--font-scale, 1));
-  color: $facade-text-body;
-}
-.todo-summary-arrow {
-  font-size: calc(28rpx * var(--font-scale, 1));
-  color: $app-text-muted;
-}
+/* 2026-12-05 廖总:原 .todo-overdue-tag 独立标签已并入任务行 meta 文案(已超期),样式同步移除 */
+/* 2026-12-05 廖总:原 .todo-summary 独立汇总行已并入「当前待办」标题行(.todo-head-summary),样式同步移除 */
 .todo-footer {
   margin-top: 24rpx;
 }
@@ -2832,19 +2842,22 @@ $c-violet-mid:    $violet-700;
   color: $brand-primary-deep;
 }
 
-/* ===== 快捷功能入口(单排,4个横向排列) ===== */
+/* ===== 快捷功能入口(最多 6 个,4 个一行自动换行) ===== */
 .quick-bar {
   display: flex;
   flex-direction: row;
   justify-content: space-between;
   align-items: center;
+  flex-wrap: wrap;
+  row-gap: 20rpx;
   background: $app-surface;
   border-radius: 24rpx;
   padding: 20rpx 10rpx;
 }
 
 .quick-item {
-  flex: 1;
+  flex: 0 0 calc(25% - 12rpx);
+  width: calc(25% - 12rpx);
   display: flex;
   flex-direction: column;
   align-items: center;
@@ -2898,6 +2911,32 @@ $c-violet-mid:    $violet-700;
 .btn-quick-complete::after {
   border: none;
 }
+/* 补打:超期任务补交,中性描边橙底(不发 CF,后端按超期裁剪) */
+.btn-quick-complete--makeup {
+  background: $brand-primary-soft;
+  color: $brand-primary-deep;
+}
+/* 未达成:中性描边,与 tasks.vue 同款(achieved=0 提交) */
+.btn-not-achieved {
+  margin-left: 12rpx;
+  padding: 10rpx 28rpx;
+  background: $app-surface;
+  color: $facade-text-body;
+  border: 1rpx solid $uni-border-subtle;
+  font-size: calc(24rpx * var(--font-scale, 1));
+  border-radius: 28rpx;
+  line-height: 1.4;
+  min-height: 56rpx;
+  height: auto;
+  box-sizing: border-box;
+  display: inline-flex;
+  align-items: center;
+  justify-content: center;
+  flex-shrink: 0;
+}
+.btn-not-achieved::after {
+  border: none;
+}
 
 /* ===== 待办列表「查看更多」行(双向下箭头,点进任务列表) ===== */
 .todo-more-row {

+ 60 - 0
cfc-frontend/pages/tasks/tasks.vue

@@ -33,6 +33,16 @@
       </view>
     </view>
 
+    <!-- 添加家庭挑战入口(2026-12-05 廖总:今日任务页顶部入口) -->
+    <view v-if="activeTab === 'today'" class="challenge-entry" @click="goToChallengeManage">
+      <view class="challenge-entry-ic">🏆</view>
+      <view class="challenge-entry-info">
+        <text class="challenge-entry-title">添加家庭挑战</text>
+        <text class="challenge-entry-desc">全家一起完成,共同进步</text>
+      </view>
+      <text class="challenge-entry-arrow">›</text>
+    </view>
+
     <!-- 待接受任务 -->
     <view class="task-list" v-if="activeTab === 'pending'">
       <view class="task-card" v-for="task in pendingTasks" :key="task.id">
@@ -409,6 +419,10 @@ export default {
     goToOrchestration() {
       uni.navigateTo({ url: '/pages/orchestration/index' })
     },
+    // 添加家庭挑战入口(2026-12-05 廖总):跳家庭挑战管理页,内含新建挑战
+    goToChallengeManage() {
+      uni.navigateTo({ url: '/pages/health/challenge-manage' })
+    },
     async loadInitialData() {
       this.loading = true
       try {
@@ -1279,6 +1293,52 @@ export default {
 }
 .orchestration-btn::after { border: none; }
 
+/* ===== 添加家庭挑战入口(2026-12-05 廖总) ===== */
+.challenge-entry {
+  display: flex;
+  flex-direction: row;
+  align-items: center;
+  margin: 0 24rpx 16rpx;
+  padding: 20rpx 24rpx;
+  background: $app-surface;
+  border-radius: 20rpx;
+  box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.05);
+}
+.challenge-entry:active { opacity: 0.85; }
+.challenge-entry-ic {
+  width: 56rpx;
+  height: 56rpx;
+  flex-shrink: 0;
+  border-radius: 16rpx;
+  background: $brand-primary-soft;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  font-size: calc(30rpx * var(--font-scale, 1));
+}
+.challenge-entry-info {
+  flex: 1;
+  min-width: 0;
+  margin-left: 18rpx;
+  display: flex;
+  flex-direction: column;
+}
+.challenge-entry-title {
+  font-size: calc(28rpx * var(--font-scale, 1));
+  font-weight: 600;
+  color: $facade-text-strong;
+}
+.challenge-entry-desc {
+  font-size: calc(22rpx * var(--font-scale, 1));
+  color: $facade-text-muted;
+  margin-top: 4rpx;
+}
+.challenge-entry-arrow {
+  font-size: calc(32rpx * var(--font-scale, 1));
+  color: $facade-text-muted;
+  flex-shrink: 0;
+}
+
 .modal-mask {
   position: fixed;
   top: 0;