|
|
@@ -67,6 +67,9 @@
|
|
|
:scores="sandboxScores"
|
|
|
:overallScore="sandboxData.overallScore || 0"
|
|
|
:members="sandboxData.members || []"
|
|
|
+ :dimensions="energyDimensions"
|
|
|
+ :totalEnergy="totalEnergy"
|
|
|
+ :totalHealthIndex="totalHealthIndex"
|
|
|
showDimensionBar
|
|
|
starHeight="480rpx" />
|
|
|
|
|
|
@@ -359,7 +362,7 @@ import ArticleBookshelf from '../../components/ArticleBookshelf.vue'
|
|
|
import FamilyChallengeCard from '../../components/FamilyChallengeCard.vue'
|
|
|
import DailyTaskCard from '../../components/daily-task-card.vue'
|
|
|
import ReportUploadCard from '../../components/report-upload-card.vue'
|
|
|
-import { acceptParentInvite, productList, getActivityList, getFeaturedArticles, getFamilyEnergySandbox, getFamilyMemberList, getChildren, getChallengeList, switchToFamilyMember, getMyMembership, updateChallengeProgress, respondChallenge, getTodayTasks, completeTask as completeTaskApi, getTodayParentTasks, completeParentTask as completeParentTaskApi, getTaskHistory, getNotices, getNotificationList } from '../../utils/api.js'
|
|
|
+import { acceptParentInvite, productList, getActivityList, getFeaturedArticles, getFamilyEnergySandbox, getEnergyOverview, getFamilyMemberList, getChildren, getChallengeList, switchToFamilyMember, getMyMembership, updateChallengeProgress, respondChallenge, getTodayTasks, completeTask as completeTaskApi, getTodayParentTasks, completeParentTask as completeParentTaskApi, getTaskHistory, getNotices, getNotificationList } from '../../utils/api.js'
|
|
|
import nav from '../../utils/nav.js'
|
|
|
import config from '@/config.js'
|
|
|
import { parseDate } from '../../utils/format.js'
|
|
|
@@ -425,6 +428,9 @@ export default {
|
|
|
sandboxData: null,
|
|
|
sandboxLocked: false,
|
|
|
sandboxLockGate: null,
|
|
|
+ energyDimensions: [],
|
|
|
+ totalEnergy: 0,
|
|
|
+ totalHealthIndex: 0,
|
|
|
articles: [],
|
|
|
children: [],
|
|
|
currentChildId: null,
|
|
|
@@ -578,9 +584,23 @@ export default {
|
|
|
},
|
|
|
loadDimensionData: function() {
|
|
|
this.loadSandboxData()
|
|
|
+ this.loadEnergyOverview()
|
|
|
this.loadActionArticles()
|
|
|
this.loadChallenges()
|
|
|
},
|
|
|
+ loadEnergyOverview: function() {
|
|
|
+ var self = this
|
|
|
+ var memberId = this.currentChildId || uni.getStorageSync('currentMemberId') || undefined
|
|
|
+ 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)
|
|
|
+ })
|
|
|
+ },
|
|
|
loadSandboxData: function() {
|
|
|
var self = this
|
|
|
getFamilyEnergySandbox().then(function(res) {
|