shaogen1995 1 år sedan
förälder
incheckning
f6a953398a
33 ändrade filer med 615 tillägg och 58 borttagningar
  1. 9 6
      code/public/4dage.js
  2. 1 1
      code/public/index.html
  3. 4 18
      code/public/model.html
  4. 7 1
      code/src/App.tsx
  5. BIN
      code/src/assets/img/tab2/btn_normal.png
  6. BIN
      code/src/assets/img/tab3/btn_l.png
  7. BIN
      code/src/assets/img/tab3/icon_esc.png
  8. BIN
      code/src/assets/img/tab3/icon_fullscreen.png
  9. BIN
      code/src/assets/img/tab3/icon_model_active.png
  10. BIN
      code/src/assets/img/tab3/icon_model_normal.png
  11. BIN
      code/src/assets/img/tab3/icon_next.png
  12. BIN
      code/src/assets/img/tab3/icon_rorate.png
  13. BIN
      code/src/assets/img/tab3/icon_zoomin.png
  14. BIN
      code/src/assets/img/tab3/icon_zoomout.png
  15. 179 0
      code/src/components/ArcOrBuildInfo/index.module.scss
  16. 163 0
      code/src/components/ArcOrBuildInfo/index.tsx
  17. 2 2
      code/src/index.tsx
  18. 0 1
      code/src/pages/A1Home/index.module.scss
  19. 1 1
      code/src/pages/A1Home/index.tsx
  20. 0 1
      code/src/pages/B1Card/index.module.scss
  21. 4 1
      code/src/pages/B1Card/index.tsx
  22. 47 4
      code/src/pages/C1Architec/index.module.scss
  23. 42 9
      code/src/pages/C1Architec/index.tsx
  24. 3 0
      code/src/pages/C2ArchitecInfo/index.module.scss
  25. 37 0
      code/src/pages/C2ArchitecInfo/index.tsx
  26. 24 0
      code/src/pages/Z2Scene/index.module.scss
  27. 34 0
      code/src/pages/Z2Scene/index.tsx
  28. 7 0
      code/src/types/api/layot.d.ts
  29. 15 9
      code/src/utils/history.ts
  30. BIN
      静态资源/staticData/C1Architec/pc/img_tip.png
  31. BIN
      静态资源/staticData/C2ArchitecInfo/1/new.4dage
  32. BIN
      静态资源/staticData/C2ArchitecInfo/pc/bg.jpg
  33. 36 4
      静态资源/staticData/dataTemp.js

+ 9 - 6
code/public/4dage.js

@@ -68,7 +68,10 @@ var Clamp = function (e, t, i) {
     codeToCh = function (e) {
         return unescape(e)
     };
-fdage = {},
+fdage = {
+    // 背景颜色透明
+    transparentBackground: true
+},
     function (I) {
 
         function r(e, t, i) {
@@ -6256,11 +6259,11 @@ fdage = {},
             W.prototype.start = function () {
                 // console.log('模型加载完成');
                 window.modelLoding = true
-                setTimeout(() => {
-                    let dom = document.querySelector('.bacBox')
-                    dom.style.opacity = 0
-                    dom.style.pointerEvents = 'none'
-                }, 500);
+                // setTimeout(() => {
+                //     let dom = document.querySelector('.bacBox')
+                //     dom.style.opacity = 0
+                //     dom.style.pointerEvents = 'none'
+                // }, 500);
 
                 this.scene.view.updateView(),
                     this.ui.showActiveView(),

+ 1 - 1
code/public/index.html

@@ -11,7 +11,7 @@
 
 
   <script src="http://127.0.0.1:8080/staticData/dataTemp.js"></script>
-  <script src="./staticData/dataTemp.js"></script>
+  <script src="./web/staticData/dataTemp.js"></script>
 
   <!--
       manifest.json provides metadata used when your web app is installed on a

+ 4 - 18
code/public/model.html

@@ -11,31 +11,17 @@
     html {
       overflow: hidden;
     }
-
-    .bacBox {
-      opacity: 1;
-      pointer-events: auto;
-      position: absolute;
-      z-index: 998;
-      top: 0;
-      left: 0;
-      width: 100%;
-      height: 100%;
-      background-color: #cfcfd0;
-      transition: all 1s;
-    }
   </style>
 </head>
 
 <body>
   <div id="ui"></div>
-  <div class="bacBox"></div>
   <script>
     let number = getQueryVariable("m");
     let num = getQueryVariable("n");
     // console.log('ppppppppp',number);
 
-    window.autoRotate = true; // 是否自动旋转
+    // window.autoRotate = true; // 是否自动旋转
 
     // 打包配置
 
@@ -43,14 +29,14 @@
 
     if (window.location.href.includes('http://')) {
       // 本地环境
-      src = 'http://127.0.0.1:8080/staticData/'
+      src = 'http://127.0.0.1:8080/staticData'
     } else {
       // 正式环境
-      src = './staticData/'
+      src = '/web/staticData'
     }
 
     // fdage.embed( number, {
-    fdage.embed(`${src}3Goods/${number}/main${num}.4dage`, {
+    fdage.embed(`${src}/C2ArchitecInfo/${number}/${num}.4dage`, {
       transparentBackground: true,
       width: 800,
       height: 600,

+ 7 - 1
code/src/App.tsx

@@ -15,13 +15,15 @@ import store, { RootState } from "./store";
 const A1Home = React.lazy(() => import("./pages/A1Home"));
 const B1Village = React.lazy(() => import("./pages/B1Village"));
 const C1Architec = React.lazy(() => import("./pages/C1Architec"));
+const C2ArchitecInfo = React.lazy(() => import("./pages/C2ArchitecInfo"));
 const D1Build = React.lazy(() => import("./pages/D1Build"));
+const Z2Scene = React.lazy(() => import("./pages/Z2Scene"));
 
 const tabList = [
   { id: 1, name: "总览", pathUrl: "/", path: "/" },
   { id: 2, name: "村落", pathUrl: "/village", path: "/village" },
   { id: 3, name: "建筑", pathUrl: "/architec?id=1", path: "/architec" },
-  { id: 4, name: "构件", pathUrl: "/build?id=1", path: "/build" },
+  { id: 4, name: "构件", pathUrl: "/build", path: "/build" },
 ];
 
 export default function App() {
@@ -76,8 +78,12 @@ export default function App() {
             <Route path="/village" component={B1Village} />
             {/* 建筑 */}
             <Route path="/architec" component={C1Architec} />
+            {/* 建筑详情 */}
+            <Route path="/architecInfo" component={C2ArchitecInfo} />
             {/* 构件 */}
             <Route path="/build" component={D1Build} />
+            {/* 场景 */}
+            <Route path="/scene" component={Z2Scene} />
 
             {/* 找不到页面 */}
             <Route path="*" component={NotFound} />

BIN
code/src/assets/img/tab2/btn_normal.png


BIN
code/src/assets/img/tab3/btn_l.png


BIN
code/src/assets/img/tab3/icon_esc.png


BIN
code/src/assets/img/tab3/icon_fullscreen.png


BIN
code/src/assets/img/tab3/icon_model_active.png


BIN
code/src/assets/img/tab3/icon_model_normal.png


BIN
code/src/assets/img/tab3/icon_next.png


BIN
code/src/assets/img/tab3/icon_rorate.png


BIN
code/src/assets/img/tab3/icon_zoomin.png


BIN
code/src/assets/img/tab3/icon_zoomout.png


+ 179 - 0
code/src/components/ArcOrBuildInfo/index.module.scss

@@ -0,0 +1,179 @@
+.ArcOrBuildInfo {
+  width: 100%;
+  height: 100%;
+  background-size: 100% 100%;
+
+  :global {
+    .C2leftBtn {
+      position: absolute;
+      z-index: 3;
+      left: 100px;
+      bottom: 100px;
+
+      .C2lRow {
+        width: 80px;
+        height: 80px;
+        transition: all .3s;
+        background-image: url('../../assets/img/tab2/btn_normal.png');
+        background-size: 100% 100%;
+        color: var(--themeColor2);
+        font-size: 16px;
+        display: flex;
+        justify-content: center;
+        align-items: center;
+        letter-spacing: 2px;
+        text-shadow: 1px 1px black;
+        cursor: pointer;
+
+        &:nth-of-type(2) {
+          position: absolute;
+          top: -50px;
+          left: 50px;
+        }
+
+        &:nth-of-type(3) {
+          position: absolute;
+          top: 0px;
+          left: 100px;
+        }
+
+        &:nth-of-type(4) {
+          position: absolute;
+          top: 50px;
+          left: 50px;
+        }
+
+        &:hover {
+          background-image: url('../../assets/img/tab2/btn_active.png');
+        }
+      }
+    }
+
+    .C2left {
+      position: absolute;
+      z-index: 3;
+      top: 160px;
+      left: 140px;
+      display: flex;
+      justify-content: space-between;
+      width: 350px;
+      height: 480px;
+
+      .C2left1 {
+        width: 40px;
+        font-size: 40px;
+        color: #fff;
+        text-align: center;
+        padding-top: 20px;
+      }
+
+      .C2left2 {
+        width: calc(100% - 80px);
+        color: #fff;
+        letter-spacing: 2px;
+        line-height: 20px;
+      }
+    }
+
+    .C2right {
+      width: calc(100% - 560px);
+      height: calc(100% - 160px);
+      position: absolute;
+      z-index: 3;
+      top: 160px;
+      right: 0px;
+
+      iframe {
+        position: absolute;
+        top: 0;
+        left: 0;
+        width: 100%;
+        height: 100%;
+      }
+
+      .C2rToScene {
+        position: absolute;
+        z-index: 2;
+        right: 100px;
+        bottom: 80px;
+        width: 180px;
+        height: 50px;
+        background-image: url('../../assets/img/tab3/btn_l.png');
+        background-size: 100% 100%;
+        display: flex;
+        justify-content: center;
+        align-items: center;
+        letter-spacing: 2px;
+        cursor: pointer;
+        font-size: 20px;
+        padding-right: 15px;
+
+        &::after {
+          content: '';
+          position: absolute;
+          bottom: 5px;
+          right: 24px;
+          width: 30px;
+          height: 30px;
+          background-image: url('../../assets/img/tab3/icon_next.png');
+          background-size: 100% 100%;
+        }
+      }
+
+      .C2rBtn {
+        position: absolute;
+        bottom: 160px;
+        right: 100px;
+        width: 50px;
+        padding: 0 5px;
+
+        .C2rBtnRow {
+          width: 40px;
+          height: 40px;
+          margin-bottom: 20px;
+          cursor: pointer;
+          background-size: 100% 100%;
+          transition: all .3s;
+        }
+
+        .C2rBtnRow1 {
+          background-image: url('../../assets/img/tab3/icon_model_normal.png');
+        }
+
+        .C2rBtnRow1Ac {
+          background-image: url('../../assets/img/tab3/icon_model_active.png');
+        }
+
+        .C2rBtnRow2 {
+          background-image: url('../../assets/img/tab3/icon_zoomin.png');
+        }
+
+        .C2rBtnRow3 {
+          background-image: url('../../assets/img/tab3/icon_zoomout.png');
+        }
+
+        .C2rBtnRow4 {
+          background-image: url('../../assets/img/tab3/icon_rorate.png');
+        }
+
+        .C2rBtnRow5 {
+          background-image: url('../../assets/img/tab3/icon_fullscreen.png');
+        }
+
+        .C2rBtnRow5Ac {
+          background-image: url('../../assets/img/tab3/icon_esc.png');
+        }
+      }
+    }
+
+    .C2rightAc {
+      width: 100%;
+      height: 100%;
+      position: absolute;
+      z-index: 30;
+      top: 0;
+      right: 0;
+      background-size: 100% 100%;
+    }
+  }
+}

+ 163 - 0
code/src/components/ArcOrBuildInfo/index.tsx

@@ -0,0 +1,163 @@
+/* eslint-disable jsx-a11y/iframe-has-title */
+import React, { useEffect, useMemo, useRef, useState } from "react";
+import styles from "./index.module.scss";
+import { baseUrl } from "@/index";
+import history from "@/utils/history";
+import { useSelector } from "react-redux";
+import { RootState } from "@/store";
+import classNames from "classnames";
+
+const iconArr = [
+  { id: 2, name: "放大" },
+  { id: 3, name: "缩小" },
+  { id: 4, name: "复位" },
+];
+
+type Props = {
+  type: "3" | "4";
+  uid: string;
+  cid: string;
+};
+
+function ArcOrBuildInfo({ type, cid, uid }: Props) {
+  // 建筑的数据
+  const architec = useSelector(
+    (state: RootState) => state.A0Layout.dataAll.architec
+  );
+
+  const info = useMemo(() => {
+    // 筛选出 村 的信息
+
+    const infoArr = architec[cid as "key"].data;
+
+    const infoRes = infoArr.filter((v) => v.id === Number(uid))[0];
+
+    // console.log(infoRes);
+
+    return type === "3" ? infoRes : infoRes;
+  }, [architec, cid, uid, type]);
+
+  // 模型的ref
+  const ifrRefNew = useRef<any>(null);
+
+  const modelChangeFu = (val: number) => {
+    const dom = ifrRefNew.current;
+
+    if (dom && dom.contentWindow && dom.contentWindow.webview) {
+      if (val === 2) dom.contentWindow.webview.zoomIn(); // 放大
+      else if (val === 3) dom.contentWindow.webview.zoomOut(); // 缩小
+      else dom.contentWindow.webview.resetView(); // 复位
+    }
+  };
+
+  // 点击对比
+  const [oldShow, setOldShow] = useState(false);
+
+  // 点击全屏
+  const [full, setFull] = useState(false);
+
+  return (
+    <div
+      className={styles.ArcOrBuildInfo}
+      style={{ backgroundImage: `url(${baseUrl}/C2ArchitecInfo/pc/bg.jpg)` }}
+    >
+      {/* 左下方的按钮 */}
+      <div className="C2leftBtn">
+        <div className="C2lRow" onClick={() => history.go(-1)}>
+          返回
+        </div>
+        {info.isBuild ? (
+          <>
+            {info.isBuild.map((v) => (
+              <div
+                className="C2lRow"
+                key={v.id}
+                onClick={() => history.push(`/buildInfo?id=${v.id}`)}
+              >
+                {v.name}
+              </div>
+            ))}
+          </>
+        ) : null}
+      </div>
+
+      {/* 左边信息 */}
+      <div className="C2left">
+        <div className="C2left1">{info.name}</div>
+        <div
+          className="C2left2"
+          dangerouslySetInnerHTML={{ __html: info.txt }}
+        ></div>
+      </div>
+
+      {/* 右边模型 */}
+      <div
+        className={classNames("C2right", full ? "C2rightAc" : "")}
+        style={{
+          backgroundImage: full
+            ? `url(${baseUrl}/C2ArchitecInfo/pc/bg.jpg)`
+            : "",
+        }}
+      >
+        <iframe
+          ref={ifrRefNew}
+          src={`/model.html?m=${uid}&n=new`}
+          frameBorder="0"
+        ></iframe>
+        {/* 进入室内按钮 */}
+        <div
+          hidden={full}
+          className="C2rToScene"
+          onClick={() => history.push(`/scene?id=${info.code}`)}
+        >
+          进入室内
+        </div>
+
+        {/* 右侧的功能按钮 */}
+        <div className="C2rBtn">
+          {/* 是否有对比 */}
+          {info.isOld ? (
+            <div
+              hidden={full}
+              onClick={() => setOldShow(!oldShow)}
+              className={classNames(
+                "C2rBtnRow",
+                "C2rBtnRow1",
+                oldShow ? "C2rBtnRow1Ac" : ""
+              )}
+              title={oldShow ? "退出对比" : "对比"}
+            ></div>
+          ) : null}
+
+          {iconArr.map((v) => (
+            <div
+              onClick={() => modelChangeFu(v.id)}
+              className={classNames("C2rBtnRow", "C2rBtnRow" + v.id)}
+              key={v.id}
+              title={v.name}
+            ></div>
+          ))}
+
+          {/* 全屏 */}
+          <div
+            onClick={() => {
+              const dom = ifrRefNew.current;
+              if (dom && dom.contentWindow && dom.contentWindow.modelLoding)
+                setFull(!full);
+            }}
+            className={classNames(
+              "C2rBtnRow",
+              "C2rBtnRow5",
+              full ? "C2rBtnRow5Ac" : ""
+            )}
+            title={full ? "退出全屏" : "全屏"}
+          ></div>
+        </div>
+      </div>
+    </div>
+  );
+}
+
+const MemoArcOrBuildInfo = React.memo(ArcOrBuildInfo);
+
+export default MemoArcOrBuildInfo;

+ 2 - 2
code/src/index.tsx

@@ -35,7 +35,7 @@ if (isMobileFu()) {
       locale={locale}
       theme={{
         token: {
-          colorPrimary: "#FCE9AC",
+          colorPrimary: "#5C4B32",
         },
       }}
     >
@@ -56,7 +56,7 @@ if (isMobileFu()) {
       locale={locale}
       theme={{
         token: {
-          colorPrimary: "#FCE9AC",
+          colorPrimary: "#5C4B32",
         },
       }}
     >

+ 0 - 1
code/src/pages/A1Home/index.module.scss

@@ -194,7 +194,6 @@
             }
 
             &>p {
-              text-indent: 2em;
               font-size: 14px;
               line-height: 22px;
               letter-spacing: 2px;

+ 1 - 1
code/src/pages/A1Home/index.tsx

@@ -104,7 +104,7 @@ function A1Home() {
                 <div>
                   <h3>历史事件</h3>
                   <div className="A1mapXian"></div>
-                  <p>{v.txt}</p>
+                  <p dangerouslySetInnerHTML={{ __html: v.txt }}></p>
                 </div>
               </div>
             ) : null}

+ 0 - 1
code/src/pages/B1Card/index.module.scss

@@ -61,7 +61,6 @@
               letter-spacing: 4px;
               font-size: 14px;
               line-height: 24px;
-              text-indent: 2em;
 
             }
           }

+ 4 - 1
code/src/pages/B1Card/index.tsx

@@ -49,7 +49,10 @@ function B1Card({ isShow, closeFu, clickCardFu }: Props) {
               <p className="B1Ciname">{v.name}</p>
               {/* 鼠标移入的效果 */}
               <div className="B1Cihover">
-                <div className="mySorrl">{v.infoTxt}</div>
+                <div
+                  className="mySorrl"
+                  dangerouslySetInnerHTML={{ __html: v.infoTxt }}
+                ></div>
               </div>
             </div>
           </div>

+ 47 - 4
code/src/pages/C1Architec/index.module.scss

@@ -4,6 +4,28 @@
   overflow: hidden;
 
   :global {
+
+    .C1tit{
+      pointer-events: none;
+      transition: all .3s;
+      position: absolute;
+      z-index: 20;
+      left: 50%;
+      top: 140px;
+      transform: translateX(-50%);
+      text-align: center;
+      &>p{
+        margin-top: 20px;
+        color: var(--themeColor);
+        font-size: 18px;
+        letter-spacing: 2px;
+        font-weight: 700;
+      }
+    }
+    .C1titHide{
+      opacity: 0;
+    }
+
     .C1bs {
       position: absolute;
       z-index: 3;
@@ -119,14 +141,14 @@
             padding: 6px 10px;
             margin-top: 20px;
             height: 150px;
-            text-indent: 2em;
             color: #fff;
             white-space: normal;
             letter-spacing: 2px;
             line-height: 20px;
           }
         }
-        .C1rowShow{
+
+        .C1rowShow {
           opacity: 1;
         }
       }
@@ -146,7 +168,6 @@
       }
 
       .C1cent1 {
-        background-color: #655b54;
         position: absolute;
         bottom: 180px;
         height: 400px;
@@ -162,6 +183,7 @@
           width: 25vw;
           height: 100%;
           transition: all .3s;
+          z-index: 2;
 
           &>img {
             width: 100%;
@@ -178,14 +200,35 @@
             font-size: 20px;
             color: var(--themeColor);
             letter-spacing: 2px;
+            pointer-events: none;
           }
         }
-        .C1crowNone{
+
+        .C1crowNone {
           opacity: 0;
         }
       }
+    }
 
+    .C1Bac {
+      position: absolute;
+      bottom: 180px;
+      left: 0;
+      width: 100%;
+      height: 400px;
+      background-color: #655b54;
+      overflow-y: auto;
 
+      &::-webkit-scrollbar {
+        width: 0px;
+        height: 0px;
+      }
+
+      .C1Bmove {
+        width: 200%;
+        height: 100%;
+        background-size: 100% 100%;
+      }
     }
   }
 }

+ 42 - 9
code/src/pages/C1Architec/index.tsx

@@ -7,6 +7,7 @@ import upimg from "@/assets/img/tab3/icon_up.png";
 import downimg from "@/assets/img/tab3/icon_down.png";
 import { useSelector } from "react-redux";
 import { RootState } from "@/store";
+import history from "@/utils/history";
 
 function C1Architec() {
   const location = useLocation();
@@ -25,7 +26,7 @@ function C1Architec() {
   useEffect(() => {
     const query = new URLSearchParams(location.search);
     const param = query.get("id");
-    console.log("建筑页面获取id", param);
+    // console.log("建筑页面获取id", param);
     setUid(param!);
   }, [location.search]);
 
@@ -34,13 +35,16 @@ function C1Architec() {
     (num: number) => {
       const id = Number(uId);
       const numRes = id + num;
-      setUid(numRes + "");
+      history.replace(`/architec?id=${numRes}`);
+      // setUid(numRes + "");
 
       // 改变滚动状态
       const dom1 = document.querySelector(".C1main") as HTMLDivElement;
       const dom2 = document.querySelector(".C1cent") as HTMLDivElement;
+      const dom3 = document.querySelector(".C1Bac") as HTMLDivElement;
       dom1.scrollLeft = 0;
       dom2.scrollLeft = 0;
+      dom3.scrollLeft = 0;
     },
     [uId]
   );
@@ -54,23 +58,44 @@ function C1Architec() {
     // };
 
     const dom2 = document.querySelector(".C1cent") as HTMLDivElement;
+    const dom3 = document.querySelector(".C1Bac") as HTMLDivElement;
     dom2.onwheel = (e) => {
       const num1 = dom1.scrollLeft;
-      dom1.scrollLeft = num1 + e.deltaY;
+      dom1.scrollLeft = num1 + e.deltaY * 0.4;
 
       const num2 = dom2.scrollLeft;
-      dom2.scrollLeft = num2 + e.deltaY;
+      dom2.scrollLeft = num2 + e.deltaY * 0.4;
+
+      // 如果dom2 滚到底了 ,不然dom3滚
+      const temp = dom2.scrollWidth - dom2.clientWidth;
+      if (dom2.scrollLeft >= temp) return;
+
+      const num3 = dom3.scrollLeft;
+      dom3.scrollLeft = num3 + e.deltaY * 0.2;
     };
+
+    window.setTimeout(() => {
+      setIsTit(false);
+    }, 2000);
   }, []);
 
   // 输入移入的
   const [hoverId, setHoverId] = useState(0);
 
+  // 滚轮提示
+  const [isTit, setIsTit] = useState(true);
+
   return (
     <div
       className={styles.C1Architec}
       style={{ backgroundImage: `url(${baseUrl}/C1Architec/pc/bg.jpg)` }}
     >
+      {/* 滚轮提示 */}
+      <div className={classNames("C1tit", isTit ? "" : "C1titHide")}>
+        <img src={`${baseUrl}/C1Architec/pc/img_tip.png`} alt="" />
+        <p>滑动滚轮即可查看更多建筑</p>
+      </div>
+
       {/* 村落标识 */}
       <div className="C1bs">
         <img
@@ -102,7 +127,7 @@ function C1Architec() {
               <h1>{v.name}</h1>
               <div className="C1line"></div>
               <img src={`${baseUrl}/C1Architec/pc/${uId}/${v.id}.png`} alt="" />
-              <p>{v.txt}</p>
+              <p dangerouslySetInnerHTML={{ __html: v.txt }}></p>
             </div>
           ))}
 
@@ -111,10 +136,7 @@ function C1Architec() {
       </div>
 
       <div className="C1cent">
-        <div
-          className="C1cent1"
-          // style={{ backgroundImage: `url(${baseUrl}/C1Architec/pc/bac.png)` }}
-        >
+        <div className="C1cent1">
           {info.data.map((v) => (
             <div
               className={classNames(
@@ -124,6 +146,9 @@ function C1Architec() {
               key={v.id}
               onMouseEnter={() => setHoverId(v.id)}
               onMouseLeave={() => setHoverId(0)}
+              onClick={() =>
+                history.push(`/architecInfo?cid=${uId}&id=${v.id}&t=3`)
+              }
             >
               <img src={`${baseUrl}/C1Architec/pc/${uId}/${v.id}.png`} alt="" />
               <p>{v.name}</p>
@@ -131,6 +156,14 @@ function C1Architec() {
           ))}
         </div>
       </div>
+
+      {/* 背景图的滚动 */}
+      <div className="C1Bac">
+        <div
+          className="C1Bmove"
+          style={{ backgroundImage: `url(${baseUrl}/C1Architec/pc/bac.png)` }}
+        ></div>
+      </div>
     </div>
   );
 }

+ 3 - 0
code/src/pages/C2ArchitecInfo/index.module.scss

@@ -0,0 +1,3 @@
+// .C2ArchitecInfo {
+
+// }

+ 37 - 0
code/src/pages/C2ArchitecInfo/index.tsx

@@ -0,0 +1,37 @@
+/* eslint-disable jsx-a11y/iframe-has-title */
+import React, { useEffect, useState } from "react";
+import styles from "./index.module.scss";
+import { useLocation } from "react-router-dom";
+
+import ArcOrBuildInfo from "@/components/ArcOrBuildInfo";
+function C2ArchitecInfo() {
+  const location = useLocation();
+
+  const [uid, setUid] = useState("");
+  const [cid, setCid] = useState("");
+
+  // 建筑还是构件
+  const [type, setType] = useState<"" | "3" | "4">("");
+
+  useEffect(() => {
+    const query = new URLSearchParams(location.search);
+    const id = query.get("id");
+    const cid = query.get("cid");
+    const type = query.get("t");
+    setUid(id!);
+    setCid(cid!);
+    setType(type as "3" | "4");
+  }, [location.search]);
+
+  return (
+    <div className={styles.C2ArchitecInfo}>
+      {uid && cid && type ? (
+        <ArcOrBuildInfo type={type} uid={uid} cid={cid} />
+      ) : null}
+    </div>
+  );
+}
+
+const MemoC2ArchitecInfo = React.memo(C2ArchitecInfo);
+
+export default MemoC2ArchitecInfo;

+ 24 - 0
code/src/pages/Z2Scene/index.module.scss

@@ -0,0 +1,24 @@
+.Z2Scene {
+  position: relative;
+  z-index: 30;
+  overflow: hidden;
+  
+  :global {
+    iframe {
+      width: 100%;
+      height: 100%;
+    }
+
+    .Z2back {
+      position: absolute;
+      z-index: 2;
+      top: 20px;
+      left: 20px;
+      cursor: pointer;
+      width: 60px;
+      height: 60px;
+      background-image: url('../../assets/img/back.png');
+      background-size: 100% 100%;
+    }
+  }
+}

+ 34 - 0
code/src/pages/Z2Scene/index.tsx

@@ -0,0 +1,34 @@
+/* eslint-disable jsx-a11y/iframe-has-title */
+import React, { useEffect, useState } from "react";
+import styles from "./index.module.scss";
+import { useLocation } from "react-router-dom";
+import history, { isEnvUrl } from "@/utils/history";
+function Z2Scene() {
+  const location = useLocation();
+
+  const [uid, setUid] = useState("");
+
+  useEffect(() => {
+    const query = new URLSearchParams(location.search);
+    const id = query.get("id");
+    setUid(id!);
+  }, [location.search]);
+
+  return (
+    <div className={styles.Z2Scene}>
+      {uid ? (
+        <iframe
+          src={`${isEnvUrl}/scene/index.html#/?m=${uid}`}
+          frameBorder="0"
+        ></iframe>
+      ) : null}
+
+      {/* 返回按钮 */}
+      <div className="Z2back" onClick={() => history.go(-1)}></div>
+    </div>
+  );
+}
+
+const MemoZ2Scene = React.memo(Z2Scene);
+
+export default MemoZ2Scene;

+ 7 - 0
code/src/types/api/layot.d.ts

@@ -51,6 +51,13 @@ export type DataAllType = {
         id: number;
         name: string;
         txt: string;
+        code: string;
+        isBuild: { id: number; name: string }[];
+        isOld: {
+          name: string;
+          type: "img" | "model";
+          loc: "横" | "竖";
+        };
       }[];
     };
   };

+ 15 - 9
code/src/utils/history.ts

@@ -1,6 +1,6 @@
-import { createHashHistory  } from 'history'
-const history = createHashHistory()
-export default history
+import { createHashHistory } from "history";
+const history = createHashHistory();
+export default history;
 
 export const urlParameter = (data: string) => {
   if (data) {
@@ -18,9 +18,15 @@ export const urlParameter = (data: string) => {
 
 // 判断是手机端还是pc端
 export const isMobileFu = () => {
-  if (window.navigator.userAgent.match(
-    /(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i
-  )) {
-    return true
-  } else return false
-}
+  if (
+    window.navigator.userAgent.match(
+      /(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i
+    )
+  ) {
+    return true;
+  } else return false;
+};
+
+// 当前环境是测试环境还是生产环境
+export const isEnvUrl =
+  process.env.NODE_ENV === "development" ? "https://sit-kpbwg.4dage.com" : "";

BIN
静态资源/staticData/C1Architec/pc/img_tip.png


BIN
静态资源/staticData/C2ArchitecInfo/1/new.4dage


BIN
静态资源/staticData/C2ArchitecInfo/pc/bg.jpg


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 36 - 4
静态资源/staticData/dataTemp.js