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

feat: 行首页移除成长里程碑 - 移除OctopusGraph/milestones功能

Xiaogang Liao 3 месяцев назад
Родитель
Сommit
33275e6ed7

+ 1 - 2
cfc-backend/src/main/java/com/etotem/cfc/controller/GrowthTaskController.java

@@ -23,8 +23,7 @@ public class GrowthTaskController {
     @PostMapping("/list")
     @PostMapping("/list")
     public Result<List<Map<String, Object>>> list(@RequestAttribute("userId") Long userId,
     public Result<List<Map<String, Object>>> list(@RequestAttribute("userId") Long userId,
                                                    @RequestBody Map<String, String> params) {
                                                    @RequestBody Map<String, String> params) {
-        String type = params.getOrDefault("type", "DAILY");
-        return Result.success(growthTaskService.getTaskList(userId, type));
+return Result.success(growthTaskService.getTaskList(userId, params));
     }
     }
 
 
  @PostMapping("/claim")
  @PostMapping("/claim")

+ 20 - 12
cfc-backend/src/main/java/com/etotem/cfc/service/GrowthTaskService.java

@@ -38,17 +38,24 @@ public class GrowthTaskService {
     /**
     /**
      * Get task list with user's progress for today (daily) or all-time (newbie).
      * Get task list with user's progress for today (daily) or all-time (newbie).
      */
      */
-    public List<Map<String, Object>> getTaskList(Long userId, String type) {
-        if (type == null || type.isEmpty()) {
-            type = "DAILY";
-        }
+public List<Map<String, Object>> getTaskList(Long userId, Map<String, String> params) {
+	String type = params != null ? params.getOrDefault("type", "DAILY") : "DAILY";
+	String dimension = params != null ? params.get("dimension") : null;
 
 
-        List<GrowthTask> tasks = growthTaskMapper.selectList(
-                new LambdaQueryWrapper<GrowthTask>()
-                        .eq(GrowthTask::getType, type)
-                        .eq(GrowthTask::getEnabled, 1)
-                        .orderByAsc(GrowthTask::getSortOrder)
-        );
+	if (type == null || type.isEmpty()) {
+		type = "DAILY";
+	}
+
+	LambdaQueryWrapper<GrowthTask> queryWrapper = new LambdaQueryWrapper<GrowthTask>()
+		.eq(GrowthTask::getType, type)
+		.eq(GrowthTask::getEnabled, 1)
+		.orderByAsc(GrowthTask::getSortOrder);
+
+	if (dimension != null && !dimension.isEmpty()) {
+		queryWrapper.eq(GrowthTask::getDimension, dimension);
+	}
+
+	List<GrowthTask> tasks = growthTaskMapper.selectList(queryWrapper);
 
 
         String today = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
         String today = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
 
 
@@ -62,9 +69,10 @@ public class GrowthTaskService {
             item.put("rewardPoints", task.getRewardPoints());
             item.put("rewardPoints", task.getRewardPoints());
             item.put("rewardEnergy", task.getRewardEnergy());
             item.put("rewardEnergy", task.getRewardEnergy());
             item.put("targetValue", task.getTargetValue());
             item.put("targetValue", task.getTargetValue());
-            item.put("taskKey", task.getTaskKey());
+item.put("taskKey", task.getTaskKey());
+item.put("dimension", task.getDimension());
 
 
-            // Find user's log for this task
+// Find user's log for this task
             LambdaQueryWrapper<GrowthTaskLog> logWrapper = new LambdaQueryWrapper<GrowthTaskLog>()
             LambdaQueryWrapper<GrowthTaskLog> logWrapper = new LambdaQueryWrapper<GrowthTaskLog>()
                     .eq(GrowthTaskLog::getUserId, userId)
                     .eq(GrowthTaskLog::getUserId, userId)
                     .eq(GrowthTaskLog::getTaskId, task.getId());
                     .eq(GrowthTaskLog::getTaskId, task.getId());

+ 7 - 14
cfc-frontend/pages/action/index.vue

@@ -82,12 +82,11 @@
       @articleClick="goArticleDetail"
       @articleClick="goArticleDetail"
       @moreArticles="goMoreArticles" />
       @moreArticles="goMoreArticles" />
 
 
-    <!-- ===== 重要关系维护 + 关系健康概览 ===== -->
-    <OctopusGraph
-      :contactList="contactList"
-      :healthAlerts="healthAlerts"
-      :milestones="milestones"
-      :isLoggedIn="isLoggedIn" />
+        <!-- ===== 重要关系维护 ===== -->
+        <OctopusGraph
+          :contactList="contactList"
+          :healthAlerts="healthAlerts"
+          :isLoggedIn="isLoggedIn" />
 
 
     <!-- 功能入口(4个:活动、商品、课程) -->
     <!-- 功能入口(4个:活动、商品、课程) -->
     <view class="func-section" v-if="sectionVisible('func_entries')">
     <view class="func-section" v-if="sectionVisible('func_entries')">
@@ -151,7 +150,7 @@ export default {
       contactList: [],
       contactList: [],
       showImportModal: false,
       showImportModal: false,
       healthAlerts: [],
       healthAlerts: [],
-      milestones: [],
+    
       funcList: [
       funcList: [
         { icon: '\u{1F3CB}', label: '任务', needLogin: true, page: '/pages/tasks/tasks' },
         { icon: '\u{1F3CB}', label: '任务', needLogin: true, page: '/pages/tasks/tasks' },
         { icon: '\u{1F3C0}', label: '活动', needLogin: false, page: '/pages/discover/index?type=activity' },
         { icon: '\u{1F3C0}', label: '活动', needLogin: false, page: '/pages/discover/index?type=activity' },
@@ -473,13 +472,7 @@ export default {
       }).catch(function() {
       }).catch(function() {
         self.healthAlerts = []
         self.healthAlerts = []
       })
       })
-      getMilestones({}, 30).then(function(res) {
-        if (res.code === 200 && res.data) {
-          self.milestones = Array.isArray(res.data) ? res.data : []
-        }
-      }).catch(function() {
-        self.milestones = []
-      })
+      
     },
     },
     goInteractionLog: function(memberId) {
     goInteractionLog: function(memberId) {
       if (memberId) {
       if (memberId) {

+ 10 - 6
cfc-frontend/pages/wisdom/index.vue

@@ -317,12 +317,16 @@ export default {
                 }
                 }
               }
               }
             }
             }
-            // FIX: 不再自动选择第一个孩子
-          }
-          // Load cognitive report only if activeChildId is set (user switched)
-          if (self.activeChildId) {
-            self.loadCognitiveReport()
-          }
+                // Fallback: 首次进入或未选孩子时,默认选第一个孩子以加载认知数据(仅本地状态,不触发全局切换)
+                if (!self.activeChildId && self.children.length > 0) {
+                  self.activeChildId = self.children[0].id
+                  self.activeChildName = self.children[0].nickname || self.children[0].name || ''
+                }
+            }
+            // Load cognitive report if activeChildId is available
+            if (self.activeChildId) {
+                self.loadCognitiveReport()
+            }
         }
         }
         self.loadContacts()
         self.loadContacts()
       }).catch(function(e) {})
       }).catch(function(e) {})