首页定位问题
This commit is contained in:
@@ -1255,26 +1255,26 @@ function getPosition(){
|
|||||||
if(city){
|
if(city){
|
||||||
city = formatBaiduCity(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", {
|
axios.get("/rest/index/isChinaCity", {
|
||||||
params: {
|
params: {
|
||||||
city: city
|
city: city,
|
||||||
|
region: region
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.then(function (response) {
|
.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;
|
address = p.address.street;
|
||||||
province = p.address.province;
|
province = p.address.province;
|
||||||
|
region = response.data.data.region
|
||||||
region = p.address.district;
|
|
||||||
lng = p.coords.longitude;//获取到当前位置的经度
|
lng = p.coords.longitude;//获取到当前位置的经度
|
||||||
lat = p.coords.latitude;//获取到当前位置的纬度;
|
lat = p.coords.latitude;//获取到当前位置的纬度;
|
||||||
oriLng = p.coords.longitude;
|
oriLng = p.coords.longitude;
|
||||||
oriLat = p.coords.latitude;
|
oriLat = p.coords.latitude;
|
||||||
|
|
||||||
|
|
||||||
if(region.endWith("区") || region.endWith("市") ){
|
|
||||||
region = region.substring(0, region.length-1);
|
|
||||||
}
|
|
||||||
oriRegion = region;
|
oriRegion = region;
|
||||||
oriCity = city;
|
oriCity = city;
|
||||||
}else{
|
}else{
|
||||||
@@ -1282,7 +1282,6 @@ function getPosition(){
|
|||||||
$("#input_city").text(city);
|
$("#input_city").text(city);
|
||||||
initRegionSelect(city);
|
initRegionSelect(city);
|
||||||
localStorage.setItem("init_city", city);
|
localStorage.setItem("init_city", city);
|
||||||
//addLocation(lat,lng);
|
|
||||||
initBaseInfo(city,"","",0,0);
|
initBaseInfo(city,"","",0,0);
|
||||||
$("#ShangHaiDiv").show();
|
$("#ShangHaiDiv").show();
|
||||||
$("#otherCityDiv").hide();
|
$("#otherCityDiv").hide();
|
||||||
@@ -1303,7 +1302,18 @@ function getPosition(){
|
|||||||
console.log(error);
|
console.log(error);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
/*}
|
||||||
|
city = "嘉兴";
|
||||||
|
province = "浙江";
|
||||||
|
region = "秀洲"
|
||||||
|
lng = 120.6845052002997;//获取到当前位置的经度
|
||||||
|
lat = 30.62661481274257;//获取到当前位置的纬度;
|
||||||
|
oriLng = 120.6845052002997;
|
||||||
|
oriLat = 30.62661481274257;
|
||||||
|
|
||||||
|
oriRegion = "秀洲";
|
||||||
|
oriCity = "嘉兴";
|
||||||
|
initData();*/
|
||||||
}, function(e){
|
}, function(e){
|
||||||
city = "上海";
|
city = "上海";
|
||||||
$("#input_city").text(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>';
|
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);
|
$("#select_price").html(html);
|
||||||
|
getDistrictList(cityParam,lat,lng,"",6,0,0,"");
|
||||||
|
|
||||||
$("#select_price li").on("click", function () {
|
$("#select_price li").on("click", function () {
|
||||||
$(this).parents("#select_price").find(".item-title").removeClass("active");
|
$(this).parents("#select_price").find(".item-title").removeClass("active");
|
||||||
|
|||||||
Reference in New Issue
Block a user