diff --git a/src/components/topic/single.tsx b/src/components/topic/single.tsx new file mode 100644 index 0000000..9a2f92d --- /dev/null +++ b/src/components/topic/single.tsx @@ -0,0 +1,10 @@ +import {FC} from "react"; +import {View} from "@tarojs/components"; + +export const Single:FC = ()=>{ + return( + 1 + ) +} + +export default Single diff --git a/src/components/video/type.ts b/src/components/video/type.ts index 82fe90b..a0fc3fa 100644 --- a/src/components/video/type.ts +++ b/src/components/video/type.ts @@ -1,3 +1,5 @@ +import {ReactNode} from "react"; + export interface HVideoOptions { /** 视频时长s */ duration: number @@ -9,11 +11,10 @@ export interface HVideoOptions { poster?: string /** 视频断点 */ breakpoint: number[] - /** 进入断点 */ onBreakpoint: (id: number) => void /** 视频播放结束 */ onEnded: () => void - - setTime: (fn:(time:number)=>void) => void + setTime: (fn: (time: number) => void) => void + children?: ReactNode } diff --git a/src/components/video/video.tsx b/src/components/video/video.tsx index e324452..69e9501 100644 --- a/src/components/video/video.tsx +++ b/src/components/video/video.tsx @@ -48,7 +48,8 @@ const HVideo: FC = (opt: HVideoOptions) => { if (process.env.TARO_ENV === 'h5') { try { document?.exitFullscreen().then() - } catch (e) {} + } catch (e) { + } } video?.exitFullScreen() opt.onBreakpoint(d) @@ -122,7 +123,9 @@ const HVideo: FC = (opt: HVideoOptions) => { onEnded={onEnded} onPlay={onPlay} onPause={onPause} - /> + > + {opt.children} + ) } diff --git a/src/pages/business/videoInfo/components/course.tsx b/src/pages/business/videoInfo/components/course.tsx index b8df4c7..53ba61b 100644 --- a/src/pages/business/videoInfo/components/course.tsx +++ b/src/pages/business/videoInfo/components/course.tsx @@ -1,4 +1,4 @@ -import {ScrollView, Text, View} from "@tarojs/components"; +import {CoverView, ScrollView, Text, View} from "@tarojs/components"; import {FC, useEffect, useState} from "react"; import HVideo from "@/components/video/video"; import {curriculum, HourPlayData} from "@/api"; @@ -9,6 +9,7 @@ import unique_ident from "@/hooks/unique_ident"; import MyButton from "@/components/button/MyButton"; import {formatMinute} from "@/utils/time"; import CustomPageContainer from "@/components/custom-page-container/custom-page-container"; +import Single from "@/components/topic/single"; interface Props { id: number, @@ -127,7 +128,11 @@ const Course: FC = ({id, courseId, preview, curEnd}) => { breakpoint={breakpoint} onBreakpoint={onBreakpoint} setTime={videoSeek} - /> + > + {/**/} + {/* */} + {/**/} + diff --git a/src/pages/business/videoInfo/videoInfo.scss b/src/pages/business/videoInfo/videoInfo.scss index 5c0a7ad..7057f0c 100644 --- a/src/pages/business/videoInfo/videoInfo.scss +++ b/src/pages/business/videoInfo/videoInfo.scss @@ -106,3 +106,8 @@ filter: saturate(0); } +.single-cover { + position: absolute; + color: #fff; +} +