From 78c0c46125e8a5c6fb0594b952f153f79acd0cdd Mon Sep 17 00:00:00 2001 From: king <2229249788@qq.com> Date: Wed, 9 Aug 2023 16:33:00 +0800 Subject: [PATCH] =?UTF-8?q?=E8=80=83=E8=AF=95=E6=AC=A1=E6=95=B0=E6=9B=B4?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env | 4 ++-- src/api/curriculum.ts | 2 +- src/pages/business/videoInfo/components/course.tsx | 10 ++++------ 3 files changed, 7 insertions(+), 9 deletions(-) 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,