|
@@ -64,7 +64,6 @@ |
|
@@ -64,7 +64,6 @@ |
64
|
{include file="public/js" /}
|
64
|
{include file="public/js" /}
|
65
|
<script src="__CDN__/assets/advertising/mui/mui.min.js"></script>
|
65
|
<script src="__CDN__/assets/advertising/mui/mui.min.js"></script>
|
66
|
<script src="__CDN__/assets/advertising/mui/mui.picker.min.js"></script>
|
66
|
<script src="__CDN__/assets/advertising/mui/mui.picker.min.js"></script>
|
67
|
- <script src="__CDN__/assets/advertising/js/qqmap-wx-jssdk.js"></script>
|
|
|
68
|
<script type="text/javascript" src="http://res.wx.qq.com/open/js/jweixin-1.4.0.js"></script>
|
67
|
<script type="text/javascript" src="http://res.wx.qq.com/open/js/jweixin-1.4.0.js"></script>
|
69
|
<script>
|
68
|
<script>
|
70
|
$(function(){
|
69
|
$(function(){
|
|
@@ -134,16 +133,20 @@ |
|
@@ -134,16 +133,20 @@ |
134
|
function success(data) {
|
133
|
function success(data) {
|
135
|
lat = data.latitude; //经度
|
134
|
lat = data.latitude; //经度
|
136
|
lng = data.longitude; //纬度
|
135
|
lng = data.longitude; //纬度
|
137
|
- var qqmapsdk = new QQMapWX({
|
|
|
138
|
- key: 'PWEBZ-YJVWK-KAYJ2-ATH6Y-I7D35-GZFGU' //这里自己的key秘钥进行填充
|
|
|
139
|
- });
|
|
|
140
|
- qqmapsdk.reverseGeocoder({
|
|
|
141
|
- location: {
|
|
|
142
|
- latitude: lat,
|
|
|
143
|
- longitude: lng
|
136
|
+ //保存到用户表
|
|
|
137
|
+ $.ajax({
|
|
|
138
|
+ url:"{:url('home/member/get_city')}",
|
|
|
139
|
+ type:"POST",
|
|
|
140
|
+ data:{'user_id':user_id,'longitude':lng,'latitude':lat},
|
|
|
141
|
+ success:function(res){
|
|
|
142
|
+ if(res.code == 1){
|
|
|
143
|
+ toast('定位成功');
|
|
|
144
|
+ }else{
|
|
|
145
|
+ toast('定位失败');
|
|
|
146
|
+ }
|
144
|
},
|
147
|
},
|
145
|
- success: function(res) {
|
|
|
146
|
- console.log(res);
|
148
|
+ error:function(res){
|
|
|
149
|
+ toast('与服务器断开连接')
|
147
|
}
|
150
|
}
|
148
|
});
|
151
|
});
|
149
|
}
|
152
|
}
|