achao 2 роки тому
батько
коміт
7206f0646c
2 змінених файлів з 35 додано та 24 видалено
  1. 1 2
      uni_applet/pageA/food/fondMap.vue
  2. 34 22
      uni_applet/pages/food/food.vue

+ 1 - 2
uni_applet/pageA/food/fondMap.vue

@@ -135,8 +135,7 @@
 						label:{
 							content:item.shopNames,
 							textAlign:"left",
-							x: Number(item.latitude),
-							y: Number(item.longitude),
+							padding:-20
 						},
 						width: 30,
 						height: 30,

+ 34 - 22
uni_applet/pages/food/food.vue

@@ -88,10 +88,7 @@
 
 <script>
 	var that;
-	var QQMapWX = require('@/js_sdk/qqmap-wx-jssdk.min.js');
-	var qqmapsdk = new QQMapWX({
-		key: 'HQ6BZ-RMALQ-TGF5H-BXJQB-UFYN3-Q5BYM'
-	});
+	var GDMapWX = require('@/js_sdk/js-amap/amap-wx.130.js');
 	
 	import uniTag from '@/uni_modules/uni-tag/components/uni-tag/uni-tag.vue';
 	import MoteLinesDivide from "@/components/text-over-flow/text-over-flow.vue"
@@ -238,21 +235,36 @@
 					}
 					this.longitude = _obj.longitude
 					this.latitude = _obj.latitude
-					qqmapsdk.reverseGeocoder({
-						location: _obj,
-						success: function(res) {
-							console.log(res)
-							that.detailedAddress = res.result.formatted_addresses.recommend
-							that.mescroll.resetUpScroll()
-						},
-						fail: function(error) {
-							console.error(error);
-						},
-						complete: function(res) {
-							// console.log(res);
-						}
-
-					})
+					var amapPluginInstance = new GDMapWX.AMapWX({	
+									key: '6bafe91754a563ff2b7c02542c1ef4e8'
+								});
+							   amapPluginInstance.getRegeo({
+							      success: function(res){
+									  console.log(res)
+									  		that.detailedAddress = res[0].desc
+									  		that.mescroll.resetUpScroll()
+							        //成功回调
+							      },
+							      fail: function(info){
+							        //失败回调
+							        console.log(info)
+							      }
+							    })
+					// qqmapsdk.reverseGeocoder({
+					// 	location: _obj,
+					// 	success: function(res) {
+					// 		console.log(res)
+					// 		that.detailedAddress = res.result.formatted_addresses.recommend
+					// 		that.mescroll.resetUpScroll()
+					// 	},
+					// 	fail: function(error) {
+					// 		console.error(error);
+					// 	},
+					// 	complete: function(res) {
+					// 		// console.log(res);
+					// 	}
+
+					// })
 
 				})
 			},
@@ -291,9 +303,9 @@
 						that.longitude = res.longitude
 						uni.setStorageSync("findlatitude", res.latitude)
 						uni.setStorageSync("findlongitude", res.longitude)
-						let _address = that.$helper.formatLocation(res.address)
-						that.detailedAddress = _address.Village
-						uni.setStorageSync("detailedAddress", _address.Village)
+						// let _address = that.$helper.formatLocation(res.address)
+						that.detailedAddress = res.name
+						uni.setStorageSync("detailedAddress", res.name)
 						that.$forceUpdate()
 						that.upCallback({
 							num: 1,