From ab5241ebbfdaf4d49cdad7f5d05229c362309c97 Mon Sep 17 00:00:00 2001 From: king <2229249788@qq.com> Date: Sun, 6 Aug 2023 17:28:52 +0800 Subject: [PATCH] =?UTF-8?q?1.=E8=A7=86=E9=A2=91=E6=92=AD=E6=94=BE=E7=BB=93?= =?UTF-8?q?=E6=9D=9F=E7=9A=84=E8=80=83=E9=A2=98=20&=20=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E6=92=AD=E6=94=BE=E4=B8=8B=E4=B8=80=E4=B8=AA=202.=E8=A7=86?= =?UTF-8?q?=E9=A2=91=E6=92=AD=E6=94=BE=E8=BF=87=E7=A8=8B=E4=B8=AD=E7=9A=84?= =?UTF-8?q?=E6=9A=82=E5=81=9C=E5=92=8C=E8=BF=94=E5=9B=9E=E7=BB=A7=E7=BB=AD?= =?UTF-8?q?=E6=92=AD=E6=94=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/lineChart/lineChart.module.scss | 2 +- src/components/lineChart/lineChart.tsx | 1 + src/components/video/video.tsx | 18 ++++++++++++------ src/pages/business/test/test.tsx | 1 + .../business/videoInfo/components/course.tsx | 1 + src/pages/business/videoInfo/videoInfo.tsx | 13 +++++++++---- src/pages/manage/userInfo/userInfo.tsx | 2 +- 7 files changed, 26 insertions(+), 12 deletions(-) diff --git a/src/components/lineChart/lineChart.module.scss b/src/components/lineChart/lineChart.module.scss index ed31596..e8f31d7 100644 --- a/src/components/lineChart/lineChart.module.scss +++ b/src/components/lineChart/lineChart.module.scss @@ -3,7 +3,7 @@ align-items: flex-end; justify-content: left; flex-wrap: nowrap; - height: 400px; + height: 420px; } .columnBox { diff --git a/src/components/lineChart/lineChart.tsx b/src/components/lineChart/lineChart.tsx index f8e7780..9dac5bf 100644 --- a/src/components/lineChart/lineChart.tsx +++ b/src/components/lineChart/lineChart.tsx @@ -30,6 +30,7 @@ const LineChart: FC = ({data}) => { lineChartList.map(d => + {d.value} {d.time} diff --git a/src/components/video/video.tsx b/src/components/video/video.tsx index 955375c..4afa044 100644 --- a/src/components/video/video.tsx +++ b/src/components/video/video.tsx @@ -7,14 +7,14 @@ import unique_ident from "@/hooks/unique_ident"; const deviation: number = 1 const HVideo: FC = (opt: HVideoOptions) => { - let video - try { - video = Taro.createVideoContext('myVideo') - } catch (e) { + let video: Taro.VideoContext - } const [currentTime, setCurrentTime] = useState(0) + try { + video = Taro.createVideoContext('myVideo') + } catch (e) {} + function onTimeUpdate(event: BaseEventOrig) { // if (opt.preview) return; const time = event.detail.currentTime @@ -53,10 +53,16 @@ const HVideo: FC = (opt: HVideoOptions) => { } Taro.useDidHide(() => { - video?.stop() + video?.pause() unique_ident.put(Number(currentTime.toFixed(2)), Date.now()) }) + Taro.useDidShow(()=>{ + if(!video){ + video = Taro.createVideoContext('myVideo') + video.play() + } + }) return (