Yansen 2 years ago
parent
commit
42e663b86d
4 changed files with 46 additions and 23 deletions
  1. BIN
      public/map/right.png
  2. 39
    21
      src/components/CustMap.vue
  3. 6
    1
      src/components/PopUp.vue
  4. 1
    1
      src/utils/resources.js

BIN
public/map/right.png View File


+ 39
- 21
src/components/CustMap.vue View File

@@ -24,6 +24,7 @@
24 24
     <img class="map-border border-left" :src="borders[2]" alt="" :style="borderLRStyle">
25 25
     <img class="map-border border-right" :src="borders[3]" alt="" :style="borderLRStyle">
26 26
     <ZoomOut class="map-zoom-gesture" v-if="showZoomGesture" />
27
+    <div class="slide-tip">点击此处 上下滑动</div>
27 28
   </div>
28 29
 </template>
29 30
 
@@ -80,7 +81,6 @@
80 81
   });
81 82
 
82 83
   document.body.addEventListener('click', () => {
83
-    showZoomGesture.value = false;
84 84
     if (playing.value) {
85 85
       audioRef.value.toggle();
86 86
     }
@@ -112,7 +112,6 @@
112 112
   }
113 113
 
114 114
   const onMapClick = (e) => {
115
-    showZoomGesture.value = false
116 115
     const { lnglat } = e;
117 116
 
118 117
     // 计算点击位置, 与各景点距离
@@ -148,6 +147,7 @@
148 147
       center,
149 148
       zooms,
150 149
       zoom: zooms[0],
150
+      // dragEnable: false, // 禁止拖动
151 151
     });
152 152
 
153 153
     // 获取左上角经纬度
@@ -200,27 +200,31 @@
200 200
       console.log('--------->', e)
201 201
       onMapClick(e)
202 202
     })
203
+
204
+    map.on('zoomchange', (e) => {
205
+      console.log('----zoomchange----->', e)
206
+    })
203 207
   }
204 208
 
205
-  // onMounted(() => {
206
-  //   // 当前地图可见的时候展示放大手势
207
-  //   // 2秒后自动关闭
208
-  //   const observer = new IntersectionObserver((entries) => {
209
-  //     if (entries && entries[0]) {
210
-  //       if (entries[0].intersectionRatio >= 0.6) {
211
-  //         showZoomGesture.value = true;
212
-
213
-  //         const t = setTimeout(() => {
214
-  //           clearTimeout(t);
215
-  //           showZoomGesture.value = false;
216
-  //           observer.disconnect();
217
-  //         }, 2000);
218
-  //       }
219
-  //     }
220
-  //   }, { threshold: [0.6] });
221
-
222
-  //   observer.observe(elRef.value);
223
-  // })
209
+  onMounted(() => {
210
+    // 当前地图可见的时候展示放大手势
211
+    // 2秒后自动关闭
212
+    const observer = new IntersectionObserver((entries) => {
213
+      if (entries && entries[0]) {
214
+        if (entries[0].intersectionRatio >= 0.6) {
215
+          showZoomGesture.value = true;
216
+
217
+          const t = setTimeout(() => {
218
+            clearTimeout(t);
219
+            showZoomGesture.value = false;
220
+            observer.disconnect();
221
+          }, 2000);
222
+        }
223
+      }
224
+    }, { threshold: [0.6] });
225
+
226
+    observer.observe(elRef.value);
227
+  })
224 228
 
225 229
 </script>
226 230
 
@@ -337,6 +341,20 @@
337 341
     left: calc(50% - 25px);
338 342
     top: calc(50% - 50px);
339 343
   }
344
+
345
+  .slide-tip {
346
+    left: auto;
347
+    top: 160px;
348
+    right: 2px;
349
+    width: 1.6em;
350
+    height: 300px;
351
+    color: #576147;
352
+    letter-spacing: 2px;
353
+    font-weight: bold;
354
+    writing-mode: vertical-lr;
355
+    z-index: 200;
356
+    cursor: pointer;
357
+  }
340 358
 }
341 359
 
342 360
 </style>

+ 6
- 1
src/components/PopUp.vue View File

@@ -68,9 +68,14 @@ watch(() => props.show, (val) => {
68 68
       line-height: 1.6em;
69 69
       padding: 0 20px;
70 70
       font-size: 20px;
71
-      text-indent: 42px;
72 71
       margin-top: 30px;
73 72
       color: #fff;
73
+      
74
+      // text-indent: 2em;
75
+      line-break: anywhere;
76
+      word-break: keep-all;
77
+      word-wrap: break-word;
78
+      overflow-wrap: anywhere;
74 79
     }
75 80
   }
76 81
   .warp::-webkit-scrollbar {

+ 1
- 1
src/utils/resources.js View File

@@ -233,7 +233,7 @@ export const resources = [
233 233
     desc: `长干里位于南京市秦淮区内秦淮河以南至雨花台以北,是中国古代著名的地名,是江南佛教圣地,素有“佛陀里”之美誉。长干里地势高亢,雨花台陈于前,秦淮河卫其后,大江护其西,又是秦淮河的入江通道,战略地位十分重要。南京城市的雏形——越城就位于此。范蠡之所以选择在此筑越城,就是看到这块地方物产丰富,交通便利,商业繁荣,人中密集,同时,这里有山水卫护,攻守皆宜。秦、汉、六朝时期,长干里是南京最繁华的地方,是著名的商业区和货物集散地。`,
234 234
   },
235 235
   {
236
-    name: '报恩寺',
236
+    name: '报恩寺遗址景区',
237 237
     image: './images/17.jpg',
238 238
     thumb1: './infos/17大报恩寺.jpg',
239 239
     thumb2: './map/大报恩寺.jpg',