|
@@ -63,6 +63,20 @@
|
|
|
:intent="userIntent"
|
|
:intent="userIntent"
|
|
|
@action="handleJourneyAction" />
|
|
@action="handleJourneyAction" />
|
|
|
|
|
|
|
|
|
|
+ <!-- 定向科普内容 — 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 五行星图 -->
|
|
<!-- 能量沙盘 — Canvas 五行星图 -->
|
|
|
<WuxingSandbox
|
|
<WuxingSandbox
|
|
|
v-if="sandboxData"
|
|
v-if="sandboxData"
|
|
@@ -345,7 +359,7 @@ import ArticleBookshelf from '../../components/ArticleBookshelf.vue'
|
|
|
import FamilyChallengeCard from '../../components/FamilyChallengeCard.vue'
|
|
import FamilyChallengeCard from '../../components/FamilyChallengeCard.vue'
|
|
|
import IntentPicker from '../../components/intent-picker.vue'
|
|
import IntentPicker from '../../components/intent-picker.vue'
|
|
|
import JourneyCard from '../../components/journey-card.vue'
|
|
import JourneyCard from '../../components/journey-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 } 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, getContentByTags } from '../../utils/api.js'
|
|
|
import nav from '../../utils/nav.js'
|
|
import nav from '../../utils/nav.js'
|
|
|
import config from '@/config.js'
|
|
import config from '@/config.js'
|
|
|
|
|
|
|
@@ -424,7 +438,8 @@ export default {
|
|
|
// 改版v1 用户意图/旅程
|
|
// 改版v1 用户意图/旅程
|
|
|
userIntent: null,
|
|
userIntent: null,
|
|
|
showIntentPicker: false,
|
|
showIntentPicker: false,
|
|
|
- intentPickerDismissed: false
|
|
|
|
|
|
|
+ intentPickerDismissed: false,
|
|
|
|
|
+ targetedArticles: []
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
computed: {
|
|
computed: {
|
|
@@ -1031,6 +1046,8 @@ export default {
|
|
|
var intent = res && res.data
|
|
var intent = res && res.data
|
|
|
if (intent) {
|
|
if (intent) {
|
|
|
self.userIntent = intent
|
|
self.userIntent = intent
|
|
|
|
|
+ // F17: 已有调研结果的用户加载定向科普内容
|
|
|
|
|
+ self.loadTargetedContent(intent)
|
|
|
} else {
|
|
} else {
|
|
|
// 无意图且未跳过,弹选择层
|
|
// 无意图且未跳过,弹选择层
|
|
|
if (!self.intentPickerDismissed) {
|
|
if (!self.intentPickerDismissed) {
|
|
@@ -1042,6 +1059,32 @@ 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) {
|
|
handleIntentSelect: function(payload) {
|
|
|
var self = this
|
|
var self = this
|
|
|
self.showIntentPicker = false
|
|
self.showIntentPicker = false
|
|
@@ -1061,7 +1104,7 @@ export default {
|
|
|
if (payload.intentType === 'A') {
|
|
if (payload.intentType === 'A') {
|
|
|
uni.navigateTo({ url: '/pages/assessment/purchase' })
|
|
uni.navigateTo({ url: '/pages/assessment/purchase' })
|
|
|
} else if (payload.intentType === 'B') {
|
|
} else if (payload.intentType === 'B') {
|
|
|
- uni.navigateTo({ url: '/pages/problem/domain-list' })
|
|
|
|
|
|
|
+ uni.navigateTo({ url: '/pages/problem/quick-survey' })
|
|
|
} else if (payload.intentType === 'C') {
|
|
} else if (payload.intentType === 'C') {
|
|
|
uni.navigateTo({
|
|
uni.navigateTo({
|
|
|
url: '/pages/problem/flow-intro?code=' + (payload.problemDomainCode || '')
|
|
url: '/pages/problem/flow-intro?code=' + (payload.problemDomainCode || '')
|
|
@@ -1085,7 +1128,12 @@ export default {
|
|
|
if (action === 'flow-intro') {
|
|
if (action === 'flow-intro') {
|
|
|
uni.navigateTo({ url: '/pages/problem/flow-intro?code=' + (code || '') })
|
|
uni.navigateTo({ url: '/pages/problem/flow-intro?code=' + (code || '') })
|
|
|
} else if (action === 'survey') {
|
|
} else if (action === 'survey') {
|
|
|
- uni.navigateTo({ url: '/pages/problem/survey?code=' + (code || '') })
|
|
|
|
|
|
|
+ // B类轻问卷 / C类专项调研
|
|
|
|
|
+ if (code) {
|
|
|
|
|
+ uni.navigateTo({ url: '/pages/problem/survey?code=' + code })
|
|
|
|
|
+ } else {
|
|
|
|
|
+ uni.navigateTo({ url: '/pages/problem/quick-survey' })
|
|
|
|
|
+ }
|
|
|
} else if (action === 'package') {
|
|
} else if (action === 'package') {
|
|
|
uni.navigateTo({ url: '/pages/problem/package-match?code=' + (code || '') })
|
|
uni.navigateTo({ url: '/pages/problem/package-match?code=' + (code || '') })
|
|
|
} else if (action === 'logistics') {
|
|
} else if (action === 'logistics') {
|
|
@@ -1335,6 +1383,46 @@ export default {
|
|
|
font-size: 24rpx;
|
|
font-size: 24rpx;
|
|
|
color: #5B9BD5;
|
|
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 {
|
|
.empty-state {
|
|
|
display: flex;
|
|
display: flex;
|
|
|
justify-content: center;
|
|
justify-content: center;
|