首页定位问题
This commit is contained in:
@@ -1255,26 +1255,26 @@ function getPosition(){
|
||||
if(city){
|
||||
city = formatBaiduCity(city);
|
||||
}
|
||||
region = p.address.district;
|
||||
if(region.endWith("区") || region.endWith("市") ){
|
||||
region = region.substring(0, region.length-1);
|
||||
}
|
||||
axios.get("/rest/index/isChinaCity", {
|
||||
params: {
|
||||
city: city
|
||||
city: city,
|
||||
region: region
|
||||
}
|
||||
})
|
||||
.then(function (response) {
|
||||
if(response.data.data.status==1){
|
||||
if(response.data.data.status==1 && (response.data.data.region!="" || response.data.data.region!=undefined)){
|
||||
address = p.address.street;
|
||||
province = p.address.province;
|
||||
|
||||
region = p.address.district;
|
||||
region = response.data.data.region
|
||||
lng = p.coords.longitude;//获取到当前位置的经度
|
||||
lat = p.coords.latitude;//获取到当前位置的纬度;
|
||||
oriLng = p.coords.longitude;
|
||||
oriLat = p.coords.latitude;
|
||||
|
||||
|
||||
if(region.endWith("区") || region.endWith("市") ){
|
||||
region = region.substring(0, region.length-1);
|
||||
}
|
||||
oriRegion = region;
|
||||
oriCity = city;
|
||||
}else{
|
||||
@@ -1282,7 +1282,6 @@ function getPosition(){
|
||||
$("#input_city").text(city);
|
||||
initRegionSelect(city);
|
||||
localStorage.setItem("init_city", city);
|
||||
//addLocation(lat,lng);
|
||||
initBaseInfo(city,"","",0,0);
|
||||
$("#ShangHaiDiv").show();
|
||||
$("#otherCityDiv").hide();
|
||||
@@ -1303,7 +1302,18 @@ function getPosition(){
|
||||
console.log(error);
|
||||
});
|
||||
}
|
||||
/*}
|
||||
city = "嘉兴";
|
||||
province = "浙江";
|
||||
region = "秀洲"
|
||||
lng = 120.6845052002997;//获取到当前位置的经度
|
||||
lat = 30.62661481274257;//获取到当前位置的纬度;
|
||||
oriLng = 120.6845052002997;
|
||||
oriLat = 30.62661481274257;
|
||||
|
||||
oriRegion = "秀洲";
|
||||
oriCity = "嘉兴";
|
||||
initData();*/
|
||||
}, function(e){
|
||||
city = "上海";
|
||||
$("#input_city").text(city);
|
||||
@@ -2693,6 +2703,7 @@ function getCityPriceLevel(cityParam){
|
||||
}
|
||||
html += '<li class="item-content"><div class="item-inner"><div class="item-title theme" data-id="8"><i class="icon"></i>自定义:<input type="number" placeholder="最小" id="minPrice"> - <input type="number" placeholder="最大" id="maxPrice"> 万<a class="button button-fill theme" onclick="customPriceQuery()">确定</a></div></div></li></ul>';
|
||||
$("#select_price").html(html);
|
||||
getDistrictList(cityParam,lat,lng,"",6,0,0,"");
|
||||
|
||||
$("#select_price li").on("click", function () {
|
||||
$(this).parents("#select_price").find(".item-title").removeClass("active");
|
||||
|
||||
Reference in New Issue
Block a user