|
|
@@ -8,7 +8,30 @@
|
|
|
tagline="学以启智 · 慧及未来"
|
|
|
quote="知者不惑,仁者不忧" />
|
|
|
|
|
|
- <!-- 2. 游客专属区块 -->
|
|
|
+ <!-- 2. 认知雷达图(登录后) -->
|
|
|
+ <view class="section" v-if="isLoggedIn && cognitiveReport">
|
|
|
+ <view class="section-header">
|
|
|
+ <text class="section-title">认知雷达</text>
|
|
|
+ <text class="section-more" @click="goCognitiveReport">查看详情 ›</text>
|
|
|
+ </view>
|
|
|
+ <RadarChart
|
|
|
+ :dimensions="cognitiveDimensions"
|
|
|
+ :scores="cognitiveScores"
|
|
|
+ :avg-scores="cognitiveAvgScores"
|
|
|
+ :childName="activeChildName"
|
|
|
+ fillColor="#6366F1"
|
|
|
+ gridColor="#E0E7FF"
|
|
|
+ labelColor="#3730A3" />
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <!-- 家庭成员选择条 -->
|
|
|
+ <FamilyMemberStrip
|
|
|
+ v-if="isLoggedIn"
|
|
|
+ :members="familyMembersVisible"
|
|
|
+ :selectedMemberId="selectedMemberId"
|
|
|
+ @select="onFamilyMemberSelect" />
|
|
|
+
|
|
|
+ <!-- 3. 游客专属区块 -->
|
|
|
<template v-if="!isLoggedIn">
|
|
|
<LoginGuideCard
|
|
|
title="登录后查看全家智慧成长数据"
|
|
|
@@ -19,42 +42,34 @@
|
|
|
]" />
|
|
|
</template>
|
|
|
|
|
|
- <!-- 3. 五维能量条(登录后) -->
|
|
|
+ <!-- 4. 五维能量条(登录后) -->
|
|
|
<FamilyEnergyBar
|
|
|
v-if="isLoggedIn"
|
|
|
dimensionCode="wisdom"
|
|
|
:sandboxData="sandboxData"
|
|
|
:dualDimension="dualDimension" />
|
|
|
|
|
|
- <!-- 4. 认知雷达图(登录后) -->
|
|
|
- <view class="section" v-if="isLoggedIn && cognitiveReport">
|
|
|
+ <!-- ===== DAN 报告(登录后) ===== -->
|
|
|
+ <view class="section" v-if="isLoggedIn">
|
|
|
<view class="section-header">
|
|
|
- <text class="section-title">认知雷达</text>
|
|
|
- <text class="section-more" @click="goCognitiveReport">查看详情 ›</text>
|
|
|
+ <text class="section-title">📊 DAN 报告</text>
|
|
|
+ <text class="section-more" @click="goDanUpload">上传 +</text>
|
|
|
+ </view>
|
|
|
+ <view class="dan-card" v-for="report in danReports" :key="report.id" @click="viewDanReport(report)">
|
|
|
+ <view class="dan-card-header">
|
|
|
+ <text class="dan-report-date">{{ formatDate(report.assessmentDate) }}</text>
|
|
|
+ <text :class="['dan-status', report.draftStatus === 'confirmed' ? 'confirmed' : 'pending']">
|
|
|
+ {{ report.draftStatus === 'confirmed' ? '已确认' : '待确认' }}
|
|
|
+ </text>
|
|
|
+ </view>
|
|
|
+ <text class="dan-report-desc">DAN B4 智维度测评报告</text>
|
|
|
+ </view>
|
|
|
+ <view class="dan-empty" v-if="danReports.length === 0">
|
|
|
+ <text class="dan-empty-text">暂无 DAN 报告,点击上方「上传 +」上传测评报告</text>
|
|
|
</view>
|
|
|
- <RadarChart
|
|
|
- :dimensions="cognitiveDimensions"
|
|
|
- :scores="cognitiveScores"
|
|
|
- :avg-scores="cognitiveAvgScores"
|
|
|
- :childName="activeChildName"
|
|
|
- fillColor="#6366F1"
|
|
|
- gridColor="#E0E7FF"
|
|
|
- labelColor="#3730A3" />
|
|
|
</view>
|
|
|
|
|
|
- <!-- 5. 家庭成员关系图谱(登录后) -->
|
|
|
- <FamilyRelationGraph
|
|
|
- v-if="isLoggedIn && familyMembersVisible.length > 0"
|
|
|
- dimensionCode="wisdom"
|
|
|
- :selfId="activeChildId"
|
|
|
- :members="familyMembersVisible"
|
|
|
- :energyMap="energyMapForGraph"
|
|
|
- :intimacyMap="intimacyMapForGraph"
|
|
|
- @memberTap="goMemberDetail" />
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- <!-- 7. 功能入口 -->
|
|
|
+ <!-- 6. 功能入口 -->
|
|
|
<view class="func-section" v-if="sectionVisible('func_entries')">
|
|
|
<view class="func-grid">
|
|
|
<view class="func-item" v-for="item in funcList" :key="item.label" @click="onFuncClick(item)">
|
|
|
@@ -66,7 +81,7 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
|
- <!-- 8. 维度任务 -->
|
|
|
+ <!-- 7. 维度任务 -->
|
|
|
<DimensionTasks
|
|
|
v-if="isLoggedIn"
|
|
|
dimensionCode="wisdom"
|
|
|
@@ -74,7 +89,7 @@
|
|
|
@taskClick="onTaskClick"
|
|
|
@moreTasks="goTasks" />
|
|
|
|
|
|
- <!-- 9. 维度活动 -->
|
|
|
+ <!-- 8. 维度活动 -->
|
|
|
<DimensionActivities
|
|
|
dimensionCode="wisdom"
|
|
|
:activities="dimensionActivities"
|
|
|
@@ -82,14 +97,14 @@
|
|
|
@activityClick="goActivityDetail"
|
|
|
@moreActivities="goMoreActivities" />
|
|
|
|
|
|
- <!-- 10. 维度商品 -->
|
|
|
+ <!-- 9. 维度商品 -->
|
|
|
<DimensionProducts
|
|
|
dimensionCode="wisdom"
|
|
|
:products="dimensionProducts"
|
|
|
@productClick="goProductDetail"
|
|
|
@moreProducts="goMoreProducts" />
|
|
|
|
|
|
- <!-- 11. 推荐阅读 -->
|
|
|
+ <!-- 10. 推荐阅读 -->
|
|
|
<DimensionArticles
|
|
|
v-if="sectionVisible('recommended_reading')"
|
|
|
dimensionCode="wisdom"
|
|
|
@@ -98,40 +113,7 @@
|
|
|
@articleClick="goArticleDetail"
|
|
|
@moreArticles="goMoreArticles" />
|
|
|
|
|
|
- <!-- 12. 智慧小贴士 -->
|
|
|
- <view class="section" v-if="sectionVisible('wisdom_tips')">
|
|
|
- <view class="section-header">
|
|
|
- <text class="section-title">智慧小贴士</text>
|
|
|
- </view>
|
|
|
- <view class="tips-list">
|
|
|
- <view class="tip-card" v-for="item in wisdomTips" :key="item.id">
|
|
|
- <text class="tip-title">{{ item.title }}</text>
|
|
|
- <text class="tip-summary">{{ item.summary }}</text>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
-
|
|
|
- <!-- ===== DAN 报告(B4-智维度) ===== -->
|
|
|
- <view class="section" v-if="isLoggedIn && danReports.length > 0">
|
|
|
- <view class="section-header">
|
|
|
- <text class="section-title">📊 DAN 报告</text>
|
|
|
- <text class="section-more" @click="goDanUpload('wisdom')">上传 +</text>
|
|
|
- </view>
|
|
|
- <view class="dan-card" v-for="report in danReports" :key="report.id">
|
|
|
- <view class="dan-card-header">
|
|
|
- <text class="dan-report-date">{{ formatDate(report.assessmentDate) }}</text>
|
|
|
- <text :class="['dan-status', report.draftStatus === 'confirmed' ? 'confirmed' : 'pending']">
|
|
|
- {{ report.draftStatus === 'confirmed' ? '已确认' : '待确认' }}
|
|
|
- </text>
|
|
|
- </view>
|
|
|
- <text class="dan-report-desc">DAN B4 智维度测评报告</text>
|
|
|
- <view class="dan-card-footer" @click="viewDanReport(report)">
|
|
|
- <text class="dan-view-link">查看详情 →</text>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
-
|
|
|
- <!-- 13. 快捷操作按钮 -->
|
|
|
+ <!-- 11. 快捷操作按钮 -->
|
|
|
<view class="section quick-actions" v-if="isLoggedIn">
|
|
|
<view class="action-btn" @click="goCognitiveReport">
|
|
|
<text class="action-icon">📊</text>
|
|
|
@@ -145,9 +127,9 @@
|
|
|
<text class="action-icon">📋</text>
|
|
|
<text class="action-text">测评预约</text>
|
|
|
</view>
|
|
|
- <view class="action-btn" @click="goHome">
|
|
|
- <text class="action-icon">🏠</text>
|
|
|
- <text class="action-text">返回首页</text>
|
|
|
+ <view class="action-btn" @click="goDanUpload">
|
|
|
+ <text class="action-icon">📄</text>
|
|
|
+ <text class="action-text">上传报告</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
|
@@ -167,12 +149,12 @@ import DimensionTasks from '../../components/DimensionTasks.vue'
|
|
|
import DimensionActivities from '../../components/DimensionActivities.vue'
|
|
|
import DimensionProducts from '../../components/DimensionProducts.vue'
|
|
|
import DimensionArticles from '../../components/DimensionArticles.vue'
|
|
|
-import FamilyRelationGraph from '../../components/FamilyRelationGraph.vue'
|
|
|
import AIFloatingAvatar from '../../components/AIFloatingAvatar.vue'
|
|
|
-import { getVisibleSections, getChildren, getTodayTasksByCategory, getActivityList, getProductsByDomain, getFamilyEnergySandbox, getAssessmentLatestResult, getFeaturedArticles, getContactList, getHealthAlerts, getMilestones, getDanReportByChild } from '../../utils/api.js'
|
|
|
+import FamilyMemberStrip from '../../components/FamilyMemberStrip.vue'
|
|
|
+import { getVisibleSections, getChildren, getTodayTasksByCategory, getActivityList, getProductsByDomain, getFamilyEnergySandbox, getAssessmentLatestResult, getFeaturedArticles, getDanReportByChild } from '../../utils/api.js'
|
|
|
|
|
|
export default {
|
|
|
- components: { TabTransition, PageBanner, LoginGuideCard, RadarChart, FamilyEnergyBar, DimensionTasks, DimensionActivities, DimensionProducts, DimensionArticles, FamilyRelationGraph, AIFloatingAvatar },
|
|
|
+ components: { TabTransition, PageBanner, LoginGuideCard, RadarChart, FamilyEnergyBar, DimensionTasks, DimensionActivities, DimensionProducts, DimensionArticles, AIFloatingAvatar, FamilyMemberStrip },
|
|
|
data() {
|
|
|
return {
|
|
|
isLoggedIn: false,
|
|
|
@@ -183,6 +165,7 @@ export default {
|
|
|
userName: '',
|
|
|
children: [],
|
|
|
familyMembersVisible: [],
|
|
|
+ selectedMemberId: null,
|
|
|
sandboxData: null,
|
|
|
dualDimension: null,
|
|
|
visibleSections: [],
|
|
|
@@ -191,12 +174,8 @@ export default {
|
|
|
dimensionActivities: [],
|
|
|
dimensionProducts: [],
|
|
|
articles: [],
|
|
|
- wisdomTips: [],
|
|
|
/** Mock 平均值(6维认知):感知/专注/记忆/逻辑/空间/加工速度 */
|
|
|
cognitiveAvgScores: [70, 65, 72, 68, 66, 71],
|
|
|
- contactList: [],
|
|
|
- healthAlerts: [],
|
|
|
- milestones: [],
|
|
|
danReports: [],
|
|
|
funcList: [
|
|
|
{ icon: '\u{1F4CA}', label: '认知报告', needLogin: true, page: '/pages/wisdom-detail/cognitive-report' },
|
|
|
@@ -207,24 +186,6 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
- energyMapForGraph: function() {
|
|
|
- var map = {}
|
|
|
- if (this.sandboxData && this.sandboxData.members) {
|
|
|
- for (var i = 0; i < this.sandboxData.members.length; i++) {
|
|
|
- var m = this.sandboxData.members[i]
|
|
|
- map[m.memberId || m.id] = {
|
|
|
- bodyScore: m.bodyScore || 0,
|
|
|
- mindScore: m.mindScore || 0,
|
|
|
- actionScore: m.actionScore || 0,
|
|
|
- wisdomScore: m.wisdomScore || 0
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- return map
|
|
|
- },
|
|
|
- intimacyMapForGraph: function() {
|
|
|
- return {}
|
|
|
- },
|
|
|
wisdomArticles: function() {
|
|
|
if (!this.articles || this.articles.length === 0) return []
|
|
|
var result = []
|
|
|
@@ -271,7 +232,6 @@ export default {
|
|
|
this.loadChildren()
|
|
|
this.loadFamilyMembersVisible()
|
|
|
this.loadCognitiveReport()
|
|
|
- this.loadRelationshipHealth()
|
|
|
this.loadDanReports()
|
|
|
}
|
|
|
this.loadDimensionActivities()
|
|
|
@@ -281,8 +241,11 @@ export default {
|
|
|
this._watchPageReady()
|
|
|
},
|
|
|
methods: {
|
|
|
+ onFamilyMemberSelect: function(member) {
|
|
|
+ this.selectedMemberId = member.id
|
|
|
+ },
|
|
|
loadSectionConfig: function() {
|
|
|
- var baseSections = ['func_entries', 'wisdom_tips', 'recommended_reading']
|
|
|
+ var baseSections = ['func_entries', 'recommended_reading']
|
|
|
if (!uni.getStorageSync('token')) {
|
|
|
this.visibleSections = baseSections
|
|
|
return
|
|
|
@@ -297,7 +260,7 @@ export default {
|
|
|
self.visibleSections = merged
|
|
|
}
|
|
|
}).catch(function(e) {
|
|
|
- self.visibleSections = ['func_entries', 'wisdom_tips']
|
|
|
+ self.visibleSections = ['func_entries', 'recommended_reading']
|
|
|
})
|
|
|
},
|
|
|
loadChildren: function() {
|
|
|
@@ -327,7 +290,6 @@ export default {
|
|
|
self.loadCognitiveReport()
|
|
|
}
|
|
|
}
|
|
|
- self.loadContacts()
|
|
|
}).catch(function(e) {})
|
|
|
},
|
|
|
loadFamilyMembersVisible: function() {
|
|
|
@@ -364,6 +326,7 @@ export default {
|
|
|
}
|
|
|
this.loadFamilyMembersVisible()
|
|
|
this.loadCognitiveReport()
|
|
|
+ this.loadDanReports()
|
|
|
},
|
|
|
loadDimensionTasks: function() {
|
|
|
var self = this
|
|
|
@@ -413,12 +376,6 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
scrollToSection: function(section) {},
|
|
|
- goMemberDetail: function(memberId) {
|
|
|
- uni.navigateTo({ url: '/pages/member-detail/member-detail?memberId=' + memberId + '&entrySource=relation-graph&dimensionCode=wisdom' })
|
|
|
- },
|
|
|
- goFamilyMembers: function() {
|
|
|
- uni.navigateTo({ url: '/pages/profile-extra/family-members' })
|
|
|
- },
|
|
|
goCognitiveReport: function() {
|
|
|
uni.navigateTo({ url: '/pages/wisdom-detail/cognitive-report' })
|
|
|
},
|
|
|
@@ -428,15 +385,8 @@ export default {
|
|
|
goAssessment: function() {
|
|
|
uni.navigateTo({ url: '/pages/assessment/apply' })
|
|
|
},
|
|
|
- goHome: function() {
|
|
|
- uni.switchTab({ url: '/pages/index-home/index' })
|
|
|
- },
|
|
|
onTaskClick: function(task) {},
|
|
|
goTasks: function() { uni.switchTab({ url: '/pages/tasks/tasks' }) },
|
|
|
- goActivityDetail: function(id) {},
|
|
|
- goMoreActivities: function() {
|
|
|
- uni.navigateTo({ url: '/pages/activity/index' })
|
|
|
- },
|
|
|
goActivityDetail: function(act) {
|
|
|
if (!act || !act.id) return
|
|
|
uni.navigateTo({ url: '/pages/discover-detail/activity-detail/activity-detail?id=' + act.id })
|
|
|
@@ -503,55 +453,11 @@ export default {
|
|
|
uni.navigateTo({ url: '/pages/mind-detail/article-detail?id=' + (article.id || article) })
|
|
|
},
|
|
|
|
|
|
- // ===== 重要关系 =====
|
|
|
- loadContacts: function() {
|
|
|
- var self = this
|
|
|
- getContactList({}).then(function(res) {
|
|
|
- if (res.code === 200 && res.data) {
|
|
|
- self.contactList = Array.isArray(res.data) ? res.data : []
|
|
|
- }
|
|
|
- }).catch(function(e) {
|
|
|
- console.log('获取联系人失败', e)
|
|
|
- })
|
|
|
- },
|
|
|
- loadRelationshipHealth: function() {
|
|
|
- var self = this
|
|
|
- getHealthAlerts({}).then(function(res) {
|
|
|
- if (res.code === 200 && res.data) {
|
|
|
- self.healthAlerts = Array.isArray(res.data) ? res.data : []
|
|
|
- }
|
|
|
- }).catch(function() {
|
|
|
- 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 = []
|
|
|
- })
|
|
|
- },
|
|
|
- onContactClick: function(item) {
|
|
|
- uni.navigateTo({ url: '/pages/wisdom-detail/contact-detail?id=' + item.id })
|
|
|
- },
|
|
|
- onShowImport: function() {
|
|
|
- uni.showToast({ title: '导入通讯录', icon: 'none' })
|
|
|
- },
|
|
|
- goInteractionLog: function(memberId) {
|
|
|
- if (memberId) {
|
|
|
- uni.navigateTo({ url: '/pages/wisdom-detail/interaction-log?memberId=' + memberId })
|
|
|
- } else {
|
|
|
- uni.navigateTo({ url: '/pages/wisdom-detail/interaction-log' })
|
|
|
- }
|
|
|
- },
|
|
|
- goRelationshipQuestionnaire: function() {
|
|
|
- uni.navigateTo({ url: '/pages/wisdom-detail/relationship-questionnaire' })
|
|
|
- },
|
|
|
_watchPageReady() {
|
|
|
var self = this
|
|
|
var unwatch = this.$watch(function() {
|
|
|
if (self.isLoggedIn) {
|
|
|
- return !!(self.cognitiveReport || self.energyOverview)
|
|
|
+ return !!(self.cognitiveReport || self.sandboxData)
|
|
|
}
|
|
|
return !!(self.dimensionActivities && self.dimensionActivities.length > 0) ||
|
|
|
!!(self.dimensionProducts && self.dimensionProducts.length > 0)
|
|
|
@@ -669,32 +575,6 @@ export default {
|
|
|
color: #999;
|
|
|
}
|
|
|
|
|
|
-/* ===== 智慧小贴士 ===== */
|
|
|
-.tips-list {
|
|
|
- display: flex;
|
|
|
- flex-direction: column;
|
|
|
-}
|
|
|
-.tip-card {
|
|
|
- background: #fff;
|
|
|
- border-radius: 16rpx;
|
|
|
- padding: 24rpx 20rpx;
|
|
|
- box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.06);
|
|
|
- margin-bottom: 16rpx;
|
|
|
-}
|
|
|
-.tip-title {
|
|
|
- font-size: 28rpx;
|
|
|
- font-weight: bold;
|
|
|
- color: #333;
|
|
|
- display: block;
|
|
|
- margin-bottom: 8rpx;
|
|
|
-}
|
|
|
-.tip-summary {
|
|
|
- font-size: 24rpx;
|
|
|
- color: #888;
|
|
|
- line-height: 1.5;
|
|
|
- display: block;
|
|
|
-}
|
|
|
-
|
|
|
/* ===== 快捷操作按钮 ===== */
|
|
|
.quick-actions {
|
|
|
display: flex;
|
|
|
@@ -776,4 +656,14 @@ export default {
|
|
|
font-size: 26rpx;
|
|
|
color: #6366F1;
|
|
|
}
|
|
|
+.dan-empty {
|
|
|
+ background: #fff;
|
|
|
+ border-radius: 16rpx;
|
|
|
+ padding: 40rpx 24rpx;
|
|
|
+ text-align: center;
|
|
|
+}
|
|
|
+.dan-empty-text {
|
|
|
+ font-size: 24rpx;
|
|
|
+ color: #999;
|
|
|
+}
|
|
|
</style>
|