(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/switchcity/switchcity"],{"01d5":function(t,e,o){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=getApp(),a=o("81de"),n=o("81de"),c=o("17f5"),r=getApp(),s={data:function(){return{searchLetter:[],showLetter:"",winHeight:0,cityList:[],isShowLetter:!1,scrollTop:0,oldScrollTop:0,scrollTopId:"",city:"定位中...",currentCityCode:"",inputName:"",completeList:[],county:"",condition:!1,itemH:"",toastShowLetter:"",countyList:""}},components:{},props:{},onLoad:function(){var e=a.searchLetter,o=a.cityList(),i=t.getSystemInfoSync();console.log(i);var n=i.windowHeight,c=n/e.length,s=[];e.map((function(t,e){var o={};o.name=t,o.tHeight=e*c,o.bHeight=(e+1)*c,s.push(o)})),this.setData({winHeight:n,itemH:c,searchLetter:s,cityList:o,city:r.globalData.city,currentCityCode:r.globalData.currentCityCode,county:r.globalData.county})},methods:{back:function(){this.$isEmpty(this.county)||t.navigateBack({delta:1})},goTop:function(t){var e=this;this.scrollTop=this.oldScrollTop,this.$nextTick((function(){e.scrollTop=0}))},clickLetter:function(t){console.log(t.currentTarget.dataset.letter);var e=t.currentTarget.dataset.letter;this.setData({toastShowLetter:e,isShowLetter:!0,scrollTopId:e});var o=this;setTimeout((function(){o.setData({isShowLetter:!1})}),500)},reGetLocation:function(){r.globalData.defaultCity=this.city,r.globalData.defaultCounty=this.county,console.log(r.globalData.defaultCity),t.navigateTo({url:"/pages/choosePlot/choosePlot"})},bindCity:function(t){this.goTop(),this.setData({condition:!0,city:t.currentTarget.dataset.city,currentCityCode:t.currentTarget.dataset.code,completeList:[]}),this.selectCounty(),r.globalData.defaultCity=this.city,r.globalData.defaultCounty="",this.setData({county:"",currentCityCode:""}),console.log(r.globalData.defaultCity)},bindCounty:function(e){console.log(e),console.info("////"+this.city);var o=getCurrentPages(),a=o[o.length-2].$vm;this.$isEmpty(this.city)||(i.globalData.city=this.city),this.$isEmpty(e.currentTarget.dataset.city)||(i.globalData.county=e.currentTarget.dataset.city),this.$isEmpty(e.currentTarget.dataset.code)||(i.globalData.currentCityCode=e.currentTarget.dataset.code),a.setData({city:this.city,county:e.currentTarget.dataset.city,currentCityCode:e.currentTarget.dataset.code}),t.navigateBack()},hotCity:function(){console.log("hotCity"),this.setData({scrollTop:0})},bindScroll:function(t){this.oldScrollTop=t.detail.scrollTop},selectCounty:function(){console.log("正在定位区县");var t=this.currentCityCode,e=this,o={id:t,key:c.key};e.$http.getDistrictChildren(o).then((function(t){var o=t.data.result.result[0];e.setData({countyList:o})}))},getLocation:function(){console.log("正在定位城市"),this.setData({county:""});var e=this;t.getLocation({type:"wgs84",success:function(t){var o=t.latitude,i=t.longitude,a={location:o+","+i,key:c.key};e.$http.getLocation(a).then((function(t){var o=t.data.result.result.ad_info;console.log(o.city+o.adcode),e.setData({city:o.city,currentCityCode:o.adcode,county:o.district})}))}})},bindBlur:function(t){this.setData({inputName:""})},bindKeyInput:function(t){this.setData({inputName:t.detail.value}),this.auto(),this.goTop()},auto:function(){var t=this.inputName.trim(),e=t.toLowerCase(),o=e.length,i=n.cityObjs,a=[],c=i.filter((function(t){var i=t.short.slice(0,o).toLowerCase();return i&&i==e})),r=i.filter((function(t){if(t.shorter){var i=t.shorter.slice(0,o).toLowerCase();return i&&i==e}})),s=i.filter((function(t){var i=t.city.slice(0,o);return i&&i==e}));if(c[0])c.map((function(t){var e={};e.city=t.city,e.code=t.code,a.push(e)})),this.setData({completeList:a});else if(r[0])r.map((function(t){var e={};e.city=t.city,e.code=t.code,a.push(e)})),this.setData({completeList:a});else{if(!s[0])return;s.map((function(t){var e={};e.city=t.city,e.code=t.code,a.push(e)})),this.setData({completeList:a})}}}};e.default=s}).call(this,o("543d")["default"])},1251:function(t,e,o){},1293:function(t,e,o){"use strict";o.r(e);var i=o("214a"),a=o("8ce4");for(var n in a)"default"!==n&&function(t){o.d(e,t,(function(){return a[t]}))}(n);o("8dcc");var c,r=o("f0c5"),s=Object(r["a"])(a["default"],i["b"],i["c"],!1,null,null,null,!1,i["a"],c);e["default"]=s.exports},"214a":function(t,e,o){"use strict";var i;o.d(e,"b",(function(){return a})),o.d(e,"c",(function(){return n})),o.d(e,"a",(function(){return i}));var a=function(){var t=this,e=t.$createElement;t._self._c},n=[]},"67d5":function(t,e,o){"use strict";(function(t){o("4518");i(o("66fd"));var e=i(o("1293"));function i(t){return t&&t.__esModule?t:{default:t}}t(e.default)}).call(this,o("543d")["createPage"])},"8ce4":function(t,e,o){"use strict";o.r(e);var i=o("01d5"),a=o.n(i);for(var n in i)"default"!==n&&function(t){o.d(e,t,(function(){return i[t]}))}(n);e["default"]=a.a},"8dcc":function(t,e,o){"use strict";var i=o("1251"),a=o.n(i);a.a}},[["67d5","common/runtime","common/vendor"]]]);