Explorar o código

fix(body): guard loadHealthDimensions on activeChildId + debug logs

- Add null check for activeChildId before API call to prevent silent failures
- Add console logs for tracking dimension data loading flow
- Helps diagnose radar chart not rendering when no child selected or API fails
Xiaogang Liao hai 3 meses
pai
achega
d3055d826f
Modificáronse 1 ficheiros con 8 adicións e 1 borrados
  1. 8 1
      cfc-frontend/pages/body/index.vue

+ 8 - 1
cfc-frontend/pages/body/index.vue

@@ -383,13 +383,20 @@ export default {
       this.loadHealthDimensions()
     },
     loadHealthDimensions: function() {
+      if (!this.activeChildId) {
+        console.log('[body] loadHealthDimensions skipped: no activeChildId')
+        return
+      }
       var self = this
       getDimensionOverview({ memberId: this.activeChildId }).then(function(res) {
         if (res && res.data) {
           self.dimensionData = res.data
+          console.log('[body] dimensionData loaded:', res.data.dimensions ? res.data.dimensions.length : 0, 'dimensions')
+        } else if (res) {
+          console.warn('[body] dimension API error:', res.message || res.code)
         }
       }).catch(function(e) {
-        console.log('获取维度概览失败', e)
+        console.error('[body] loadHealthDimensions failed', e)
       })
     },
     loadSandboxData: function() {