|
|
@@ -5,6 +5,7 @@ import { useHistory } from 'react-router-dom'
|
|
|
function A3scene() {
|
|
|
const history = useHistory()
|
|
|
const [showBack, setShowBack] = useState(true);
|
|
|
+ const [isShowIntro, setIsShowIntro] = useState(false);
|
|
|
|
|
|
const code = history.location.search.split('code=')[1]
|
|
|
|
|
|
@@ -27,16 +28,25 @@ function A3scene() {
|
|
|
};
|
|
|
}, [history]);
|
|
|
|
|
|
+ window.goBack = () => {
|
|
|
+ history.push('#/layout?siderActive=scenes')
|
|
|
+ }
|
|
|
+
|
|
|
return (
|
|
|
<div className={styles.A3scene}>
|
|
|
{showBack && (
|
|
|
- <div className="back">科学广场</div>
|
|
|
+ <div className="back" onClick={() => setIsShowIntro(!isShowIntro)}>{sceneData.find(item => item.code === code)?.title} <img className={`arrow ${isShowIntro ? 'active' : ''}`} src={require('@/assets/img/up.png')} alt="" /> </div>
|
|
|
)}
|
|
|
<iframe
|
|
|
src={`https://houseoss.4dkankan.com/project/ScientistEducationBase/scene/index.html#/home?m=${code}`}
|
|
|
allow="src"
|
|
|
title="scene"
|
|
|
/>
|
|
|
+
|
|
|
+ <div className={`intro ${isShowIntro ? 'introShow' : ''}`}>
|
|
|
+ <div className="text" dangerouslySetInnerHTML={{ __html: sceneData.find(item => item.code === code)?.intro || '' }}></div>
|
|
|
+ </div>
|
|
|
+
|
|
|
</div>
|
|
|
)
|
|
|
}
|