From 68d99f86b17bdee4bbffd60a81c031960f61086c Mon Sep 17 00:00:00 2001 From: king <2229249788@qq.com> Date: Wed, 6 Sep 2023 19:42:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=96=87=E7=AB=A0=E6=98=BE?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env | 4 +- src/app.scss | 29 ++++++- src/pages/home/components/curRecommended.tsx | 84 +++++++++++-------- src/pages/index/index.tsx | 8 +- src/static/img/emptyLineChart.png | Bin 0 -> 10099 bytes src/static/img/play-back.png | Bin 0 -> 1587 bytes 6 files changed, 85 insertions(+), 40 deletions(-) create mode 100644 src/static/img/emptyLineChart.png create mode 100644 src/static/img/play-back.png diff --git a/.env b/.env index 3852d45..86e2b46 100644 --- a/.env +++ b/.env @@ -1,5 +1,5 @@ -TARO_APP_API=https://yjx.dev.yaojiankang.top -#TARO_APP_API=https://mooc.yaojiankang.top +#TARO_APP_API=https://yjx.dev.yaojiankang.top +TARO_APP_API=https://mooc.yaojiankang.top #TARO_APP_API=https://shopfix.yaojiankang.top #TARO_APP_API=https://playedu.yaojiankang.top TARO_APP_LGOIN=true diff --git a/src/app.scss b/src/app.scss index 76057d2..5f2fd71 100644 --- a/src/app.scss +++ b/src/app.scss @@ -234,6 +234,8 @@ .font-68{font-size: 68rpx;line-height: 1;} .font-weight{font-weight: bold} +.bold {font-weight: bold} + .text-indent{text-indent:2;} .text-through{text-decoration:line-through;} .text-left { text-align: left;} @@ -272,10 +274,12 @@ .text-hover-dark{ color: #121416;} .text-body { color: #212529;} .text-muted { color: #909795;} +.text-black {color: #000 } .lh-28 {line-height: 28rpx} .lh-40 {line-height: 40rpx} - +.lh1_2 {line-height: 1.2} +.lh1_5 {line-height: 1.5} /* 圆角 */ .rounded { border-radius: 8rpx;} @@ -369,3 +373,26 @@ .hr-dashed { border-bottom-style: dashed; } + +.relative {position: relative} +.absolute {position: absolute} +.fixed {position: fixed} +.sticky {position: sticky} + +.top {top: 0} +.right{right: 0} +.bottom{bottom: 0} +.left{left: 0} + +.divided::after { + position: absolute; + left: 0; + right: 0; + bottom: 0; + height: 1px; + transform: scaleY(0.5); + transform-origin: bottom center; + content: ""; + background: #000; + opacity: 0.05; +} diff --git a/src/pages/home/components/curRecommended.tsx b/src/pages/home/components/curRecommended.tsx index a1a124f..e47d4f3 100644 --- a/src/pages/home/components/curRecommended.tsx +++ b/src/pages/home/components/curRecommended.tsx @@ -1,26 +1,22 @@ -import {FC, useEffect, useState} from "react"; +import {FC, ReactNode, useEffect, useState} from "react"; import {Image, View} from "@tarojs/components"; import {HomeApi} from "@/api"; -import Taro, {useReachBottom} from "@tarojs/taro"; +import {useReachBottom} from "@tarojs/taro"; import styles from "../home.module.scss"; import VideoCover from "@/components/videoCover/videoCover"; import courseTag from '@/static/img/courseTag.png' +import {rfc33392time} from "@/utils/day"; +import Img from "@/components/image/image"; const CurRecommended: FC = () => { const [page, setPage] = useState(1) const [data, setData] = useState([]) const [total, setTotal] = useState(0) - const [examine, setExamine] = useState(false) const [articles, setArticles] = useState([]) async function getData() { const res = await HomeApi.course(page, 4) - if (res.audit_mode) { - Taro.setTabBarItem({index: 1, text: '文章'}) - setArticles(res.articles) - setExamine(res.audit_mode) - return - } + setArticles(res.articles) setTotal(res.course.total) const newData = res.course.data.reduce((pre, cut) => { const index = pre.findIndex(d => d.id === cut.id) @@ -42,32 +38,54 @@ const CurRecommended: FC = () => { data.length < total && setPage(page + 1) }) + let examines: ReactNode | undefined + if (articles.length > 0) { + examines = ( + + 推荐文章 + + {articles.map((d, i) => + {i > 0 && } + {d.title} + {(d.intro || '').length > 40 && ( + {d.intro}文章结束阿斯卡极乐空间是你拉卡萨文章结束阿斯卡极乐空间是你拉卡萨文章结束阿斯卡极乐空间是你拉卡萨文章结束阿斯卡极乐空间是你拉卡萨文章结束阿斯卡极乐空间是你拉卡萨文章结束阿斯卡极乐空间是你拉卡萨 + {d.cover && } + )} + + {rfc33392time(d.created_at).split(' ')[0]} + 阅读 {d.page_view || 0} + + )} + + + ) + } + + let videos: ReactNode | undefined + if (data.length > 0) { + videos = ( + + + + { + data.map(c => ) + } + + + ) + } + return ( <> - { - examine ? - <> - 推荐文章 - { - articles.map(d => {d.title}) - } - - : data.length > 0 && - - - { - data.map(c => ) - } - - - } + {examines} + {videos} - 暂无更多 - ) diff --git a/src/pages/index/index.tsx b/src/pages/index/index.tsx index 5cb819b..d8f88a1 100644 --- a/src/pages/index/index.tsx +++ b/src/pages/index/index.tsx @@ -5,7 +5,7 @@ import {VideoList} from "@/pages/index/components/videoList"; import Tabs, {OnChangOpt, TabList} from "@/components/tabs/tabs"; import {CoursesKey, publicApi} from "@/api/public"; import NavigationBar from "@/components/navigationBar/navigationBar"; -import Taro from "@tarojs/taro"; +// import Taro from "@tarojs/taro"; const category: TabList[] = [ {title: "企选课程", value: 'is_required'}, @@ -41,9 +41,9 @@ const AuditMode: FC = () => { publicApi.course({page: 1, pageSize: 10}).then(res => { setAuditMode(res.audit_mode) setArticles(res.articles) - if(res.audit_mode){ - Taro.setTabBarItem({index: 1, text: '文章'}) - } + // if(res.audit_mode){ + // Taro.setTabBarItem({index: 1, text: '文章'}) + // } }) }, []) return ( diff --git a/src/static/img/emptyLineChart.png b/src/static/img/emptyLineChart.png new file mode 100644 index 0000000000000000000000000000000000000000..80622abf72e647e0aeb76d9b9497c2d1491519a5 GIT binary patch literal 10099 zcmeHtcT`jBvo?XyiBd!)ph#Dwh!PFGND~l2DG@}1NDWmGR0u>A6oeomMWl*&P+DlB z(n5`b^xi~>s7Mnz6sg~vfbATA-&%Kl>$`v4b^n2^Wbc`IXP%jPX7&y>GSq>wz*%T$ zXkf>6HBZsd(4xTSPfQHp@8QDV-d*~9 z{Bm;1@?x3QeCErQiG*1?2$LEOZ2(kz>ScN9iwhsk61w@0WM4t4?))sXEyq-#x2e2B z*_WK$)qkv#_AEVw$s|Ut>C&jLc6uQ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