Просмотр исходного кода

chore: add care_family .gitignore, cfContent submodule, update HealthReportService and purchase page

liaoxg 4 дней назад
Родитель
Сommit
aed1504a12

+ 3 - 0
.gitmodules

@@ -0,0 +1,3 @@
+[submodule "cfContent"]
+	path = cfContent
+	url = https://git.iwintrue.com/liaoxg/cfContent

+ 2 - 0
care_family家庭健康小红书运营/.gitignore

@@ -0,0 +1,2 @@
+.workbuddy/
+cdp-profile/

+ 3 - 3
cfc-backend/src/main/java/com/etotem/cfc/service/HealthReportService.java

@@ -347,11 +347,11 @@ public class HealthReportService {
             log.warn("无法解析成员所属家庭,返回空报告列表 memberId={}", memberId);
             return Collections.emptyList();
         }
+        // 严格绑定:经 reassignReport 取消归属(subject_id 被清空)的报告不在此列出,
+        // 家庭「全部」视图 getFamilyReports 仍会展示它们。
         return healthReportMapper.selectList(
                 new LambdaQueryWrapper<HealthReport>()
-                        .and(w -> w.in(HealthReport::getSubjectId, ids)
-                                .or(w2 -> w2.isNull(HealthReport::getSubjectId)
-                                        .in(HealthReport::getUserId, ids)))
+                        .in(HealthReport::getSubjectId, ids)
                         .eq(HealthReport::getFamilyId, familyId)
                         .eq(HealthReport::getStatus, "active")
                         .orderByDesc(HealthReport::getCreatedAt)

+ 16 - 24
cfc-frontend/pages/purchase/index.vue

@@ -4,7 +4,6 @@
       <view class="nav-back" @tap="goBack">
         <text class="back-text">‹ 返回</text>
       </view>
-      <text class="nav-title">健康启航计划</text>
     </view>
 
     <scroll-view class="content" scroll-y>
@@ -60,20 +59,15 @@
         </view>
       </view>
 
-      <!-- 闯关任务预览 -->
+      <!-- 21天挑战任务 -->
       <view class="card">
         <view class="card-header">
-          <text class="card-title">3周闯关挑战</text>
+          <text class="card-title">21天挑战</text>
         </view>
         <view class="challenge-preview">
-          <view class="week-item" v-for="(week, idx) in weeks" :key="idx">
-            <view class="week-header">
-              <text class="week-num">第{{ idx + 1 }}周</text>
-              <text class="week-reward">{{ week.reward }} CF</text>
-            </view>
-            <view class="week-tasks">
-              <text class="task-tag" v-for="(task, tidx) in week.tasks" :key="tidx">{{ task }}</text>
-            </view>
+          <view class="task-item" v-for="(task, idx) in challengeTasks" :key="idx">
+            <text class="task-num">{{ idx + 1 }}</text>
+            <text class="task-content">{{ task }}</text>
           </view>
         </view>
       </view>
@@ -101,14 +95,16 @@ export default {
         { icon: '📋', text: '无限报告上传', active: true },
         { icon: '🤖', text: 'AI报告解析', active: true },
         { icon: '📝', text: '每日方案生成', active: true },
-        { icon: '🏆', text: '3周闯关挑战', active: true },
+        { icon: '🏆', text: '21天挑战', active: true },
         { icon: '💰', text: 'CF值奖励', active: true },
         { icon: '👨‍👩‍👧', text: '家庭会员权益', active: false }
       ],
-      weeks: [
-        { reward: '300 CF', tasks: ['首次报告上传', '连续3天打卡', '上传1份报告'] },
-        { reward: '300 CF', tasks: ['上传3份报告', '连续7天打卡', '累计3份报告'] },
-        { reward: '300 CF', tasks: ['完成3个挑战', '连续21天打卡', '上传5份报告'] }
+      challengeTasks: [
+        '完成方案制定',
+        '根据方案践行任务',
+        '任务完成率不低于70%',
+        '21天连续打卡',
+        '上传其他报告'
       ]
     }
   },
@@ -195,7 +191,6 @@ export default {
 .nav-bar { display: flex; align-items: center; height: 88rpx; padding-top: env(safe-area-inset-top); background: #fff; border-bottom: 1rpx solid #f0f0f0; position: relative; }
 .nav-back { position: absolute; left: 24rpx; top: 0; bottom: 0; display: flex; align-items: center; }
 .back-text { font-size: 28rpx; color: #F97316; }
-.nav-title { flex: 1; text-align: center; font-size: 32rpx; font-weight: bold; color: #333; }
 .content { height: calc(100vh - 88rpx); }
 
 .hero { background: linear-gradient(135deg, #FF8C42, #F97316); padding: 40rpx 32rpx; text-align: center; }
@@ -230,13 +225,10 @@ export default {
 .cf-equivalent { font-size: 22rpx; color: #999; text-align: center; margin-top: 8rpx; display: block; }
 
 .challenge-preview { padding: 16rpx 24rpx; }
-.week-item { margin-bottom: 20rpx; }
-.week-item:last-child { margin-bottom: 0; }
-.week-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12rpx; }
-.week-num { font-size: 26rpx; font-weight: bold; color: #333; }
-.week-reward { font-size: 22rpx; color: #F97316; }
-.week-tasks { display: flex; flex-wrap: wrap; gap: 8rpx; }
-.task-tag { font-size: 22rpx; color: #666; background: #FFF3E0; padding: 6rpx 12rpx; border-radius: 12rpx; }
+.task-item { display: flex; align-items: center; gap: 16rpx; padding: 16rpx 0; border-bottom: 1rpx solid #f5f5f5; }
+.task-item:last-child { border-bottom: none; }
+.task-num { width: 40rpx; height: 40rpx; line-height: 40rpx; text-align: center; border-radius: 50%; background: #FFF3E0; color: #F97316; font-size: 22rpx; font-weight: bold; flex-shrink: 0; }
+.task-content { flex: 1; font-size: 26rpx; color: #333; }
 
 .purchase-wrap { padding: 32rpx 24rpx 40rpx; text-align: center; }
 .purchase-btn { background: linear-gradient(135deg, #FF8C42, #F97316); color: #fff; text-align: center; padding: 28rpx 0; border-radius: 16rpx; font-size: 32rpx; font-weight: bold; }