|
|
@@ -44,14 +44,9 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
|
- <!-- 首次选择意图弹层 — 改版v1 -->
|
|
|
- <IntentPicker
|
|
|
- :show="showIntentPicker"
|
|
|
- @select="handleIntentSelect"
|
|
|
- @close="handleIntentClose" />
|
|
|
-
|
|
|
<!-- 登录态 — 直接内嵌,保持底签可见 -->
|
|
|
<view v-if="currentRole" class="logged-in-container">
|
|
|
+<<<<<<< Updated upstream
|
|
|
<!-- ① 了解区 — 自测大卡(首屏,引导"从了解开始") -->
|
|
|
<view class="self-test-card" @click="goSelfTest">
|
|
|
<view class="self-test-head">
|
|
|
@@ -65,6 +60,9 @@
|
|
|
</view>
|
|
|
|
|
|
<!-- ② 发现区 — 能量沙盘 — Canvas 五行星图(未测评时显示引导卡) -->
|
|
|
+=======
|
|
|
+ <!-- 能量沙盘 — Canvas 五行星图(未测评时显示引导卡) -->
|
|
|
+>>>>>>> Stashed changes
|
|
|
<GateLock v-if="sandboxLocked && sandboxLockGate" :gate="sandboxLockGate" />
|
|
|
<WuxingSandbox
|
|
|
v-else-if="sandboxData"
|
|
|
@@ -84,12 +82,6 @@
|
|
|
@click="goToUploadReport" />
|
|
|
</view>
|
|
|
|
|
|
- <!-- ③ 行动区 — 旅程状态卡 — 改版v1 需求驱动(A类·随便看看 不展示旅程卡) -->
|
|
|
- <JourneyCard
|
|
|
- v-if="userIntent && userIntent.intentType !== 'A'"
|
|
|
- :intent="userIntent"
|
|
|
- @action="handleJourneyAction" />
|
|
|
-
|
|
|
<!-- ③ 行动区 — 今日任务 -->
|
|
|
<DailyTaskCard />
|
|
|
|
|
|
@@ -360,9 +352,7 @@ import ArticleBookshelf from '../../components/ArticleBookshelf.vue'
|
|
|
import FamilyChallengeCard from '../../components/FamilyChallengeCard.vue'
|
|
|
import DailyTaskCard from '../../components/daily-task-card.vue'
|
|
|
import ReportUploadCard from '../../components/report-upload-card.vue'
|
|
|
-import IntentPicker from '../../components/intent-picker.vue'
|
|
|
-import JourneyCard from '../../components/journey-card.vue'
|
|
|
-import { acceptParentInvite, productList, getActivityList, getFeaturedArticles, getFamilyEnergySandbox, getFamilyMemberList, getChildren, getChallengeList, switchToFamilyMember, getMyMembership, updateChallengeProgress, respondChallenge, getTodayTasks, completeTask as completeTaskApi, getTodayParentTasks, completeParentTask as completeParentTaskApi, getTaskHistory, getNotices, getNotificationList, getUserIntent, chooseUserIntent } from '../../utils/api.js'
|
|
|
+import { acceptParentInvite, productList, getActivityList, getFeaturedArticles, getFamilyEnergySandbox, getFamilyMemberList, getChildren, getChallengeList, switchToFamilyMember, getMyMembership, updateChallengeProgress, respondChallenge, getTodayTasks, completeTask as completeTaskApi, getTodayParentTasks, completeParentTask as completeParentTaskApi, getTaskHistory, getNotices, getNotificationList } from '../../utils/api.js'
|
|
|
import nav from '../../utils/nav.js'
|
|
|
import config from '@/config.js'
|
|
|
import { parseDate } from '../../utils/format.js'
|
|
|
@@ -377,8 +367,7 @@ export default {
|
|
|
FamilyChallengeCard,
|
|
|
DailyTaskCard,
|
|
|
ReportUploadCard,
|
|
|
- IntentPicker,
|
|
|
- JourneyCard
|
|
|
+
|
|
|
},
|
|
|
data() {
|
|
|
// 从 storage 预取登录态/角色,确保首次渲染即正确(WeChat 渲染层/逻辑层分离架构下 onLoad 执行前已渲染)
|
|
|
@@ -443,10 +432,7 @@ export default {
|
|
|
isLifetime: false,
|
|
|
membershipDays: 0,
|
|
|
|
|
|
- // 改版v1 用户意图/旅程
|
|
|
- userIntent: null,
|
|
|
- showIntentPicker: false,
|
|
|
- intentPickerDismissed: false
|
|
|
+
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
@@ -902,7 +888,6 @@ export default {
|
|
|
this.loadLoggedInData()
|
|
|
}
|
|
|
this.checkMemberStatus()
|
|
|
- this.checkUserIntent()
|
|
|
this._watchPageReady()
|
|
|
},
|
|
|
_watchPageReady() {
|
|
|
@@ -1099,84 +1084,7 @@ export default {
|
|
|
return config.API_BASE_URL + path
|
|
|
},
|
|
|
|
|
|
- // ===== 改版v1 用户意图/旅程 =====
|
|
|
- checkUserIntent: function() {
|
|
|
- var self = this
|
|
|
- var role = uni.getStorageSync('currentRole') || uni.getStorageSync('role') || ''
|
|
|
- // teacher 角色不弹意图选择
|
|
|
- if (role === 'teacher') return
|
|
|
- getUserIntent().then(function(res) {
|
|
|
- var intent = res && res.data
|
|
|
- if (intent) {
|
|
|
- self.userIntent = intent
|
|
|
- } else {
|
|
|
- // 无意图且未跳过,弹选择层
|
|
|
- if (!self.intentPickerDismissed) {
|
|
|
- self.intentPickerDismissed = true
|
|
|
- self.showIntentPicker = true
|
|
|
- }
|
|
|
- }
|
|
|
- }).catch(function() {
|
|
|
- // 静默:接口异常时不弹
|
|
|
- })
|
|
|
- },
|
|
|
- handleIntentSelect: function(payload) {
|
|
|
- var self = this
|
|
|
- self.showIntentPicker = false
|
|
|
- uni.showLoading({ title: '处理中...', mask: true })
|
|
|
- var data = { intentType: payload.intentType }
|
|
|
- if (payload.intentType === 'C' && payload.problemDomainCode) {
|
|
|
- data.problemDomainCode = payload.problemDomainCode
|
|
|
- }
|
|
|
- chooseUserIntent(data).then(function(res) {
|
|
|
- uni.hideLoading()
|
|
|
- if (res && (res.code === 0 || res.code === 200)) {
|
|
|
- // 选择成功后刷新意图
|
|
|
- getUserIntent().then(function(r) {
|
|
|
- self.userIntent = r && r.data
|
|
|
- }).catch(function() {})
|
|
|
- // B类:进入问卷,问卷完成后回调更新画像
|
|
|
- if (payload.intentType === 'B') {
|
|
|
- uni.navigateTo({ url: '/pages/health/ai-questionnaire' })
|
|
|
- } else if (payload.intentType === 'C') {
|
|
|
- uni.navigateTo({
|
|
|
- url: '/pages/problem/flow-intro?code=' + (payload.problemDomainCode || '')
|
|
|
- })
|
|
|
- }
|
|
|
- } else {
|
|
|
- uni.showToast({ title: res.message || '选择失败', icon: 'none' })
|
|
|
- }
|
|
|
- }).catch(function() {
|
|
|
- uni.hideLoading()
|
|
|
- uni.showToast({ title: '选择失败,请重试', icon: 'none' })
|
|
|
- })
|
|
|
- },
|
|
|
- handleIntentClose: function() {
|
|
|
- this.showIntentPicker = false
|
|
|
- },
|
|
|
- handleJourneyAction: function(payload) {
|
|
|
- var action = payload && payload.action
|
|
|
- var code = payload && payload.code
|
|
|
- if (action === 'flow-intro') {
|
|
|
- uni.navigateTo({ url: '/pages/problem/flow-intro?code=' + (code || '') })
|
|
|
- } else if (action === 'survey') {
|
|
|
- uni.navigateTo({ url: '/pages/problem/survey?code=' + (code || '') })
|
|
|
- } else if (action === 'package') {
|
|
|
- uni.navigateTo({ url: '/pages/problem/package-match?code=' + (code || '') })
|
|
|
- } else if (action === 'logistics') {
|
|
|
- uni.navigateTo({ url: '/pages/problem/logistics?code=' + (code || '') })
|
|
|
- } else if (action === 'report') {
|
|
|
- uni.navigateTo({ url: '/pages/problem/plan-confirm?code=' + (code || '') })
|
|
|
- } else if (action === 'plan-confirm') {
|
|
|
- uni.navigateTo({ url: '/pages/problem/plan-confirm?code=' + (code || '') })
|
|
|
- } else if (action === 'tasks') {
|
|
|
- uni.navigateTo({ url: '/pages/tasks/tasks' })
|
|
|
- } else if (action === 'purchase') {
|
|
|
- uni.navigateTo({ url: '/pages/assessment/purchase' })
|
|
|
- } else if (action === 'recommend') {
|
|
|
- uni.navigateTo({ url: '/pages/problem/domain-list' })
|
|
|
- }
|
|
|
- }
|
|
|
+
|
|
|
|
|
|
}
|
|
|
}
|