This commit is contained in:
xuhe@fangjia.com
2018-03-30 09:50:10 +08:00
parent ac2d0ec58d
commit a4be112e1a
+21 -16
View File
@@ -2054,17 +2054,23 @@ $(document).on('click','#notFound_btn', function () {
}); });
/* 获取城市 */ /* 获取城市 */
$("body").delegate(".popup-about01 p", "click", function () { $("body").delegate(".popup-about01 p", "click", function () {
changeCity($(this).text())
$("#input_city").text($(this).text()); });
$(".cityChoice a").text($(this).text()); $("body").delegate(".popup-about01 .cityGPS", "click", function () {
changeCity($(this).find('p')[0].innerHTML)
});
function changeCity(cityStr){
$("#input_city").text(cityStr);
$(".cityChoice a").text(cityStr);
$(".popup-about01 p").removeClass("active"); $(".popup-about01 p").removeClass("active");
$(this).addClass("active"); $(this).addClass("active");
var sort = 1; var sort = 1;
city = $(this).text() city = cityStr
if(oriCity== $(this).text()){ if(oriCity== cityStr){
lat = oriLat; lat = oriLat;
lng = oriLng; lng = oriLng;
if($(this).text()=="上海"){ if(cityStr=="上海"){
$("#ShangHaiDiv").show(); $("#ShangHaiDiv").show();
$("#otherCityDiv").hide(); $("#otherCityDiv").hide();
//initNearDistricts($(this).text(),lat,lng,"",0,0,0,""); //initNearDistricts($(this).text(),lat,lng,"",0,0,0,"");
@@ -2080,7 +2086,7 @@ $("body").delegate(".popup-about01 p", "click", function () {
}else{ }else{
lat = 0; lat = 0;
lng = 0; lng = 0;
if($(this).text()=="上海"){ if(cityStr=="上海"){
$("#ShangHaiDiv").show(); $("#ShangHaiDiv").show();
$("#otherCityDiv").hide(); $("#otherCityDiv").hide();
//initNews() //initNews()
@@ -2093,11 +2099,11 @@ $("body").delegate(".popup-about01 p", "click", function () {
} }
} }
if($(this).text()=="上海"){ if(cityStr=="上海"){
$("#ShangHaiDiv").show(); $("#ShangHaiDiv").show();
$("#otherCityDiv").hide(); $("#otherCityDiv").hide();
//initNearDistricts($(this).text(),0,0,"",0,0,0,""); //initNearDistricts($(this).text(),0,0,"",0,0,0,"");
initBaseInfo($(this).text(),"",address,lat,lng); initBaseInfo(cityStr,"",address,lat,lng);
}else{ }else{
$("#ShangHaiDiv").hide(); $("#ShangHaiDiv").hide();
$("#otherCityDiv").show(); $("#otherCityDiv").show();
@@ -2105,24 +2111,23 @@ $("body").delegate(".popup-about01 p", "click", function () {
dataObj2 = {}; dataObj2 = {};
$(".infinite-scroll-preloader").show(); $(".infinite-scroll-preloader").show();
$('.infinite-scroll-bottom .list-container').html(''); $('.infinite-scroll-bottom .list-container').html('');
city = $(this).text(); city = cityStr;
initRegionSelect($(this).text()); initRegionSelect(cityStr);
$(".region a").text('不限'); $(".region a").text('不限');
$("#select_price_div a").text('不限'); $("#select_price_div a").text('不限');
//不同城市查询价格区间 //不同城市查询价格区间
getCityPriceLevel($(this).text()); getCityPriceLevel(cityStr);
//加载列表 //加载列表
sort=6; sort=6;
getDistrictList($(this).text(),lat,lng,"",sort,0,0,""); getDistrictList(cityStr,lat,lng,"",sort,0,0,"");
initBaseInfo($(this).text(),"","",0,0); initBaseInfo(cityStr,"","",0,0);
} }
$(".selectContent").hide(); $(".selectContent").hide();
//刷新下拉滚动加载事件 //刷新下拉滚动加载事件
$.attachInfiniteScroll($('.infinite-scroll')) $.attachInfiniteScroll($('.infinite-scroll'))
//potenialIndex($(this).text(),sort); //potenialIndex($(this).text(),sort);
}); }
function req(cityStr){ function req(cityStr){
city=cityStr.replace("<i></i>","") city=cityStr.replace("<i></i>","")
$("#input_city").text(city); $("#input_city").text(city);