Browse Source

ws-地图点击事件

ws 1 year ago
parent
commit
ae73d02b35

+ 5 - 5
nnzwminiapp/pages/publics/topics/topics.js

@@ -15,11 +15,11 @@ Page({
 				title: '政策问答库',
 				url: '/pages/web/web?url=https://data.cqna.gov.cn/zdjc/symobile.html'
 			},
-			{
-				pic: 'https://www.cqna.gov.cn/zwgk_254/zwzt/362900/images/P020220802602397615813.png',
-				title: '疫情防控',
-				url: '/pages/web/web?url=https://www.cqna.gov.cn/zwgk_254/zfxxgkml/yqfk'
-			},
+			// {
+			// 	pic: 'https://www.cqna.gov.cn/zwgk_254/zwzt/362900/images/P020220802602397615813.png',
+			// 	title: '疫情防控',
+			// 	url: '/pages/web/web?url=https://www.cqna.gov.cn/zwgk_254/zfxxgkml/yqfk'
+			// },
 			{
 				pic: 'https://www.cqna.gov.cn/zwgk_254/zwzt/348203/images/P020220520419381023376.png',
 				title: '政策文件与政策解读',

+ 14 - 10
nnzwminiapp/pagesPublic/pages/tdcr/details/detail.js

@@ -178,17 +178,21 @@ Page({
     })
   },
   mapEvent(e) {
-    const arr = this.data.list[this.data.dataIndex].polygon.map(item => {
-      return [
-        item.longitude,
-        item.latitude
-      ]
-    })
-    if (this.pointInPolygon([e.detail.longitude, e.detail.latitude], arr)) {
-      wx.navigateTo({
-        url: '/pages/map2/map?dataIndex=' + this.data.dataIndex + '&type=tdcr',
+    this.data.list[this.data.dataIndex].polygon.forEach(item => {
+      const arr = item.map(p => {
+        return [
+          p.longitude,
+          p.latitude
+        ]
       })
-    }
+      if (this.pointInPolygon([e.detail.longitude, e.detail.latitude], arr)) {
+        wx.navigateTo({
+          url: '/pages/map2/map?dataIndex=' + this.data.dataIndex + '&type=tdcr',
+        })
+        return
+      }
+    })
+   
   },
   pointInPolygon(point, polygon) {
     let x = point[0], y = point[1];