Преглед изворни кода

chore: auto bump version and changelog [skip ci]

iwt пре 3 месеци
родитељ
комит
bbef709753

+ 187 - 5
cfc-frontend/pages/home-pages/parent-index.vue

@@ -38,9 +38,46 @@
 <FamilyChallengeCard
   v-for="ch in activeChallenges"
   :key="ch.id"
-  :challenge="ch" />
+:challenge="ch" />
+
+    <!-- ===== 健康圈入口(P3:社区扩散) ===== -->
+    <view class="circle-entry-section">
+      <!-- 有健康圈数据:显示排行榜预览 -->
+      <PlayfulCard v-if="circleName && circleRankings.length > 0" variant="flat" shadow="sm" :clickable="true" @click="goToHealthCircle" class="circle-card-wide">
+        <view class="circle-card-content">
+          <view class="circle-header">
+            <view class="circle-icon-wrap">
+              <text class="circle-icon">🏅</text>
+            </view>
+            <view class="circle-header-body">
+              <text class="circle-card-title">健康圈</text>
+              <text class="circle-card-subtitle">{{ circleName }}</text>
+            </view>
+          </view>
+          <view class="circle-ranking-preview">
+            <view class="circle-rank-row" v-for="(item, idx) in circleRankings.slice(0, 3)" :key="idx">
+              <text class="circle-rank-badge">{{ '🥇🥈🥉'[idx] || '#' + (idx + 1) }}</text>
+              <text class="circle-rank-family">家庭 {{ idx + 1 }}</text>
+              <text class="circle-rank-score">{{ item.totalScore || 0 }} 分</text>
+            </view>
+          </view>
+          <view class="circle-action">
+            <text class="circle-action-text">查看详情 →</text>
+          </view>
+        </view>
+      </PlayfulCard>
+      <!-- 无健康圈数据:邀请加入 -->
+      <PlayfulCard v-else variant="flat" shadow="sm" :clickable="true" @click="goToHealthCircle" class="circle-card-wide circle-card-invite">
+        <view class="circle-invite-content">
+          <view class="circle-invite-icon">🏅</view>
+          <text class="circle-invite-title">健康圈</text>
+          <text class="circle-invite-desc">加入健康圈,和更多家庭一起健康打卡</text>
+          <text class="circle-invite-cta">去看看 →</text>
+        </view>
+      </PlayfulCard>
+    </view>
 
-<!-- ===== 家庭成员关系图谱 ===== -->
+    <!-- ===== 家庭成员关系图谱 ===== -->
 <FamilyRelationGraph
   v-if="familyMembersVisible.length > 0"
   dimensionCode="home"
@@ -395,7 +432,7 @@
 </template>
 
 <script>
-import { getFamilyMembers, getChildren, getPendingReviewTasks, getPendingWishes, approveTask, rejectTask, getChildCompletionStats, getParentDashboard, getFamilyEnergySandbox, getEnergyOverview, getVisibleFamilyMembers, getActivityList, getProductsByDomain, getContactList, getFeaturedArticles, getActiveAlerts, dismissAlert, getFamilyRanking, getChallengeList } from '../../utils/api.js'
+import { getFamilyMembers, getChildren, getPendingReviewTasks, getPendingWishes, approveTask, rejectTask, getChildCompletionStats, getParentDashboard, getFamilyEnergySandbox, getEnergyOverview, getVisibleFamilyMembers, getActivityList, getProductsByDomain, getContactList, getFeaturedArticles, getActiveAlerts, dismissAlert, getFamilyRanking, getChallengeList, getCircleRanking } from '../../utils/api.js'
 import PageBanner from '../../components/PageBanner.vue'
 import PlayfulCard from '../../components/PlayfulCard.vue'
 import PlayfulButton from '../../components/PlayfulButton.vue'
@@ -415,10 +452,11 @@ import FeedbackToast from '../../components/FeedbackToast.vue'
 import MilestoneCelebration from '../../components/MilestoneCelebration.vue'
 import DailySummary from '../../components/DailySummary.vue'
 import HealthAlertBanner from '../../components/HealthAlertBanner.vue'
+import CircleRanking from '../../components/CircleRanking.vue'
 import feedbackEngine from '../../utils/feedback-engine.js'
 
 export default {
-  components: { PageBanner, RecommendedFeed, PlayfulCard, PlayfulButton, BaseBadge, BaseEmpty, BaseLoading, FamilyRelationGraph, WuxingSandbox, ContactCard, ContactImport, FamilyMemberStrip, MicroActionCard, FeedbackToast, MilestoneCelebration, DailySummary, HealthAlertBanner, FamilyHealthRanking, FamilyChallengeCard },
+  components: { PageBanner, RecommendedFeed, PlayfulCard, PlayfulButton, BaseBadge, BaseEmpty, BaseLoading, FamilyRelationGraph, WuxingSandbox, ContactCard, ContactImport, FamilyMemberStrip, MicroActionCard, FeedbackToast, MilestoneCelebration, DailySummary, HealthAlertBanner, FamilyHealthRanking, FamilyChallengeCard, CircleRanking },
   data() {
     return {
       nickname: '',
@@ -483,7 +521,11 @@ export default {
       // P2-2 家庭互动
       rankingMembers: [],
       rankingTotalScore: 0,
-      activeChallenges: []
+      activeChallenges: [],
+      // P3 健康圈(社区扩散)
+      circleRankings: [],
+      circleName: '',
+      circleLoading: false
     }
   },
   computed: {
@@ -750,6 +792,8 @@ export default {
         this.loadAlerts()
         // 加载家庭健康互动(P2-2)
         this.loadFamilyInteraction()
+        // 加载健康圈(P3:社区扩散)
+        this.loadHealthCircle()
         // 加载外部联系人
         this.loadContacts()
         // 加载推荐阅读
@@ -867,6 +911,26 @@ export default {
         }
       }).catch(function() {})
     },
+    loadHealthCircle: function() {
+      var familyId = this._familyId
+      if (!familyId) return
+      var self = this
+      self.circleLoading = true
+      getCircleRanking({ familyId: familyId }).then(function(res) {
+        if (res.code === 200 && res.data) {
+          self.circleName = res.data.circleName || ''
+          self.circleRankings = res.data.rankings || []
+        }
+      }).catch(function() {
+        self.circleRankings = []
+        self.circleName = ''
+      }).finally(function() {
+        self.circleLoading = false
+      })
+    },
+    goToHealthCircle: function() {
+      uni.navigateTo({ url: '/pages/share/index' })
+    },
     goMemberDetail(member) {
       if (!member || !member.memberId) return
       uni.navigateTo({
@@ -1566,4 +1630,122 @@ export default {
   font-size: 22rpx;
   color: #bbb;
 }
+
+/* ===== 健康圈入口卡片(P3:社区扩散) ===== */
+.circle-entry-section {
+  margin: 0 20rpx 28rpx 20rpx;
+}
+.circle-card-wide {
+  width: 100%;
+}
+.circle-card-content {
+  padding: 24rpx;
+  display: flex;
+  flex-direction: column;
+  gap: 16rpx;
+}
+.circle-header {
+  display: flex;
+  align-items: center;
+  gap: 12rpx;
+}
+.circle-icon-wrap {
+  width: 56rpx;
+  height: 56rpx;
+  border-radius: 14rpx;
+  background: linear-gradient(135deg, #10B981, #34D399);
+  display: flex;
+  align-items: center;
+  justify-content: center;
+}
+.circle-icon {
+  font-size: 28rpx;
+}
+.circle-header-body {
+  flex: 1;
+}
+.circle-card-title {
+  display: block;
+  font-size: 28rpx;
+  font-weight: 700;
+  color: #1E293B;
+  line-height: 1.4;
+}
+.circle-card-subtitle {
+  display: block;
+  font-size: 22rpx;
+  color: #6B7280;
+  margin-top: 2rpx;
+}
+.circle-ranking-preview {
+  background: #F0FDF4;
+  border-radius: 12rpx;
+  padding: 16rpx;
+  display: flex;
+  flex-direction: column;
+  gap: 10rpx;
+}
+.circle-rank-row {
+  display: flex;
+  align-items: center;
+  gap: 10rpx;
+}
+.circle-rank-badge {
+  font-size: 24rpx;
+  width: 40rpx;
+  text-align: center;
+}
+.circle-rank-family {
+  flex: 1;
+  font-size: 24rpx;
+  color: #374151;
+  font-weight: 500;
+}
+.circle-rank-score {
+  font-size: 24rpx;
+  color: #F97316;
+  font-weight: 600;
+}
+.circle-action {
+  display: flex;
+  justify-content: flex-end;
+}
+.circle-action-text {
+  font-size: 24rpx;
+  color: #F97316;
+  font-weight: 500;
+}
+
+/* 无数据:邀请加入样式 */
+.circle-card-invite {
+  background: linear-gradient(135deg, #F0FDF4, #ECFDF5);
+}
+.circle-invite-content {
+  padding: 32rpx 24rpx;
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  gap: 12rpx;
+}
+.circle-invite-icon {
+  font-size: 48rpx;
+  margin-bottom: 4rpx;
+}
+.circle-invite-title {
+  font-size: 30rpx;
+  font-weight: 700;
+  color: #065F46;
+}
+.circle-invite-desc {
+  font-size: 24rpx;
+  color: #6B7280;
+  text-align: center;
+  line-height: 1.5;
+}
+.circle-invite-cta {
+  font-size: 26rpx;
+  color: #F97316;
+  font-weight: 600;
+  margin-top: 4rpx;
+}
 </style>

+ 1 - 1
cfc-web/.last_build_commit

@@ -1 +1 @@
-75b5fa7ec296fff5a26b014b271022a0a78be865
+df38e28904ac4e097360650ae23714ff27068be1

+ 2 - 2
cfc-web/package-lock.json

@@ -1,12 +1,12 @@
 {
   "name": "cfc-web",
-  "version": "1.0.511",
+  "version": "1.0.512",
   "lockfileVersion": 3,
   "requires": true,
   "packages": {
     "": {
       "name": "cfc-web",
-      "version": "1.0.511",
+      "version": "1.0.512",
       "dependencies": {
         "@wangeditor/editor": "^5.1.23",
         "@wangeditor/editor-for-vue": "^1.0.2",

+ 1 - 1
cfc-web/package.json

@@ -1,6 +1,6 @@
 {
   "name": "cfc-web",
-  "version": "1.0.512",
+  "version": "1.0.513",
   "private": true,
   "scripts": {
     "dev": "vue-cli-service serve",

+ 57 - 0
cfc-web/public/CHANGELOG-v1.0.md

@@ -4,6 +4,63 @@
 
 ---
 
+## v1.0.513 (2026-07-24)
+
+### Bug 修复
+- resolve subpackage path conflict in pages.json
+- fix encoding corruption from directory rename and restore UTF-8
+- Fix:
+- rename pages/index to pages/home and update all references
+- fix 405 POST→GET redirect, RecommendedFeed items ref, and unhandled rejections
+
+### 其他
+-   - pages/index-home/index.vue (main package TabBar home page)
+-   - pages/home-pages/ (subpackage for parent-index, child-index, member-home-detail)
+- - Update all navigation URLs to use correct paths
+- - Fix /pages/home-index/index -> /pages/index-home/index across 19 files
+- 
+- corrupting Chinese characters in 230+ files, causing Unterminated string errors.
+- - Restore all files from e8fd4d05~1 (pre-corruption) via git checkout
+- - Re-apply directory rename (pages/index -> pages/home)
+- - Re-apply path replacements using Python with explicit UTF-8 encoding
+- - Fix tab icon references (tab-home -> tab-action) in custom-tab-bar
+- - Fix historical encoding issue in pages/games/1a2b.vue (pre-existing garbled text)
+- - Clean up duplicate pages/home/index/ directory created by git checkout
+- 
+- - Update pages.json: TabBar pagePath, main pages array, and subPackages root
+- - Fix custom-tab-bar page paths and icon filenames (tab-home -> tab-action)
+- - Update all Vue file navigation URLs from /pages/index/... to /pages/home/...
+- 
+-   to subpackages (pages/index, pages/login, pages/share, pages/profile)
+- - index/index.vue: remove static import of ParentIndex/ChildIndex, redirect
+-   authenticated users via redirectTo instead of rendering as sub-components
+- - AGENTS.md: document subpackage structure (45 subpackages)
+- - api.js: add console.log for /api/auth requests for debugging
+- - family/add-member.vue: minor fix
+- 
+- language as the energy sandbox (wuxing-sandbox) dots:
+-   行🌿 身🌏 智⚡ 心🔥 富💧
+- 
+-   the energy sandbox (wuxing-sandbox) visual language:
+-   行(wood/leaf) 身(earth/mountain) 智(metal/diamond) 心(fire/flame) 富(water/drop)
+- - Use dimension colors from the sandbox palette for active state,
+-   gray for inactive state
+- - Remove old tab-home icons (replaced by tab-action)
+- - Update pages.json to reference new tab-action filenames
+- 
+-   redirect converting POST to GET
+- - RecommendedFeed.vue: template 'items'→'displayItems' (undefined
+-   computed ref)
+- - parent-index.vue: add .catch() to getFamilyRanking/getChallengeList
+-   to prevent unhandled Promise rejections
+- 
+
+### 新功能
+- subpackage split - move non-TabBar pages out of main package to reduce size
+- use emoji tab icons matching wuxing sandbox style
+- redesign tab bar icons in wuxing sandbox style
+
+
 ## v1.0.512 (2026-07-24)
 
 ### Bug 修复

+ 58 - 1
cfc-web/public/CHANGELOG.md

@@ -1,6 +1,6 @@
 # 更新日志
 
-> 当前版本: v1.0.512
+> 当前版本: v1.0.513
 
 ## 历史版本
 
@@ -8,6 +8,63 @@
 
 ---
 
+## v1.0.513 (2026-07-24)
+
+### Bug 修复
+- resolve subpackage path conflict in pages.json
+- fix encoding corruption from directory rename and restore UTF-8
+- Fix:
+- rename pages/index to pages/home and update all references
+- fix 405 POST→GET redirect, RecommendedFeed items ref, and unhandled rejections
+
+### 其他
+-   - pages/index-home/index.vue (main package TabBar home page)
+-   - pages/home-pages/ (subpackage for parent-index, child-index, member-home-detail)
+- - Update all navigation URLs to use correct paths
+- - Fix /pages/home-index/index -> /pages/index-home/index across 19 files
+- 
+- corrupting Chinese characters in 230+ files, causing Unterminated string errors.
+- - Restore all files from e8fd4d05~1 (pre-corruption) via git checkout
+- - Re-apply directory rename (pages/index -> pages/home)
+- - Re-apply path replacements using Python with explicit UTF-8 encoding
+- - Fix tab icon references (tab-home -> tab-action) in custom-tab-bar
+- - Fix historical encoding issue in pages/games/1a2b.vue (pre-existing garbled text)
+- - Clean up duplicate pages/home/index/ directory created by git checkout
+- 
+- - Update pages.json: TabBar pagePath, main pages array, and subPackages root
+- - Fix custom-tab-bar page paths and icon filenames (tab-home -> tab-action)
+- - Update all Vue file navigation URLs from /pages/index/... to /pages/home/...
+- 
+-   to subpackages (pages/index, pages/login, pages/share, pages/profile)
+- - index/index.vue: remove static import of ParentIndex/ChildIndex, redirect
+-   authenticated users via redirectTo instead of rendering as sub-components
+- - AGENTS.md: document subpackage structure (45 subpackages)
+- - api.js: add console.log for /api/auth requests for debugging
+- - family/add-member.vue: minor fix
+- 
+- language as the energy sandbox (wuxing-sandbox) dots:
+-   行🌿 身🌏 智⚡ 心🔥 富💧
+- 
+-   the energy sandbox (wuxing-sandbox) visual language:
+-   行(wood/leaf) 身(earth/mountain) 智(metal/diamond) 心(fire/flame) 富(water/drop)
+- - Use dimension colors from the sandbox palette for active state,
+-   gray for inactive state
+- - Remove old tab-home icons (replaced by tab-action)
+- - Update pages.json to reference new tab-action filenames
+- 
+-   redirect converting POST to GET
+- - RecommendedFeed.vue: template 'items'→'displayItems' (undefined
+-   computed ref)
+- - parent-index.vue: add .catch() to getFamilyRanking/getChallengeList
+-   to prevent unhandled Promise rejections
+- 
+
+### 新功能
+- subpackage split - move non-TabBar pages out of main package to reduce size
+- use emoji tab icons matching wuxing sandbox style
+- redesign tab bar icons in wuxing sandbox style
+
+
 ## v1.0.512 (2026-07-24)
 
 ### Bug 修复