diff --git a/src/api/curriculum.ts b/src/api/curriculum.ts index 8a0532c..4100e40 100644 --- a/src/api/curriculum.ts +++ b/src/api/curriculum.ts @@ -32,6 +32,7 @@ export interface HourPlayData { } export interface Course { + audit_mode: boolean /** 完成 */ finished_count: number; /** 未完成 */ diff --git a/src/components/collect/collect.module.scss b/src/components/collect/collect.module.scss new file mode 100644 index 0000000..3262142 --- /dev/null +++ b/src/components/collect/collect.module.scss @@ -0,0 +1,13 @@ +.collect { + display: flex; + align-items: center; + color: #909795; + font-size: 24rpx; + + Image { + width: 32rpx; + height: 32rpx; + margin-right: 10rpx; + //vertical-align: middle; + } +} diff --git a/src/components/collect/collect.tsx b/src/components/collect/collect.tsx new file mode 100644 index 0000000..3c000a6 --- /dev/null +++ b/src/components/collect/collect.tsx @@ -0,0 +1,22 @@ +import {FC} from "react"; +import star from '@/static/img/star.png' +import starLine from '@/static/img/starLine.png' +import {Image, View} from "@tarojs/components"; +import styles from './collect.module.scss' + +interface Props { + onClick?: () => void + select?: boolean +} + +/** 收藏 */ +const Collect: FC = (props) => { + return ( + + + {props.select ? '已收藏' : '收藏'} + + ) +} + +export default Collect diff --git a/src/components/lineChart/lineChart.module.scss b/src/components/lineChart/lineChart.module.scss index eb02c83..2eb264d 100644 --- a/src/components/lineChart/lineChart.module.scss +++ b/src/components/lineChart/lineChart.module.scss @@ -3,7 +3,7 @@ align-items: flex-end; justify-content: left; flex-wrap: nowrap; - height: 380px; + height: 400px; position: relative; } diff --git a/src/pages/index/index.tsx b/src/pages/index/index.tsx index a4d3037..91bbaad 100644 --- a/src/pages/index/index.tsx +++ b/src/pages/index/index.tsx @@ -58,7 +58,7 @@ const AuditMode: FC = () => { { articles.map((d, i) => {i > 0 && } - {d.title} + {d.title} {(d.intro || '').length > 40 && ( {d.intro} {d.cover && } diff --git a/src/pages/manage/courseAdmin/courseAdmin.tsx b/src/pages/manage/courseAdmin/courseAdmin.tsx index 70c0a28..4799fc6 100644 --- a/src/pages/manage/courseAdmin/courseAdmin.tsx +++ b/src/pages/manage/courseAdmin/courseAdmin.tsx @@ -1,5 +1,5 @@ import {FC, useCallback, useEffect, useState} from "react"; -import {Image, Radio, Text, View} from "@tarojs/components"; +import {Radio, Text, View} from "@tarojs/components"; import {Search} from "./components/search"; import {CourseAllParam, courseApi, ManageApi} from "@/api"; import styles from './courseAdmin.module.scss' @@ -7,6 +7,7 @@ import Taro, {useReachBottom} from "@tarojs/taro"; import MyButton from "@/components/button/MyButton"; import storageDep from "@/hooks/storageDep"; import Spin from "@/components/spinner"; +import Img from "@/components/image/image"; const CourseAdmin: FC = () => { const [total, setTotal] = useState(0) @@ -125,7 +126,7 @@ const CourseAdmin: FC = () => { Taro.useDidShow(useCallback(async () => { const dep_id = storageDep.get() - if (!dep_id.length || !curs.length) return; + if (!dep_id.length || !curs.length) return; try { @@ -162,7 +163,7 @@ const CourseAdmin: FC = () => { checked={curs.includes(d.id)} style={{marginTop: '30px'}} onClick={() => addCurs(d.id)}/>} - + {d.title} diff --git a/src/pages/manage/depAdmin/depAdmin.tsx b/src/pages/manage/depAdmin/depAdmin.tsx index 13d3b7f..4e4b966 100644 --- a/src/pages/manage/depAdmin/depAdmin.tsx +++ b/src/pages/manage/depAdmin/depAdmin.tsx @@ -150,15 +150,17 @@ const DepAdmin: FC = () => { leftImage={folder} />)} - {users.map(d => Taro.navigateTo({url: '/pages/manage/userInfo/userInfo?userId=' + d.id})} - content={['学员', '管理员', '超级管理员'][d.role_type]} - />)} - 暂无更多 + { + users.map(d => Taro.navigateTo({url: '/pages/manage/userInfo/userInfo?userId=' + d.id})} + content={['学员', '管理员', '超级管理员'][d.role_type]} + />) + } + {manages.length > 0 || users.length > 0 && 暂无更多} {!manages.length && !users.length && } diff --git a/src/pages/my/my.tsx b/src/pages/my/my.tsx index e0f8ec3..6a48127 100644 --- a/src/pages/my/my.tsx +++ b/src/pages/my/my.tsx @@ -38,6 +38,7 @@ const My: FC = () => { const [companyList, setCompanyList] = useState([]) const [navbarOpacity, setNavbarOpacity] = useState('0') const navbarHeight = globalData.statusBarHeight + globalData.textBarHeight; + const [auditMode, setAuditMode] = useState(true) Taro.useDidShow(() => { token && userApi.companyList().then(res => { @@ -60,9 +61,10 @@ const My: FC = () => { Taro.useDidShow(async () => { try { const res = await curriculum.course() + setAuditMode(res.audit_mode) const oldList: List[] = JSON.parse(JSON.stringify(list)) - oldList[1].time = res.finished_count - oldList[2].time = res.not_finished_count + oldList[1].time = res.finished_count || 0 + oldList[2].time = res.not_finished_count || 0 setList(oldList) } catch (e) { } @@ -91,31 +93,34 @@ const My: FC = () => {
companyList.length >= 2 && setCompanyShow(true)}/> -