diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/map/map.js b/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/map/map.js deleted file mode 100644 index 8e90359..0000000 --- a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/map/map.js +++ /dev/null @@ -1,77 +0,0 @@ -// map.js -let schoolData = require('../../resources/gis-school') -Page({ - data: { - centerX:113.3245211, - centerY:23.10229, - markers: [], - controls: [{ - id: 1, - iconPath: '/image/location-control.png', - position: { - left: 0, - top:10, - width: 40, - height: 40 - }, - clickable: true - }] - }, - onReady: function (e) { - // 使用 wx.createMapContext 获取 map 上下文 - this.mapCtx = wx.createMapContext('myMap') - }, - onLoad: function () { - console.log('地图定位!') - let that = this - wx.getLocation({ - type: 'gcj02', //返回可以用于wx.openLocation的经纬度 - success:(res)=>{ - console.log(res) - let latitude = res.latitude; - let longitude = res.longitude; - let marker=this.createMarker(res); - this.setData({ - centerX:longitude, - centerY:latitude, - markers:this.getSchoolMarkers() - }) - } - }); - }, - regionchange(e) { - console.log(e.type) - }, - markertap(e) { - console.log(e) - }, - controltap(e) { - console.log(e.controlId) - this.moveToLocation() - }, - getSchoolMarkers(){ - let markers=[]; - for(let item of schoolData){ - let marker=this.createMarker(item); - markers.push(marker) - } - return markers; - }, - moveToLocation: function () { - this.mapCtx.moveToLocation() - }, - createMarker(point){ - let latitude = point.latitude; - let longitude = point.longitude; - let marker= { - iconPath: "/image/location.png", - id:point.id || 0, - name:point.name || '', - latitude: latitude, - longitude: longitude, - width: 25, - height: 48 - }; - return marker; - } -}) \ No newline at end of file diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/map/map.json b/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/map/map.json deleted file mode 100644 index 08652e2..0000000 --- a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/map/map.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "navigationBarTitleText": "地图标注" -} \ No newline at end of file diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/map/map.wxml b/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/map/map.wxml deleted file mode 100644 index 1db24af..0000000 --- a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/map/map.wxml +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/map/map.wxss b/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/map/map.wxss deleted file mode 100644 index e69de29..0000000 diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/.eslintrc.js b/src/map/.eslintrc.js similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/.eslintrc.js rename to src/map/.eslintrc.js diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/README.md b/src/map/README.md similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/README.md rename to src/map/README.md diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/cloud/useroption/config.json b/src/map/cloud/useroption/config.json similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/cloud/useroption/config.json rename to src/map/cloud/useroption/config.json diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/cloud/useroption/index.js b/src/map/cloud/useroption/index.js similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/cloud/useroption/index.js rename to src/map/cloud/useroption/index.js diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/cloud/useroption/package.json b/src/map/cloud/useroption/package.json similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/cloud/useroption/package.json rename to src/map/cloud/useroption/package.json diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/app.js b/src/map/miniprogram/app.js similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/app.js rename to src/map/miniprogram/app.js diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/app.json b/src/map/miniprogram/app.json similarity index 82% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/app.json rename to src/map/miniprogram/app.json index 7e4763b..cacc8d2 100644 --- a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/app.json +++ b/src/map/miniprogram/app.json @@ -25,7 +25,10 @@ "pages/index_hjf/index_hjf", "pages/index1/index1", "pages/adlogin/adlogin", - "pages/login_1/login_1" + "pages/login_1/login_1", + "pages/getWeather/getWeather", + "pages/map/map" + ], "window": { "backgroundColor": "#F6F6F6", @@ -40,15 +43,10 @@ "borderStyle": "black", "backgroundColor": "#ffffff", "list": [{ - "pagePath": "pages/location/location", + "pagePath": "pages/map/map", "iconPath": "image/wechat.png", "selectedIconPath": "image/locate.png", "text": "导航" - },{ - "pagePath": "pages/Find directions/Find directions", - "iconPath": "image/map.png", - "selectedIconPath": "image/map_active.png", - "text": "查询路线" },{ "pagePath": "pages/text/text", "iconPath": "image/locate.png", @@ -58,6 +56,14 @@ ] }, "debug": true, + "style": "v2", "sitemapLocation": "sitemap.json", - "style": "v2" + "requiredPrivateInfos":[ + "getLocation" + ], + "permission": { + "scope.userLocation": { + "desc": "你的位置信息将用于小程序位置接口的效果展示" + } + } } \ No newline at end of file diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/app.wxss b/src/map/miniprogram/app.wxss similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/app.wxss rename to src/map/miniprogram/app.wxss diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/components/cloudTipModal/index.js b/src/map/miniprogram/components/cloudTipModal/index.js similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/components/cloudTipModal/index.js rename to src/map/miniprogram/components/cloudTipModal/index.js diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/components/cloudTipModal/index.json b/src/map/miniprogram/components/cloudTipModal/index.json similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/components/cloudTipModal/index.json rename to src/map/miniprogram/components/cloudTipModal/index.json diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/components/cloudTipModal/index.wxml b/src/map/miniprogram/components/cloudTipModal/index.wxml similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/components/cloudTipModal/index.wxml rename to src/map/miniprogram/components/cloudTipModal/index.wxml diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/components/cloudTipModal/index.wxss b/src/map/miniprogram/components/cloudTipModal/index.wxss similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/components/cloudTipModal/index.wxss rename to src/map/miniprogram/components/cloudTipModal/index.wxss diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/envList.js b/src/map/miniprogram/envList.js similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/envList.js rename to src/map/miniprogram/envList.js diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/image/arrowright.png b/src/map/miniprogram/image/arrowright.png similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/image/arrowright.png rename to src/map/miniprogram/image/arrowright.png diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/image/icon64_appwx_logo.png b/src/map/miniprogram/image/icon64_appwx_logo.png similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/image/icon64_appwx_logo.png rename to src/map/miniprogram/image/icon64_appwx_logo.png diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/image/locate.png b/src/map/miniprogram/image/locate.png similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/image/locate.png rename to src/map/miniprogram/image/locate.png diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/image/locateHL.png b/src/map/miniprogram/image/locateHL.png similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/image/locateHL.png rename to src/map/miniprogram/image/locateHL.png diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/image/location-control.png b/src/map/miniprogram/image/location-control.png similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/image/location-control.png rename to src/map/miniprogram/image/location-control.png diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/image/location.png b/src/map/miniprogram/image/location.png similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/image/location.png rename to src/map/miniprogram/image/location.png diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/image/logo.png b/src/map/miniprogram/image/logo.png similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/image/logo.png rename to src/map/miniprogram/image/logo.png diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/image/map.png b/src/map/miniprogram/image/map.png similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/image/map.png rename to src/map/miniprogram/image/map.png diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/image/map_active.png b/src/map/miniprogram/image/map_active.png similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/image/map_active.png rename to src/map/miniprogram/image/map_active.png diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/image/navigator.jpg b/src/map/miniprogram/image/navigator.jpg similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/image/navigator.jpg rename to src/map/miniprogram/image/navigator.jpg diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/image/pause.png b/src/map/miniprogram/image/pause.png similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/image/pause.png rename to src/map/miniprogram/image/pause.png diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/image/play.png b/src/map/miniprogram/image/play.png similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/image/play.png rename to src/map/miniprogram/image/play.png diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/image/plus.png b/src/map/miniprogram/image/plus.png similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/image/plus.png rename to src/map/miniprogram/image/plus.png diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/image/record.png b/src/map/miniprogram/image/record.png similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/image/record.png rename to src/map/miniprogram/image/record.png diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/image/screenshot-marker.png b/src/map/miniprogram/image/screenshot-marker.png similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/image/screenshot-marker.png rename to src/map/miniprogram/image/screenshot-marker.png diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/image/screenshot1.png b/src/map/miniprogram/image/screenshot1.png similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/image/screenshot1.png rename to src/map/miniprogram/image/screenshot1.png diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/image/screenshot2.png b/src/map/miniprogram/image/screenshot2.png similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/image/screenshot2.png rename to src/map/miniprogram/image/screenshot2.png diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/image/stop.png b/src/map/miniprogram/image/stop.png similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/image/stop.png rename to src/map/miniprogram/image/stop.png diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/image/trash.png b/src/map/miniprogram/image/trash.png similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/image/trash.png rename to src/map/miniprogram/image/trash.png diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/image/wechat.png b/src/map/miniprogram/image/wechat.png similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/image/wechat.png rename to src/map/miniprogram/image/wechat.png diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/image/wechatHL.png b/src/map/miniprogram/image/wechatHL.png similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/image/wechatHL.png rename to src/map/miniprogram/image/wechatHL.png diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/images/arrow.svg b/src/map/miniprogram/images/arrow.svg similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/images/arrow.svg rename to src/map/miniprogram/images/arrow.svg diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/images/database.png b/src/map/miniprogram/images/database.png similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/images/database.png rename to src/map/miniprogram/images/database.png diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/images/deploy_step1.png b/src/map/miniprogram/images/deploy_step1.png similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/images/deploy_step1.png rename to src/map/miniprogram/images/deploy_step1.png diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/images/deploy_step2.png b/src/map/miniprogram/images/deploy_step2.png similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/images/deploy_step2.png rename to src/map/miniprogram/images/deploy_step2.png diff --git a/src/map/miniprogram/images/destination.jpeg b/src/map/miniprogram/images/destination.jpeg new file mode 100644 index 0000000..b8aeb1f Binary files /dev/null and b/src/map/miniprogram/images/destination.jpeg differ diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/images/dh.jpg b/src/map/miniprogram/images/dh.jpg similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/images/dh.jpg rename to src/map/miniprogram/images/dh.jpg diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/images/gps.jpg b/src/map/miniprogram/images/gps.jpg similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/images/gps.jpg rename to src/map/miniprogram/images/gps.jpg diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/images/hxLocation.png b/src/map/miniprogram/images/hxLocation.png similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/images/hxLocation.png rename to src/map/miniprogram/images/hxLocation.png diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/images/logo1.png b/src/map/miniprogram/images/logo1.png similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/images/logo1.png rename to src/map/miniprogram/images/logo1.png diff --git a/src/map/miniprogram/images/src.jpeg b/src/map/miniprogram/images/src.jpeg new file mode 100644 index 0000000..bce35dd Binary files /dev/null and b/src/map/miniprogram/images/src.jpeg differ diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/images/sxaubg.jpg b/src/map/miniprogram/images/sxaubg.jpg similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/images/sxaubg.jpg rename to src/map/miniprogram/images/sxaubg.jpg diff --git a/src/map/miniprogram/images/tag.png b/src/map/miniprogram/images/tag.png new file mode 100644 index 0000000..308f101 Binary files /dev/null and b/src/map/miniprogram/images/tag.png differ diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/images/xm.jpg b/src/map/miniprogram/images/xm.jpg similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/images/xm.jpg rename to src/map/miniprogram/images/xm.jpg diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/Find directions/Find directions.js b/src/map/miniprogram/pages/Find directions/Find directions.js similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/Find directions/Find directions.js rename to src/map/miniprogram/pages/Find directions/Find directions.js diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/Find directions/Find directions.json b/src/map/miniprogram/pages/Find directions/Find directions.json similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/Find directions/Find directions.json rename to src/map/miniprogram/pages/Find directions/Find directions.json diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/Find directions/Find directions.wxml b/src/map/miniprogram/pages/Find directions/Find directions.wxml similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/Find directions/Find directions.wxml rename to src/map/miniprogram/pages/Find directions/Find directions.wxml diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/Find directions/Find directions.wxss b/src/map/miniprogram/pages/Find directions/Find directions.wxss similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/Find directions/Find directions.wxss rename to src/map/miniprogram/pages/Find directions/Find directions.wxss diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/ManageAccount/ManageAccount.js b/src/map/miniprogram/pages/ManageAccount/ManageAccount.js similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/ManageAccount/ManageAccount.js rename to src/map/miniprogram/pages/ManageAccount/ManageAccount.js diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/ManageAccount/ManageAccount.json b/src/map/miniprogram/pages/ManageAccount/ManageAccount.json similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/ManageAccount/ManageAccount.json rename to src/map/miniprogram/pages/ManageAccount/ManageAccount.json diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/ManageAccount/ManageAccount.wxml b/src/map/miniprogram/pages/ManageAccount/ManageAccount.wxml similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/ManageAccount/ManageAccount.wxml rename to src/map/miniprogram/pages/ManageAccount/ManageAccount.wxml diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/ManageAccount/ManageAccount.wxss b/src/map/miniprogram/pages/ManageAccount/ManageAccount.wxss similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/ManageAccount/ManageAccount.wxss rename to src/map/miniprogram/pages/ManageAccount/ManageAccount.wxss diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/ModifyInformation/ModifyInformation.js b/src/map/miniprogram/pages/ModifyInformation/ModifyInformation.js similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/ModifyInformation/ModifyInformation.js rename to src/map/miniprogram/pages/ModifyInformation/ModifyInformation.js diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/ModifyInformation/ModifyInformation.json b/src/map/miniprogram/pages/ModifyInformation/ModifyInformation.json similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/ModifyInformation/ModifyInformation.json rename to src/map/miniprogram/pages/ModifyInformation/ModifyInformation.json diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/ModifyInformation/ModifyInformation.wxml b/src/map/miniprogram/pages/ModifyInformation/ModifyInformation.wxml similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/ModifyInformation/ModifyInformation.wxml rename to src/map/miniprogram/pages/ModifyInformation/ModifyInformation.wxml diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/ModifyInformation/ModifyInformation.wxss b/src/map/miniprogram/pages/ModifyInformation/ModifyInformation.wxss similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/ModifyInformation/ModifyInformation.wxss rename to src/map/miniprogram/pages/ModifyInformation/ModifyInformation.wxss diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/ModifyMap/ModifyMap.js b/src/map/miniprogram/pages/ModifyMap/ModifyMap.js similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/ModifyMap/ModifyMap.js rename to src/map/miniprogram/pages/ModifyMap/ModifyMap.js diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/ModifyMap/ModifyMap.json b/src/map/miniprogram/pages/ModifyMap/ModifyMap.json similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/ModifyMap/ModifyMap.json rename to src/map/miniprogram/pages/ModifyMap/ModifyMap.json diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/ModifyMap/ModifyMap.wxml b/src/map/miniprogram/pages/ModifyMap/ModifyMap.wxml similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/ModifyMap/ModifyMap.wxml rename to src/map/miniprogram/pages/ModifyMap/ModifyMap.wxml diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/ModifyMap/ModifyMap.wxss b/src/map/miniprogram/pages/ModifyMap/ModifyMap.wxss similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/ModifyMap/ModifyMap.wxss rename to src/map/miniprogram/pages/ModifyMap/ModifyMap.wxss diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/adduser/index.js b/src/map/miniprogram/pages/adduser/index.js similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/adduser/index.js rename to src/map/miniprogram/pages/adduser/index.js diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/adduser/index.json b/src/map/miniprogram/pages/adduser/index.json similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/adduser/index.json rename to src/map/miniprogram/pages/adduser/index.json diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/adduser/index.wxml b/src/map/miniprogram/pages/adduser/index.wxml similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/adduser/index.wxml rename to src/map/miniprogram/pages/adduser/index.wxml diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/adduser/index.wxss b/src/map/miniprogram/pages/adduser/index.wxss similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/adduser/index.wxss rename to src/map/miniprogram/pages/adduser/index.wxss diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/addusers/index.js b/src/map/miniprogram/pages/addusers/index.js similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/addusers/index.js rename to src/map/miniprogram/pages/addusers/index.js diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/addusers/index.json b/src/map/miniprogram/pages/addusers/index.json similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/addusers/index.json rename to src/map/miniprogram/pages/addusers/index.json diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/addusers/index.wxml b/src/map/miniprogram/pages/addusers/index.wxml similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/addusers/index.wxml rename to src/map/miniprogram/pages/addusers/index.wxml diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/addusers/index.wxss b/src/map/miniprogram/pages/addusers/index.wxss similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/addusers/index.wxss rename to src/map/miniprogram/pages/addusers/index.wxss diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/adduserssuccess/index.js b/src/map/miniprogram/pages/adduserssuccess/index.js similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/adduserssuccess/index.js rename to src/map/miniprogram/pages/adduserssuccess/index.js diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/adduserssuccess/index.json b/src/map/miniprogram/pages/adduserssuccess/index.json similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/adduserssuccess/index.json rename to src/map/miniprogram/pages/adduserssuccess/index.json diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/adduserssuccess/index.wxml b/src/map/miniprogram/pages/adduserssuccess/index.wxml similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/adduserssuccess/index.wxml rename to src/map/miniprogram/pages/adduserssuccess/index.wxml diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/adduserssuccess/index.wxss b/src/map/miniprogram/pages/adduserssuccess/index.wxss similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/adduserssuccess/index.wxss rename to src/map/miniprogram/pages/adduserssuccess/index.wxss diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/adlogin/adlogin.js b/src/map/miniprogram/pages/adlogin/adlogin.js similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/adlogin/adlogin.js rename to src/map/miniprogram/pages/adlogin/adlogin.js diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/adlogin/adlogin.json b/src/map/miniprogram/pages/adlogin/adlogin.json similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/adlogin/adlogin.json rename to src/map/miniprogram/pages/adlogin/adlogin.json diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/adlogin/adlogin.wxml b/src/map/miniprogram/pages/adlogin/adlogin.wxml similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/adlogin/adlogin.wxml rename to src/map/miniprogram/pages/adlogin/adlogin.wxml diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/adlogin/adlogin.wxss b/src/map/miniprogram/pages/adlogin/adlogin.wxss similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/adlogin/adlogin.wxss rename to src/map/miniprogram/pages/adlogin/adlogin.wxss diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/delete/index.js b/src/map/miniprogram/pages/delete/index.js similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/delete/index.js rename to src/map/miniprogram/pages/delete/index.js diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/delete/index.json b/src/map/miniprogram/pages/delete/index.json similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/delete/index.json rename to src/map/miniprogram/pages/delete/index.json diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/delete/index.wxml b/src/map/miniprogram/pages/delete/index.wxml similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/delete/index.wxml rename to src/map/miniprogram/pages/delete/index.wxml diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/delete/index.wxss b/src/map/miniprogram/pages/delete/index.wxss similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/delete/index.wxss rename to src/map/miniprogram/pages/delete/index.wxss diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/deleteuser/index.js b/src/map/miniprogram/pages/deleteuser/index.js similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/deleteuser/index.js rename to src/map/miniprogram/pages/deleteuser/index.js diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/deleteuser/index.json b/src/map/miniprogram/pages/deleteuser/index.json similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/deleteuser/index.json rename to src/map/miniprogram/pages/deleteuser/index.json diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/deleteuser/index.wxml b/src/map/miniprogram/pages/deleteuser/index.wxml similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/deleteuser/index.wxml rename to src/map/miniprogram/pages/deleteuser/index.wxml diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/deleteuser/index.wxss b/src/map/miniprogram/pages/deleteuser/index.wxss similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/deleteuser/index.wxss rename to src/map/miniprogram/pages/deleteuser/index.wxss diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/deleteusers/index.js b/src/map/miniprogram/pages/deleteusers/index.js similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/deleteusers/index.js rename to src/map/miniprogram/pages/deleteusers/index.js diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/deleteusers/index.json b/src/map/miniprogram/pages/deleteusers/index.json similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/deleteusers/index.json rename to src/map/miniprogram/pages/deleteusers/index.json diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/deleteusers/index.wxml b/src/map/miniprogram/pages/deleteusers/index.wxml similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/deleteusers/index.wxml rename to src/map/miniprogram/pages/deleteusers/index.wxml diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/deleteusers/index.wxss b/src/map/miniprogram/pages/deleteusers/index.wxss similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/deleteusers/index.wxss rename to src/map/miniprogram/pages/deleteusers/index.wxss diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/deleteuserssuccess/index.js b/src/map/miniprogram/pages/deleteuserssuccess/index.js similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/deleteuserssuccess/index.js rename to src/map/miniprogram/pages/deleteuserssuccess/index.js diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/deleteuserssuccess/index.json b/src/map/miniprogram/pages/deleteuserssuccess/index.json similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/deleteuserssuccess/index.json rename to src/map/miniprogram/pages/deleteuserssuccess/index.json diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/deleteuserssuccess/index.wxml b/src/map/miniprogram/pages/deleteuserssuccess/index.wxml similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/deleteuserssuccess/index.wxml rename to src/map/miniprogram/pages/deleteuserssuccess/index.wxml diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/deleteuserssuccess/index.wxss b/src/map/miniprogram/pages/deleteuserssuccess/index.wxss similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/deleteuserssuccess/index.wxss rename to src/map/miniprogram/pages/deleteuserssuccess/index.wxss diff --git a/src/map/miniprogram/pages/getWeather/getWeather.js b/src/map/miniprogram/pages/getWeather/getWeather.js new file mode 100644 index 0000000..25b720e --- /dev/null +++ b/src/map/miniprogram/pages/getWeather/getWeather.js @@ -0,0 +1,36 @@ +var amapFile = require('../../utils/amap-wx.js'); +var app = getApp(); + +Page({ + data: { + city:"天津", + weather:"晴", + temperature:"10", + windpower:"18级", + winddirection:"南", + humidity:"5", + }, + onLoad: function(options){ + var that = this; + var myAmapFun = new amapFile.AMapWX({key:'78a99442f6e5cad3bfb832e33bdcf629'}); + myAmapFun.getWeather({ + success: function(res){ + //成功回调 + console.log("调取天气接口成功", res) + // 一定要在接口里进行赋值,否则接口数据还未返回,页面就已经将数据取走进行显示 + that.setData({ + city: res.city.data, + weather: res.weather.data, + temperature: res.temperature.data, + windpower: res.windpower.data, + winddirection: res.winddirection.data, + humidity: res.humidity.data + }) + }, + fail: function(info){ + //失败回调 + console.log(info) + } + }) + } +}) \ No newline at end of file diff --git a/src/map/miniprogram/pages/getWeather/getWeather.json b/src/map/miniprogram/pages/getWeather/getWeather.json new file mode 100644 index 0000000..f9e31e9 --- /dev/null +++ b/src/map/miniprogram/pages/getWeather/getWeather.json @@ -0,0 +1,4 @@ +{ + "navigationBarTitleText": "天气", + "usingComponents": {} +} \ No newline at end of file diff --git a/src/map/miniprogram/pages/getWeather/getWeather.wxml b/src/map/miniprogram/pages/getWeather/getWeather.wxml new file mode 100644 index 0000000..70176bf --- /dev/null +++ b/src/map/miniprogram/pages/getWeather/getWeather.wxml @@ -0,0 +1,10 @@ + + + + 城市:{{city}} + 天气:{{weather}} + 温度:{{temperature}} + 风力:{{windpower}} + 风向:{{winddirection}} + 湿度:{{humidity}} + \ No newline at end of file diff --git a/src/map/miniprogram/pages/getWeather/getWeather.wxss b/src/map/miniprogram/pages/getWeather/getWeather.wxss new file mode 100644 index 0000000..693eaa5 --- /dev/null +++ b/src/map/miniprogram/pages/getWeather/getWeather.wxss @@ -0,0 +1,14 @@ +/* pages/getWeather/getWeather.wxss */ + +.container{ + position: absolute; + top: 0; + bottom: 0; + left: 0; + right: 0; + background: #4D8AD7; + color: #fff; + font-size: 18px; + padding-top: 200rpx; + padding-left: 150rpx; +} \ No newline at end of file diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/home/home.js b/src/map/miniprogram/pages/home/home.js similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/home/home.js rename to src/map/miniprogram/pages/home/home.js diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/home/home.json b/src/map/miniprogram/pages/home/home.json similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/home/home.json rename to src/map/miniprogram/pages/home/home.json diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/home/home.wxml b/src/map/miniprogram/pages/home/home.wxml similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/home/home.wxml rename to src/map/miniprogram/pages/home/home.wxml diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/home/home.wxss b/src/map/miniprogram/pages/home/home.wxss similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/home/home.wxss rename to src/map/miniprogram/pages/home/home.wxss diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/index/index.js b/src/map/miniprogram/pages/index/index.js similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/index/index.js rename to src/map/miniprogram/pages/index/index.js diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/index/index.json b/src/map/miniprogram/pages/index/index.json similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/index/index.json rename to src/map/miniprogram/pages/index/index.json diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/index/index.wxml b/src/map/miniprogram/pages/index/index.wxml similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/index/index.wxml rename to src/map/miniprogram/pages/index/index.wxml diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/index/index.wxss b/src/map/miniprogram/pages/index/index.wxss similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/index/index.wxss rename to src/map/miniprogram/pages/index/index.wxss diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/index1/index1.js b/src/map/miniprogram/pages/index1/index1.js similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/index1/index1.js rename to src/map/miniprogram/pages/index1/index1.js diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/index1/index1.json b/src/map/miniprogram/pages/index1/index1.json similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/index1/index1.json rename to src/map/miniprogram/pages/index1/index1.json diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/index1/index1.wxml b/src/map/miniprogram/pages/index1/index1.wxml similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/index1/index1.wxml rename to src/map/miniprogram/pages/index1/index1.wxml diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/index1/index1.wxss b/src/map/miniprogram/pages/index1/index1.wxss similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/index1/index1.wxss rename to src/map/miniprogram/pages/index1/index1.wxss diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/index_hjf/index_hjf.js b/src/map/miniprogram/pages/index_hjf/index_hjf.js similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/index_hjf/index_hjf.js rename to src/map/miniprogram/pages/index_hjf/index_hjf.js diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/index_hjf/index_hjf.json b/src/map/miniprogram/pages/index_hjf/index_hjf.json similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/index_hjf/index_hjf.json rename to src/map/miniprogram/pages/index_hjf/index_hjf.json diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/index_hjf/index_hjf.wxml b/src/map/miniprogram/pages/index_hjf/index_hjf.wxml similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/index_hjf/index_hjf.wxml rename to src/map/miniprogram/pages/index_hjf/index_hjf.wxml diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/index_hjf/index_hjf.wxss b/src/map/miniprogram/pages/index_hjf/index_hjf.wxss similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/index_hjf/index_hjf.wxss rename to src/map/miniprogram/pages/index_hjf/index_hjf.wxss diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/location/location.js b/src/map/miniprogram/pages/location/location.js similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/location/location.js rename to src/map/miniprogram/pages/location/location.js diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/location/location.json b/src/map/miniprogram/pages/location/location.json similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/location/location.json rename to src/map/miniprogram/pages/location/location.json diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/location/location.wxml b/src/map/miniprogram/pages/location/location.wxml similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/location/location.wxml rename to src/map/miniprogram/pages/location/location.wxml diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/location/location.wxss b/src/map/miniprogram/pages/location/location.wxss similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/location/location.wxss rename to src/map/miniprogram/pages/location/location.wxss diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/login/login.js b/src/map/miniprogram/pages/login/login.js similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/login/login.js rename to src/map/miniprogram/pages/login/login.js diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/login/login.json b/src/map/miniprogram/pages/login/login.json similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/login/login.json rename to src/map/miniprogram/pages/login/login.json diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/login/login.wxml b/src/map/miniprogram/pages/login/login.wxml similarity index 61% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/login/login.wxml rename to src/map/miniprogram/pages/login/login.wxml index b8f69d0..5be0fb6 100644 --- a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/login/login.wxml +++ b/src/map/miniprogram/pages/login/login.wxml @@ -1,26 +1,6 @@ - + - @@ -36,4 +16,10 @@ 注册,忘记密码请联系qq:xx +--> + + + + + \ No newline at end of file diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/login/login.wxss b/src/map/miniprogram/pages/login/login.wxss similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/login/login.wxss rename to src/map/miniprogram/pages/login/login.wxss diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/login_1/login_1.js b/src/map/miniprogram/pages/login_1/login_1.js similarity index 97% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/login_1/login_1.js rename to src/map/miniprogram/pages/login_1/login_1.js index e00ec9d..5bcd6b8 100644 --- a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/login_1/login_1.js +++ b/src/map/miniprogram/pages/login_1/login_1.js @@ -68,7 +68,7 @@ Page({ if (mima == user.mima) { console.log('登陆成功') wx.reLaunch({ - url: '../Find directions/Find directions', + url: '../map/map', }) wx.showToast({ title: '登陆成功', diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/login_1/login_1.json b/src/map/miniprogram/pages/login_1/login_1.json similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/login_1/login_1.json rename to src/map/miniprogram/pages/login_1/login_1.json diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/login_1/login_1.wxml b/src/map/miniprogram/pages/login_1/login_1.wxml similarity index 71% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/login_1/login_1.wxml rename to src/map/miniprogram/pages/login_1/login_1.wxml index 6cdf64c..49b7eae 100644 --- a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/login_1/login_1.wxml +++ b/src/map/miniprogram/pages/login_1/login_1.wxml @@ -2,7 +2,7 @@ 输入账号 输入密码 - + diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/login_1/login_1.wxss b/src/map/miniprogram/pages/login_1/login_1.wxss similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/login_1/login_1.wxss rename to src/map/miniprogram/pages/login_1/login_1.wxss diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/logs/logs.js b/src/map/miniprogram/pages/logs/logs.js similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/logs/logs.js rename to src/map/miniprogram/pages/logs/logs.js diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/logs/logs.wxml b/src/map/miniprogram/pages/logs/logs.wxml similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/logs/logs.wxml rename to src/map/miniprogram/pages/logs/logs.wxml diff --git a/src/map/miniprogram/pages/map/map.js b/src/map/miniprogram/pages/map/map.js new file mode 100644 index 0000000..5bafa37 --- /dev/null +++ b/src/map/miniprogram/pages/map/map.js @@ -0,0 +1,946 @@ +var amapFile = require('../../utils/amap-wx.js'); +var QQMapWX = require('../../utils/qqmap-wx-jssdk.js'); +var app = getApp(); + +Page({ + data:{ + location_table:[{ + name:"中国民航大学", + longitude: 117.35002, + latitude: 39.11198, + },{ + name:"中国民航大学北苑南门", + longitude: 117.34731127236174, + latitude: 39.10971874275899, + },{ + name:"中国民航大学北苑西门", + longitude: 117.34878648731993, + latitude: 39.11463444059635, + },{ + name:"中国民航大学北苑北门", + longitude: 117.3517905614166, + latitude: 39.11623685901714, + },{ + name:"中国民航大学北苑操场", + longitude: 117.35193003628538, + latitude: 39.11286133256378, + },{ + name:"中国民航大学北苑体育场", + longitude: 117.35319067452238, + latitude: 39.11298620078748, + },{ + name:"中国民航大学北苑游泳馆", + longitude: 117.35225190136717, + latitude: 39.113331668385676, + },{ + name:"中国民航大学北教一", + longitude: 117.34819103691862, + latitude: 39.111167265141056, + },{ + name:"中国民航大学北教四", + longitude: 117.35005785439299, + latitude: 39.11041387072548, + },{ + name:"中国民航大学北教五", + longitude: 117.348979606369, + latitude: 39.110580367422955, + },{ + name:"中国民航大学北二十一宿舍楼", + longitude: 117.3529251358299, + latitude: 39.111835323611125, + },{ + name:"中国民航大学北一食堂", + longitude: 117.351141466835, + latitude: 39.11229109820452, + },{ + name:"中国民航大学北四食堂", + longitude: 117.34990228627012, + latitude: 39.11351064491374, + },{ + name:"中国民航大学北五食堂", + longitude: 117.35222507927702, + latitude: 39.114359736647195, + },{ + name:"中国民航大学北苑礼堂", + longitude: 117.34922100518034, + latitude: 39.11285300801614, + },{ + name:"中国民航大学文化艺术教育中心", + longitude: 117.35004712555693, + latitude: 39.11260327087659, + },{ + name:"中国民航大学北区实验大楼", + longitude: 117.35049773667143, + latitude: 39.111554365211944, + },{ + name:"中国民航大学南一教学楼", + longitude: 117.35323358986662, + latitude: 39.10597242612648, + },{ + name:"中国民航大学南二教学楼", + longitude: 117.35212851975248, + latitude: 39.10647610917062, + },{ + name:"中国民航大学南三教学楼", + longitude: 117.35269714806364, + latitude: 39.10509825692947, + },{ + name:"中国民航大学南四教学楼", + longitude: 117.35289563153074, + latitude: 39.104253216397744, + },{ + name:"中国民航大学南五教学楼", + longitude: 117.35373784516142, + latitude: 39.10181794441759, + },{ + name:"中国民航大学南三教学楼", + longitude: 117.35483755085752, + latitude: 39.1078414467564, + },{ + name:"中国民航大学南苑北门", + longitude: 117.35484023306654, + latitude: 39.10783936546857, + },{ + name:"中国民航大学南苑体育馆", + longitude: 117.35579778168486, + latitude: 39.10689653606183, + },{ + name:"中国民航大学南苑图书馆", + longitude: 117.35313703034208, + latitude: 39.10710050464082, + },{ + name:"中国民航大学南苑田径场西", + longitude: 117.3557870528488, + latitude: 39.104977537473204, + },{ + name:"中国民航大学南苑田径场东", + longitude: 117.35731054756926, + latitude: 39.105185674336425, + },{ + name:"中国民航大学南苑篮球场", + longitude: 117.3557870528488, + latitude: 39.1060598424514, + },{ + name:"中国民航大学南苑排球场", + longitude: 117.35521842453764, + latitude: 39.10398679758133, + },{ + name:"中国民航大学南苑网球场", + longitude: 117.35609818909452, + latitude: 39.10344563125516, + },{ + name:"中国民航大学南苑羽乒馆", + longitude: 117.35184957001493, + latitude: 39.105310556161044, + },{ + name:"中国民航大学南苑明德馆", + longitude: 117.35486437294767, + latitude: 39.10133087992974, + },{ + name:"中国民航大学南一食堂", + longitude: 117.35289026711271, + latitude: 39.10357884181467, + },{ + name:"中国民航大学南二食堂", + longitude: 117.35157598469542, + latitude: 39.1017846409744, + },{ + name:"中国民航大学南三食堂", + longitude: 117.35169400189207, + latitude: 39.10357467898941, + },{ + name:"中国民航大学南一宿舍楼", + longitude: 117.3534642598419, + latitude: 39.10355386485458, + },{ + name:"中国民航大学南苑菜鸟驿站", + longitude: 117.35596944306181, + latitude: 39.10322500071765, + }], + src: { + longitude: 1.1, + latitude: 1.1, + }, + des: { + longitude: 1.1, + latitude: 1.1, + }, + src_location: "", + des_location: "", + // 初始展示时的经纬度 + longitude: 117.35002, + latitude: 39.11198, + // 初始的缩放比例 + scale:15, + // 统一设置地图 + setting : { + skew: 0, + rotate: 0, + showLocation: false, + showScale: false, + subKey: '', + layerStyle: 1, + enableZoom: true, + enableScroll: true, + enableRotate: false, + showCompass: false, + enable3D: false, + enableOverlooking: false, + enableSatellite: false, + enableTraffic: false, + }, + // 初始化显示地标 + markers:[{ + //id: 1, + longitude: 117.35002, + latitude: 39.11198, + title:"中国民航大学", + iconPath:"../../images/tag.png", + width: 20, + height: 30 + }], + // 显示按钮是否被点击 + type_door: "type", + type_mess: "type", + type_bathroom: "type", + type_print_shop: "type", + type_supermarket: "type", + type_post_station: "type", + type_library: "type", + type_barber_shop: "type", + type_playground: "type", + type_gymnasium: "type", + type_cancel: "type", + distance: '', + cost: '', + polyline: [] + }, + + // 界面出现即执行 + onLoad:function(options){ + this.setData({ + // 仅设置的属性会生效,其它的不受影响 + setting: { + // 展示目前位置 + showLocation: true, + // 右上角指南针 + showCompass: true, + // 左下角比例尺 + showScale: true, + enable3D: true, + //enableTraffic: true + } + }) + }, + + // 输入框获取出发地 + getSrc_location: function(event){ + this.setData({ + src_location: event.detail.value + }) + console.log("获取出发地调用成功", event) + // 对内部使用变量重新赋值,否则无法使用 + let location_table = this.data.location_table + let src_location = this.data.src_location + var that = this; + var qqmapsdk = new QQMapWX({ + key: 'MVJBZ-KOICX-B6W4G-TH5QR-MKW2E-5YBJA' //必需,自己申请 + }) + // geoCoder 根据地址获取经纬度 + qqmapsdk.geocoder({ + address: this.data.src_location, //需要转换为经纬度的地址 + success: function (res) { //返回的数据里面有该地址的经纬度 + console.log("qqmapsdk.geocoder 接口调用成功返回的回调", res) + that.data.src.longitude = res.result.location.lng; + that.data.src.latitude = res.result.location.lat; + }, + fail: function (res) { + console.log("qqmapsdk.geocoder 接口调用失败返回的回调,准备查询本地映射表", res) + // 查询映射表 + // let location = app.globalData.location + // let location = this.data.location + let i + let length = location_table.length + for (i=0; i +出发地: + + +目的地: + + + + + + + + + + + + + + {{distance}} + {{cost}} + 详情 + + + + + + {{index==1? '校门':''}} + {{index==2? '食堂':''}} + {{index==3? '浴室':''}} + {{index==4? '打印店':''}} + {{index==5? '超市':''}} + {{index==6? '菜鸟驿站':''}} + {{index==7? '图书馆':''}} + {{index==8? '理发店':''}} + {{index==9? '操场':''}} + {{index==10? '体育馆':''}} + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/map/miniprogram/pages/map/map.wxss b/src/map/miniprogram/pages/map/map.wxss new file mode 100644 index 0000000..0618695 --- /dev/null +++ b/src/map/miniprogram/pages/map/map.wxss @@ -0,0 +1,137 @@ +/* 显示位置按钮 */ +/* map { + width: 750rpx; +} */ + +/* .show_all { + position: absolute; + right: 100rpx; + bottom: 100rpx; + color: rgb(62, 207, 142); + background-color: rgb(255, 255, 255); + box-shadow: 0 4px 6px rgba(50, 50, 93, .11), 0 1px 3px rgba(0, 0, 0, .08); +} */ + +/* .cover { + color: #fff; + height: 100rpx; + width: 220rpx; + line-height: 100rpx; + font-size: 35rpx; + text-align: center; + position: absolute; + left: 100rpx; + bottom: 100rpx; + border-radius: 50rpx; + text-shadow: 0 1px 3px rgba(36, 180, 126, .4); +} */ + +/* .add_me { + font-size: 30rpx; + color: #fff; + background-color: rgb(62, 207, 142); + width: 450rpx; + padding: 20rpx; + position: absolute; + right: 10rpx; + top: 20rpx; + text-align: center; +} */ + +/* .up { + position: absolute; + right: 150rpx; + top: 5rpx; + border-right: 20rpx solid transparent; + border-left: 20rpx solid transparent; + border-bottom: 20rpx solid rgb(62, 207, 142); +} */ + +/* .getLocation { + position: absolute; + left: 20rpx; + bottom: 250rpx; + text-align: center; + width: 20px; + background-color:rgb(255, 255, 255,0.9); + padding: 13px; + box-shadow: 1px 2px 3px #999999; + border-radius: 100px; +} */ + + /* .list { + position: absolute; + left: 20rpx; + bottom: 360rpx; + text-align: center; + width: 20px; + background-color: rgb(62, 207, 142,0.9); + padding: 13px; + box-shadow: 1px 2px 3px #999999; + border-radius: 100px; +} */ + +.tab-h{ + height: 400rpx; + width: 140rpx; + bottom:250rpx; + right: 12px; + box-sizing: border-box; + overflow: hidden; + line-height: 80rpx; + background: rgba(255, 255, 255, 0.9); + font-size: 16px; + white-space: nowrap; + position: fixed; + z-index: 99; + border-radius: 10px; +} +.chouse_type { + font-size: 32rpx; + color: rgb(62, 207, 142); + text-align: center; +} +.type { + font-size: 32rpx; + + color: rgb(192, 192, 192); + text-align: center; +} +scroll-view ::-webkit-scrollbar { + width: 0; + height: 0; + color: transparent; + display: none; +} + +/***************************************************************/ + +.text_box{ + position:absolute; + height: 90px; + bottom: 0px; + left: 0px; + right: 0px; +} +.text_box .text{ + margin: 15px; +} +.detail_button{ + position:absolute; + bottom: 30px; + right: 10px; + padding: 3px 5px; + color: #fff; + background: #0091ff; + width:50px; + text-align:center; + border-radius:5px; +} + +.weather_button{ + bottom:150rpx; + right: 12px; + font-size: 16px; + position: fixed; +} + diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/me/me.js b/src/map/miniprogram/pages/me/me.js similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/me/me.js rename to src/map/miniprogram/pages/me/me.js diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/me/me.json b/src/map/miniprogram/pages/me/me.json similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/me/me.json rename to src/map/miniprogram/pages/me/me.json diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/me/me.wxml b/src/map/miniprogram/pages/me/me.wxml similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/me/me.wxml rename to src/map/miniprogram/pages/me/me.wxml diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/me/me.wxss b/src/map/miniprogram/pages/me/me.wxss similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/me/me.wxss rename to src/map/miniprogram/pages/me/me.wxss diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/me1/me1.js b/src/map/miniprogram/pages/me1/me1.js similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/me1/me1.js rename to src/map/miniprogram/pages/me1/me1.js diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/me1/me1.json b/src/map/miniprogram/pages/me1/me1.json similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/me1/me1.json rename to src/map/miniprogram/pages/me1/me1.json diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/me1/me1.wxml b/src/map/miniprogram/pages/me1/me1.wxml similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/me1/me1.wxml rename to src/map/miniprogram/pages/me1/me1.wxml diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/me1/me1.wxss b/src/map/miniprogram/pages/me1/me1.wxss similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/me1/me1.wxss rename to src/map/miniprogram/pages/me1/me1.wxss diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/selectusers(ID)/index.js b/src/map/miniprogram/pages/selectusers(ID)/index.js similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/selectusers(ID)/index.js rename to src/map/miniprogram/pages/selectusers(ID)/index.js diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/selectusers(ID)/index.json b/src/map/miniprogram/pages/selectusers(ID)/index.json similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/selectusers(ID)/index.json rename to src/map/miniprogram/pages/selectusers(ID)/index.json diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/selectusers(ID)/index.wxml b/src/map/miniprogram/pages/selectusers(ID)/index.wxml similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/selectusers(ID)/index.wxml rename to src/map/miniprogram/pages/selectusers(ID)/index.wxml diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/selectusers(ID)/index.wxss b/src/map/miniprogram/pages/selectusers(ID)/index.wxss similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/selectusers(ID)/index.wxss rename to src/map/miniprogram/pages/selectusers(ID)/index.wxss diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/selectusers(college)/index.js b/src/map/miniprogram/pages/selectusers(college)/index.js similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/selectusers(college)/index.js rename to src/map/miniprogram/pages/selectusers(college)/index.js diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/selectusers(college)/index.json b/src/map/miniprogram/pages/selectusers(college)/index.json similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/selectusers(college)/index.json rename to src/map/miniprogram/pages/selectusers(college)/index.json diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/selectusers(college)/index.wxml b/src/map/miniprogram/pages/selectusers(college)/index.wxml similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/selectusers(college)/index.wxml rename to src/map/miniprogram/pages/selectusers(college)/index.wxml diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/selectusers(college)/index.wxss b/src/map/miniprogram/pages/selectusers(college)/index.wxss similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/selectusers(college)/index.wxss rename to src/map/miniprogram/pages/selectusers(college)/index.wxss diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/selectusers/index.js b/src/map/miniprogram/pages/selectusers/index.js similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/selectusers/index.js rename to src/map/miniprogram/pages/selectusers/index.js diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/selectusers/index.json b/src/map/miniprogram/pages/selectusers/index.json similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/selectusers/index.json rename to src/map/miniprogram/pages/selectusers/index.json diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/selectusers/index.wxml b/src/map/miniprogram/pages/selectusers/index.wxml similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/selectusers/index.wxml rename to src/map/miniprogram/pages/selectusers/index.wxml diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/selectusers/index.wxss b/src/map/miniprogram/pages/selectusers/index.wxss similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/selectusers/index.wxss rename to src/map/miniprogram/pages/selectusers/index.wxss diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/selectuserss/index.js b/src/map/miniprogram/pages/selectuserss/index.js similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/selectuserss/index.js rename to src/map/miniprogram/pages/selectuserss/index.js diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/selectuserss/index.json b/src/map/miniprogram/pages/selectuserss/index.json similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/selectuserss/index.json rename to src/map/miniprogram/pages/selectuserss/index.json diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/selectuserss/index.wxml b/src/map/miniprogram/pages/selectuserss/index.wxml similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/selectuserss/index.wxml rename to src/map/miniprogram/pages/selectuserss/index.wxml diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/selectuserss/index.wxss b/src/map/miniprogram/pages/selectuserss/index.wxss similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/selectuserss/index.wxss rename to src/map/miniprogram/pages/selectuserss/index.wxss diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/selectuserssuccess/index.js b/src/map/miniprogram/pages/selectuserssuccess/index.js similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/selectuserssuccess/index.js rename to src/map/miniprogram/pages/selectuserssuccess/index.js diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/selectuserssuccess/index.json b/src/map/miniprogram/pages/selectuserssuccess/index.json similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/selectuserssuccess/index.json rename to src/map/miniprogram/pages/selectuserssuccess/index.json diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/selectuserssuccess/index.wxml b/src/map/miniprogram/pages/selectuserssuccess/index.wxml similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/selectuserssuccess/index.wxml rename to src/map/miniprogram/pages/selectuserssuccess/index.wxml diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/selectuserssuccess/index.wxss b/src/map/miniprogram/pages/selectuserssuccess/index.wxss similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/selectuserssuccess/index.wxss rename to src/map/miniprogram/pages/selectuserssuccess/index.wxss diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/text/text.js b/src/map/miniprogram/pages/text/text.js similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/text/text.js rename to src/map/miniprogram/pages/text/text.js diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/text/text.json b/src/map/miniprogram/pages/text/text.json similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/text/text.json rename to src/map/miniprogram/pages/text/text.json diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/text/text.wxml b/src/map/miniprogram/pages/text/text.wxml similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/text/text.wxml rename to src/map/miniprogram/pages/text/text.wxml diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/text/text.wxss b/src/map/miniprogram/pages/text/text.wxss similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/text/text.wxss rename to src/map/miniprogram/pages/text/text.wxss diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/updateusers/index.js b/src/map/miniprogram/pages/updateusers/index.js similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/updateusers/index.js rename to src/map/miniprogram/pages/updateusers/index.js diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/updateusers/index.json b/src/map/miniprogram/pages/updateusers/index.json similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/updateusers/index.json rename to src/map/miniprogram/pages/updateusers/index.json diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/updateusers/index.wxml b/src/map/miniprogram/pages/updateusers/index.wxml similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/updateusers/index.wxml rename to src/map/miniprogram/pages/updateusers/index.wxml diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/updateusers/index.wxss b/src/map/miniprogram/pages/updateusers/index.wxss similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/updateusers/index.wxss rename to src/map/miniprogram/pages/updateusers/index.wxss diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/updateuserssuccess/index.js b/src/map/miniprogram/pages/updateuserssuccess/index.js similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/updateuserssuccess/index.js rename to src/map/miniprogram/pages/updateuserssuccess/index.js diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/updateuserssuccess/index.json b/src/map/miniprogram/pages/updateuserssuccess/index.json similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/updateuserssuccess/index.json rename to src/map/miniprogram/pages/updateuserssuccess/index.json diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/updateuserssuccess/index.wxml b/src/map/miniprogram/pages/updateuserssuccess/index.wxml similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/updateuserssuccess/index.wxml rename to src/map/miniprogram/pages/updateuserssuccess/index.wxml diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/updateuserssuccess/index.wxss b/src/map/miniprogram/pages/updateuserssuccess/index.wxss similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/pages/updateuserssuccess/index.wxss rename to src/map/miniprogram/pages/updateuserssuccess/index.wxss diff --git a/scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/sitemap.json b/src/map/miniprogram/sitemap.json similarity index 100% rename from scr/wechat-weapp-mapdemo-master/wechat-weapp-mapdemo-master - 副本/miniprogram/sitemap.json rename to src/map/miniprogram/sitemap.json diff --git a/src/map/miniprogram/utils/Find directions.wxml b/src/map/miniprogram/utils/Find directions.wxml new file mode 100644 index 0000000..088eb73 --- /dev/null +++ b/src/map/miniprogram/utils/Find directions.wxml @@ -0,0 +1,13 @@ +出发地: + + +目的地: + + + + + + + \ No newline at end of file diff --git a/src/map/miniprogram/utils/amap-wx.js b/src/map/miniprogram/utils/amap-wx.js new file mode 100644 index 0000000..c8dd42d --- /dev/null +++ b/src/map/miniprogram/utils/amap-wx.js @@ -0,0 +1 @@ +function AMapWX(a) { this.key = a.key, this.requestConfig = { key: a.key, s: "rsx", platform: "WXJS", appname: a.key, sdkversion: "1.2.0", logversion: "2.0" } } AMapWX.prototype.getWxLocation = function (a, b) { wx.getLocation({ type: "gcj02", success: function (a) { var c = a.longitude + "," + a.latitude; wx.setStorage({ key: "userLocation", data: c }), b(c) }, fail: function (c) { wx.getStorage({ key: "userLocation", success: function (a) { a.data && b(a.data) } }), a.fail({ errCode: "0", errMsg: c.errMsg || "" }) } }) }, AMapWX.prototype.getRegeo = function (a) { function c(c) { var d = b.requestConfig; wx.request({ url: "https://restapi.amap.com/v3/geocode/regeo", data: { key: b.key, location: c, extensions: "all", s: d.s, platform: d.platform, appname: b.key, sdkversion: d.sdkversion, logversion: d.logversion }, method: "GET", header: { "content-type": "application/json" }, success: function (b) { var d, e, f, g, h, i, j, k; b.data.status && "1" == b.data.status ? (d = b.data.regeocode, e = d.addressComponent, f = [], g = d.roads[0].name + "附近", h = c.split(",")[0], i = c.split(",")[1], d.pois && d.pois[0] && (g = d.pois[0].name + "附近", j = d.pois[0].location, j && (h = parseFloat(j.split(",")[0]), i = parseFloat(j.split(",")[1]))), e.provice && f.push(e.provice), e.city && f.push(e.city), e.district && f.push(e.district), e.streetNumber && e.streetNumber.street && e.streetNumber.number ? (f.push(e.streetNumber.street), f.push(e.streetNumber.number)) : f.push(d.roads[0].name), f = f.join(""), k = [{ iconPath: a.iconPath, width: a.iconWidth, height: a.iconHeight, name: f, desc: g, longitude: h, latitude: i, id: 0, regeocodeData: d }], a.success(k)) : a.fail({ errCode: b.data.infocode, errMsg: b.data.info }) }, fail: function (b) { a.fail({ errCode: "0", errMsg: b.errMsg || "" }) } }) } var b = this; a.location ? c(a.location) : b.getWxLocation(a, function (a) { c(a) }) }, AMapWX.prototype.getWeather = function (a) { function d(d) { var e = "base"; a.type && "forecast" == a.type && (e = "all"), wx.request({ url: "https://restapi.amap.com/v3/weather/weatherInfo", data: { key: b.key, city: d, extensions: e, s: c.s, platform: c.platform, appname: b.key, sdkversion: c.sdkversion, logversion: c.logversion }, method: "GET", header: { "content-type": "application/json" }, success: function (b) { function c(a) { var b = { city: { text: "城市", data: a.city }, weather: { text: "天气", data: a.weather }, temperature: { text: "温度", data: a.temperature }, winddirection: { text: "风向", data: a.winddirection + "风" }, windpower: { text: "风力", data: a.windpower + "级" }, humidity: { text: "湿度", data: a.humidity + "%" } }; return b } var d, e; b.data.status && "1" == b.data.status ? b.data.lives ? (d = b.data.lives, d && d.length > 0 && (d = d[0], e = c(d), e["liveData"] = d, a.success(e))) : b.data.forecasts && b.data.forecasts[0] && a.success({ forecast: b.data.forecasts[0] }) : a.fail({ errCode: b.data.infocode, errMsg: b.data.info }) }, fail: function (b) { a.fail({ errCode: "0", errMsg: b.errMsg || "" }) } }) } function e(e) { wx.request({ url: "https://restapi.amap.com/v3/geocode/regeo", data: { key: b.key, location: e, extensions: "all", s: c.s, platform: c.platform, appname: b.key, sdkversion: c.sdkversion, logversion: c.logversion }, method: "GET", header: { "content-type": "application/json" }, success: function (b) { var c, e; b.data.status && "1" == b.data.status ? (e = b.data.regeocode, e.addressComponent ? c = e.addressComponent.adcode : e.aois && e.aois.length > 0 && (c = e.aois[0].adcode), d(c)) : a.fail({ errCode: b.data.infocode, errMsg: b.data.info }) }, fail: function (b) { a.fail({ errCode: "0", errMsg: b.errMsg || "" }) } }) } var b = this, c = b.requestConfig; a.city ? d(a.city) : b.getWxLocation(a, function (a) { e(a) }) }, AMapWX.prototype.getPoiAround = function (a) { function d(d) { var e = { key: b.key, location: d, s: c.s, platform: c.platform, appname: b.key, sdkversion: c.sdkversion, logversion: c.logversion }; a.querytypes && (e["types"] = a.querytypes), a.querykeywords && (e["keywords"] = a.querykeywords), wx.request({ url: "https://restapi.amap.com/v3/place/around", data: e, method: "GET", header: { "content-type": "application/json" }, success: function (b) { var c, d, e, f; if (b.data.status && "1" == b.data.status) { if (b = b.data, b && b.pois) { for (c = [], d = 0; d < b.pois.length; d++)e = 0 == d ? a.iconPathSelected : a.iconPath, c.push({ latitude: parseFloat(b.pois[d].location.split(",")[1]), longitude: parseFloat(b.pois[d].location.split(",")[0]), iconPath: e, width: 22, height: 32, id: d, name: b.pois[d].name, address: b.pois[d].address }); f = { markers: c, poisData: b.pois }, a.success(f) } } else a.fail({ errCode: b.data.infocode, errMsg: b.data.info }) }, fail: function (b) { a.fail({ errCode: "0", errMsg: b.errMsg || "" }) } }) } var b = this, c = b.requestConfig; a.location ? d(a.location) : b.getWxLocation(a, function (a) { d(a) }) }, AMapWX.prototype.getStaticmap = function (a) { function f(b) { c.push("location=" + b), a.zoom && c.push("zoom=" + a.zoom), a.size && c.push("size=" + a.size), a.scale && c.push("scale=" + a.scale), a.markers && c.push("markers=" + a.markers), a.labels && c.push("labels=" + a.labels), a.paths && c.push("paths=" + a.paths), a.traffic && c.push("traffic=" + a.traffic); var e = d + c.join("&"); a.success({ url: e }) } var e, b = this, c = [], d = "https://restapi.amap.com/v3/staticmap?"; c.push("key=" + b.key), e = b.requestConfig, c.push("s=" + e.s), c.push("platform=" + e.platform), c.push("appname=" + e.appname), c.push("sdkversion=" + e.sdkversion), c.push("logversion=" + e.logversion), a.location ? f(a.location) : b.getWxLocation(a, function (a) { f(a) }) }, AMapWX.prototype.getInputtips = function (a) { var b = this, c = b.requestConfig, d = { key: b.key, s: c.s, platform: c.platform, appname: b.key, sdkversion: c.sdkversion, logversion: c.logversion }; a.location && (d["location"] = a.location), a.keywords && (d["keywords"] = a.keywords), a.type && (d["type"] = a.type), a.city && (d["city"] = a.city), a.citylimit && (d["citylimit"] = a.citylimit), wx.request({ url: "https://restapi.amap.com/v3/assistant/inputtips", data: d, method: "GET", header: { "content-type": "application/json" }, success: function (b) { b && b.data && b.data.tips && a.success({ tips: b.data.tips }) }, fail: function (b) { a.fail({ errCode: "0", errMsg: b.errMsg || "" }) } }) }, AMapWX.prototype.getDrivingRoute = function (a) { var b = this, c = b.requestConfig, d = { key: b.key, s: c.s, platform: c.platform, appname: b.key, sdkversion: c.sdkversion, logversion: c.logversion }; a.origin && (d["origin"] = a.origin), a.destination && (d["destination"] = a.destination), a.strategy && (d["strategy"] = a.strategy), a.waypoints && (d["waypoints"] = a.waypoints), a.avoidpolygons && (d["avoidpolygons"] = a.avoidpolygons), a.avoidroad && (d["avoidroad"] = a.avoidroad), wx.request({ url: "https://restapi.amap.com/v3/direction/driving", data: d, method: "GET", header: { "content-type": "application/json" }, success: function (b) { b && b.data && b.data.route && a.success({ paths: b.data.route.paths, taxi_cost: b.data.route.taxi_cost || "" }) }, fail: function (b) { a.fail({ errCode: "0", errMsg: b.errMsg || "" }) } }) }, AMapWX.prototype.getWalkingRoute = function (a) { var b = this, c = b.requestConfig, d = { key: b.key, s: c.s, platform: c.platform, appname: b.key, sdkversion: c.sdkversion, logversion: c.logversion }; a.origin && (d["origin"] = a.origin), a.destination && (d["destination"] = a.destination), wx.request({ url: "https://restapi.amap.com/v3/direction/walking", data: d, method: "GET", header: { "content-type": "application/json" }, success: function (b) { b && b.data && b.data.route && a.success({ paths: b.data.route.paths }) }, fail: function (b) { a.fail({ errCode: "0", errMsg: b.errMsg || "" }) } }) }, AMapWX.prototype.getTransitRoute = function (a) { var b = this, c = b.requestConfig, d = { key: b.key, s: c.s, platform: c.platform, appname: b.key, sdkversion: c.sdkversion, logversion: c.logversion }; a.origin && (d["origin"] = a.origin), a.destination && (d["destination"] = a.destination), a.strategy && (d["strategy"] = a.strategy), a.city && (d["city"] = a.city), a.cityd && (d["cityd"] = a.cityd), wx.request({ url: "https://restapi.amap.com/v3/direction/transit/integrated", data: d, method: "GET", header: { "content-type": "application/json" }, success: function (b) { if (b && b.data && b.data.route) { var c = b.data.route; a.success({ distance: c.distance || "", taxi_cost: c.taxi_cost || "", transits: c.transits }) } }, fail: function (b) { a.fail({ errCode: "0", errMsg: b.errMsg || "" }) } }) }, AMapWX.prototype.getRidingRoute = function (a) { var b = this, c = b.requestConfig, d = { key: b.key, s: c.s, platform: c.platform, appname: b.key, sdkversion: c.sdkversion, logversion: c.logversion }; a.origin && (d["origin"] = a.origin), a.destination && (d["destination"] = a.destination), wx.request({ url: "https://restapi.amap.com/v3/direction/riding", data: d, method: "GET", header: { "content-type": "application/json" }, success: function (b) { b && b.data && b.data.route && a.success({ paths: b.data.route.paths }) }, fail: function (b) { a.fail({ errCode: "0", errMsg: b.errMsg || "" }) } }) }, module.exports.AMapWX = AMapWX; \ No newline at end of file diff --git a/src/map/miniprogram/utils/location.js b/src/map/miniprogram/utils/location.js new file mode 100644 index 0000000..f5e6edd --- /dev/null +++ b/src/map/miniprogram/utils/location.js @@ -0,0 +1,40 @@ +// Page({ +// data:{ +// location:[{ +// id:0, +// name:"中国民航大学南一教学楼", +// longitude: 116.481028, +// latitude: 39.989643, +// },{ +// id:1, +// name:"中国民航大学南二教学楼", +// longitude: 116.481028, +// latitude: 39.989643, +// },{ +// id:3, +// name:"中国民航大学南三教学楼", +// longitude: 116.481028, +// latitude: 39.989643, +// } +// ] +// } +// }) + +module.exports.location = [ + { + id:0, + name:"中国民航大学南一教学楼", + longitude: 116.481028, + latitude: 39.989643, + },{ + id:1, + name:"中国民航大学南二教学楼", + longitude: 116.481028, + latitude: 39.989643, + },{ + id:3, + name:"中国民航大学南三教学楼", + longitude: 116.481028, + latitude: 39.989643, + } +] \ No newline at end of file diff --git a/src/map/miniprogram/utils/qqmap-wx-jssdk.js b/src/map/miniprogram/utils/qqmap-wx-jssdk.js new file mode 100644 index 0000000..b114e29 --- /dev/null +++ b/src/map/miniprogram/utils/qqmap-wx-jssdk.js @@ -0,0 +1,741 @@ +/** + * 微信小程序JavaScriptSDK + * + * @version 1.1 + * @date 2019-01-20 + */ + +var ERROR_CONF = { + KEY_ERR: 311, + KEY_ERR_MSG: 'key格式错误', + PARAM_ERR: 310, + PARAM_ERR_MSG: '请求参数信息有误', + SYSTEM_ERR: 600, + SYSTEM_ERR_MSG: '系统错误', + WX_ERR_CODE: 1000, + WX_OK_CODE: 200 +}; +var BASE_URL = 'https://apis.map.qq.com/ws/'; +var URL_SEARCH = BASE_URL + 'place/v1/search'; +var URL_SUGGESTION = BASE_URL + 'place/v1/suggestion'; +var URL_GET_GEOCODER = BASE_URL + 'geocoder/v1/'; +var URL_CITY_LIST = BASE_URL + 'district/v1/list'; +var URL_AREA_LIST = BASE_URL + 'district/v1/getchildren'; +var URL_DISTANCE = BASE_URL + 'distance/v1/'; +var EARTH_RADIUS = 6378136.49; +var Utils = { + /** + * 得到终点query字符串 + * @param {Array|String} 检索数据 + */ + location2query(data) { + if (typeof data == 'string') { + return data; + } + var query = ''; + for (var i = 0; i < data.length; i++) { + var d = data[i]; + if (!!query) { + query += ';'; + } + if (d.location) { + query = query + d.location.lat + ',' + d.location.lng; + } + if (d.latitude && d.longitude) { + query = query + d.latitude + ',' + d.longitude; + } + } + return query; + }, + + /** + * 计算角度 + */ + rad(d) { + return d * Math.PI / 180.0; + }, + /** + * 处理终点location数组 + * @return 返回终点数组 + */ + getEndLocation(location){ + var to = location.split(';'); + var endLocation = []; + for (var i = 0; i < to.length; i++) { + endLocation.push({ + lat: parseFloat(to[i].split(',')[0]), + lng: parseFloat(to[i].split(',')[1]) + }) + } + return endLocation; + }, + + /** + * 计算两点间直线距离 + * @param a 表示纬度差 + * @param b 表示经度差 + * @return 返回的是距离,单位m + */ + getDistance(latFrom, lngFrom, latTo, lngTo) { + var radLatFrom = this.rad(latFrom); + var radLatTo = this.rad(latTo); + var a = radLatFrom - radLatTo; + var b = this.rad(lngFrom) - this.rad(lngTo); + var distance = 2 * Math.asin(Math.sqrt(Math.pow(Math.sin(a / 2), 2) + Math.cos(radLatFrom) * Math.cos(radLatTo) * Math.pow(Math.sin(b / 2), 2))); + distance = distance * EARTH_RADIUS; + distance = Math.round(distance * 10000) / 10000; + return parseFloat(distance.toFixed(0)); + }, + /** + * 使用微信接口进行定位 + */ + getWXLocation(success, fail, complete) { + wx.getLocation({ + type: 'gcj02', + success: success, + fail: fail, + complete: complete + }); + }, + + /** + * 获取location参数 + */ + getLocationParam(location) { + if (typeof location == 'string') { + var locationArr = location.split(','); + if (locationArr.length === 2) { + location = { + latitude: location.split(',')[0], + longitude: location.split(',')[1] + }; + } else { + location = {}; + } + } + return location; + }, + + /** + * 回调函数默认处理 + */ + polyfillParam(param) { + param.success = param.success || function () { }; + param.fail = param.fail || function () { }; + param.complete = param.complete || function () { }; + }, + + /** + * 验证param对应的key值是否为空 + * + * @param {Object} param 接口参数 + * @param {String} key 对应参数的key + */ + checkParamKeyEmpty(param, key) { + if (!param[key]) { + var errconf = this.buildErrorConfig(ERROR_CONF.PARAM_ERR, ERROR_CONF.PARAM_ERR_MSG + key +'参数格式有误'); + param.fail(errconf); + param.complete(errconf); + return true; + } + return false; + }, + + /** + * 验证参数中是否存在检索词keyword + * + * @param {Object} param 接口参数 + */ + checkKeyword(param){ + return !this.checkParamKeyEmpty(param, 'keyword'); + }, + + /** + * 验证location值 + * + * @param {Object} param 接口参数 + */ + checkLocation(param) { + var location = this.getLocationParam(param.location); + if (!location || !location.latitude || !location.longitude) { + var errconf = this.buildErrorConfig(ERROR_CONF.PARAM_ERR, ERROR_CONF.PARAM_ERR_MSG + ' location参数格式有误'); + param.fail(errconf); + param.complete(errconf); + return false; + } + return true; + }, + + /** + * 构造错误数据结构 + * @param {Number} errCode 错误码 + * @param {Number} errMsg 错误描述 + */ + buildErrorConfig(errCode, errMsg) { + return { + status: errCode, + message: errMsg + }; + }, + + /** + * + * 数据处理函数 + * 根据传入参数不同处理不同数据 + * @param {String} feature 功能名称 + * search 地点搜索 + * suggest关键词提示 + * reverseGeocoder逆地址解析 + * geocoder地址解析 + * getCityList获取城市列表:父集 + * getDistrictByCityId获取区县列表:子集 + * calculateDistance距离计算 + * @param {Object} param 接口参数 + * @param {Object} data 数据 + */ + handleData(param,data,feature){ + if (feature === 'search') { + var searchResult = data.data; + var searchSimplify = []; + for (var i = 0; i < searchResult.length; i++) { + searchSimplify.push({ + id: searchResult[i].id || null, + title: searchResult[i].title || null, + latitude: searchResult[i].location && searchResult[i].location.lat || null, + longitude: searchResult[i].location && searchResult[i].location.lng || null, + address: searchResult[i].address || null, + category: searchResult[i].category || null, + tel: searchResult[i].tel || null, + adcode: searchResult[i].ad_info && searchResult[i].ad_info.adcode || null, + city: searchResult[i].ad_info && searchResult[i].ad_info.city || null, + district: searchResult[i].ad_info && searchResult[i].ad_info.district || null, + province: searchResult[i].ad_info && searchResult[i].ad_info.province || null + }) + } + param.success(data, { + searchResult: searchResult, + searchSimplify: searchSimplify + }) + } else if (feature === 'suggest') { + var suggestResult = data.data; + var suggestSimplify = []; + for (var i = 0; i < suggestResult.length; i++) { + suggestSimplify.push({ + adcode: suggestResult[i].adcode || null, + address: suggestResult[i].address || null, + category: suggestResult[i].category || null, + city: suggestResult[i].city || null, + district: suggestResult[i].district || null, + id: suggestResult[i].id || null, + latitude: suggestResult[i].location && suggestResult[i].location.lat || null, + longitude: suggestResult[i].location && suggestResult[i].location.lng || null, + province: suggestResult[i].province || null, + title: suggestResult[i].title || null, + type: suggestResult[i].type || null + }) + } + param.success(data, { + suggestResult: suggestResult, + suggestSimplify: suggestSimplify + }) + } else if (feature === 'reverseGeocoder') { + var reverseGeocoderResult = data.result; + var reverseGeocoderSimplify = { + address: reverseGeocoderResult.address || null, + latitude: reverseGeocoderResult.location && reverseGeocoderResult.location.lat || null, + longitude: reverseGeocoderResult.location && reverseGeocoderResult.location.lng || null, + adcode: reverseGeocoderResult.ad_info && reverseGeocoderResult.ad_info.adcode || null, + city: reverseGeocoderResult.address_component && reverseGeocoderResult.address_component.city || null, + district: reverseGeocoderResult.address_component && reverseGeocoderResult.address_component.district || null, + nation: reverseGeocoderResult.address_component && reverseGeocoderResult.address_component.nation || null, + province: reverseGeocoderResult.address_component && reverseGeocoderResult.address_component.province || null, + street: reverseGeocoderResult.address_component && reverseGeocoderResult.address_component.street || null, + street_number: reverseGeocoderResult.address_component && reverseGeocoderResult.address_component.street_number || null, + recommend: reverseGeocoderResult.formatted_addresses && reverseGeocoderResult.formatted_addresses.recommend || null, + rough: reverseGeocoderResult.formatted_addresses && reverseGeocoderResult.formatted_addresses.rough || null + }; + if (reverseGeocoderResult.pois) {//判断是否返回周边poi + var pois = reverseGeocoderResult.pois; + var poisSimplify = []; + for (var i = 0;i < pois.length;i++) { + poisSimplify.push({ + id: pois[i].id || null, + title: pois[i].title || null, + latitude: pois[i].location && pois[i].location.lat || null, + longitude: pois[i].location && pois[i].location.lng || null, + address: pois[i].address || null, + category: pois[i].category || null, + adcode: pois[i].ad_info && pois[i].ad_info.adcode || null, + city: pois[i].ad_info && pois[i].ad_info.city || null, + district: pois[i].ad_info && pois[i].ad_info.district || null, + province: pois[i].ad_info && pois[i].ad_info.province || null + }) + } + param.success(data,{ + reverseGeocoderResult: reverseGeocoderResult, + reverseGeocoderSimplify: reverseGeocoderSimplify, + pois: pois, + poisSimplify: poisSimplify + }) + } else { + param.success(data, { + reverseGeocoderResult: reverseGeocoderResult, + reverseGeocoderSimplify: reverseGeocoderSimplify + }) + } + } else if (feature === 'geocoder') { + var geocoderResult = data.result; + var geocoderSimplify = { + title: geocoderResult.title || null, + latitude: geocoderResult.location && geocoderResult.location.lat || null, + longitude: geocoderResult.location && geocoderResult.location.lng || null, + adcode: geocoderResult.ad_info && geocoderResult.ad_info.adcode || null, + province: geocoderResult.address_components && geocoderResult.address_components.province || null, + city: geocoderResult.address_components && geocoderResult.address_components.city || null, + district: geocoderResult.address_components && geocoderResult.address_components.district || null, + street: geocoderResult.address_components && geocoderResult.address_components.street || null, + street_number: geocoderResult.address_components && geocoderResult.address_components.street_number || null, + level: geocoderResult.level || null + }; + param.success(data,{ + geocoderResult: geocoderResult, + geocoderSimplify: geocoderSimplify + }); + } else if (feature === 'getCityList') { + var provinceResult = data.result[0]; + var cityResult = data.result[1]; + var districtResult = data.result[2]; + param.success(data,{ + provinceResult: provinceResult, + cityResult: cityResult, + districtResult: districtResult + }); + } else if (feature === 'getDistrictByCityId') { + var districtByCity = data.result[0]; + param.success(data, districtByCity); + } else if (feature === 'calculateDistance') { + var calculateDistanceResult = data.result.elements; + var distance = []; + for (var i = 0; i < calculateDistanceResult.length; i++){ + distance.push(calculateDistanceResult[i].distance); + } + param.success(data, { + calculateDistanceResult: calculateDistanceResult, + distance: distance + }); + } else { + param.success(data); + } + }, + + /** + * 构造微信请求参数,公共属性处理 + * + * @param {Object} param 接口参数 + * @param {Object} param 配置项 + * @param {String} feature 方法名 + */ + buildWxRequestConfig(param, options, feature) { + var that = this; + options.header = { "content-type": "application/json" }; + options.method = 'GET'; + options.success = function (res) { + var data = res.data; + if (data.status === 0) { + that.handleData(param, data, feature); + } else { + param.fail(data); + } + }; + options.fail = function (res) { + res.statusCode = ERROR_CONF.WX_ERR_CODE; + param.fail(that.buildErrorConfig(ERROR_CONF.WX_ERR_CODE, res.errMsg)); + }; + options.complete = function (res) { + var statusCode = +res.statusCode; + switch(statusCode) { + case ERROR_CONF.WX_ERR_CODE: { + param.complete(that.buildErrorConfig(ERROR_CONF.WX_ERR_CODE, res.errMsg)); + break; + } + case ERROR_CONF.WX_OK_CODE: { + var data = res.data; + if (data.status === 0) { + param.complete(data); + } else { + param.complete(that.buildErrorConfig(data.status, data.message)); + } + break; + } + default:{ + param.complete(that.buildErrorConfig(ERROR_CONF.SYSTEM_ERR, ERROR_CONF.SYSTEM_ERR_MSG)); + } + + } + }; + return options; + }, + + /** + * 处理用户参数是否传入坐标进行不同的处理 + */ + locationProcess(param, locationsuccess, locationfail, locationcomplete) { + var that = this; + locationfail = locationfail || function (res) { + res.statusCode = ERROR_CONF.WX_ERR_CODE; + param.fail(that.buildErrorConfig(ERROR_CONF.WX_ERR_CODE, res.errMsg)); + }; + locationcomplete = locationcomplete || function (res) { + if (res.statusCode == ERROR_CONF.WX_ERR_CODE) { + param.complete(that.buildErrorConfig(ERROR_CONF.WX_ERR_CODE, res.errMsg)); + } + }; + if (!param.location) { + that.getWXLocation(locationsuccess, locationfail, locationcomplete); + } else if (that.checkLocation(param)) { + var location = Utils.getLocationParam(param.location); + locationsuccess(location); + } + } +}; + + +class QQMapWX { + + /** + * 构造函数 + * + * @param {Object} options 接口参数,key 为必选参数 + */ + constructor(options) { + if (!options.key) { + throw Error('key值不能为空'); + } + this.key = options.key; + }; + + /** + * POI周边检索 + * + * @param {Object} options 接口参数对象 + * + * 参数对象结构可以参考 + * @see http://lbs.qq.com/webservice_v1/guide-search.html + */ + search(options) { + var that = this; + options = options || {}; + + Utils.polyfillParam(options); + + if (!Utils.checkKeyword(options)) { + return; + } + + var requestParam = { + keyword: options.keyword, + orderby: options.orderby || '_distance', + page_size: options.page_size || 10, + page_index: options.page_index || 1, + output: 'json', + key: that.key + }; + + if (options.address_format) { + requestParam.address_format = options.address_format; + } + + if (options.filter) { + requestParam.filter = options.filter; + } + + var distance = options.distance || "1000"; + var auto_extend = options.auto_extend || 1; + var region = null; + var rectangle = null; + + //判断城市限定参数 + if (options.region) { + region = options.region; + } + + //矩形限定坐标(暂时只支持字符串格式) + if (options.rectangle) { + rectangle = options.rectangle; + } + + var locationsuccess = function (result) { + if (region && !rectangle) { + //城市限定参数拼接 + requestParam.boundary = "region(" + region + "," + auto_extend + "," + result.latitude + "," + result.longitude + ")"; + } else if (rectangle && !region) { + //矩形搜索 + requestParam.boundary = "rectangle(" + rectangle + ")"; + } else { + requestParam.boundary = "nearby(" + result.latitude + "," + result.longitude + "," + distance + "," + auto_extend + ")"; + } + wx.request(Utils.buildWxRequestConfig(options, { + url: URL_SEARCH, + data: requestParam + }, 'search')); + }; + Utils.locationProcess(options, locationsuccess); + }; + + /** + * sug模糊检索 + * + * @param {Object} options 接口参数对象 + * + * 参数对象结构可以参考 + * http://lbs.qq.com/webservice_v1/guide-suggestion.html + */ + getSuggestion(options) { + var that = this; + options = options || {}; + Utils.polyfillParam(options); + + if (!Utils.checkKeyword(options)) { + return; + } + + var requestParam = { + keyword: options.keyword, + region: options.region || '全国', + region_fix: options.region_fix || 0, + policy: options.policy || 0, + page_size: options.page_size || 10,//控制显示条数 + page_index: options.page_index || 1,//控制页数 + get_subpois : options.get_subpois || 0,//返回子地点 + output: 'json', + key: that.key + }; + //长地址 + if (options.address_format) { + requestParam.address_format = options.address_format; + } + //过滤 + if (options.filter) { + requestParam.filter = options.filter; + } + //排序 + if (options.location) { + var locationsuccess = function (result) { + requestParam.location = result.latitude + ',' + result.longitude; + wx.request(Utils.buildWxRequestConfig(options, { + url: URL_SUGGESTION, + data: requestParam + }, "suggest")); + }; + Utils.locationProcess(options, locationsuccess); + } else { + wx.request(Utils.buildWxRequestConfig(options, { + url: URL_SUGGESTION, + data: requestParam + }, "suggest")); + } + }; + + /** + * 逆地址解析 + * + * @param {Object} options 接口参数对象 + * + * 请求参数结构可以参考 + * http://lbs.qq.com/webservice_v1/guide-gcoder.html + */ + reverseGeocoder(options) { + var that = this; + options = options || {}; + Utils.polyfillParam(options); + var requestParam = { + coord_type: options.coord_type || 5, + get_poi: options.get_poi || 0, + output: 'json', + key: that.key + }; + if (options.poi_options) { + requestParam.poi_options = options.poi_options + } + + var locationsuccess = function (result) { + requestParam.location = result.latitude + ',' + result.longitude; + wx.request(Utils.buildWxRequestConfig(options, { + url: URL_GET_GEOCODER, + data: requestParam + }, 'reverseGeocoder')); + }; + Utils.locationProcess(options, locationsuccess); + }; + + /** + * 地址解析 + * + * @param {Object} options 接口参数对象 + * + * 请求参数结构可以参考 + * http://lbs.qq.com/webservice_v1/guide-geocoder.html + */ + geocoder(options) { + var that = this; + options = options || {}; + Utils.polyfillParam(options); + + if (Utils.checkParamKeyEmpty(options, 'address')) { + return; + } + + var requestParam = { + address: options.address, + output: 'json', + key: that.key + }; + + //城市限定 + if (options.region) { + requestParam.region = options.region; + } + + wx.request(Utils.buildWxRequestConfig(options, { + url: URL_GET_GEOCODER, + data: requestParam + },'geocoder')); + }; + + + /** + * 获取城市列表 + * + * @param {Object} options 接口参数对象 + * + * 请求参数结构可以参考 + * http://lbs.qq.com/webservice_v1/guide-region.html + */ + getCityList(options) { + var that = this; + options = options || {}; + Utils.polyfillParam(options); + var requestParam = { + output: 'json', + key: that.key + }; + + wx.request(Utils.buildWxRequestConfig(options, { + url: URL_CITY_LIST, + data: requestParam + },'getCityList')); + }; + + /** + * 获取对应城市ID的区县列表 + * + * @param {Object} options 接口参数对象 + * + * 请求参数结构可以参考 + * http://lbs.qq.com/webservice_v1/guide-region.html + */ + getDistrictByCityId(options) { + var that = this; + options = options || {}; + Utils.polyfillParam(options); + + if (Utils.checkParamKeyEmpty(options, 'id')) { + return; + } + + var requestParam = { + id: options.id || '', + output: 'json', + key: that.key + }; + + wx.request(Utils.buildWxRequestConfig(options, { + url: URL_AREA_LIST, + data: requestParam + },'getDistrictByCityId')); + }; + + /** + * 用于单起点到多终点的路线距离(非直线距离)计算: + * 支持两种距离计算方式:步行和驾车。 + * 起点到终点最大限制直线距离10公里。 + * + * 新增直线距离计算。 + * + * @param {Object} options 接口参数对象 + * + * 请求参数结构可以参考 + * http://lbs.qq.com/webservice_v1/guide-distance.html + */ + calculateDistance(options) { + var that = this; + options = options || {}; + Utils.polyfillParam(options); + + if (Utils.checkParamKeyEmpty(options, 'to')) { + return; + } + + var requestParam = { + mode: options.mode || 'walking', + to: Utils.location2query(options.to), + output: 'json', + key: that.key + }; + + if (options.from) { + options.location = options.from; + } + + //计算直线距离 + if(requestParam.mode == 'straight'){ + var locationsuccess = function (result) { + var locationTo = Utils.getEndLocation(requestParam.to);//处理终点坐标 + var data = { + message:"query ok", + result:{ + elements:[] + }, + status:0 + }; + for (var i = 0; i < locationTo.length; i++) { + data.result.elements.push({//将坐标存入 + distance: Utils.getDistance(result.latitude, result.longitude, locationTo[i].lat, locationTo[i].lng), + duration:0, + from:{ + lat: result.latitude, + lng:result.longitude + }, + to:{ + lat: locationTo[i].lat, + lng: locationTo[i].lng + } + }); + } + var calculateResult = data.result.elements; + var distanceResult = []; + for (var i = 0; i < calculateResult.length; i++) { + distanceResult.push(calculateResult[i].distance); + } + return options.success(data,{ + calculateResult: calculateResult, + distanceResult: distanceResult + }); + }; + + Utils.locationProcess(options, locationsuccess); + } else { + var locationsuccess = function (result) { + requestParam.from = result.latitude + ',' + result.longitude; + wx.request(Utils.buildWxRequestConfig(options, { + url: URL_DISTANCE, + data: requestParam + },'calculateDistance')); + }; + + Utils.locationProcess(options, locationsuccess); + } + } +}; + +module.exports = QQMapWX; \ No newline at end of file diff --git a/src/map/miniprogram/utils/qqmap-wx-jssdk.min.js b/src/map/miniprogram/utils/qqmap-wx-jssdk.min.js new file mode 100644 index 0000000..b8fbad4 --- /dev/null +++ b/src/map/miniprogram/utils/qqmap-wx-jssdk.min.js @@ -0,0 +1,3 @@ +var ERROR_CONF={KEY_ERR:311,KEY_ERR_MSG:'key格式错误',PARAM_ERR:310,PARAM_ERR_MSG:'请求参数信息有误',SYSTEM_ERR:600,SYSTEM_ERR_MSG:'系统错误',WX_ERR_CODE:1000,WX_OK_CODE:200};var BASE_URL='https://apis.map.qq.com/ws/';var URL_SEARCH=BASE_URL+'place/v1/search';var URL_SUGGESTION=BASE_URL+'place/v1/suggestion';var URL_GET_GEOCODER=BASE_URL+'geocoder/v1/';var URL_CITY_LIST=BASE_URL+'district/v1/list';var URL_AREA_LIST=BASE_URL+'district/v1/getchildren';var URL_DISTANCE=BASE_URL+'distance/v1/';var EARTH_RADIUS=6378136.49;var Utils={location2query(data){if(typeof data=='string'){return data}var query='';for(var i=0;i