shaogen1995 1 anno fa
parent
commit
bbaa4813be
5 ha cambiato i file con 27 aggiunte e 35 eliminazioni
  1. 1 2
      README.md
  2. 4 14
      public/index.html
  3. 1 1
      public/model.html
  4. 2 4
      src/pages/A4Intro/index.module.scss
  5. 19 14
      src/pages/A4Intro/index.tsx

+ 1 - 2
README.md

@@ -1,2 +1 @@
-打包的时候搜索:打包配置
-来修改url变量
+本地运行:静态资源里面先运行一个服务 

+ 4 - 14
public/index.html

@@ -9,24 +9,14 @@
   <meta name="description" content="Web site created using create-react-app" />
   <link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
 
-  <script>
-    const scriptDom = document.createElement('script')
 
-    let src = ''
 
-    if (window.location.href.includes('localhost:')) {
-      // 本地环境
-      src = 'http://192.168.20.55:8080/data.js'
-    } else {
-      // 正式环境
-      src = './staticData/data.js'
-    }
+  <!-- 本地开发 -->
+  <script src="http://192.168.20.55:8080/data.js"></script>
+  <!-- 打包配置 -->
+  <script src="./staticData/data.js"></script>
 
-    scriptDom.src = src
 
-    document.querySelector('html').appendChild(scriptDom)
-
-  </script>
 
   <!--
       manifest.json provides metadata used when your web app is installed on a

+ 1 - 1
public/model.html

@@ -50,7 +50,7 @@
     }
 
     // fdage.embed( number, {
-    fdage.embed(`${src}/3Goods/${number}/main${num}.4dage`, {
+    fdage.embed(`${src}3Goods/${number}/main${num}.4dage`, {
       transparentBackground: true,
       width: 800,
       height: 600,

+ 2 - 4
src/pages/A4Intro/index.module.scss

@@ -69,10 +69,8 @@
           .swiper-slide {
             border: 3px solid #fff;
             border-radius: 4px;
-
-            .swImg {
-              cursor: pointer;
-            }
+            height: 120px;
+            cursor: pointer;
           }
 
 

+ 19 - 14
src/pages/A4Intro/index.tsx

@@ -11,6 +11,7 @@ import { Swiper, SwiperSlide } from "swiper/react";
 import { Navigation } from "swiper";
 import "swiper/css";
 import "swiper/css/navigation";
+import ImageLazy from "@/components/ImageLazy";
 
 function A4Intro() {
   const data = useSelector((state: RootState) => state.A0Layout.dataAll.Home);
@@ -82,21 +83,25 @@ function A4Intro() {
             // onSwiper={(swiper) => console.log(swiper)}
           >
             {imgArr.map((v, i) => (
-              <SwiperSlide key={v}>
-                <img
-                  onClick={() =>
-                    store.dispatch({
-                      type: "layout/lookBigImg",
-                      payload: {
-                        show: true,
-                        url: lookArr(),
-                        current: i,
-                      },
-                    })
-                  }
-                  className="swImg"
+              <SwiperSlide
+                key={v}
+                onClick={() =>
+                  store.dispatch({
+                    type: "layout/lookBigImg",
+                    payload: {
+                      show: true,
+                      url: lookArr(),
+                      current: i,
+                    },
+                  })
+                }
+              >
+                <ImageLazy
+                  noLook={true}
+                  offline={true}
+                  width="100%"
+                  height="100%"
                   src={`${baseURL}/4Intro/pc/${v + 1}.jpg`}
-                  alt=""
                 />
               </SwiperSlide>
             ))}