From 541be630b53637a696d0821d172f4896c73751cf Mon Sep 17 00:00:00 2001 From: king <2229249788@qq.com> Date: Mon, 21 Aug 2023 16:45:20 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A6=96=E9=A1=B5=20=E5=81=A5=E5=BA=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/home.ts | 15 +++ src/app.config.ts | 2 + src/components/videoCover/videoCover.scss | 2 +- src/pages/business/sort/sort.config.ts | 3 + src/pages/business/sort/sort.tsx | 21 ++++ .../business/videoFull/videoFull.config.ts | 6 ++ src/pages/business/videoFull/videoFull.tsx | 27 ++++++ src/pages/health/health.tsx | 12 ++- src/pages/home/components/curRecommended.tsx | 2 +- src/pages/home/components/feature.tsx | 6 +- .../home/components/feature_recommended.tsx | 97 +++++++++++++++---- src/pages/home/home.module.scss | 29 ++++-- types/home.d.ts | 24 +++++ 13 files changed, 211 insertions(+), 35 deletions(-) create mode 100644 src/pages/business/sort/sort.config.ts create mode 100644 src/pages/business/sort/sort.tsx create mode 100644 src/pages/business/videoFull/videoFull.config.ts create mode 100644 src/pages/business/videoFull/videoFull.tsx diff --git a/src/api/home.ts b/src/api/home.ts index e5272dc..3b39499 100644 --- a/src/api/home.ts +++ b/src/api/home.ts @@ -35,7 +35,22 @@ export const HomeApi = { return request<{ data: Curriculum[], total: number }>('/home/v1/course/course', "GET", {page, page_size}) }, /** 健康管理 */ + healthTop(count: number) { + return request('/home/v1/health/top', "GET", {count}) + }, health(page: number, page_size: number) { return request<{ data: Health[], total: number }>('/home/v1/health/index', "GET", {page, page_size}) + }, + /** 增加播放量 */ + healthSetPlay(id) { + return request(`/home/v1/health/set_play/${id}`, "PUT") + }, + /** 品牌 */ + brand(page: number, page_size: number) { + return request<{ data: Brand[], total: number }>('/home/v1/brand/list', "GET", {page, page_size}) + }, + /** 技能 */ + skillTop(count: number) { + return request('/home/v1/skill/top', "GET", {count}) } } diff --git a/src/app.config.ts b/src/app.config.ts index 0bd7fb5..86b7b99 100644 --- a/src/app.config.ts +++ b/src/app.config.ts @@ -59,6 +59,8 @@ export default defineAppConfig({ 'curHistory/curHistory', 'hourHistory/hourHistory', 'courType/courType', + 'videoFull/videoFull', // 资源id 视频全屏 + 'sort/sort', // 公共二级分类 ] }, { diff --git a/src/components/videoCover/videoCover.scss b/src/components/videoCover/videoCover.scss index b9e734b..df662ed 100644 --- a/src/components/videoCover/videoCover.scss +++ b/src/components/videoCover/videoCover.scss @@ -44,7 +44,7 @@ Image { width: 100%; - //height: 100%; + background: #eee; } } diff --git a/src/pages/business/sort/sort.config.ts b/src/pages/business/sort/sort.config.ts new file mode 100644 index 0000000..f54b62b --- /dev/null +++ b/src/pages/business/sort/sort.config.ts @@ -0,0 +1,3 @@ +export default definePageConfig({ + navigationBarTitleText: '分类' +}) diff --git a/src/pages/business/sort/sort.tsx b/src/pages/business/sort/sort.tsx new file mode 100644 index 0000000..f01c221 --- /dev/null +++ b/src/pages/business/sort/sort.tsx @@ -0,0 +1,21 @@ +import {FC} from "react"; +import {View} from "@tarojs/components"; +import {useRouter} from "@tarojs/taro"; + +type SortType = '' + +interface Params { + id: number + type: SortType + jumpUrl: () => void +} + +const Sort: FC = () => { + const params = useRouter().params as unknown as Params + + return ( + ds + ) +} + +export default Sort diff --git a/src/pages/business/videoFull/videoFull.config.ts b/src/pages/business/videoFull/videoFull.config.ts new file mode 100644 index 0000000..82334a5 --- /dev/null +++ b/src/pages/business/videoFull/videoFull.config.ts @@ -0,0 +1,6 @@ +export default definePageConfig({ + navigationBarTitleText: ' ', + backgroundColor:'#000000', + navigationBarTextStyle:'white', + navigationBarBackgroundColor:'#000000' +}) diff --git a/src/pages/business/videoFull/videoFull.tsx b/src/pages/business/videoFull/videoFull.tsx new file mode 100644 index 0000000..c88333b --- /dev/null +++ b/src/pages/business/videoFull/videoFull.tsx @@ -0,0 +1,27 @@ +import {Video} from "@tarojs/components"; +import {FC} from "react"; +import Taro from "@tarojs/taro"; + +interface Props { + url: string +} + +const VideoFull: FC = () => { + const {url} = Taro.useRouter().params + return ( +