diff --git a/src/api/curriculum.ts b/src/api/curriculum.ts index 4a7221e..56ce566 100644 --- a/src/api/curriculum.ts +++ b/src/api/curriculum.ts @@ -110,5 +110,9 @@ export const curriculum = { /** 学习记录 */ hourCache(courseId: number, data: HourCacheParam) { return request(`/api/v1/course/${courseId}/hour/cache`, "PUT", data) + }, + /** 删除 */ + delCache(courseId: number) { + return request(`/api/v1/course/${courseId}/hour/cache`, "DELETE") } } diff --git a/src/components/topic/judge.tsx b/src/components/topic/judge.tsx index 396b792..181693c 100644 --- a/src/components/topic/judge.tsx +++ b/src/components/topic/judge.tsx @@ -9,9 +9,10 @@ interface Props { index: number validate: boolean frequency?: number + end: boolean } -const Judge: FC = ({data, onAnswer, onUpAndDown, index, validate, frequency}) => { +const Judge: FC = ({data, onAnswer, onUpAndDown, index, validate, frequency, end}) => { const [rightAnswer, setRightAnswer] = useState(null) //答案 const rightKey = data.right_answer ? 'correct' : 'error' // 正确答案数组 const [error, setError] = useState(false) @@ -68,7 +69,7 @@ const Judge: FC = ({data, onAnswer, onUpAndDown, index, validate, frequen {onUpAndDown && {index > 0 && } - + {!end && } } diff --git a/src/components/topic/multi.tsx b/src/components/topic/multi.tsx index 71f8238..3d40cef 100644 --- a/src/components/topic/multi.tsx +++ b/src/components/topic/multi.tsx @@ -9,9 +9,10 @@ interface Props { index: number validate: boolean frequency?: number + end: boolean } -const Multi: FC = ({data, onAnswer, onUpAndDown, index, validate, frequency}) => { +const Multi: FC = ({data, onAnswer, onUpAndDown, index, validate, frequency, end}) => { const [rightAnswer, setRightAnswer] = useState([]) //答案 const rightKey = data?.right_answer?.split(',') || [] // 正确答案数组 @@ -83,7 +84,7 @@ const Multi: FC = ({data, onAnswer, onUpAndDown, index, validate, frequen {onUpAndDown && {index > 0 && } - + {!end && } } diff --git a/src/components/topic/shortAnswer.tsx b/src/components/topic/shortAnswer.tsx index d3d2b1d..c9d85e2 100644 --- a/src/components/topic/shortAnswer.tsx +++ b/src/components/topic/shortAnswer.tsx @@ -10,9 +10,10 @@ interface Props { index: number validate: boolean frequency?: number + end:boolean } -const ShortAnswer: FC = ({data, onAnswer, onUpAndDown, index, validate, frequency}) => { +const ShortAnswer: FC = ({data, onAnswer, onUpAndDown, index, validate, frequency,end}) => { const [value, setValue] = useState('') function onBlur() { @@ -57,7 +58,7 @@ const ShortAnswer: FC = ({data, onAnswer, onUpAndDown, index, validate, f {onUpAndDown && {index > 0 && } - + {!end && } } diff --git a/src/components/topic/topic.scss b/src/components/topic/topic.scss index ddf9069..e685f2c 100644 --- a/src/components/topic/topic.scss +++ b/src/components/topic/topic.scss @@ -11,23 +11,34 @@ } .statistics { - padding: 40px 20px; + border-top: 1px solid #F5F8F7; + padding: 30px; display: flex; - justify-content: space-around; + align-items: center; + justify-content: space-between; + margin-bottom: env(safe-area-inset-bottom); + + .button { + border-radius: 100px; + height: 76px; + width: 304rpx; + margin: 0; + } } .upAndDown { display: flex; - justify-content: space-around; + justify-content: space-between; margin-top: 30px; button { width: 40%; + border-radius: 100px; } } -.right_answer{ +.right_answer { font-weight: bold; color: #FF9E5F; line-height: 40rpx; diff --git a/src/components/video/video.tsx b/src/components/video/video.tsx index 1e5fdd4..224e89c 100644 --- a/src/components/video/video.tsx +++ b/src/components/video/video.tsx @@ -2,6 +2,7 @@ import {BaseEventOrig, Video, VideoProps} from "@tarojs/components"; import {HVideoOptions} from "@/components/video/type"; import Taro from "@tarojs/taro"; import {FC, useState} from "react"; +import unique_ident from "@/hooks/unique_ident"; // import {Profile} from '@/store' const deviation: number = 0.5 @@ -50,6 +51,11 @@ const HVideo: FC = (opt: HVideoOptions) => { } } + Taro.useUnload(() => { + unique_ident.put(Number(currentTime.toFixed(2)), Date.now()) + }) + + return (