From 451828b70c5328f639168d811bc125ac0d7ca300 Mon Sep 17 00:00:00 2001 From: king <2229249788@qq.com> Date: Mon, 4 Sep 2023 15:00:54 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AD=A6=E4=B9=A0=E9=A1=B5=E9=9D=A2=E6=8A=80?= =?UTF-8?q?=E6=9C=AF=E9=AB=98=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/index/components/videoList.tsx | 10 ++++++---- src/pages/index/index.module.scss | 7 ++----- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/pages/index/components/videoList.tsx b/src/pages/index/components/videoList.tsx index 6913e08..f734078 100644 --- a/src/pages/index/components/videoList.tsx +++ b/src/pages/index/components/videoList.tsx @@ -1,9 +1,8 @@ import {FC, useEffect, useMemo, useState} from "react"; -import {useDidShow} from "@tarojs/taro"; +import Taro, {useDidShow} from "@tarojs/taro"; import {ScrollView, Swiper, SwiperItem, View} from "@tarojs/components"; import {Courses, CoursesKey, publicApi} from "@/api/public"; import VideoCover from "@/components/videoCover/videoCover"; -import styles from '../index.module.scss' import {formatMinute} from "@/utils/time"; import {userApi} from "@/api"; import Empty from "@/components/empty/empty"; @@ -23,6 +22,9 @@ export const VideoList: FC = ({categoryKey, setCategoryKey}) => { const [page, setPage] = useState(1) const [records, setRecords] = useState([]) const {token} = Profile.useContainer() + const {windowHeight, textBarHeight, statusBarHeight} = Taro.getApp().globalData + const pageHeight = windowHeight - textBarHeight - statusBarHeight + function screen(oldData: Curriculum[], data: Curriculum[]): Curriculum[] { return data.reduce((pre, cur) => { @@ -93,12 +95,12 @@ export const VideoList: FC = ({categoryKey, setCategoryKey}) => { }, [data, categoryKey]) return ( - { Object.entries(data).map(([key, value]) => - setPage(page + 1)} enhanced + setPage(page + 1)} enhanced showScrollbar={false}> { !token && key === 'is_required' diff --git a/src/pages/index/index.module.scss b/src/pages/index/index.module.scss index 81eddcc..66b5461 100644 --- a/src/pages/index/index.module.scss +++ b/src/pages/index/index.module.scss @@ -2,6 +2,8 @@ position: fixed; top: 0; left: 0; + right: 0; + bottom: 0; padding: 0 20px; min-height: 100vh; box-sizing: border-box; @@ -21,11 +23,6 @@ } } -.swiper { - height: calc(100vh - 88rpx); -} - - .videoListBox { border-radius: 20px; }