diff --git a/.env b/.env index 0cde6d6..1eee7ad 100644 --- a/.env +++ b/.env @@ -1,5 +1,5 @@ -#TARO_APP_API=https://yjx.dev.yaojiankang.top -TARO_APP_API=https://playedu.yaojiankang.top +TARO_APP_API=https://yjx.dev.yaojiankang.top +#TARO_APP_API=https://playedu.yaojiankang.top TARO_APP_LGOIN=true diff --git a/src/api/curriculum.ts b/src/api/curriculum.ts index 8f76a45..9e03a14 100644 --- a/src/api/curriculum.ts +++ b/src/api/curriculum.ts @@ -10,6 +10,7 @@ export interface CourseDepData { chapters: Chapters[] course: Curriculum hours: Hours + duration: number /** 是否必修 */ is_required: boolean learn_hour_records: LearnHourRecords[] diff --git a/src/app.scss b/src/app.scss index 8deaaf8..d75e1b0 100644 --- a/src/app.scss +++ b/src/app.scss @@ -267,7 +267,7 @@ .text-dark { color: #343a40;} .text-hover-dark{ color: #121416;} .text-body { color: #212529;} -.text-muted { color: #6c757d;} +.text-muted { color: #909795;} /* 圆角 */ diff --git a/src/components/topic/judge.tsx b/src/components/topic/judge.tsx index 065e413..e947c90 100644 --- a/src/components/topic/judge.tsx +++ b/src/components/topic/judge.tsx @@ -1,19 +1,15 @@ import {FC, useEffect, useState} from "react"; import { Radio, RadioGroup, Text, View} from "@tarojs/components"; import './topic.scss' -import MyButton from "@/components/button/MyButton"; interface Props { data: ShareSubject onAnswer: (isAnswer: boolean) => void - onUpAndDown?: (index: number) => void - index: number validate: boolean frequency?: number - end?: boolean } -const Judge: FC = ({data, onAnswer, onUpAndDown, index, validate, frequency, end}) => { +const Judge: FC = ({data, onAnswer, validate, frequency}) => { const [rightAnswer, setRightAnswer] = useState(null) //答案 const rightKey = data.right_answer ? 'correct' : 'error' // 正确答案数组 const [error, setError] = useState(false) @@ -58,10 +54,6 @@ const Judge: FC = ({data, onAnswer, onUpAndDown, index, validate, frequen - {onUpAndDown && - {index > 0 && onUpAndDown(index - 1)}>上一题} - {!end && onUpAndDown(index + 1)}>下一题} - } {error && frequency == 0 && diff --git a/src/components/topic/multi.tsx b/src/components/topic/multi.tsx index d98f7f4..e2db7b2 100644 --- a/src/components/topic/multi.tsx +++ b/src/components/topic/multi.tsx @@ -1,19 +1,15 @@ import {FC, useEffect, useState} from "react"; import {Checkbox, CheckboxGroup, Radio, RadioGroup, Text, View} from "@tarojs/components"; import './topic.scss' -import MyButton from "@/components/button/MyButton"; interface Props { data: Multi onAnswer: (isAnswer: boolean) => void - onUpAndDown?: (index: number) => void - index: number validate: boolean frequency?: number - end?: boolean } -const Multi: FC = ({data, onAnswer, onUpAndDown, index, validate, frequency, end}) => { +const Multi: FC = ({data, onAnswer, validate, frequency}) => { const [rightAnswer, setRightAnswer] = useState([]) //答案 const rightKey = data?.right_answer?.split(',') || [] // 正确答案数组 @@ -46,7 +42,7 @@ const Multi: FC = ({data, onAnswer, onUpAndDown, index, validate, frequen return ( - {data.type ? "多选题" : '单选题'} + {data.type ? "多选题" : '单选题'} {data.question} @@ -75,12 +71,6 @@ const Multi: FC = ({data, onAnswer, onUpAndDown, index, validate, frequen } - {onUpAndDown && - {index > 0 && onUpAndDown?.(index - 1)}>上一题} - {!end && onUpAndDown?.(index + 1)}>下一题} - } - - {error && frequency == 0 && 正确答案:{data.right_answer} 题目解析 diff --git a/src/components/topic/shortAnswer.tsx b/src/components/topic/shortAnswer.tsx index 466b9bd..7649acc 100644 --- a/src/components/topic/shortAnswer.tsx +++ b/src/components/topic/shortAnswer.tsx @@ -1,30 +1,20 @@ -import {Button, Text, Textarea, View} from "@tarojs/components"; +import {Text, Textarea, View} from "@tarojs/components"; import {FC, useEffect, useState} from "react"; -import Taro from "@tarojs/taro"; import './topic.scss' interface Props { data: ShareSubject onAnswer: (isAnswer: boolean) => void - onUpAndDown?: (index: number) => void - index: number validate: boolean frequency?: number - end?: boolean } -const ShortAnswer: FC = ({data, onAnswer, onUpAndDown, index, validate, frequency, end}) => { +const ShortAnswer: FC = ({data, onAnswer, validate, frequency}) => { const [value, setValue] = useState('') - function onBlur() { - if (value.length < 3) { - Taro.showToast({title: '最少3个字', icon: 'error'}) - } - } - useEffect(() => { if (validate) { - if (value.length < 3) { + if (value.length < 1) { onAnswer(false) } else { onAnswer(true) @@ -42,17 +32,9 @@ const ShortAnswer: FC = ({data, onAnswer, onUpAndDown, index, validate, f