|
@@ -28,6 +28,18 @@
|
|
|
:alerts="healthAlerts"
|
|
:alerts="healthAlerts"
|
|
|
@dismiss="onAlertDismiss" />
|
|
@dismiss="onAlertDismiss" />
|
|
|
|
|
|
|
|
|
|
+<!-- ===== 家庭健康排行榜(P2-2) ===== -->
|
|
|
|
|
+<FamilyHealthRanking
|
|
|
|
|
+ v-if="rankingMembers && rankingMembers.length > 0"
|
|
|
|
|
+ :list="rankingMembers"
|
|
|
|
|
+ :totalScore="rankingTotalScore" />
|
|
|
|
|
+
|
|
|
|
|
+<!-- ===== 家庭挑战卡片(P2-2) ===== -->
|
|
|
|
|
+<FamilyChallengeCard
|
|
|
|
|
+ v-for="ch in activeChallenges"
|
|
|
|
|
+ :key="ch.id"
|
|
|
|
|
+ :challenge="ch" />
|
|
|
|
|
+
|
|
|
<!-- ===== 家庭成员关系图谱 ===== -->
|
|
<!-- ===== 家庭成员关系图谱 ===== -->
|
|
|
<FamilyRelationGraph
|
|
<FamilyRelationGraph
|
|
|
v-if="familyMembersVisible.length > 0"
|
|
v-if="familyMembersVisible.length > 0"
|
|
@@ -383,7 +395,7 @@
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
-import { getFamilyMembers, getChildren, getPendingReviewTasks, getPendingWishes, approveTask, rejectTask, getChildCompletionStats, getParentDashboard, getFamilyEnergySandbox, getEnergyOverview, getVisibleFamilyMembers, getActivityList, getProductsByDomain, getContactList, getFeaturedArticles, getActiveAlerts, dismissAlert } from '../../utils/api.js'
|
|
|
|
|
|
|
+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 PageBanner from '../../components/PageBanner.vue'
|
|
import PageBanner from '../../components/PageBanner.vue'
|
|
|
import PlayfulCard from '../../components/PlayfulCard.vue'
|
|
import PlayfulCard from '../../components/PlayfulCard.vue'
|
|
|
import PlayfulButton from '../../components/PlayfulButton.vue'
|
|
import PlayfulButton from '../../components/PlayfulButton.vue'
|
|
@@ -393,6 +405,8 @@ import BaseLoading from '../../components/BaseLoading.vue'
|
|
|
import FamilyRelationGraph from '../../components/FamilyRelationGraph.vue'
|
|
import FamilyRelationGraph from '../../components/FamilyRelationGraph.vue'
|
|
|
import WuxingSandbox from '../../components/wuxing-sandbox.vue'
|
|
import WuxingSandbox from '../../components/wuxing-sandbox.vue'
|
|
|
import ContactCard from '../../components/ContactCard.vue'
|
|
import ContactCard from '../../components/ContactCard.vue'
|
|
|
|
|
+import FamilyHealthRanking from '../../components/FamilyHealthRanking.vue'
|
|
|
|
|
+import FamilyChallengeCard from '../../components/FamilyChallengeCard.vue'
|
|
|
import ContactImport from '../../components/ContactImport.vue'
|
|
import ContactImport from '../../components/ContactImport.vue'
|
|
|
import RecommendedFeed from '../../components/RecommendedFeed.vue'
|
|
import RecommendedFeed from '../../components/RecommendedFeed.vue'
|
|
|
import FamilyMemberStrip from '../../components/FamilyMemberStrip.vue'
|
|
import FamilyMemberStrip from '../../components/FamilyMemberStrip.vue'
|
|
@@ -404,7 +418,7 @@ import HealthAlertBanner from '../../components/HealthAlertBanner.vue'
|
|
|
import feedbackEngine from '../../utils/feedback-engine.js'
|
|
import feedbackEngine from '../../utils/feedback-engine.js'
|
|
|
|
|
|
|
|
export default {
|
|
export default {
|
|
|
- components: { PageBanner, RecommendedFeed, PlayfulCard, PlayfulButton, BaseBadge, BaseEmpty, BaseLoading, FamilyRelationGraph, WuxingSandbox, ContactCard, ContactImport, FamilyMemberStrip, MicroActionCard, FeedbackToast, MilestoneCelebration, DailySummary, HealthAlertBanner },
|
|
|
|
|
|
|
+ components: { PageBanner, RecommendedFeed, PlayfulCard, PlayfulButton, BaseBadge, BaseEmpty, BaseLoading, FamilyRelationGraph, WuxingSandbox, ContactCard, ContactImport, FamilyMemberStrip, MicroActionCard, FeedbackToast, MilestoneCelebration, DailySummary, HealthAlertBanner, FamilyHealthRanking, FamilyChallengeCard },
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
nickname: '',
|
|
nickname: '',
|
|
@@ -465,7 +479,11 @@ export default {
|
|
|
celebrationSubtitle: '',
|
|
celebrationSubtitle: '',
|
|
|
celebrationParticles: [],
|
|
celebrationParticles: [],
|
|
|
// P1-2 健康预警
|
|
// P1-2 健康预警
|
|
|
- healthAlerts: []
|
|
|
|
|
|
|
+ healthAlerts: [],
|
|
|
|
|
+ // P2-2 家庭互动
|
|
|
|
|
+ rankingMembers: [],
|
|
|
|
|
+ rankingTotalScore: 0,
|
|
|
|
|
+ activeChallenges: []
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
computed: {
|
|
computed: {
|
|
@@ -730,6 +748,8 @@ export default {
|
|
|
this.loadFamilyMembersVisible()
|
|
this.loadFamilyMembersVisible()
|
|
|
// 加载健康预警(P1-2)
|
|
// 加载健康预警(P1-2)
|
|
|
this.loadAlerts()
|
|
this.loadAlerts()
|
|
|
|
|
+ // 加载家庭健康互动(P2-2)
|
|
|
|
|
+ this.loadFamilyInteraction()
|
|
|
// 加载外部联系人
|
|
// 加载外部联系人
|
|
|
this.loadContacts()
|
|
this.loadContacts()
|
|
|
// 加载推荐阅读
|
|
// 加载推荐阅读
|
|
@@ -821,9 +841,7 @@ export default {
|
|
|
if (res.code === 200) {
|
|
if (res.code === 200) {
|
|
|
self.healthAlerts = res.data || []
|
|
self.healthAlerts = res.data || []
|
|
|
}
|
|
}
|
|
|
- }).catch(function() {})
|
|
|
|
|
},
|
|
},
|
|
|
- onAlertDismiss: function(alertId) {
|
|
|
|
|
var self = this
|
|
var self = this
|
|
|
dismissAlert({ id: alertId }).then(function(res) {
|
|
dismissAlert({ id: alertId }).then(function(res) {
|
|
|
if (res.code === 200) {
|
|
if (res.code === 200) {
|
|
@@ -831,6 +849,22 @@ export default {
|
|
|
}
|
|
}
|
|
|
}).catch(function() {})
|
|
}).catch(function() {})
|
|
|
},
|
|
},
|
|
|
|
|
+ loadFamilyInteraction: function() {
|
|
|
|
|
+ var familyId = this._familyId
|
|
|
|
|
+ if (!familyId) return
|
|
|
|
|
+ var self = this
|
|
|
|
|
+ getFamilyRanking({ familyId: familyId }).then(function(res) {
|
|
|
|
|
+ if (res.code === 200 && res.data) {
|
|
|
|
|
+ self.rankingMembers = res.data.members || []
|
|
|
|
|
+ self.rankingTotalScore = res.data.totalScore || 0
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ getChallengeList({ familyId: familyId }).then(function(res) {
|
|
|
|
|
+ if (res.code === 200 && Array.isArray(res.data)) {
|
|
|
|
|
+ self.activeChallenges = res.data
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
goMemberDetail(member) {
|
|
goMemberDetail(member) {
|
|
|
if (!member || !member.memberId) return
|
|
if (!member || !member.memberId) return
|
|
|
uni.navigateTo({
|
|
uni.navigateTo({
|