diff --git a/src/pages/index/components/HotPanel.vue b/src/pages/index/components/HotPanel.vue new file mode 100644 index 0000000..2fae43f --- /dev/null +++ b/src/pages/index/components/HotPanel.vue @@ -0,0 +1,84 @@ + + + + + diff --git a/src/pages/index/index.vue b/src/pages/index/index.vue index 5266179..ae3f83d 100644 --- a/src/pages/index/index.vue +++ b/src/pages/index/index.vue @@ -7,17 +7,20 @@ + + diff --git a/src/services/home.ts b/src/services/home.ts index b527858..1e04d55 100644 --- a/src/services/home.ts +++ b/src/services/home.ts @@ -1,6 +1,6 @@ // 请求封装调用 import { http } from '@/utils/http' -import type { BannerItem, CategoryItem } from '@/types/home' +import type { BannerItem, CategoryItem, HotItem } from '@/types/home' /** * 首页-广告区域-小程序 * @param distributionSite 广告区域展示位置(投放位置 投放位置,1为首页,2为分类商品页) 默认是1 @@ -24,3 +24,13 @@ export const getHomeCategoryAPI = () => { url: '/home/category/mutli', }) } + +/** + * 首页-热门推荐-小程序 + */ +export const getHomeHotAPI = () => { + return http({ + method: 'GET', + url: '/home/hot/mutli', + }) +} diff --git a/src/types/home.d.ts b/src/types/home.d.ts index 364837e..a4e9753 100644 --- a/src/types/home.d.ts +++ b/src/types/home.d.ts @@ -19,3 +19,19 @@ export type CategoryItem = { /** 分类名称 */ name: string } + +/** 首页-热门推荐数据类型 */ +export type HotItem = { + /** 说明 */ + alt: string + /** id */ + id: string + /** 图片集合[ 图片路径 ] */ + pictures: string[] + /** 跳转地址 */ + target: string + /** 标题 */ + title: string + /** 推荐类型 */ + type: string +}