|
|
@@ -305,6 +305,7 @@ export default {
|
|
|
],
|
|
|
demoCogScores: [78, 72, 85, 68, 80],
|
|
|
// 真实数据缓存
|
|
|
+ bodyData: null,
|
|
|
cognitiveData: null,
|
|
|
cognitiveFamilyData: [],
|
|
|
emiData: null,
|
|
|
@@ -389,6 +390,10 @@ export default {
|
|
|
if (!d) return [0, 0, 0, 0]
|
|
|
return [d.wealthSkill || 0, d.wealthAltruism || 0, d.wealthIncome || 0, d.wealthFx || 0]
|
|
|
}
|
|
|
+ // body: 从 API 真实维度数据取分
|
|
|
+ if (this.bodyData && this.bodyData.dimensions && this.bodyData.dimensions.length > 0) {
|
|
|
+ return this.bodyData.dimensions.map(function(d) { return Number(d.score) || 0 })
|
|
|
+ }
|
|
|
// body: fallback to demo
|
|
|
if (this.reports.length > 0) {
|
|
|
var latest = this.reports[0]
|
|
|
@@ -434,7 +439,7 @@ export default {
|
|
|
return []
|
|
|
},
|
|
|
chartIsEmpty: function() {
|
|
|
- if (this.currentTab === 'body') return this.reports.length === 0
|
|
|
+ if (this.currentTab === 'body') return !this.bodyData || !this.bodyData.dimensions || this.bodyData.dimensions.length === 0
|
|
|
if (this.currentTab === 'cognitive') return !this.cognitiveData || !this.cognitiveData.overallScore
|
|
|
if (this.currentTab === 'mental') return !this.emiData || !this.emiData.overallScore
|
|
|
if (this.currentTab === 'relationship') return !this.relationshipData || this.relationshipData.length === 0
|
|
|
@@ -529,7 +534,13 @@ export default {
|
|
|
}
|
|
|
}).catch(function() {})
|
|
|
}
|
|
|
- // 文章
|
|
|
+ // 身体七维概览
|
|
|
+ if (memberId) {
|
|
|
+ api.getDimensionOverview({ memberId: memberId }).then(function(res) {
|
|
|
+ if (res.code === 200 && res.data) self.bodyData = res.data
|
|
|
+ }).catch(function() {})
|
|
|
+ }
|
|
|
+ // 文章
|
|
|
api.getFeaturedArticles({ size: 3, dimensionCode: 'body' }).then(function(res) {
|
|
|
if (res.code === 200 && res.data) {
|
|
|
var list = Array.isArray(res.data) ? res.data : (res.data.records || [])
|