|
|
@@ -137,9 +137,13 @@
|
|
|
:intimacyMap="intimacyMapForGraph"
|
|
|
@memberTap="goMemberDetail" />
|
|
|
|
|
|
+ <!-- 通关引导进度条 -->
|
|
|
+ <GateGuideBar :unlockStatus="unlockStatus" />
|
|
|
+
|
|
|
<!-- 能量沙盘 -->
|
|
|
+ <GateLock v-if="sandboxLocked && sandboxLockGate" :gate="sandboxLockGate" />
|
|
|
<WuxingSandbox
|
|
|
- v-if="sandboxData"
|
|
|
+ v-else-if="sandboxData"
|
|
|
mode="live"
|
|
|
:scores="sandboxScores"
|
|
|
:overallScore="sandboxData.overallScore || 0"
|
|
|
@@ -147,12 +151,15 @@
|
|
|
:dimensions="energyDimensions"
|
|
|
:totalEnergy="totalEnergy"
|
|
|
:totalHealthIndex="totalHealthIndex"
|
|
|
+ :familyUnlocked="familyUnlocked"
|
|
|
+ :currentView="currentSandboxView"
|
|
|
starHeight="400rpx"
|
|
|
showDimensionBar
|
|
|
+ @view-change="onSandboxViewChange"
|
|
|
@point-click="onDomainClick" />
|
|
|
|
|
|
<!-- 能量数据加载失败兜底 -->
|
|
|
- <view class="error-state" v-if="errorEnergy && !sandboxData" @click="loadData">
|
|
|
+ <view class="error-state" v-if="errorEnergy && !sandboxData && !sandboxLocked" @click="loadData">
|
|
|
<text class="error-state-text">家庭能量数据加载失败,点击重试</text>
|
|
|
</view>
|
|
|
|
|
|
@@ -470,7 +477,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { getFamilyMembers, getChildren, getPendingReviewTasks, getPendingWishes, approveTask, rejectTask, getChildCompletionStats, getParentDashboard, getFamilyEnergySandbox, getEnergyOverview, getVisibleFamilyMembers, getActivityList, getProductsByDomain, getContactList, getFeaturedArticles, getActiveAlerts, dismissAlert, getFamilyRanking, getChallengeList, getCircleRanking, getInviteQrCode, switchToFamilyMember } from '../../utils/api.js'
|
|
|
+import { getFamilyMembers, getChildren, getPendingReviewTasks, getPendingWishes, approveTask, rejectTask, getChildCompletionStats, getParentDashboard, getFamilyEnergySandbox, getEnergySandbox, getUnlockStatus, getEnergyOverview, getVisibleFamilyMembers, getActivityList, getProductsByDomain, getContactList, getFeaturedArticles, getActiveAlerts, dismissAlert, getFamilyRanking, getChallengeList, getCircleRanking, getInviteQrCode, switchToFamilyMember } from '../../utils/api.js'
|
|
|
import store from '../../store/index.js'
|
|
|
import PageBanner from '../../components/PageBanner.vue'
|
|
|
import PlayfulCard from '../../components/PlayfulCard.vue'
|
|
|
@@ -494,10 +501,12 @@ import HealthAlertBanner from '../../components/HealthAlertBanner.vue'
|
|
|
import CircleRanking from '../../components/CircleRanking.vue'
|
|
|
import ArticleBookshelf from '../../components/ArticleBookshelf.vue'
|
|
|
import OnboardingProgressBar from '../../components/OnboardingProgressBar.vue'
|
|
|
+import GateLock from '../../components/gate-lock.vue'
|
|
|
+import GateGuideBar from '../../components/gate-guide-bar.vue'
|
|
|
import feedbackEngine from '../../utils/feedback-engine.js'
|
|
|
|
|
|
export default {
|
|
|
- components: { PageBanner, RecommendedFeed, PlayfulCard, PlayfulButton, BaseBadge, BaseEmpty, BaseLoading, FamilyRelationGraph, WuxingSandbox, ContactCard, ContactImport, FamilyMemberStrip, MicroActionCard, FeedbackToast, MilestoneCelebration, DailySummary, HealthAlertBanner, FamilyHealthRanking, FamilyChallengeCard, CircleRanking, ArticleBookshelf, OnboardingProgressBar },
|
|
|
+ components: { PageBanner, RecommendedFeed, PlayfulCard, PlayfulButton, BaseBadge, BaseEmpty, BaseLoading, FamilyRelationGraph, WuxingSandbox, ContactCard, ContactImport, FamilyMemberStrip, MicroActionCard, FeedbackToast, MilestoneCelebration, DailySummary, HealthAlertBanner, FamilyHealthRanking, FamilyChallengeCard, CircleRanking, ArticleBookshelf, OnboardingProgressBar, GateLock, GateGuideBar },
|
|
|
data() {
|
|
|
return {
|
|
|
nickname: '',
|
|
|
@@ -529,6 +538,13 @@ export default {
|
|
|
recommendedProducts: [],
|
|
|
sandboxData: null,
|
|
|
errorEnergy: false,
|
|
|
+ // 通关解锁状态
|
|
|
+ sandboxLocked: false,
|
|
|
+ sandboxLockGate: null,
|
|
|
+ currentSandboxView: 'personal',
|
|
|
+ familyUnlocked: false,
|
|
|
+ familyLockGate: null,
|
|
|
+ unlockStatus: null,
|
|
|
errorTasks: false,
|
|
|
errorActivities: false,
|
|
|
errorProducts: false,
|
|
|
@@ -817,14 +833,44 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- // 加载家庭能量沙盘数据(五维 + 所有成员)
|
|
|
+ // 加载通关解锁状态
|
|
|
try {
|
|
|
- const energyRes = await getFamilyEnergySandbox()
|
|
|
- this.energyData = energyRes.data || null
|
|
|
- this.sandboxData = energyRes.data || null
|
|
|
+ var statusRes = await getUnlockStatus()
|
|
|
+ if (statusRes && statusRes.data) {
|
|
|
+ this.unlockStatus = statusRes.data
|
|
|
+ }
|
|
|
+ } catch (e) {
|
|
|
+ console.log('获取通关解锁状态失败', e)
|
|
|
+ }
|
|
|
+
|
|
|
+ // 加载能量沙盘(含通关门禁)
|
|
|
+ try {
|
|
|
+ var energyRes = await getEnergySandbox(this.currentSandboxView)
|
|
|
+ if (energyRes && energyRes.data) {
|
|
|
+ var ed = energyRes.data
|
|
|
+ if (ed.locked) {
|
|
|
+ this.sandboxLocked = true
|
|
|
+ this.sandboxLockGate = ed.gate || null
|
|
|
+ this.sandboxData = null
|
|
|
+ this.energyData = null
|
|
|
+ } else {
|
|
|
+ this.sandboxLocked = false
|
|
|
+ this.sandboxLockGate = null
|
|
|
+ if (ed.view === 'personal') {
|
|
|
+ this.sandboxData = ed.personalData || null
|
|
|
+ this.energyData = ed.personalData || null
|
|
|
+ this.familyUnlocked = ed.familyUnlocked || false
|
|
|
+ this.familyLockGate = ed.familyGate || null
|
|
|
+ } else {
|
|
|
+ this.sandboxData = ed.familyData || null
|
|
|
+ this.energyData = ed.familyData || null
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
} catch (e) {
|
|
|
console.log('获取能量沙盘数据失败', e)
|
|
|
this.energyData = null
|
|
|
+ this.sandboxData = null
|
|
|
this.errorEnergy = true
|
|
|
}
|
|
|
|
|
|
@@ -906,6 +952,37 @@ export default {
|
|
|
onDomainClick(evt) {
|
|
|
this.goToDomain(evt.code)
|
|
|
},
|
|
|
+ /** 切换沙盘个人/全家视角 */
|
|
|
+ onSandboxViewChange: async function(view) {
|
|
|
+ this.currentSandboxView = view
|
|
|
+ this.loadSandboxData()
|
|
|
+ },
|
|
|
+ /** 单独加载沙盘数据(用于视角切换) */
|
|
|
+ loadSandboxData: async function() {
|
|
|
+ try {
|
|
|
+ var energyRes = await getEnergySandbox(this.currentSandboxView)
|
|
|
+ if (energyRes && energyRes.data) {
|
|
|
+ var ed = energyRes.data
|
|
|
+ if (ed.locked) {
|
|
|
+ this.sandboxLocked = true
|
|
|
+ this.sandboxLockGate = ed.gate || null
|
|
|
+ this.sandboxData = null
|
|
|
+ } else {
|
|
|
+ this.sandboxLocked = false
|
|
|
+ this.sandboxLockGate = null
|
|
|
+ if (ed.view === 'personal') {
|
|
|
+ this.sandboxData = ed.personalData || null
|
|
|
+ this.familyUnlocked = ed.familyUnlocked || false
|
|
|
+ this.familyLockGate = ed.familyGate || null
|
|
|
+ } else {
|
|
|
+ this.sandboxData = ed.familyData || null
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } catch (e) {
|
|
|
+ console.log('加载沙盘数据失败', e)
|
|
|
+ }
|
|
|
+ },
|
|
|
goToDomain(code) {
|
|
|
// 跳转到能量详情页
|
|
|
var memberId = this.currentChildId
|