Yansen 1 rok temu
rodzic
commit
d411bc1b45

+ 1
- 0
config/config.js Wyświetl plik

@@ -10,6 +10,7 @@ console.log('REACT_APP_ENV', REACT_APP_ENV);
10 10
 
11 11
 export default defineConfig({
12 12
   define: {
13
+    IS_DEMO: true,
13 14
     API_BASE: REACT_APP_ENV == 'dev' ? '' : 'http://machine.njyunzhi.com',
14 15
     // API_BASE: 'http://192.168.89.147',
15 16
   },

+ 1
- 1
src/components/GeoMap/CarsMarker.js Wyświetl plik

@@ -29,7 +29,7 @@ export default function getCarsMarker(AMap, map, opts = {}) {
29 29
           <div style="width:100%;text-align:center">
30 30
             <img  class="map-top-cars borderBox" src="${thumb}" alt="" />
31 31
           </div>
32
-          <img class="map-top-start borderBox" src="${videoStartImg}" alt="" />
32
+          <img class="map-top-start borderBox map-video-btn" src="${videoStartImg}" alt="" />
33 33
           <img class="map-top-stop borderBox" src="${videoStopImg}" alt="" />
34 34
         </div>
35 35
         <div  class="map-button-border">      

+ 18
- 7
src/components/GeoMap/VideoModel.jsx Wyświetl plik

@@ -18,12 +18,14 @@ export default (props) => {
18 18
   };
19 19
 
20 20
   useEffect(() => {
21
-    // 隐藏的时候取消视频播放
22
-    if (visible) {
23
-      getPreviewInfo('05a281758ccfe9c68fcada81faee7cae').then(setPreview);
24
-    } else {
25
-      if (hatcRef.current) {
26
-        hatcRef.current.stop();
21
+    if (!IS_DEMO) {
22
+      // 隐藏的时候取消视频播放
23
+      if (visible) {
24
+        getPreviewInfo('05a281758ccfe9c68fcada81faee7cae').then(setPreview);
25
+      } else {
26
+        if (hatcRef.current) {
27
+          hatcRef.current.stop();
28
+        }
27 29
       }
28 30
     }
29 31
   }, [visible]);
@@ -37,7 +39,16 @@ export default (props) => {
37 39
       visible={visible}
38 40
       onCancel={handleCancel}
39 41
     >
40
-      <Hatc width={width} ref={hatcRef} height={height} previewParams={preview} />
42
+      {IS_DEMO ? (
43
+        <video
44
+          controls
45
+          autoPlay
46
+          src="https://dz-machinery.oss-cn-nanjing.aliyuncs.com/video/ydpjksfw7bhh.mp4"
47
+          style={{ width: `${width}px`, height: `${height}px` }}
48
+        ></video>
49
+      ) : (
50
+        <Hatc width={width} ref={hatcRef} height={height} previewParams={preview} />
51
+      )}
41 52
     </Modal>
42 53
   );
43 54
 };

+ 7
- 0
src/components/GeoMap/global.less Wyświetl plik

@@ -133,6 +133,13 @@
133 133
   bottom: 8vh;
134 134
 }
135 135
 
136
+.map-video-btn {
137
+  position: absolute;
138
+  right: 0;
139
+  left: 0;
140
+  margin: auto;
141
+}
142
+
136 143
 //底部
137 144
 .map-button-border {
138 145
   font-weight: 800;