diff --git a/src/pages.json b/src/pages.json
index e60fb95..db227d4 100644
--- a/src/pages.json
+++ b/src/pages.json
@@ -51,7 +51,7 @@
{
"path": "pages/hot/hot",
"style": {
- "navigationBarTitleText": "hot"
+ "navigationBarTitleText": "热门推荐"
}
},
{
diff --git a/src/pages/hot/hot.vue b/src/pages/hot/hot.vue
index 2337a94..1b11058 100644
--- a/src/pages/hot/hot.vue
+++ b/src/pages/hot/hot.vue
@@ -1,7 +1,225 @@
- hot
+
+
+
+
+
+
+
+
+ {{ subTypeItem.title }}
+
+
+
+
+
+
+ {{ goodItem.desc }}
+
+ ¥
+ {{ goodItem.price }}
+
+
+
+ {{
+ subTypeItem.goodsItems.page === subTypeItem.goodsItems.pages
+ ? '没有更多数据~'
+ : '正在加载...'
+ }}
+
+
+
-
+
+
+
diff --git a/src/services/hot.ts b/src/services/hot.ts
new file mode 100644
index 0000000..36f44d0
--- /dev/null
+++ b/src/services/hot.ts
@@ -0,0 +1,18 @@
+import { http } from '@/utils/http'
+import type { PageParams, PageResult } from '@/types/global'
+import type { HotResult } from '@/types/hot'
+
+type HotParams = PageParams & {
+ // 推荐列表 Tab 项的 id, 默认查询全部 Tab 项的第 1 页数据
+ subType?: string
+}
+/**
+ * 获取热门推荐
+ */
+export const getHotRecommend = (url: string, data: HotParams) => {
+ return http({
+ url,
+ method: 'GET',
+ data,
+ })
+}
diff --git a/src/types/hot.d.ts b/src/types/hot.d.ts
new file mode 100644
index 0000000..0b64de9
--- /dev/null
+++ b/src/types/hot.d.ts
@@ -0,0 +1,23 @@
+import type { PageResult, GoodsItem } from './global'
+
+/** 热门推荐-子类选项 */
+export type SubTypeItem = {
+ /** 子类id */
+ id: string
+ /** 子类标题 */
+ title: string
+ /** 子类对应的商品集合 */
+ goodsItems: PageResult
+}
+
+/** 热门推荐 */
+export type HotResult = {
+ /** id信息 */
+ id: string
+ /** 活动图片 */
+ bannerPicture: string
+ /** 活动标题 */
+ title: string
+ /** 子类选项 */
+ subTypes: SubTypeItem[]
+}