diff --git a/pages/insights/index.vue b/pages/insights/index.vue
index 8ade118..917cb58 100644
--- a/pages/insights/index.vue
+++ b/pages/insights/index.vue
@@ -5,9 +5,11 @@ import SiteFooter from '~/components/site/SiteFooter.vue'
const {
ALL_LABEL,
LATEST_LABEL,
+ buildMediaMap,
bySortAndTime,
- categoryList,
+ fetchPublicCategories,
fetchPublicContent,
+ fetchPublicMediaAsset,
normalizeArticle,
normalizeWhitepaper
} = useOfficialContent()
@@ -17,17 +19,30 @@ const visibleCount = ref(4)
const { openConsultation } = useConsultation()
const { data: pageData } = await useAsyncData('public-insights', async () => {
- const [articleRows, whitepaperRows] = await Promise.all([
+ const [articleRows, whitepaperRows, categories] = await Promise.all([
fetchPublicContent('ARTICLE'),
- fetchPublicContent('WHITEPAPER')
+ fetchPublicContent('WHITEPAPER'),
+ fetchPublicCategories().catch(() => ({}))
])
+ const whitepaperAssetIds = Array.from(
+ new Set(
+ whitepaperRows.flatMap((item) => [item.coverAssetId, item.documentAssetId]).filter(Boolean)
+ )
+ )
+ const whitepaperMediaRows = await Promise.all(
+ whitepaperAssetIds.map((id) => fetchPublicMediaAsset(id).catch(() => null))
+ )
+ const whitepaperMediaMap = buildMediaMap(whitepaperMediaRows.filter(Boolean))
return {
articles: articleRows.sort(bySortAndTime).map((item) => normalizeArticle(item, new Map())),
- whitepapers: whitepaperRows.sort(bySortAndTime).map((item) => normalizeWhitepaper(item, new Map()))
+ whitepapers: whitepaperRows
+ .sort(bySortAndTime)
+ .map((item) => normalizeWhitepaper(item, whitepaperMediaMap)),
+ categories: categories || {}
}
})
-
+useRefreshNuxtDataOnResume('public-insights')
const insights = computed(() => pageData.value?.articles || [])
const whitepapers = computed(() => pageData.value?.whitepapers || [])
const featuredInsight = computed(
@@ -36,7 +51,15 @@ const featuredInsight = computed(
const featuredWhitepaper = computed(
() => whitepapers.value.find((item) => item.isFeatured) || whitepapers.value[0] || null
)
-const insightCategories = computed(() => categoryList(insights.value, 'category', [LATEST_LABEL]))
+const insightCategories = computed(() => [
+ ALL_LABEL,
+ LATEST_LABEL,
+ ...Array.from(
+ new Set(
+ (pageData.value?.categories?.insightCategories || []).map((item) => item.name).filter(Boolean)
+ )
+ )
+])
useHead({
title: '增长洞察|大马棒·云途全域 GEO',
@@ -74,7 +97,7 @@ function requestWhitepaper(source) {
openConsultation({
title: featuredWhitepaper.value?.title || '获取行业白皮书',
- need: featuredWhitepaper.value?.title || '行业白皮书',
+ need: '行业白皮书',
source
})
}
@@ -227,9 +250,14 @@ function articleTags(article) {
REPORT2026
-
{{ featuredWhitepaper?.category || '行业白皮书' }}
+
+
行业白皮书
{{ featuredWhitepaper?.title || 'AI 搜索与品牌增长观察' }}
-
{{ featuredWhitepaper?.excerpt || '用户行为 · 内容信源 · 衡量框架 · 行业实践' }}
+
+
+
{{
+ featuredWhitepaper?.excerpt || '用户行为 · 内容信源 · 衡量框架 · 行业实践'
+ }}