From 088ab69f327a39175791678c6cb07c312f75d6f8 Mon Sep 17 00:00:00 2001 From: king <2229249788@qq.com> Date: Mon, 31 Jul 2023 15:54:31 +0800 Subject: [PATCH] =?UTF-8?q?=E6=92=AD=E6=94=BE=E7=BB=93=E6=9D=9F=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E6=92=AD=E6=94=BE=E4=B8=8B=E4=B8=80=E4=B8=AA=E8=AF=BE?= =?UTF-8?q?=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../business/videoInfo/components/catalogue.tsx | 2 +- .../business/videoInfo/components/course.tsx | 6 +++--- src/pages/business/videoInfo/videoInfo.tsx | 13 +++++++------ src/static/img/curRecord.png | Bin 0 -> 2413 bytes src/static/img/hourRecord.png | Bin 0 -> 3357 bytes 5 files changed, 11 insertions(+), 10 deletions(-) create mode 100644 src/static/img/curRecord.png create mode 100644 src/static/img/hourRecord.png diff --git a/src/pages/business/videoInfo/components/catalogue.tsx b/src/pages/business/videoInfo/components/catalogue.tsx index 7bcf800..132bda6 100644 --- a/src/pages/business/videoInfo/components/catalogue.tsx +++ b/src/pages/business/videoInfo/components/catalogue.tsx @@ -85,7 +85,7 @@ const Catalogue: FC = ({data, setHors, id}) => { if (flat.id === lastTimeId) { const next = flats[index + 1] if (next) { - setHors(true, lastTimeId) + setHors(true, next.id) } } } diff --git a/src/pages/business/videoInfo/components/course.tsx b/src/pages/business/videoInfo/components/course.tsx index e6dadd4..b1340c4 100644 --- a/src/pages/business/videoInfo/components/course.tsx +++ b/src/pages/business/videoInfo/components/course.tsx @@ -32,7 +32,7 @@ const Course: FC = ({id, courseId, preview, curEnd}: Props) => { const [count, setCount] = useState | null>(null) const [frequency, setFrequency] = useState(1) // 次数 const [testId, setTestId] = useState(null) - const [startRecording, setStartRecording] = useState(null) // 开始记录 + const [startRecording, setStartRecording] = useState(null) // 视频开始记录 const {user} = Profile.useContainer() @@ -179,7 +179,7 @@ const Course: FC = ({id, courseId, preview, curEnd}: Props) => { setTime={videoSeek} /> - + = ({id, courseId, preview, curEnd}: Props) => { {frequency === 0 && validate && } - + ) diff --git a/src/pages/business/videoInfo/videoInfo.tsx b/src/pages/business/videoInfo/videoInfo.tsx index 958e020..ebe0377 100644 --- a/src/pages/business/videoInfo/videoInfo.tsx +++ b/src/pages/business/videoInfo/videoInfo.tsx @@ -1,5 +1,5 @@ import {Image, Text, View} from "@tarojs/components"; -import {FC, useEffect, useState} from "react"; +import {FC, useCallback, useEffect, useState} from "react"; import {CourseDepData, curriculum} from "@/api"; import './videoInfo.scss' import {Profile} from '@/store' @@ -24,7 +24,7 @@ const VideoInfo: FC = () => { } /** 用于自动播放 判断当前课程是否完成 */ if (playId) { - currentVideo() + currentVideo(res) } } @@ -37,8 +37,9 @@ const VideoInfo: FC = () => { getData() }, []) + /** 播放下一个视频 */ - function playNext() { + const playNext = useCallback(() => { const flats: Hour[] = Object.values(data?.hours || {}).flat(Infinity) as Hour[] if (playId === flats?.[flats.length - 1]?.id) { Taro.showModal({title: '当前课程结束'}) @@ -61,12 +62,12 @@ const VideoInfo: FC = () => { return } } - } + }, [playId, data]) /** * 判断当前课程是否完成 */ - function currentVideo() { + const currentVideo = useCallback((data: CourseDepData) => { const courseHourRecordsFinish = data?.learn_hour_records.find(d => d.id === playId)?.courseHourRecordsFinish if (typeof courseHourRecordsFinish === 'number') { if (courseHourRecordsFinish === 1) { @@ -82,7 +83,7 @@ const VideoInfo: FC = () => { }) } } - } + }, [playId, data]) Taro.useDidShow(() => { data && getData() diff --git a/src/static/img/curRecord.png b/src/static/img/curRecord.png new file mode 100644 index 0000000000000000000000000000000000000000..02d6ac5611ba4d70b92d69986eda75c3a17e90e3 GIT binary patch literal 2413 zcmV-z36l1SP)Px;CrLy>RCr$Poo#GeXBEf)=UykaleBqhnkChsYav=`S!tnZoHa27Z7}+2)utjb zJ|MA|GCDv*2u)q=dOI4-%Jjeg@|2@Y~o?G>lV8d&=fBQPp{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