|
@@ -1,6 +1,6 @@
|
|
|
/* eslint-disable jsx-a11y/iframe-has-title */
|
|
|
|
|
|
-import React, { useMemo, useRef, useState } from "react";
|
|
|
+import React, { useEffect, useMemo, useRef, useState } from "react";
|
|
|
import styles from "./index.module.scss";
|
|
|
import { baseUrl } from "@/index";
|
|
|
import { InfoRowType } from "@/types";
|
|
@@ -8,6 +8,7 @@ import history, { modelUrl } from "@/utils/history";
|
|
|
import { SwapRightOutlined } from "@ant-design/icons";
|
|
|
import classNames from "classnames";
|
|
|
import { getUrlHashFu } from "@/utils/data";
|
|
|
+import { useLocation } from "react-router-dom";
|
|
|
|
|
|
const iconArr = [
|
|
|
{ id: 2, name: "放大" },
|
|
@@ -21,6 +22,18 @@ type Props = {
|
|
|
};
|
|
|
|
|
|
function ArcOrBuildInfoM({ info, type }: Props) {
|
|
|
+ // 嵌套 四维看看 iframe 返回的问题
|
|
|
+ const location = useLocation();
|
|
|
+ const [back2, setBack2] = useState("");
|
|
|
+
|
|
|
+ useEffect(() => {
|
|
|
+ const query = new URLSearchParams(location.search);
|
|
|
+ const back2 = query.get("back2");
|
|
|
+ setBack2(back2!);
|
|
|
+
|
|
|
+ setBack2(back2!);
|
|
|
+ }, [location.search]);
|
|
|
+
|
|
|
// 模型的ref
|
|
|
const ifrRefNew = useRef<any>(null);
|
|
|
|
|
@@ -58,7 +71,11 @@ function ArcOrBuildInfoM({ info, type }: Props) {
|
|
|
style={{ backgroundImage: `url(${baseUrl}/C2ArchitecInfo/bg2.jpg)` }}
|
|
|
>
|
|
|
{/* 返回按钮 */}
|
|
|
- <div className="AMback" onClick={() => history.go(-1)} hidden={full}>
|
|
|
+ <div
|
|
|
+ className="AMback"
|
|
|
+ onClick={() => (back2 ? history.push(back2) : history.go(-1))}
|
|
|
+ hidden={full}
|
|
|
+ >
|
|
|
<img src={`${baseUrl}/C2ArchitecInfo/icon_back.png`} alt="" />
|
|
|
</div>
|
|
|
|
|
@@ -132,7 +149,10 @@ function ArcOrBuildInfoM({ info, type }: Props) {
|
|
|
|
|
|
{/* 去大场景 */}
|
|
|
{type === "C2ArchitecInfo" && info.code ? (
|
|
|
- <div className="AMtoVr" onClick={() => getUrlHashFu(info.code)}>
|
|
|
+ <div
|
|
|
+ className="AMtoVr"
|
|
|
+ onClick={() => getUrlHashFu(info.code, "scene")}
|
|
|
+ >
|
|
|
室内VR
|
|
|
<p>
|
|
|
<SwapRightOutlined />
|