|
|
@@ -57,29 +57,12 @@
|
|
|
tagline="知行合一 · 快乐成长"
|
|
|
quote="千里之行,始于足下" />
|
|
|
|
|
|
- <!-- 旅程状态卡 — 改版v1 需求驱动 -->
|
|
|
+ <!-- 旅程状态卡 — 改版v1 需求驱动(A类·随便看看 不展示旅程卡) -->
|
|
|
<JourneyCard
|
|
|
- v-if="userIntent"
|
|
|
+ v-if="userIntent && userIntent.intentType !== 'A'"
|
|
|
:intent="userIntent"
|
|
|
@action="handleJourneyAction" />
|
|
|
|
|
|
- <!-- 今日任务卡片 — 每日任务统一入口 -->
|
|
|
- <DailyTaskCard />
|
|
|
-
|
|
|
- <!-- 定向科普内容 — F17 B类问卷结果定向展示 -->
|
|
|
- <view v-if="targetedArticles.length > 0" class="section">
|
|
|
- <view class="section-header">
|
|
|
- <text class="section-title">📚 为你推荐</text>
|
|
|
- </view>
|
|
|
- <view class="targeted-list">
|
|
|
- <view class="targeted-card" v-for="article in targetedArticles" :key="article.id" @click="goArticleDetail(article.id)">
|
|
|
- <text class="targeted-category">{{ article.categoryName || article.category || '推荐' }}</text>
|
|
|
- <text class="targeted-title">{{ article.title }}</text>
|
|
|
- <text class="targeted-summary">{{ article.summary || '' }}</text>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
-
|
|
|
<!-- 能量沙盘 — Canvas 五行星图 -->
|
|
|
<WuxingSandbox
|
|
|
v-if="sandboxData"
|
|
|
@@ -362,8 +345,7 @@ import ArticleBookshelf from '../../components/ArticleBookshelf.vue'
|
|
|
import FamilyChallengeCard from '../../components/FamilyChallengeCard.vue'
|
|
|
import IntentPicker from '../../components/intent-picker.vue'
|
|
|
import JourneyCard from '../../components/journey-card.vue'
|
|
|
-import DailyTaskCard from '../../components/daily-task-card.vue'
|
|
|
-import { acceptParentInvite, productList, getActivityList, getFeaturedArticles, getFamilyEnergySandbox, getVisibleFamilyMembers, getChildren, getChallengeList, switchToFamilyMember, getMyMembership, updateChallengeProgress, respondChallenge, getTodayTasks, completeTask as completeTaskApi, getTodayParentTasks, completeParentTask as completeParentTaskApi, getTaskHistory, getNotices, getUserIntent, chooseUserIntent, getContentByTags } from '../../utils/api.js'
|
|
|
+import { acceptParentInvite, productList, getActivityList, getFeaturedArticles, getFamilyEnergySandbox, getVisibleFamilyMembers, getChildren, getChallengeList, switchToFamilyMember, getMyMembership, updateChallengeProgress, respondChallenge, getTodayTasks, completeTask as completeTaskApi, getTodayParentTasks, completeParentTask as completeParentTaskApi, getTaskHistory, getNotices, getUserIntent, chooseUserIntent } from '../../utils/api.js'
|
|
|
import nav from '../../utils/nav.js'
|
|
|
import config from '@/config.js'
|
|
|
|
|
|
@@ -376,8 +358,7 @@ export default {
|
|
|
ArticleBookshelf,
|
|
|
FamilyChallengeCard,
|
|
|
IntentPicker,
|
|
|
- JourneyCard,
|
|
|
- DailyTaskCard
|
|
|
+ JourneyCard
|
|
|
},
|
|
|
data() {
|
|
|
// 从 storage 预取登录态/角色,确保首次渲染即正确(WeChat 渲染层/逻辑层分离架构下 onLoad 执行前已渲染)
|
|
|
@@ -443,8 +424,7 @@ export default {
|
|
|
// 改版v1 用户意图/旅程
|
|
|
userIntent: null,
|
|
|
showIntentPicker: false,
|
|
|
- intentPickerDismissed: false,
|
|
|
- targetedArticles: []
|
|
|
+ intentPickerDismissed: false
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
@@ -1051,8 +1031,6 @@ export default {
|
|
|
var intent = res && res.data
|
|
|
if (intent) {
|
|
|
self.userIntent = intent
|
|
|
- // F17: 已有调研结果的用户加载定向科普内容
|
|
|
- self.loadTargetedContent(intent)
|
|
|
} else {
|
|
|
// 无意图且未跳过,弹选择层
|
|
|
if (!self.intentPickerDismissed) {
|
|
|
@@ -1064,32 +1042,6 @@ export default {
|
|
|
// 静默:接口异常时不弹
|
|
|
})
|
|
|
},
|
|
|
- // F17: 按调研 resultTags 定向加载科普内容
|
|
|
- loadTargetedContent: function(intent) {
|
|
|
- var self = this
|
|
|
- var tags = []
|
|
|
- var resultJson = intent && intent.survey_result_json
|
|
|
- if (resultJson) {
|
|
|
- try {
|
|
|
- var parsed = typeof resultJson === 'string' ? JSON.parse(resultJson) : resultJson
|
|
|
- if (parsed && parsed.resultTags && Array.isArray(parsed.resultTags)) {
|
|
|
- tags = parsed.resultTags
|
|
|
- }
|
|
|
- } catch (e) {
|
|
|
- tags = []
|
|
|
- }
|
|
|
- }
|
|
|
- // B类无 tags 时用问题域 contentTags 或空数组
|
|
|
- if (tags.length === 0 && intent && intent.intentType === 'C' && intent.problemDomainCode) {
|
|
|
- tags = [intent.problemDomainCode]
|
|
|
- }
|
|
|
- getContentByTags({ tags: tags }).then(function(res) {
|
|
|
- var list = res && res.data
|
|
|
- self.targetedArticles = Array.isArray(list) ? list : []
|
|
|
- }).catch(function() {
|
|
|
- self.targetedArticles = []
|
|
|
- })
|
|
|
- },
|
|
|
handleIntentSelect: function(payload) {
|
|
|
var self = this
|
|
|
self.showIntentPicker = false
|
|
|
@@ -1105,11 +1057,9 @@ export default {
|
|
|
getUserIntent().then(function(r) {
|
|
|
self.userIntent = r && r.data
|
|
|
}).catch(function() {})
|
|
|
- // 按类型跳转
|
|
|
- if (payload.intentType === 'A') {
|
|
|
- uni.navigateTo({ url: '/pages/assessment/purchase' })
|
|
|
- } else if (payload.intentType === 'B') {
|
|
|
- uni.navigateTo({ url: '/pages/problem/quick-survey' })
|
|
|
+ // 按类型跳转(A类·随便看看 不跳转,留在首页浏览)
|
|
|
+ if (payload.intentType === 'B') {
|
|
|
+ uni.navigateTo({ url: '/pages/problem/domain-list' })
|
|
|
} else if (payload.intentType === 'C') {
|
|
|
uni.navigateTo({
|
|
|
url: '/pages/problem/flow-intro?code=' + (payload.problemDomainCode || '')
|
|
|
@@ -1133,12 +1083,7 @@ export default {
|
|
|
if (action === 'flow-intro') {
|
|
|
uni.navigateTo({ url: '/pages/problem/flow-intro?code=' + (code || '') })
|
|
|
} else if (action === 'survey') {
|
|
|
- // B类轻问卷 / C类专项调研
|
|
|
- if (code) {
|
|
|
- uni.navigateTo({ url: '/pages/problem/survey?code=' + code })
|
|
|
- } else {
|
|
|
- uni.navigateTo({ url: '/pages/problem/quick-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') {
|
|
|
@@ -1388,46 +1333,6 @@ export default {
|
|
|
font-size: 24rpx;
|
|
|
color: #5B9BD5;
|
|
|
}
|
|
|
-.targeted-list {
|
|
|
- display: flex;
|
|
|
- flex-direction: column;
|
|
|
- gap: 16rpx;
|
|
|
-}
|
|
|
-.targeted-card {
|
|
|
- background: #fff;
|
|
|
- border-radius: 16rpx;
|
|
|
- padding: 24rpx 28rpx;
|
|
|
- box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.06);
|
|
|
-}
|
|
|
-.targeted-card:active {
|
|
|
- opacity: 0.9;
|
|
|
-}
|
|
|
-.targeted-category {
|
|
|
- display: inline-block;
|
|
|
- font-size: 20rpx;
|
|
|
- color: #F97316;
|
|
|
- background: rgba(249, 115, 22, 0.1);
|
|
|
- padding: 2rpx 14rpx;
|
|
|
- border-radius: 16rpx;
|
|
|
- margin-bottom: 10rpx;
|
|
|
-}
|
|
|
-.targeted-title {
|
|
|
- display: block;
|
|
|
- font-size: 28rpx;
|
|
|
- font-weight: 600;
|
|
|
- color: #333;
|
|
|
- margin-bottom: 6rpx;
|
|
|
-}
|
|
|
-.targeted-summary {
|
|
|
- display: block;
|
|
|
- font-size: 24rpx;
|
|
|
- color: #999;
|
|
|
- overflow: hidden;
|
|
|
- text-overflow: ellipsis;
|
|
|
- display: -webkit-box;
|
|
|
- -webkit-box-orient: vertical;
|
|
|
- -webkit-line-clamp: 2;
|
|
|
-}
|
|
|
.empty-state {
|
|
|
display: flex;
|
|
|
justify-content: center;
|