mirror of
https://github.com/PlayEdu/frontend.git
synced 2025-12-23 18:29:39 +08:00
课程学习记录显示优化
This commit is contained in:
@@ -162,7 +162,10 @@ const CoursePage = () => {
|
||||
title={it.title}
|
||||
record={learnHourRecord[it.id]}
|
||||
duration={it.duration}
|
||||
progress={learnHourRecord[it.id].progress}
|
||||
progress={
|
||||
(learnHourRecord[it.id].finished_duration * 100) /
|
||||
learnHourRecord[it.id].total_duration
|
||||
}
|
||||
onChange={() => getDetail()}
|
||||
></HourCompenent>
|
||||
)}
|
||||
|
||||
@@ -6,6 +6,7 @@ import { Row, Col, Empty, Spin, Image } from "antd";
|
||||
const LatestLearnPage = () => {
|
||||
const [loading, setLoading] = useState<boolean>(false);
|
||||
const [courses, setCourses] = useState<any>([]);
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
getCourses();
|
||||
@@ -14,7 +15,10 @@ const LatestLearnPage = () => {
|
||||
const getCourses = () => {
|
||||
setLoading(true);
|
||||
course.latestLearn().then((res: any) => {
|
||||
setCourses(res.data);
|
||||
|
||||
setCourses(res.data);
|
||||
|
||||
|
||||
setLoading(false);
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user