|
|
@@ -532,18 +532,22 @@ var app = new Vue({
|
|
|
// 获取定位数据
|
|
|
wx.getLocation({
|
|
|
success: function (res) {
|
|
|
-
|
|
|
- wx.openLocation({
|
|
|
- success: function (res) {
|
|
|
+ $.jsonp('http://api.map.baidu.com/geoconv/v1/',{
|
|
|
+ params:{
|
|
|
+ coords:res.longitude+','+res.latitude, // 微信返回用户当前位置经度纬度
|
|
|
+ from:1, // 当前坐标类型,1-7种类型,详情看http://lbsyun.baidu.com/index.php?title=webapi/guide/changeposition
|
|
|
+ to:5, // 百度地图返回的坐标类型,5:bd09ll(百度经纬度坐标)6:bd09mc(百度米制经纬度坐标)
|
|
|
+ ak:'3123skdhfiweuyrkhtkjhskf1', // 百度地图开发者秘钥(我的乱写的),一定要设置一下 Referer白名单
|
|
|
},
|
|
|
- error: function(){
|
|
|
-
|
|
|
- }
|
|
|
- });
|
|
|
+ },).then((result) => {
|
|
|
+ console.log(result)
|
|
|
|
|
|
- $.post('/api/member/updateLocation/', {: }, function (res) {
|
|
|
+ },(err)=>{
|
|
|
+ console.log('地址转换失败')
|
|
|
+ })
|
|
|
+ /* $.post('/api/member/updateLocation/', {}, function (res) {
|
|
|
|
|
|
- });
|
|
|
+ });*/
|
|
|
alert(JSON.stringify(res));
|
|
|
},
|
|
|
cancel: function (res) {
|