diff --git a/src/api/brand.ts b/src/api/brand.ts index fe673cc..4848853 100644 --- a/src/api/brand.ts +++ b/src/api/brand.ts @@ -11,12 +11,14 @@ export type BrandRecord = { introductory_video_resource: any article_count: number created_at: string + page_view:number } export type ArticleRecord = { title: string page_view: number created_at: string content: string + brands: BrandRecord[] } export const brandApi = { diff --git a/src/api/manage.ts b/src/api/manage.ts index ba13c5d..291746b 100644 --- a/src/api/manage.ts +++ b/src/api/manage.ts @@ -46,7 +46,6 @@ export interface depCurProps { interface AddCurProps { course_id: number[] dep_id: number[] - is_required: (1 | 0)[] } diff --git a/src/app.scss b/src/app.scss index 5f2fd71..af88b78 100644 --- a/src/app.scss +++ b/src/app.scss @@ -270,7 +270,7 @@ .text-hover-danger { color: #a71d2a;} .text-light { color: #f8f9fa;} .text-hover-light { color: #cbd3da;} -.text-dark { color: #343a40;} +.text-dark { color: #323635;} .text-hover-dark{ color: #121416;} .text-body { color: #212529;} .text-muted { color: #909795;} diff --git a/src/components/learningRecord/learningRecord.tsx b/src/components/learningRecord/learningRecord.tsx index c54c2c4..8e3db5c 100644 --- a/src/components/learningRecord/learningRecord.tsx +++ b/src/components/learningRecord/learningRecord.tsx @@ -5,7 +5,7 @@ import LineChart from "@/components/lineChart/lineChart"; import {CSSProperties, FC, useEffect, useState} from "react"; import {StatisticsParam, userApi} from "@/api"; import styles from './learningRecord.module.scss' -import Spin from "@/components/spinner"; +// import Spin from "@/components/spinner"; import {Profile} from "@/store"; import Taro from "@tarojs/taro"; import debounce from "@/utils/debounce"; @@ -44,20 +44,19 @@ interface Props { */ const LearningRecord: FC = ({userId, style, className}) => { const [lineData, setLineData] = useState([]) - const [loading, setLoading] = useState(false) + // const [loading, setLoading] = useState(false) const {token} = Profile.useContainer() async function getStatistics(data: StatisticsParam) { - if (!userId) return; try { - setLoading(true) + if (!userId) return; + setLineData([]) const res = await userApi.statistics(userId, data) const everyDayValue = everyDay(data.start_time, Number(data.end_time), res.data) setLineData(everyDayValue) } catch (e) { setLineData([]) } - setLoading(false) } function tabChange({tab}: OnChangOpt) { @@ -79,7 +78,7 @@ const LearningRecord: FC = ({userId, style, className}) => { return ( - + {/**/} 总共学习 diff --git a/src/hooks/storageDep.ts b/src/hooks/storageDep.ts index b0e9c89..bd8283c 100644 --- a/src/hooks/storageDep.ts +++ b/src/hooks/storageDep.ts @@ -1,14 +1,12 @@ import Taro from "@tarojs/taro"; const KET = 'SELECT_DEP' -const KET_REQUIRED = 'SELECT_REQUIRED' /** 部门 */ function set(data: number[]) { Taro.setStorageSync(KET, data) } - function get(): number[] { const deps = Taro.getStorageSync(KET) if (deps && deps.length) { @@ -23,28 +21,7 @@ function removeDeps() { Taro.removeStorageSync(KET) } -/** 必修选修 */ -function removeRequired() { - Taro.removeStorageSync(KET_REQUIRED) -} - -function setRequired(data: number[]) { - Taro.setStorageSync(KET_REQUIRED, data) -} - - -/** getRequired 比 set后调用 */ -function getRequired(): (0 | 1)[] { - const deps = Taro.getStorageSync(KET_REQUIRED) - if (deps && deps.length) { - removeRequired() - return deps - } - return [] -} - function remove() { - removeRequired() removeDeps() } @@ -52,6 +29,4 @@ export default { set, get, remove, - setRequired, - getRequired } diff --git a/src/pages/business/courType/courType.tsx b/src/pages/business/courType/courType.tsx index cc7cba0..1d6e057 100644 --- a/src/pages/business/courType/courType.tsx +++ b/src/pages/business/courType/courType.tsx @@ -57,17 +57,27 @@ const CourType: FC = () => { }) return ( - - {data.length > 0 ? data.map(c => - ) : } - + <> + { + data.length > 0 ? + <> + + { + data.map(c => ) + } + + 暂无更多 + + : + } + ) } diff --git a/src/pages/business/curHistory/curHistory.tsx b/src/pages/business/curHistory/curHistory.tsx index 0015159..5131f03 100644 --- a/src/pages/business/curHistory/curHistory.tsx +++ b/src/pages/business/curHistory/curHistory.tsx @@ -106,6 +106,7 @@ const CurHistory = () => { /> ) } + 暂无更多 : } diff --git a/src/pages/business/history/history.tsx b/src/pages/business/history/history.tsx index efb372b..8375e73 100644 --- a/src/pages/business/history/history.tsx +++ b/src/pages/business/history/history.tsx @@ -1,7 +1,7 @@ import {Text, View} from "@tarojs/components"; import styles from './history.module.scss' import Taro from "@tarojs/taro"; -import {useEffect, useState} from "react"; +import React, {useEffect, useState} from "react"; import {formatMinute} from "@/utils/time"; import Empty from "@/components/empty/empty"; import {userApi} from "@/api"; @@ -27,21 +27,28 @@ const History = () => { return ( - {data.length ? data.map((d, index) => - jump(d.userCourseRecord.course_id)}> - - - 共{d.userCourseRecord.hour_count}节/已学{d.userCourseRecord.finished_count}节 - - - {d.title} - - 观看{formatMinute(durations[d.id])} - 学习进度:{(d.userCourseRecord.finished_count / d.userCourseRecord.hour_count * 100).toFixed(0)}% - - - ) : } + { + data.length ? <> { + data.map((d, index) => + jump(d.userCourseRecord.course_id)}> + + + 共{d.userCourseRecord.hour_count}节/已学{d.userCourseRecord.finished_count}节 + + + {d.title} + + 观看{formatMinute(durations[d.id])} + 学习进度:{(d.userCourseRecord.finished_count / d.userCourseRecord.hour_count * 100).toFixed(0)}% + + + ) + } + 暂无更多 + + : + } ) } diff --git a/src/pages/home/components/curRecommended.tsx b/src/pages/home/components/curRecommended.tsx index e47d4f3..d80a496 100644 --- a/src/pages/home/components/curRecommended.tsx +++ b/src/pages/home/components/curRecommended.tsx @@ -1,12 +1,28 @@ import {FC, ReactNode, useEffect, useState} from "react"; import {Image, View} from "@tarojs/components"; import {HomeApi} from "@/api"; -import {useReachBottom} from "@tarojs/taro"; +import Taro, {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"; +import {beforeTime} from "@/utils/time"; + +const toArticlePage = (d: any) => { + console.log({d}) + switch (d.owner_type) { + case 1: + Taro.navigateTo({ + url: `/pages/preview/brand/article/article?id=${d.id}` + }) + return + case 2: + Taro.navigateTo({ + url: `/pages/preview/illness/article/article?id=${d.id}` + }) + return + } +} const CurRecommended: FC = () => { const [page, setPage] = useState(1) @@ -44,15 +60,15 @@ const CurRecommended: FC = () => { 推荐文章 - {articles.map((d, i) => - {i > 0 && } - {d.title} + {articles.map((d, i) => toArticlePage(d)}> + {i > 0 && } + {d.title} {(d.intro || '').length > 40 && ( - {d.intro}文章结束阿斯卡极乐空间是你拉卡萨文章结束阿斯卡极乐空间是你拉卡萨文章结束阿斯卡极乐空间是你拉卡萨文章结束阿斯卡极乐空间是你拉卡萨文章结束阿斯卡极乐空间是你拉卡萨文章结束阿斯卡极乐空间是你拉卡萨 - {d.cover && } + {d.intro} + {d.cover && } )} - {rfc33392time(d.created_at).split(' ')[0]} + {beforeTime(d.created_at)} 阅读 {d.page_view || 0} )} @@ -86,7 +102,7 @@ const CurRecommended: FC = () => { <> {examines} {videos} - - 暂无更多 - + 暂无更多 ) } diff --git a/src/pages/home/home.tsx b/src/pages/home/home.tsx index 5de95de..db3454d 100644 --- a/src/pages/home/home.tsx +++ b/src/pages/home/home.tsx @@ -1,4 +1,4 @@ -import {FC, useEffect, useState} from "react"; +import {FC, useState} from "react"; import {Image, View, Text} from "@tarojs/components"; import styles from "./home.module.scss"; import Adware from "@/pages/home/components/adware"; @@ -27,14 +27,14 @@ const Home: FC = () => { Taro.navigateTo({url: '/pages/login/login'}) } - useEffect(() => { + Taro.useDidShow(() => { HomeApi.home().then(res => { setData(res) }) setTimeout(() => { setEnable(false) }, 600) - }, []) + }) Taro.usePageScroll((e) => { const v = (Math.min(e.scrollTop / navbarHeight, 1) * 0.9).toFixed(6) diff --git a/src/pages/index/index.tsx b/src/pages/index/index.tsx index d8f88a1..a4d3037 100644 --- a/src/pages/index/index.tsx +++ b/src/pages/index/index.tsx @@ -5,7 +5,9 @@ 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 Spin from "@/components/spinner"; +import Img from "@/components/image/image"; +import {beforeTime} from "@/utils/time"; const category: TabList[] = [ {title: "企选课程", value: 'is_required'}, @@ -37,26 +39,38 @@ const Index: FC = () => { const AuditMode: FC = () => { const [auditMode, setAuditMode] = useState(false) const [articles, setArticles] = useState([]) + const [enable, setEnable] = useState(true) useEffect(() => { publicApi.course({page: 1, pageSize: 10}).then(res => { setAuditMode(res.audit_mode) setArticles(res.articles) - // if(res.audit_mode){ - // Taro.setTabBarItem({index: 1, text: '文章'}) - // } + setEnable(false) }) }, []) return ( <> + { auditMode ? <> - - + + { - articles.map(d => {d.title}) + articles.map((d, i) => + {i > 0 && } + {d.title} + {(d.intro || '').length > 40 && ( + {d.intro} + {d.cover && } + )} + + {beforeTime(d.created_at)} + 阅读 {d.page_view || 0} + + ) } + 暂无更多 : } diff --git a/src/pages/login/login.tsx b/src/pages/login/login.tsx index bf19ea2..54a6278 100644 --- a/src/pages/login/login.tsx +++ b/src/pages/login/login.tsx @@ -57,10 +57,8 @@ const Login: FC = () => { setToken(token) setCompany(company) setLoading(false) - Taro.switchTab({url: '/pages/home/home'}) - + Taro.navigateBack() } else { - Taro.setStorageSync('openid', catch_key) Taro.reLaunch({url: '/pages/check/check'}) } @@ -98,7 +96,6 @@ const Login: FC = () => { {error} setError(null)}/> : null} - {/*{process.env.TARO_APP_LGOIN === 'true' && 线下登录}*/} ) diff --git a/src/pages/manage/courseAdmin/components/search.tsx b/src/pages/manage/courseAdmin/components/search.tsx index 43f9fd7..ca639ea 100644 --- a/src/pages/manage/courseAdmin/components/search.tsx +++ b/src/pages/manage/courseAdmin/components/search.tsx @@ -17,6 +17,7 @@ export const Search: FC = ({param, setParam}) => { const [show, setShow] = useState(false) const [deps, setDeps] = useState([]) const [depId, setDepId] = useState(param.dep_id) + const [title, setTitle] = useState(param.title) async function getDepList() { try { @@ -53,19 +54,21 @@ export const Search: FC = ({param, setParam}) => { <> - + setTitle(e.detail.value)} onConfirm={(e) => setParam({ ...param, title: e.detail.value, page: 1 - })}/> + })} + /> setShow(true)}> 筛选 @@ -99,7 +102,7 @@ export const Search: FC = ({param, setParam}) => { ) } - + setShow(false)}> 取消 diff --git a/src/pages/manage/courseAdmin/courseAdmin.module.scss b/src/pages/manage/courseAdmin/courseAdmin.module.scss index 2267ffa..de29a19 100644 --- a/src/pages/manage/courseAdmin/courseAdmin.module.scss +++ b/src/pages/manage/courseAdmin/courseAdmin.module.scss @@ -3,6 +3,9 @@ padding: 24rpx 30rpx; display: flex; justify-content: space-between; + position: sticky; + top: 0; + border-bottom: 1px solid #F5F8F7; } .searchInput { @@ -13,7 +16,6 @@ padding-left: 24rpx; background: #F5F8F7; border-radius: 32rpx; - color: #909795; overflow: hidden; } @@ -65,7 +67,7 @@ } .curList { - padding-bottom: 100px; + padding-bottom: calc(env(safe-area-inset-bottom) + 63rpx); } .add { @@ -83,4 +85,6 @@ display: flex; justify-content: space-between; padding: 30rpx; + align-items: center; + box-sizing: border-box; } diff --git a/src/pages/manage/courseAdmin/courseAdmin.tsx b/src/pages/manage/courseAdmin/courseAdmin.tsx index ad087dd..70c0a28 100644 --- a/src/pages/manage/courseAdmin/courseAdmin.tsx +++ b/src/pages/manage/courseAdmin/courseAdmin.tsx @@ -124,13 +124,12 @@ const CourseAdmin: FC = () => { Taro.useDidShow(useCallback(async () => { const dep_id = storageDep.get() - const is_required = storageDep.getRequired() - if (!dep_id.length || !is_required.length || !curs.length) return; + if (!dep_id.length || !curs.length) return; try { - await ManageApi.addCur({course_id: curs, dep_id, is_required}) + await ManageApi.addCur({course_id: curs, dep_id}) Taro.showToast({title: '修改成功'}) // deps 中没有 筛选条件中的depid 删除已选的课程 if (param.dep_id && dep_id.includes(param.dep_id)) { @@ -151,15 +150,15 @@ const CourseAdmin: FC = () => { return ( - - + <> - + { data?.map((d, index) => addCurs(d.id)}> {batch && addCurs(d.id)}/>} @@ -172,6 +171,7 @@ const CourseAdmin: FC = () => { ) } + 暂无更多 @@ -182,13 +182,13 @@ const CourseAdmin: FC = () => { } { batch && - 全选 + 全选 setBatch(false)}>取消 batchChangDep(curs)}>分配部门{curs.length} } - + ) } diff --git a/src/pages/manage/depAdmin/depAdmin.tsx b/src/pages/manage/depAdmin/depAdmin.tsx index 4b558c5..13d3b7f 100644 --- a/src/pages/manage/depAdmin/depAdmin.tsx +++ b/src/pages/manage/depAdmin/depAdmin.tsx @@ -158,6 +158,7 @@ const DepAdmin: FC = () => { onClick={() => Taro.navigateTo({url: '/pages/manage/userInfo/userInfo?userId=' + d.id})} content={['学员', '管理员', '超级管理员'][d.role_type]} />)} + 暂无更多 {!manages.length && !users.length && } diff --git a/src/pages/manage/selectDep/selectDep.tsx b/src/pages/manage/selectDep/selectDep.tsx index 72760ce..cf1e907 100644 --- a/src/pages/manage/selectDep/selectDep.tsx +++ b/src/pages/manage/selectDep/selectDep.tsx @@ -1,5 +1,5 @@ import React, {FC, useCallback, useEffect, useState} from "react"; -import {Checkbox, Switch, View} from "@tarojs/components"; +import {Checkbox, View} from "@tarojs/components"; import Taro from "@tarojs/taro"; import {curriculum} from "@/api"; import PopPut from "@/components/popPut/popPut"; @@ -13,10 +13,9 @@ import Spin from "@/components/spinner"; * required 是 必修选修 */ const SelectDep: FC = () => { - const params = Taro.getCurrentInstance()?.router?.params as { depIds: string, required: string | undefined } + const params = Taro.getCurrentInstance()?.router?.params as { depIds: string} const [ids, setIds] = useState([]) const [deps, setDeps] = useState([]) - const [required, setRequired] = useState([]) const [enable, setEnable] = useState(true) useEffect(() => { @@ -25,7 +24,6 @@ const SelectDep: FC = () => { }) setEnable(false) setIds(JSON.parse(params.depIds)) - setRequired(JSON.parse(params.required || "[]")) }, []) const onChange = useCallback((id: number) => { @@ -35,51 +33,19 @@ const SelectDep: FC = () => { ...ids, id ]) - - if (params.required) { - setRequired([...required, 0]) - } } else { const oldIds: number[] = JSON.parse(JSON.stringify(ids)) oldIds.splice(index, 1) setIds(oldIds) - - if (params.required) { - const oldRequired: number[] = JSON.parse(JSON.stringify(required)) - oldRequired.splice(index, 1) - setRequired(oldRequired) - } } }, [ids]) function ok() { storageDep.set(ids) - storageDep.setRequired(required) Taro.navigateBack({delta: 1}) } - function isRequired(dep_id: number): boolean { - const index = ids.indexOf(dep_id) - if (index === -1) { - return false - } else { - return !!required?.[index] - } - } - - function requiredChange(dep_id: number, value: boolean) { - const index = ids.indexOf(dep_id) - if (index === -1) { - setIds([...ids, dep_id]) - setRequired([...required, value ? 1 : 0]) - } else { - const oldRequired: number[] = JSON.parse(JSON.stringify(required)) - oldRequired.splice(index, 1, value ? 1 : 0) - setRequired(oldRequired) - } - } - return ( @@ -90,21 +56,10 @@ const SelectDep: FC = () => { key={d.id} title={d.name} chevron - leftImage={folder} - content={ - params?.required ? - - 必修: event?.stopImmediatePropagation()} - checked={isRequired(d.id)} - onChange={(e) => requiredChange(d.id, e.detail.value)}/> - - : null - } - /> + leftImage={folder}/> )} + 暂无更多 确定 diff --git a/src/pages/manage/userInfo/userInfo.tsx b/src/pages/manage/userInfo/userInfo.tsx index c9be6c3..eb91867 100644 --- a/src/pages/manage/userInfo/userInfo.tsx +++ b/src/pages/manage/userInfo/userInfo.tsx @@ -58,7 +58,6 @@ const UserInfo: FC = () => { useEffect(() => { - userApi.info(userId).then(res => { setData(res) }) @@ -76,7 +75,7 @@ const UserInfo: FC = () => { - + diff --git a/src/pages/preview/brand/article/article.module.scss b/src/pages/preview/brand/article/article.module.scss index e28c2e9..c6d9d5f 100644 --- a/src/pages/preview/brand/article/article.module.scss +++ b/src/pages/preview/brand/article/article.module.scss @@ -1,30 +1,33 @@ -.fixedBox{ +.fixedBox { position: fixed; z-index: 1000; - top:0; + top: 0; width: 100vw; height: 100vh; background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, 1), rgba(255, 255, 255, 1)); - &-inner{ + + &-inner { position: absolute; width: 100vw; - top:45vh; + top: 45vh; display: flex; flex-direction: column; align-items: center; - &-icon{ - image{ + + &-icon { + image { width: 32rpx; height: 32rpx; } } - &-box{ + + &-box { margin-top: 24rpx; width: 680rpx; - left:35rpx; + left: 35rpx; height: 76rpx; background-color: #45D4A8; - color:#fff; + color: #fff; line-height: 76rpx; text-align: center; font-size: 32rpx; @@ -34,3 +37,18 @@ } } + +.article { + font-size: 30rpx; + display: flex; + margin-bottom: 40rpx; +} + +.articleImag { + border-radius: 100rpx; +} + +.articleTitle { + font-size: 40rpx; + margin-bottom: 50rpx; +} diff --git a/src/pages/preview/brand/article/article.tsx b/src/pages/preview/brand/article/article.tsx index 25da6a9..f8b72a6 100644 --- a/src/pages/preview/brand/article/article.tsx +++ b/src/pages/preview/brand/article/article.tsx @@ -2,12 +2,14 @@ import {FC, useCallback, useEffect, useMemo, useState} from "react"; import {Image, Text, View} from "@tarojs/components"; import Taro, {useRouter} from "@tarojs/taro"; import {ArticleRecord, brandApi} from "@/api"; -import styles from "@/pages/preview/illness/article/article.module.scss"; +import styles from "./article.module.scss"; import down from "@/static/img/doubleDown.png"; import {Profile} from "@/store"; import {parse} from "@/utils/marked/marked"; import Empty from "@/components/empty/empty"; import Spin from "@/components/spinner"; +import {beforeTime} from "@/utils/time"; +import Img from "@/components/image/image"; const article: FC = () => { @@ -25,8 +27,8 @@ const article: FC = () => { const query = Taro.createSelectorQuery() query.select('#childrenNode').boundingClientRect((res) => { if (!Array.isArray(res)) { - console.log({childrenNode: res}) - setUltra(pageHeight * .45 <= res.height) + console.log({childrenNode: res}) + setUltra(pageHeight * .45 <= res.height) } }).exec() }, 300) @@ -59,8 +61,25 @@ const article: FC = () => { overflow: !token ? 'hidden' : 'auto' }}> + {articleInfo?.title} { - children.length > 0 ? children : + children.length > 0 ? + + { + articleInfo?.brands.map(d => + + + {d?.name} + + {beforeTime(articleInfo?.created_at)} . + 阅读 {articleInfo.page_view || 1} + + + ) + } + {children} + + : } @@ -71,9 +90,8 @@ const article: FC = () => { - { - Taro.navigateTo({url: '/pages/login/login'}) - }}> + Taro.navigateTo({url: '/pages/login/login'})}> 登录查看更多内容 diff --git a/src/pages/preview/brand/info/info.tsx b/src/pages/preview/brand/info/info.tsx index 8978cf0..b3065cf 100644 --- a/src/pages/preview/brand/info/info.tsx +++ b/src/pages/preview/brand/info/info.tsx @@ -113,11 +113,9 @@ const BrandInfo: FC = () => { { - articleList?.length ? - articleList.map((i: any) => - { - Taro.navigateTo({url: `/pages/preview/brand/article/article?id=${i.id}`}) - }}> + articleList?.length ? <>{ + articleList.map((i: any) => Taro.navigateTo({url: `/pages/preview/brand/article/article?id=${i.id}`})}> {i.title} @@ -127,8 +125,9 @@ const BrandInfo: FC = () => { - - ) + )} + 暂无更多 + : } diff --git a/src/pages/preview/brand/list/list.tsx b/src/pages/preview/brand/list/list.tsx index 006230e..c786088 100644 --- a/src/pages/preview/brand/list/list.tsx +++ b/src/pages/preview/brand/list/list.tsx @@ -5,7 +5,7 @@ import Taro, {useReachBottom} from "@tarojs/taro"; import Empty from "@/components/empty/empty"; import Spinner from "@/components/spinner"; import Img from "@/components/image/image"; -import {formatDate} from "@/utils/time"; +import {beforeTime} from "@/utils/time"; const BrandItem: FC<{ data: BrandRecord; onClick: VoidFunction }> = ({data, onClick}) => { let media: ReactNode @@ -16,7 +16,7 @@ const BrandItem: FC<{ data: BrandRecord; onClick: VoidFunction }> = ({data, onCl /> } else if (data.brand_album) { media = = ({data, onCl return ( - {media} - + - + {data.name} + {beforeTime(data.created_at)}·加入 - + + + {media} + + + {data.graphic_introduction} - {formatDate(new Date(data.created_at), "YY-MM-dd hh:mm:ss")} + 文章:{data.article_count || 0} 点赞:{(Math.random() * 100).toFixed(0)} @@ -105,7 +111,7 @@ const BrandList: FC = () => { content = ( <> {brands.map(d => jumpInfo(d.id)}/>)} - {text} + {text} ) } else { diff --git a/src/pages/preview/health/health.tsx b/src/pages/preview/health/health.tsx index 84b4f7a..fcf18cb 100644 --- a/src/pages/preview/health/health.tsx +++ b/src/pages/preview/health/health.tsx @@ -55,7 +55,7 @@ const Health: FC = () => { )} - 没有更多了 + 暂无更多 : } diff --git a/src/pages/preview/illness/article/article.module.scss b/src/pages/preview/illness/article/article.module.scss index 6b00ae0..1fbc3f1 100644 --- a/src/pages/preview/illness/article/article.module.scss +++ b/src/pages/preview/illness/article/article.module.scss @@ -1,4 +1,4 @@ -.botmBox{ +.botmBox { z-index: 99; position: fixed; bottom: 0; @@ -10,7 +10,8 @@ justify-content: center; align-items: center; background: #F5F8F7; - view{ + + view { width: 560rpx; height: 76rpx; background: #45D4A8; @@ -22,33 +23,37 @@ line-height: 76rpx; } } -.fixedBox{ + +.fixedBox { position: fixed; z-index: 100; - top:0; + top: 0; width: 100vw; height: 100vh; background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, 1), rgba(255, 255, 255, 1)); - &-inner{ + + &-inner { position: absolute; width: 100vw; - top:45vh; + top: 45vh; display: flex; flex-direction: column; align-items: center; - &-icon{ - image{ + + &-icon { + image { width: 32rpx; height: 32rpx; } } - &-box{ + + &-box { margin-top: 24rpx; width: 680rpx; - left:35rpx; + left: 35rpx; height: 76rpx; background-color: #45D4A8; - color:#fff; + color: #fff; line-height: 76rpx; text-align: center; font-size: 32rpx; @@ -58,3 +63,19 @@ } } + + +.article { + font-size: 30rpx; + display: flex; + margin-bottom: 40rpx; +} + +.articleImag { + border-radius: 100rpx; +} + +.articleTitle { + font-size: 40rpx; + margin-bottom: 50rpx; +} diff --git a/src/pages/preview/illness/article/article.tsx b/src/pages/preview/illness/article/article.tsx index ba0e38e..172a5c1 100644 --- a/src/pages/preview/illness/article/article.tsx +++ b/src/pages/preview/illness/article/article.tsx @@ -6,7 +6,8 @@ import styles from './article.module.scss' import down from '@/static/img/doubleDown.png' import {Profile} from "@/store"; import {parse} from "@/utils/marked/marked"; -import {formatDate} from "@/utils/time"; +import {beforeTime} from "@/utils/time"; +import Img from "@/components/image/image"; const article: FC = () => { const {token} = Profile.useContainer() @@ -58,9 +59,20 @@ const article: FC = () => { height: !token ? Taro.getWindowInfo().windowHeight - 60 + 'px' : 'auto', overflow: !token ? 'hidden' : 'auto' }}> - - {articleInfo?.title} - {formatDate(new Date(articleInfo?.created_at || 0), "YY-mm-dd hh:mm:dd")} + + {articleInfo?.title} + { + articleInfo?.brands.map(d => + + + {d?.name} + + {beforeTime(articleInfo?.created_at)} . + 阅读 {articleInfo.page_view || 1} + + + ) + } {children} @@ -93,11 +105,9 @@ const article: FC = () => { } - ) } - return helloWorld() } export default article diff --git a/src/pages/preview/illness/list/list.tsx b/src/pages/preview/illness/list/list.tsx index c1b893a..877995b 100644 --- a/src/pages/preview/illness/list/list.tsx +++ b/src/pages/preview/illness/list/list.tsx @@ -50,13 +50,16 @@ const BrandList: FC = () => { { articles.length > 0 ? - - { - articles.map((d, index) => jump(d.id)}> - {index + 1} . {d.title} - ) - } - + <> + + { + articles.map((d, index) => jump(d.id)}> + {index + 1} . {d.title} + ) + } + + 暂无更多 + : } diff --git a/src/pages/preview/illness/sort/sort.module.scss b/src/pages/preview/illness/sort/sort.module.scss index 2367ac9..ebff4fa 100644 --- a/src/pages/preview/illness/sort/sort.module.scss +++ b/src/pages/preview/illness/sort/sort.module.scss @@ -58,6 +58,7 @@ font-family: PingFang SC-Bold, PingFang SC; font-weight: bold; color: #323635; + position: relative; } .list { diff --git a/src/pages/preview/illness/sort/sort.tsx b/src/pages/preview/illness/sort/sort.tsx index 6ad6f1d..8b0ef59 100644 --- a/src/pages/preview/illness/sort/sort.tsx +++ b/src/pages/preview/illness/sort/sort.tsx @@ -96,14 +96,14 @@ const Sort: FC = () => { scrollY className={styles.tree} scrollWithAnimation> + { - loading ? : <> - { - list.length ? - list.map(d => jump(d.id)}>{d.name}) - : - } - + list.length ? + <> + {list.map(d => jump(d.id)}>{d.name})} + 暂无更多 + + : } diff --git a/src/pages/preview/profession/profession.tsx b/src/pages/preview/profession/profession.tsx index 82ce6bd..7ee3f03 100644 --- a/src/pages/preview/profession/profession.tsx +++ b/src/pages/preview/profession/profession.tsx @@ -104,6 +104,7 @@ const Profession = () => { ) } + 暂无更多 ) } diff --git a/src/static/img/del.png b/src/static/img/del.png new file mode 100644 index 0000000..d434ff8 Binary files /dev/null and b/src/static/img/del.png differ diff --git a/src/utils/time.tsx b/src/utils/time.tsx index 4759388..d3e9fb0 100644 --- a/src/utils/time.tsx +++ b/src/utils/time.tsx @@ -147,3 +147,21 @@ export function everyDay(start_time: number, end_time: number, data: Record= 365) { + return `${Math.floor(timeDifference / 365)}年前` + } else if (timeDifference >= 31) { + return `${Math.floor(timeDifference / 31)}月前` + } else if (timeDifference >= 7) { + return `${Math.floor(timeDifference / 7)}星期前` + } else { + return `${timeDifference}天前` + } +}