mirror of
https://github.com/PlayEdu/h5.git
synced 2025-06-08 01:34:12 +08:00
视频详情优化
This commit is contained in:
parent
25867876d4
commit
00b74f5ab0
@ -4,6 +4,7 @@ import styles from "./index.module.scss";
|
||||
import { useNavigate, useParams } from "react-router-dom";
|
||||
import backIcon from "../../assets/images/commen/icon-back-n.png";
|
||||
import { course as vod } from "../../api/index";
|
||||
import { isEmptyObject } from "../../utils/index";
|
||||
import { Empty } from "../../components";
|
||||
import { HourCompenent } from "./compenents/hour";
|
||||
|
||||
@ -68,7 +69,7 @@ const CoursePage = () => {
|
||||
useEffect(() => {
|
||||
if (learnRecord?.progress) {
|
||||
setUserCourseProgress(Math.floor(learnRecord.progress / 100));
|
||||
} else if (learnHourRecord && JSON.stringify(learnHourRecord) !== "{}") {
|
||||
} else if (learnHourRecord && !isEmptyObject(learnHourRecord)) {
|
||||
setUserCourseProgress(1);
|
||||
} else {
|
||||
setUserCourseProgress(0);
|
||||
|
@ -76,3 +76,7 @@ export function isMobile() {
|
||||
);
|
||||
return flag;
|
||||
}
|
||||
|
||||
export function isEmptyObject(obj: Object) {
|
||||
return Object.keys(obj).length === 0;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user