|
|
@@ -25,6 +25,7 @@
|
|
|
|
|
|
<!-- 家庭成员选择条 -->
|
|
|
<FamilyMemberStrip
|
|
|
+ v-if="currentView === 'self'"
|
|
|
v-if="isLoggedIn"
|
|
|
:members="familyMembersVisible"
|
|
|
:selectedMemberId="selectedMemberId"
|
|
|
@@ -165,7 +166,7 @@ import PsychCrisisBanner from '../../components/PsychCrisisBanner.vue'
|
|
|
import AIFloatingAvatar from '../../components/AIFloatingAvatar.vue'
|
|
|
import FamilyTianpanCard from '../../components/FamilyTianpanCard.vue'
|
|
|
import FamilyMemberStrip from '../../components/FamilyMemberStrip.vue'
|
|
|
-import { getVisibleSections, getEmiReport, getFamilyEnergySandbox, getChildren, getVisibleFamilyMembers, getEnergyOverview, getContactList, getHealthAlerts, getMilestones, getDanReportByChild, getFamilyFortune } from '../../utils/api.js'
|
|
|
+import { getVisibleSections, getEmiReport, getFamilyEnergySandbox, getEnergySandbox, getChildren, getVisibleFamilyMembers, getEnergyOverview, getContactList, getHealthAlerts, getMilestones, getDanReportByChild, getFamilyFortune } from '../../utils/api.js'
|
|
|
import nav from '../../utils/nav.js'
|
|
|
import config from '../../config.js'
|
|
|
import { parseDate } from '../../utils/format.js'
|
|
|
@@ -235,6 +236,7 @@ components: { TabTransition, PageBanner, RadarChart, FamilyEnergyBar, PsychCrisi
|
|
|
userName: '',
|
|
|
children: [],
|
|
|
sandboxData: null,
|
|
|
+ currentView: 'self', // 'self' | 'family'
|
|
|
contactList: [],
|
|
|
healthAlerts: [],
|
|
|
milestones: [],
|
|
|
@@ -736,7 +738,21 @@ var descList = descMap[this.dominantElement] || descMap.wood
|
|
|
if (res && res.data) {
|
|
|
self.sandboxData = res.data
|
|
|
}
|
|
|
- }).catch(function() {})
|
|
|
+ }).catch(function() {}
|
|
|
+ switchView: function(view) {
|
|
|
+ this.currentView = view
|
|
|
+ if (view === 'family') {
|
|
|
+ this.selectedMemberId = null
|
|
|
+ var self = this
|
|
|
+ getEnergySandbox('family').then(function(res) {
|
|
|
+ if (res && res.data && !res.data.locked) {
|
|
|
+ self.sandboxData = res.data.familyData || res.data
|
|
|
+ }
|
|
|
+ }).catch(function(e) { console.log('获取家庭数据失败', e) })
|
|
|
+ } else {
|
|
|
+ this.loadSandboxData()
|
|
|
+ }
|
|
|
+ },)
|
|
|
},
|
|
|
loadEnergyData: function() {
|
|
|
var self = this
|
|
|
@@ -908,6 +924,27 @@ var descList = descMap[this.dominantElement] || descMap.wood
|
|
|
}
|
|
|
</script>
|
|
|
|
|
|
+
|
|
|
+.view-toggle {
|
|
|
+ display: flex;
|
|
|
+ margin: 20rpx 30rpx;
|
|
|
+ background: rgba(255,255,255,0.12);
|
|
|
+ border-radius: 12rpx;
|
|
|
+ padding: 6rpx;
|
|
|
+}
|
|
|
+.toggle-btn {
|
|
|
+ flex: 1;
|
|
|
+ text-align: center;
|
|
|
+ padding: 12rpx 0;
|
|
|
+ border-radius: 8rpx;
|
|
|
+ font-size: 26rpx;
|
|
|
+ color: rgba(255,255,255,0.65);
|
|
|
+}
|
|
|
+.toggle-btn.active {
|
|
|
+ background: rgba(255,255,255,0.22);
|
|
|
+ color: #fff;
|
|
|
+ font-weight: 600;
|
|
|
+}
|
|
|
<style scoped>
|
|
|
.container {
|
|
|
min-height: 100vh;
|