From 34ffb6ed62d197a2e65e78d886c3914f15a0ff9e Mon Sep 17 00:00:00 2001 From: king <2229249788@qq.com> Date: Mon, 28 Aug 2023 14:09:08 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A2=84=E8=A7=88=E5=8A=9F=E8=83=BD=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/videoCover/videoCover.scss | 6 ++++- src/pages/home/components/curRecommended.tsx | 4 ++-- src/pages/home/components/feature.tsx | 2 +- src/pages/home/home.module.scss | 10 ++++---- src/pages/home/home.tsx | 2 +- .../preview/profession/profession.module.scss | 4 +++- src/pages/preview/profession/profession.tsx | 23 +++++++++++-------- 7 files changed, 31 insertions(+), 20 deletions(-) diff --git a/src/components/videoCover/videoCover.scss b/src/components/videoCover/videoCover.scss index df662ed..840c184 100644 --- a/src/components/videoCover/videoCover.scss +++ b/src/components/videoCover/videoCover.scss @@ -51,7 +51,7 @@ .box { box-sizing: border-box; - padding: 15rpx; + padding: 20rpx; .title { width: 100%; @@ -61,6 +61,10 @@ display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; + font-size: 28rpx; + font-family: PingFang SC-Medium, PingFang SC; + font-weight: 500; + color: #323635; } } diff --git a/src/pages/home/components/curRecommended.tsx b/src/pages/home/components/curRecommended.tsx index 1685a93..07f5e59 100644 --- a/src/pages/home/components/curRecommended.tsx +++ b/src/pages/home/components/curRecommended.tsx @@ -37,9 +37,9 @@ const CurRecommended: FC = () => { return ( <> { - data.length > 0 && + data.length > 0 && - + { data.map(c => { } return ( - + { list.map(d => jump(d.url)}> diff --git a/src/pages/home/home.module.scss b/src/pages/home/home.module.scss index 4fb817b..8820c50 100644 --- a/src/pages/home/home.module.scss +++ b/src/pages/home/home.module.scss @@ -71,8 +71,8 @@ .courseTag { - width: 200px; - margin: auto; + width: 162px; + margin: 0 auto 30rpx; display: block; } @@ -80,7 +80,7 @@ color: #323635; background: #fff; padding: 30rpx 0 30rpx 30rpx; - margin-bottom: 40rpx; + margin-bottom: 50rpx; border-radius: 30rpx; } @@ -119,8 +119,8 @@ .ranking { position: absolute; left: 24rpx; - width: 40px; - height: 40px; + width: 30px; + height: 30px; } .featureImage { diff --git a/src/pages/home/home.tsx b/src/pages/home/home.tsx index bbd407a..acc1adf 100644 --- a/src/pages/home/home.tsx +++ b/src/pages/home/home.tsx @@ -28,7 +28,7 @@ const Home: FC = () => { }, []) return ( - + {/**/} diff --git a/src/pages/preview/profession/profession.module.scss b/src/pages/preview/profession/profession.module.scss index e2c9fc3..57291c2 100644 --- a/src/pages/preview/profession/profession.module.scss +++ b/src/pages/preview/profession/profession.module.scss @@ -13,8 +13,10 @@ Image, image { - width: 200rpx; + width: 320rpx; + max-height: 180rpx; margin-right: 20rpx; border-radius: 10rpx; + background: #eee; } } diff --git a/src/pages/preview/profession/profession.tsx b/src/pages/preview/profession/profession.tsx index e3516b7..404d374 100644 --- a/src/pages/preview/profession/profession.tsx +++ b/src/pages/preview/profession/profession.tsx @@ -21,16 +21,20 @@ const Profession = () => { * more 开启加载更多 */ async function getData(more = false) { - if (categoryId) { - const oldData = new Map(data) - const categoryData = oldData.get(categoryId) - const page = more ? (categoryData?.page || 0) + 1 : categoryData?.page || 1 + if (!categoryId) return; + const oldData = new Map(data) + const categoryData = oldData.get(categoryId) + const page = more ? (categoryData?.page || 0) + 1 : categoryData?.page || 1 + + /** 无更多 */ + if (more && categoryData && categoryData.data.length >= categoryData.total) { + return + } - /** 无更多 */ - if (more && categoryData && categoryData.data.length >= categoryData.total) { - return + try { + if (!data.has(categoryId)) { + Taro.showLoading() } - const res = await HomeApi.skillList(categoryId!, page, 10) const dataList = res.data.reduce((pre, cur) => { const index = pre.findIndex(d => d.id === cur.id) @@ -42,14 +46,15 @@ const Profession = () => { return pre }, categoryData?.data || []) oldData.delete(categoryId) - oldData.set(categoryId, { data: dataList, total: res.total, page: page }) setData(oldData) + } catch (e) { } + Taro.hideLoading() } useEffect(() => {