feat: 完善黄炎培体悟

This commit is contained in:
zhongyidian committed 2025-12-31 17:48:23 +08:00
1 parent 66f460633a
commit bf4a98bf9f
6 files changed
+888 -49

No files matched your search

+16 -23
View File
@@ -1,22 +1,18 @@
import { useState } from "react";
import { Title, Image, Cursor, ExhibitOverlay } from "@/components";
import { Title, Image, Cursor } from "@/components";
import { getBackgroundImage, getStaticImage } from "@/lib/utils";
import { useNavigate, useParams } from "react-router-dom";
import ViseAssemblyDialog from "./scene3/ViseAssemblyDialog";
const starName = "huangyanpei";
const exhibitSrcMap: Record<1, string> = {
// 预留展品图片路径:请在 images 中放置对应资源
1: "huangyanpei/reflection/scene3/11_002",
};
const HuangyanpeiReflectionScene3 = () => {
const navigate = useNavigate();
const { moduleName } = useParams<{
moduleName: string;
}>();
const [activeExhibitId, setActiveExhibitId] = useState<1 | null>(null);
const [showDialog, setShowDialog] = useState(false);
const [visited, setVisited] = useState<Set<number>>(new Set());
if (!moduleName) {
@@ -58,26 +54,23 @@ const HuangyanpeiReflectionScene3 = () => {
}}
/>
{/* 互动展品光标:后续可替换为拖拽/选择类互动 */}
{/* 互动展品光标:组装台钳互动 */}
<Cursor
className="absolute left-96 top-90"
onClick={() => setActiveExhibitId(1)}
className="absolute right-100 bottom-55"
onClick={() => setShowDialog(true)}
read={visited.has(1)}
/>
{/* 展品遮罩:当前使用单张图片,占位为后续互动内容 */}
<ExhibitOverlay
visible={activeExhibitId !== null}
src={activeExhibitId ? exhibitSrcMap[activeExhibitId] : ""}
onClose={() => {
if (activeExhibitId !== null) {
setVisited((prev) => {
const next = new Set(prev);
next.add(activeExhibitId);
return next;
});
}
setActiveExhibitId(null);
{/* 组装台钳互动弹窗 */}
<ViseAssemblyDialog
visible={showDialog}
onClose={() => setShowDialog(false)}
onComplete={() => {
setVisited((prev) => {
const next = new Set(prev);
next.add(1);
return next;
});
}}
/>