diff --git a/.env b/.env index 1eee7ad..0cde6d6 100644 --- a/.env +++ b/.env @@ -1,5 +1,5 @@ -TARO_APP_API=https://yjx.dev.yaojiankang.top -#TARO_APP_API=https://playedu.yaojiankang.top +#TARO_APP_API=https://yjx.dev.yaojiankang.top +TARO_APP_API=https://playedu.yaojiankang.top TARO_APP_LGOIN=true diff --git a/src/api/curriculum.ts b/src/api/curriculum.ts index 9e03a14..7115159 100644 --- a/src/api/curriculum.ts +++ b/src/api/curriculum.ts @@ -29,7 +29,7 @@ export interface HourPlayData { /** 断点题 */ hourExamQuestions: Record /** 次数 */ - count: Record + fault_count: Record[] /** 断点 */ timeList: number[] hour_test?: { id: number } diff --git a/src/pages/business/videoInfo/components/course.tsx b/src/pages/business/videoInfo/components/course.tsx index 692c640..7346429 100644 --- a/src/pages/business/videoInfo/components/course.tsx +++ b/src/pages/business/videoInfo/components/course.tsx @@ -31,7 +31,7 @@ const Course: FC = ({id, courseId, preview, curEnd}: Props) => { const [time, setTime] = useState(0) // 进入断点的时间 const [validate, setValidate] = useState(false) // 开启验证 const [newRecord, setNewRecord] = useState([]) - const [count, setCount] = useState | null>(null) + const [faultCount, setFaultCount] = useState | null>(null) const [frequency, setFrequency] = useState(1) // 次数 const [testId, setTestId] = useState(null) const [startRecording, setStartRecording] = useState(null) // 视频开始记录 @@ -53,7 +53,7 @@ const Course: FC = ({id, courseId, preview, curEnd}: Props) => { /** 进入断点 */ function onBreakpoint(breakpoint: number) { if (breakpoint !== time) { - setFrequency(count?.[breakpoint] || 1) + setFrequency(faultCount?.[breakpoint] || 1) } setTime(breakpoint) setShow(true) @@ -68,10 +68,8 @@ const Course: FC = ({id, courseId, preview, curEnd}: Props) => { setData(res) setBreakpoint(res.timeList) setExamAll(res.hourExamQuestions || []) - setCount(res.count) - if (res.hour_test) { - setTestId(res.hour_test.id) - } + setFaultCount(res.fault_count?.[0] || {}) + setTestId(res?.hour_test?.id || null) setStartRecording({ duration: 0,