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