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 0000000..80622ab Binary files /dev/null and b/src/static/img/emptyLineChart.png differ diff --git a/src/static/img/play-back.png b/src/static/img/play-back.png new file mode 100644 index 0000000..26e3336 Binary files /dev/null and b/src/static/img/play-back.png differ