mirror of
https://github.com/PlayEdu/frontend.git
synced 2025-06-08 07:24:50 +08:00
课程学习记录显示优化
This commit is contained in:
parent
7afb99751f
commit
c26bf2f9c5
@ -19,7 +19,7 @@ export function record(courseId: number, hourId: number, duration: number) {
|
||||
|
||||
//观看ping
|
||||
export function playPing(courseId: number, hourId: number) {
|
||||
return client.get(`/api/v1/course/${courseId}/hour/${hourId}/ping`, {});
|
||||
return client.post(`/api/v1/course/${courseId}/hour/${hourId}/ping`, {});
|
||||
}
|
||||
|
||||
//最近学习课程
|
||||
|
@ -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);
|
||||
});
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user