feat: 添加音频资源和更新引导对话,提升学习体验
- 在多个场景中引入音频文件,增强互动性和沉浸感。 - 更新引导对话文本,确保信息准确性和一致性。 - 调整组件结构,清理冗余代码,提升可维护性。 - 引入结束窗口,鼓励用户深入了解黄炎培的教育理念。
This commit is contained in:
1 parent
6e106032fd
commit
a8723ab4aa
12 files changed
+158
-36
No files matched your search
@@ -1,7 +1,7 @@
|
||||
import { useState, useCallback, useRef } from "react";
|
||||
import { Title, Image, Cursor, Video, StudyGuideModal } from "@/components";
|
||||
import { MultipleChoiceQuizPanel } from "@/components/layout/quiz";
|
||||
import { SuccessAlert } from "@/components/layout";
|
||||
import { SuccessAlert, ErrorAlert } from "@/components/layout";
|
||||
import { getBackgroundImage, getStaticImage, getPublicPath } from "@/lib/utils";
|
||||
import { useNavigate, useParams } from "react-router-dom";
|
||||
import TowelSalesDialog from "./scene4/TowelSalesDialog";
|
||||
@@ -24,6 +24,7 @@ const HuangyanpeiReflectionScene4 = () => {
|
||||
const [showVideo, setShowVideo] = useState(false);
|
||||
const videoRef = useRef<VideoRef>(null);
|
||||
const [showGuide1, setShowGuide1] = useState(true);
|
||||
const [showErrorAlertForQuiz, setShowErrorAlertForQuiz] = useState(false);
|
||||
|
||||
//喇叭考题弹窗
|
||||
const [showQuizDialog, setShowQuizDialog] = useState(false);
|
||||
@@ -84,7 +85,12 @@ const HuangyanpeiReflectionScene4 = () => {
|
||||
src={getStaticImage("huangyanpei/reflection/components/喇叭2")}
|
||||
button
|
||||
onClick={() => {
|
||||
setShowQuizDialog(true);
|
||||
// 检查是否完成前两个任务(visited.has(1) && visited.has(2))
|
||||
if (visited.has(1) && visited.has(2)) {
|
||||
setShowQuizDialog(true);
|
||||
} else {
|
||||
setShowErrorAlertForQuiz(true);
|
||||
}
|
||||
}}
|
||||
/>
|
||||
|
||||
@@ -185,6 +191,7 @@ const HuangyanpeiReflectionScene4 = () => {
|
||||
onContinue={() => {
|
||||
setShowGuide1(false);
|
||||
}}
|
||||
audioSrc={getPublicPath("audio/huangyanpei/mp3_huangyanpei_26.mp3")}
|
||||
>
|
||||
终于到中华职业学校啦!这里是中国近代职教的摇篮,“免学费、包分配”,还能学真手艺,快来练就一技之长。
|
||||
{"\n"}
|
||||
@@ -214,6 +221,13 @@ const HuangyanpeiReflectionScene4 = () => {
|
||||
setVisited((prev) => new Set(prev).add(3));
|
||||
}}
|
||||
/>
|
||||
|
||||
{/* 错误提示:请先完成前两个任务 */}
|
||||
<ErrorAlert
|
||||
visible={showErrorAlertForQuiz}
|
||||
text="请先完成前两个任务吧!"
|
||||
onClose={() => setShowErrorAlertForQuiz(false)}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user