فهرست منبع

wesmiler 更新第5期升级

wesmiler 5 سال پیش
والد
کامیت
3938963b1b
2فایلهای تغییر یافته به همراه14 افزوده شده و 10 حذف شده
  1. 1 1
      public/themes/default/weixin/public/assets/css/match.css
  2. 13 9
      public/themes/default/weixin/public/assets/js/home.js

+ 1 - 1
public/themes/default/weixin/public/assets/css/match.css

@@ -417,7 +417,7 @@ body {
     display: block;
     color: red;
     width: 100%;
-    min-width: 290px;
+    min-width: 296px;
     font-size: 14px;
 }
 

+ 13 - 9
public/themes/default/weixin/public/assets/js/home.js

@@ -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) {