mirror of
https://github.com/PlayEdu/frontend.git
synced 2025-06-08 10:24:12 +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
|
//观看ping
|
||||||
export function playPing(courseId: number, hourId: number) {
|
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}
|
title={it.title}
|
||||||
record={learnHourRecord[it.id]}
|
record={learnHourRecord[it.id]}
|
||||||
duration={it.duration}
|
duration={it.duration}
|
||||||
progress={learnHourRecord[it.id].progress}
|
progress={
|
||||||
|
(learnHourRecord[it.id].finished_duration * 100) /
|
||||||
|
learnHourRecord[it.id].total_duration
|
||||||
|
}
|
||||||
onChange={() => getDetail()}
|
onChange={() => getDetail()}
|
||||||
></HourCompenent>
|
></HourCompenent>
|
||||||
)}
|
)}
|
||||||
|
@ -6,6 +6,7 @@ import { Row, Col, Empty, Spin, Image } from "antd";
|
|||||||
const LatestLearnPage = () => {
|
const LatestLearnPage = () => {
|
||||||
const [loading, setLoading] = useState<boolean>(false);
|
const [loading, setLoading] = useState<boolean>(false);
|
||||||
const [courses, setCourses] = useState<any>([]);
|
const [courses, setCourses] = useState<any>([]);
|
||||||
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
getCourses();
|
getCourses();
|
||||||
@ -14,7 +15,10 @@ const LatestLearnPage = () => {
|
|||||||
const getCourses = () => {
|
const getCourses = () => {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
course.latestLearn().then((res: any) => {
|
course.latestLearn().then((res: any) => {
|
||||||
setCourses(res.data);
|
|
||||||
|
setCourses(res.data);
|
||||||
|
|
||||||
|
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user