修改小程序考题开始和结束事件

main
king 1 year ago
parent c85cecbf0f
commit 8ad043d735
  1. 4
      src/components/video/video.tsx
  2. 5
      src/pages/business/videoInfo/components/catalogue.tsx
  3. 26
      src/pages/business/videoInfo/components/course.tsx

@ -45,12 +45,10 @@ const HVideo: FC<HVideoOptions> = (opt: HVideoOptions) => {
opt.breakpoint.forEach(d => { opt.breakpoint.forEach(d => {
if (time < d + deviation && time > d - deviation) { if (time < d + deviation && time > d - deviation) {
video?.pause() video?.pause()
video?.seek(d - deviation)
if (process.env.TARO_ENV === 'h5') { if (process.env.TARO_ENV === 'h5') {
try { try {
document?.exitFullscreen().then() document?.exitFullscreen().then()
} catch (e) { } catch (e) {}
}
} }
video?.exitFullScreen() video?.exitFullScreen()
opt.onBreakpoint(d) opt.onBreakpoint(d)

@ -175,10 +175,9 @@ const Catalogue: FC<Props> = ({data, setHors, id, playId}) => {
<View className='Videobutton'> <View className='Videobutton'>
{ {
playing ? <MyButton style={{flex: '1'}} onClick={onPause}>{JSON.stringify(playing)}</MyButton> playing ? <MyButton style={{flex: '1'}} onClick={onPause}></MyButton>
: <MyButton style={{flex: '1'}} onClick={learning}>{JSON.stringify(playing)}</MyButton> : <MyButton style={{flex: '1'}} onClick={learning}></MyButton>
} }
<View className='px-3' onClick={() => setShow(true)}>...</View> <View className='px-3' onClick={() => setShow(true)}>...</View>
</View> </View>

@ -129,24 +129,22 @@ const Course: FC<Props> = ({id, courseId, preview, curEnd}) => {
setTime={videoSeek} setTime={videoSeek}
/> />
<CustomPageContainer <CustomPageContainer show={show} position='bottom'>
show={show}
position='bottom'
>
<View> <View>
<View className='text-center mt-2 text-muted'> <View className='text-center mt-2 text-muted'>
<Text className='mr-2'>{formatMinute(time)}</Text> <Text className='mr-2'>{formatMinute(time)}</Text>
</View> </View>
{examAll?.[time]?.slice(0, 1)?.map((d) => {
<ScrollView style='height:60vh' scrollY key={d.id}> examAll?.[time]?.slice(0, 1)?.map((d) =>
{d.question_type === 2 && <ScrollView style='height:60vh' scrollY key={d.id}>
<Judge {d.question_type === 2 &&
data={d as ShareSubject} <Judge
validate={validate} data={d as ShareSubject}
onAnswer={(isAnswer) => setRecord([isAnswer])} validate={validate}
/>} onAnswer={(isAnswer) => setRecord([isAnswer])}
</ScrollView> />}
)} </ScrollView>)
}
<View> <View>
<View className='statistics'> <View className='statistics'>

Loading…
Cancel
Save