diff --git a/app/components/pages/search/SearchResultCard.vue b/app/components/pages/search/SearchResultCard.vue new file mode 100644 index 0000000..3aa76a3 --- /dev/null +++ b/app/components/pages/search/SearchResultCard.vue @@ -0,0 +1,72 @@ + + + + + diff --git a/app/components/pages/search/SearchResults.vue b/app/components/pages/search/SearchResults.vue index 816f469..1cde91c 100644 --- a/app/components/pages/search/SearchResults.vue +++ b/app/components/pages/search/SearchResults.vue @@ -6,16 +6,7 @@ :key="`${hit.type}-${hit.id}`" :to="localePath(resolveHitLink(hit))" > - -

{{ hit.title }}

-

- {{ hit.summary }} -

-

- {{ $t('search.section') }}: - {{ getIndexLabel(hit.type) }} -

-
+ diff --git a/server/utils/search-converters.ts b/server/utils/search-converters.ts index 2cc6f97..b5a66dc 100644 --- a/server/utils/search-converters.ts +++ b/server/utils/search-converters.ts @@ -9,6 +9,7 @@ export const converters: { type: 'product', title: item.name, summary: item.summary, + thumbnail: `/api/assets/${item.cover}`, }), solutions: (item: MeiliIndexMap['solutions']): SearchItemView => ({ @@ -16,6 +17,7 @@ export const converters: { type: 'solution', title: item.title, summary: item.summary, + thumbnail: `/api/assets/${item.cover}`, }), questions: (item: MeiliIndexMap['questions']): SearchItemView => ({ diff --git a/shared/types/meilisearch/meili-index.ts b/shared/types/meilisearch/meili-index.ts index 7b34473..d7a5810 100644 --- a/shared/types/meilisearch/meili-index.ts +++ b/shared/types/meilisearch/meili-index.ts @@ -16,6 +16,9 @@ export interface MeiliProductIndex { /** 产品类型 **/ type: string; + + /** 产品缩略图 **/ + cover: string; } /** @@ -36,6 +39,9 @@ export interface MeiliSolutionIndex { /** 解决方案类型 **/ type: string; + + /** 解决方案缩略图 **/ + cover: string; } /** diff --git a/shared/types/views/search-item-view.ts b/shared/types/views/search-item-view.ts index e9070f0..594caed 100644 --- a/shared/types/views/search-item-view.ts +++ b/shared/types/views/search-item-view.ts @@ -10,4 +10,7 @@ export interface SearchItemView { /** 条目摘要 **/ summary: string; + + /** 条目预览图 **/ + thumbnail?: string; }