feat: 清理无用的 MacOS 文件和更新组件,提升代码整洁性
- 删除多个无用的 MacOS 生成文件,减少项目冗余。 - 在 layout 组件中添加 ScaledPortal 和相关类型,增强组件功能。 - 更新 puzzleData 中的学校名称,确保信息准确性。 - 调整 internalization 组件中的提示文本,提升用户体验。 - 在多个场景中引入新的选择题和成功提示,增强学习互动性。
This commit is contained in:
1 parent
a365964f54
commit
45dd648d21
60 files changed
+558
-63
No files matched your search
@@ -7,12 +7,15 @@ import {
|
||||
Video,
|
||||
GuideSteps,
|
||||
GuideStepsItem,
|
||||
MultipleChoiceQuizPanel,
|
||||
} from "@/components";
|
||||
import { getBackgroundImage, getStaticImage, getPublicPath } from "@/lib/utils";
|
||||
import { useNavigate, useParams } from "react-router-dom";
|
||||
import { useChenyunStore } from "@/store/chenyunStore";
|
||||
import { usePuzzleAnimation } from "@/contexts/PuzzleAnimationContext";
|
||||
import { useCursorController } from "@/hooks/useCursorController";
|
||||
import SuccessAlert from "@/components/layout/alert/success-alert";
|
||||
import ScaledPortal from "@/components/layout/ScaledPortal";
|
||||
|
||||
// starName 固定为 chenyun
|
||||
const starName = "chenyun";
|
||||
@@ -23,12 +26,12 @@ const exhibitSrcMap: Record<1 | 2 | 3, string> = {
|
||||
2: "chenyun/place5/场景5展品2",
|
||||
3: "chenyun/place5/场景5展品3",
|
||||
};
|
||||
// 展品描述映射
|
||||
const exhibitDescriptionMap: Record<1 | 2 | 3, string> = {
|
||||
1: "",
|
||||
2: "延安时期因为国民党的封锁,陕甘宁边区经济困难。陈云转战陕甘宁边区主持财经工作,他遇到了很多经济难题。1944年新春伊始,陈云开始担任西北财经办事处副主任,工作转到财经方面,这是陈云以主要精力从事领导经济工作的开始。当时,陕甘宁边区在国民党严密封锁下,财经状况严峻,边区物价猛涨,老百姓日常生活必需的布匹和粮食十分缺乏。国民党顽固派封锁边区,企图“不让一粒粮、一尺布进入边区”,同时千方百计阻止边区食盐出口。",
|
||||
3: "",
|
||||
};
|
||||
// 展品描述映射(目前未使用,后续如需在展品弹窗中显示可恢复)
|
||||
// const exhibitDescriptionMap: Record<1 | 2 | 3, string> = {
|
||||
// 1: "",
|
||||
// 2: "延安时期因为国民党的封锁,陕甘宁边区经济困难。陈云转战陕甘宁边区主持财经工作,他遇到了很多经济难题。1944年新春伊始,陈云开始担任西北财经办事处副主任,工作转到财经方面,这是陈云以主要精力从事领导经济工作的开始。当时,陕甘宁边区在国民党严密封锁下,财经状况严峻,边区物价猛涨,老百姓日常生活必需的布匹和粮食十分缺乏。国民党顽固派封锁边区,企图“不让一粒粮、一尺布进入边区”,同时千方百计阻止边区食盐出口。",
|
||||
// 3: "",
|
||||
// };
|
||||
const ChenyunPlace5 = () => {
|
||||
const navigate = useNavigate();
|
||||
const { moduleName } = useParams<{
|
||||
@@ -44,8 +47,7 @@ const ChenyunPlace5 = () => {
|
||||
|
||||
// 使用持久化的访问状态
|
||||
const place = "place5";
|
||||
const { isExhibitVisited, markExhibitVisited, getVisitedExhibits } =
|
||||
useChenyunStore();
|
||||
const { markExhibitVisited, getVisitedExhibits } = useChenyunStore();
|
||||
|
||||
// 从 store 获取已访问的展品,转换为 Set 用于兼容现有代码
|
||||
const visitedExhibits = getVisitedExhibits(place);
|
||||
@@ -56,6 +58,8 @@ const ChenyunPlace5 = () => {
|
||||
visited,
|
||||
});
|
||||
const [videoVisible3, setVideoVisible3] = useState(false);
|
||||
const [quiz3Visible, setQuiz3Visible] = useState(false);
|
||||
const [successAlert3Visible, setSuccessAlert3Visible] = useState(false);
|
||||
|
||||
// 展品1引导对话
|
||||
const [guideVisible, setGuideVisible] = useState(false);
|
||||
@@ -182,12 +186,59 @@ const ChenyunPlace5 = () => {
|
||||
showSkipButton
|
||||
onEnded={() => {
|
||||
setVideoVisible3(false);
|
||||
markExhibitVisited(place, 3);
|
||||
triggerPuzzleAnimation(8);
|
||||
setQuiz3Visible(true);
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
|
||||
{/* 展品3视频后的题目 + 成功提示(使用 ScaledPortal) */}
|
||||
<ScaledPortal enabled={quiz3Visible || successAlert3Visible} zIndex={10050}>
|
||||
<>
|
||||
<MultipleChoiceQuizPanel
|
||||
visible={quiz3Visible}
|
||||
title="【多选】陈云主持陕甘宁边区财经工作期间,提出的解决当时经济困难的应对之策包括:"
|
||||
options={[
|
||||
{ value: "A", label: "A.实行贸易统一" },
|
||||
{
|
||||
value: "B",
|
||||
label: "B.事先准确估计情况,预测市场商情,以争取主动",
|
||||
},
|
||||
{
|
||||
value: "C",
|
||||
label:
|
||||
"C.不断总结封锁状态下对外贸易的经验,摸索实现等价交换的途径",
|
||||
},
|
||||
{
|
||||
value: "D",
|
||||
label:
|
||||
"D.贸易公司对边区内部贸易也要采取市场上做生意的办法",
|
||||
},
|
||||
{ value: "E", label: "E.做贸易工作的干部要精通业务" },
|
||||
]}
|
||||
correctAnswer={["A", "B", "C", "D", "E"]}
|
||||
minSelections={1}
|
||||
maxSelections={5}
|
||||
errorMessage="你的选择还不够全面哦~请你再想想吧!"
|
||||
onSubmit={(_values, isCorrect) => {
|
||||
if (isCorrect) {
|
||||
setQuiz3Visible(false);
|
||||
setSuccessAlert3Visible(true);
|
||||
}
|
||||
}}
|
||||
zIndex={10000}
|
||||
/>
|
||||
|
||||
<SuccessAlert
|
||||
visible={successAlert3Visible}
|
||||
onContinue={() => {
|
||||
setSuccessAlert3Visible(false);
|
||||
markExhibitVisited(place, 3);
|
||||
triggerPuzzleAnimation(8);
|
||||
}}
|
||||
/>
|
||||
</>
|
||||
</ScaledPortal>
|
||||
|
||||
{/* 遮罩层 */}
|
||||
<ExhibitOverlay
|
||||
visible={activeExhibitId !== null}
|
||||
|
||||
Reference in new issue
Block a user