From 97274ce7b24ca78c999563a1c96bce27d3f9fd8c Mon Sep 17 00:00:00 2001 From: "xuhe@fangjia.com" Date: Tue, 22 May 2018 14:33:00 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A6=96=E9=A1=B5=E5=AE=9A=E4=BD=8D=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fangija-zsyf/yfindex.html | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/fangija-zsyf/yfindex.html b/fangija-zsyf/yfindex.html index 06dc959..47dbcac 100644 --- a/fangija-zsyf/yfindex.html +++ b/fangija-zsyf/yfindex.html @@ -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 += '
  • 自定义: - 万确定
  • '; $("#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");