|
|
|
@ -1,4 +1,4 @@ |
|
|
|
|
import {Button, ScrollView, Swiper, SwiperItem, View} from "@tarojs/components"; |
|
|
|
|
import {ScrollView, Swiper, SwiperItem, View} from "@tarojs/components"; |
|
|
|
|
import {FC, useEffect, useState} from "react"; |
|
|
|
|
import HVideo from "@/components/video/video"; |
|
|
|
|
import {CurEndParam, curriculum, HourPlayData} from "@/api"; |
|
|
|
@ -9,6 +9,7 @@ import Judge from "@/components/topic/judge"; |
|
|
|
|
import ShortAnswer from "@/components/topic/shortAnswer"; |
|
|
|
|
import unique_ident from "@/hooks/unique_ident"; |
|
|
|
|
import CustomPageContainer from "@/components/custom-page-container/custom-page-container"; |
|
|
|
|
import MyButton from "@/components/button/MyButton"; |
|
|
|
|
|
|
|
|
|
interface Props { |
|
|
|
|
id: number, |
|
|
|
@ -158,7 +159,7 @@ const Course: FC<Props> = ({id, courseId, preview, curEnd}: Props) => { |
|
|
|
|
seek(time) |
|
|
|
|
init() |
|
|
|
|
} else { |
|
|
|
|
Taro.showToast({title: '错误', icon: 'error'}) |
|
|
|
|
Taro.showToast({title: '答案错误', icon: 'error', duration: 3000}) |
|
|
|
|
} |
|
|
|
|
}, [newRecord]) |
|
|
|
|
|
|
|
|
@ -187,14 +188,16 @@ const Course: FC<Props> = ({id, courseId, preview, curEnd}: Props) => { |
|
|
|
|
onAfterLeave={again} |
|
|
|
|
> |
|
|
|
|
<Swiper |
|
|
|
|
style={{height: "70vh"}} |
|
|
|
|
style={{height: "60vh"}} |
|
|
|
|
snapToEdge |
|
|
|
|
current={index} |
|
|
|
|
onChange={(e) => { |
|
|
|
|
setIndex((e.target as any).current) |
|
|
|
|
if ((e.target as any)?.current) { |
|
|
|
|
setIndex((e.target as any).current) |
|
|
|
|
} |
|
|
|
|
}}> |
|
|
|
|
{examAll?.[time]?.map((d, index) => |
|
|
|
|
<SwiperItem> |
|
|
|
|
<SwiperItem key={d.id}> |
|
|
|
|
<ScrollView style='height:70vh' scrollY> |
|
|
|
|
{d.question_type === 1 && |
|
|
|
|
<Multi |
|
|
|
@ -231,12 +234,12 @@ const Course: FC<Props> = ({id, courseId, preview, curEnd}: Props) => { |
|
|
|
|
)} |
|
|
|
|
</Swiper> |
|
|
|
|
<View className='statistics'> |
|
|
|
|
<View>考试次数{frequency}</View> |
|
|
|
|
<View>{frequency}次机会</View> |
|
|
|
|
<View>{index + 1}/{examAll?.[time]?.length}</View> |
|
|
|
|
|
|
|
|
|
{!validate && <Button className='button' onClick={() => setValidate(true)}>提交</Button>} |
|
|
|
|
{frequency > 0 && validate && <Button className='button' onClick={onceMore}>再来一次</Button>} |
|
|
|
|
{frequency === 0 && validate && <Button className='button' onClick={again}>重新学习</Button>} |
|
|
|
|
{!validate && <MyButton width={150} fillet onClick={() => setValidate(true)}>提交</MyButton>} |
|
|
|
|
{frequency > 0 && validate && <MyButton width={150} fillet onClick={onceMore}>再来一次</MyButton>} |
|
|
|
|
{frequency === 0 && validate && <MyButton width={150} fillet onClick={again}>重新学习</MyButton>} |
|
|
|
|
</View> |
|
|
|
|
</CustomPageContainer> |
|
|
|
|
</View> |
|
|
|
|