settter
parent
89056b7d1c
commit
36f40d27dc
|
@ -0,0 +1,32 @@
|
|||
// 经纬度逆解析成地址
|
||||
//lat = 30.65805;
|
||||
//lng = 104.136153;
|
||||
function getAddress(lat,lng,obj){
|
||||
$.ajax({
|
||||
type: 'get',
|
||||
url: 'http://apis.map.qq.com/ws/geocoder/v1',
|
||||
dataType: 'jsonp',
|
||||
data: {
|
||||
key: "XJXBZ-7EBCD-2MB45-HB73N-R362T-WRFJR",//开发密钥
|
||||
location: lat + "," + lng,//位置坐标
|
||||
get_poi: "0",//是否返回周边POI列表:1.返回;0不返回(默认)
|
||||
coord_type: "1",//输入的locations的坐标类型,1 GPS坐标
|
||||
parameter: { "scene_type": "tohome", "poi_num": 20 },//附加控制功能
|
||||
output: "jsonp"
|
||||
},
|
||||
success: function (data, textStatus) {
|
||||
if (data.status == 0) {
|
||||
var address = data.result.formatted_addresses.recommend;
|
||||
//$("#address").html(address);
|
||||
// console.log(data.result.address)
|
||||
// console.log(address)
|
||||
$(obj).text(data.result.address + address);
|
||||
} else {
|
||||
alert("位置获取错误,请联系管理员!")
|
||||
}
|
||||
},
|
||||
error: function () {
|
||||
alert("位置获取错误,请联系管理员!")
|
||||
}
|
||||
});
|
||||
}
|
|
@ -71,8 +71,14 @@
|
|||
|
||||
<!-- 列 轮播图 -->
|
||||
<script type="text/html" id="row-other">
|
||||
经纬度:{{ d.bill!=undefined?d.bill.lng:'' }},{{ d.bill!=undefined?d.lat:'' }}
|
||||
经纬度:{{ d.bill!=undefined?d.bill.lng:'' }},{{ d.bill!=undefined?d.bill.lat:'' }}
|
||||
|
||||
{{# if(d.bill!=undefined ){ }}
|
||||
<a onclick="getAddress({{d.bill.lat}},{{d.bill.lng}},this)" target="_blank">点击查看</a>
|
||||
{{# } }}
|
||||
|
||||
</script>
|
||||
|
||||
<script src="__MANAGER__/js/business/business_deduction_list.js?v={:mt_rand()}"></script>
|
||||
<script src="__MANAGER__/js/business/business_deduction_list.js?v={:mt_rand()}"></script>
|
||||
<script src="__STATIC__/js/jquery-3.3.1.js?v={:mt_rand()}"></script>
|
||||
<script src="__MANAGER__/js/get_addredss.js?v={:mt_rand()}"></script>
|
|
@ -136,39 +136,4 @@
|
|||
<script src="__MANAGER__/js/consumer/info.js?v={:mt_rand()}"></script>
|
||||
<script src="__STATIC__/js/jquery-3.3.1.js?v={:mt_rand()}"></script>
|
||||
|
||||
<script>
|
||||
// 经纬度逆解析成地址
|
||||
//lat = 30.65805;
|
||||
//lng = 104.136153;
|
||||
function getAddress(lat,lng,obj){
|
||||
$.ajax({
|
||||
type: 'get',
|
||||
url: 'http://apis.map.qq.com/ws/geocoder/v1',
|
||||
dataType: 'jsonp',
|
||||
data: {
|
||||
key: "XJXBZ-7EBCD-2MB45-HB73N-R362T-WRFJR",//开发密钥
|
||||
location: lat + "," + lng,//位置坐标
|
||||
get_poi: "0",//是否返回周边POI列表:1.返回;0不返回(默认)
|
||||
coord_type: "1",//输入的locations的坐标类型,1 GPS坐标
|
||||
parameter: { "scene_type": "tohome", "poi_num": 20 },//附加控制功能
|
||||
output: "jsonp"
|
||||
},
|
||||
success: function (data, textStatus) {
|
||||
if (data.status == 0) {
|
||||
var address = data.result.formatted_addresses.recommend;
|
||||
//$("#address").html(address);
|
||||
// console.log(data.result.address)
|
||||
// console.log(address)
|
||||
$(obj).text(data.result.address + address);
|
||||
} else {
|
||||
alert("位置获取错误,请联系管理员!")
|
||||
}
|
||||
},
|
||||
error: function () {
|
||||
alert("位置获取错误,请联系管理员!")
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
<script src="__MANAGER__/js/get_addredss.js?v={:mt_rand()}"></script>
|
Loading…
Reference in New Issue