Prechádzať zdrojové kódy

小程序部分点位修改

elis 1 rok pred
rodič
commit
30e38ef4bf

+ 1 - 1
nnzwminiapp/pages/map-shq/map-shq.js

@@ -21,7 +21,7 @@ Page({
   data: {
     imgUrl: imgUrl,
     newImgUrl: newImgUrl,
-    custGap: 100000,
+    custGap: 1000,
     latitude: 0,
     longitude: 0,
     scrollId: 0,

+ 34 - 10
nnzwminiapp/pages/map/map.js

@@ -69,7 +69,7 @@ Page({
         markers: [INIT_MARKER],
         latitude: '',
 		longitude: '',
-		custGap: 100000,
+		custGap: 1000,
         type: [
             [{ "id": 1, "name": "政务公开", "image":  "fgk.png","dictType":"" }, { "id": 2, "name": "政务服务", "image":  "fzwfw.png" ,"dictType":""}, { "id": 3, "name": "党群服务", "image":  "fdqfwzx.png" ,"dictType":""},{ "id": 4, "name": "教育资源", "image":  "fjy.png","dictType":"" }],
             [{ "id": 1, "name": "医疗卫生", "image":  "fyl.png" ,"dictType":""}, { "id": 2, "name": "户籍管理", "image":  "fhjgl.png" ,"dictType":""}, { "id": 3, "name": "交通服务", "image":  "fjtfw.png" ,"dictType":""},{ "id": 4, "name": "社会保障", "image":  "fshbz.png","dictType":"" }],
@@ -129,7 +129,7 @@ Page({
         this.setData({
             height: wx.getSystemInfoSync().windowHeight
         })
-        console.log(options);
+        // console.log(options);
         if (options.se) {
             this.setData({
                 loadValue: options.se,
@@ -144,13 +144,19 @@ Page({
         // searchVal
     },
     onReady:function () {
-        
+        // debugger
         const that = this
         this.loadItem();
         getMapDataAll().then((res) => {
-          let arr = []
-          Array.prototype.push.apply(arr, res.data.xzfwzxs);
-          Array.prototype.push.apply(arr, res.data.ggfwzxs);
+		  let arr = []
+		  console.log(res.data);
+		for (const key in res.data) {
+			// console.log(res.data[key]);
+			Array.prototype.push.apply(arr,res.data[key])
+		}
+		
+        //   Array.prototype.push.apply(arr, res.data.xzfwzxs);
+        //   Array.prototype.push.apply(arr, res.data.ggfwzxs);
           for (let j = 0; j < arr.length; j++) {
             if(arr[j].tel && !(arr[j].tel instanceof Array)){
               arr[j].tel = arr[j].tel.split(";")
@@ -196,7 +202,7 @@ Page({
                         width: '30px',
                         height: '30px',
                         rotate: 0,
-                        alpha: 1
+						alpha: 1
                     }]
                 });
             }
@@ -1072,7 +1078,16 @@ function initMapDataAll(that, lat, lng) {
           width: '30px',
           height: '30px',
           rotate: 0,
-          alpha: 1
+		  alpha: 1,
+		  label: {
+			anchorX: 10,
+			anchorY: -22,
+			bgColor: '#fff',
+			borderRadius: 5,
+			padding: 5,
+			content: "我的位置",
+			color: '#333'
+		  }
       })
       console.log(addrArr)
         that.setData({
@@ -1085,7 +1100,7 @@ function initMapDataAll(that, lat, lng) {
       }
       const address = arr[index]
       index++
-      const jl = getDistances(lat, lng, address.latitude, address.longitude)
+	  const jl = getDistances(lat, lng, address.latitude, address.longitude)
           console.log(jl)
           if (jl.m <= that.data.custGap) {
             marksView.push(address)
@@ -1097,7 +1112,16 @@ function initMapDataAll(that, lat, lng) {
               width: '34px',
               height: '34px',
               rotate: 0,
-              alpha: 1
+			  alpha: 1,
+			  label: {
+				anchorX: 10,
+				anchorY: -22,
+				bgColor: '#fff',
+				borderRadius: 5,
+				padding: 5,
+				content: address.dep,
+				color: '#333'
+			  }
             })
           }
       // BMap.geocoder({

+ 1 - 1
nnzwminiapp/pages/map/map.wxml

@@ -35,7 +35,7 @@
     <view class="icon-shq" style="background-image: url({{newImgUrl}}district/img/icon-shq.jpg);" bindtap="openShq"></view>
     <view wx:if="{{showTraffic}}">
       <view class="right-search" style="position: absolute; left: 22rpx; top: 700rpx; width: 708rpx; height: 370rpx; display: block; box-sizing: border-box; padding-top: 10rpx;">
-        <view style="margin-left: 15rpx;padding: 10rpx;color: #5f5d5d;" bindtap="aroundEvent">附近1公里共有<text style="color: red;">{{marksNum}}</text>个办事地点</view>
+        <view style="margin-left: 15rpx;padding: 10rpx;color: #5f5d5d;" bindtap="aroundEvent">附近1公里共有<text style="color: red;">{{marksNum}}</text>个地点</view>
         <t-tabs defaultValue="{{trafficType}}" bindchange="onchange" theme="tag" style="height: 292rpx; ">
           <t-tab-panel label="公交" value="0" style=" height: 180rpx; ">
             <include src="./quert"></include>