(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-select_address-select_address_n"],{"965d":function(n,t,e){var i=e("24fb");t=i(!1),t.push([n.i,"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n/* page {\n background-color: #fff;\n} */.text[data-v-ea817e60]{font-size:%?28?%;white-space:normal}.head_top[data-v-ea817e60]{background-color:#fff;padding:%?28?%}.address-box[data-v-ea817e60]{border-radius:%?21?% %?21?% %?0?% %?0?%;padding:%?30?% %?28?%;width:%?750?%}.head_item[data-v-ea817e60]{width:%?750?%;flex-direction:row;justify-content:space-between;padding-bottom:%?28?%;font-size:%?28?%;font-family:PingFang SC-Regular,PingFang SC;font-weight:400;color:#333}.re-location[data-v-ea817e60]{flex-direction:row;flex-wrap:nowrap;width:%?480?%;align-items:center}.re-address-img[data-v-ea817e60]{width:%?38.55?%;height:%?38.55?%;margin-right:%?10?%}.re-btn[data-v-ea817e60]{flex-direction:row;padding-left:%?10?%;width:%?200?%;height:%?100?%;align-items:center}.head_item_tips[data-v-ea817e60]{height:%?44?%;font-size:%?32?%;font-family:PingFang SC-Regular,PingFang SC;font-weight:400;color:#737373}.address-list[data-v-ea817e60]{font-size:%?28?%;font-family:PingFang SC-Regular,PingFang SC;font-weight:400;color:#333;height:%?80?%;line-height:%?75?%;border-bottom:%?1?% solid rgba(0,0,0,.1)}.area[data-v-ea817e60]{flex-direction:row;flex-wrap:wrap;padding-top:%?30?%;justify-content:flex-start}.area-item[data-v-ea817e60]{height:%?64?%;\n /* width: 100px; */background-color:#fff;border-radius:%?11?% %?11?% %?11?% %?11?%;border:%?2?% solid #b3b3b3;flex-direction:row;align-items:center;justify-content:center;padding:0 %?20?%;font-size:%?28?%;font-family:PingFang SC-Medium,PingFang SC;font-weight:500;color:#737373;margin-bottom:%?22?%;margin-right:%?22?%}.area-item-on[data-v-ea817e60]{color:#ff6d20;border:%?2?% solid #ff6d20}.street[data-v-ea817e60]{padding-top:%?28?%}.letter-item[data-v-ea817e60]{flex-direction:row}.letter[data-v-ea817e60]{margin-right:%?28?%;font-size:%?25?%;font-family:PingFang SC;font-weight:400;width:%?40?%;text-align:center;color:#737373}.item-box[data-v-ea817e60]{flex:1}.street-item[data-v-ea817e60]{width:100%;padding-bottom:%?28?%;font-size:%?28?%;font-family:PingFang SC;font-weight:400;color:#333}",""]),n.exports=t},9842:function(n,t,e){"use strict";e("7a82");var i=e("4ea4").default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;i(e("5530"));e("4e82"),e("b64b"),e("d401"),e("d3b7"),e("25f0"),e("159b"),e("14d9");var a=e("a126"),s=e("7a69"),o=e("f89e"),r={data:function(){return{tabsList:[{name:"地图定位"},{name:"泸州区县"}],current:0,latitude:"28.87",longitude:"105.44",markers:{id:1,longitude:"28.87",latitude:"105.44",iconPath:"https://lihai001.oss-cn-chengdu.aliyuncs.com/def/cbbd5202311241523412538.png",width:28,height:28},locationInfo:{},town:"",street_id:"",street:"",areaList:[],streetList:[],mapList:{},area_change:"",street_change:""}},onLoad:function(n){this.getLoaction(),this.loadArea()},onShow:function(){},computed:{mapKey:function(){return Object.keys(this.mapList).sort()}},methods:{changeCurrent:function(n){this.current=n.index},getLoaction:function(){var n=this;this.street="定位中",this.locationInfo={},this.locationInfo.formatted_addresses={},this.locationInfo.formatted_addresses.recommend="定位中",uni.getLocation({type:"wgs84",timeout:"4",success:function(t){var e,i;e=t.latitude.toString(),i=t.longitude.toString(),n.latitude=t.latitude.toFixed(6),n.longitude=t.longitude.toFixed(6),n.$store.commit("setLocation",{lat:t.latitude.toFixed(6),long:t.longitude.toFixed(6)}),(0,a.getGeocoder)({lat:e,long:i}).then((function(t){n.locationInfo=t.data,n.town=t.data.address_reference.town.title,n.street_id=t.data.address_reference.town.id,n.street=t.data.address_reference.town.title})).catch((function(t){uni.showToast({title:t,icon:"none"}),n.street="定位失败"}))},fail:function(t){n.isshow=!1,(0,o.Toast)("定位失败,请检查定位权限是否开启"),n.street="定位失败",n.locationInfo.formatted_addresses.recommend="定位失败"}})},reGetLocation:function(){this.getLoaction()},loadArea:function(){var n=this;(0,s.getArea)({city_code:510500}).then((function(t){n.areaList=t.data,n.changeArea(n.areaList[0])}))},loadStreet:function(n){var t=this;this.street_change="",(0,s.getStreet)({area_code:n}).then((function(n){t.streetList=n.data,t.initPinyin()}))},initPinyin:function(){var n=this;this.mapList={},this.streetList.forEach((function(t){var e,i=null===(e=t.pinyin)||void 0===e?void 0:e.toUpperCase();i=i||"#",n.mapList[i]||(n.mapList[i]=[]),n.mapList[i].push(t)}))},changeArea:function(n){this.area_change=n.code,this.loadStreet(this.area_change)},changeStreet:function(n){var t=this;uni.navigateBack({success:function(){uni.$emit("changeAddress",{area:t.area_change,street:n})}})},handleMapTap:function(n){return(0,o.Toast)("H5暂不支持选择坐标")},submitAddress:function(){try{this.town=this.locationInfo.address_reference.town.title,this.street_id=this.locationInfo.address_reference.town.id,this.street=this.locationInfo.address_reference.town.title;var n={area:this.locationInfo.ad_info.adcode,street:{name:this.street,code:this.street_id},latitude:this.latitude,longitude:this.longitude};uni.navigateBack({success:function(){uni.$emit("changeAddress",n)}})}catch(t){return(0,o.Toast)("地址有误,请重新选择")}},searchMap:function(){uni.request({url:"https://restapi.amap.com/v3/place/text?keywords=北京大学&city=beijing&offset=20&page=1&key=0799f37420c0784f1e6cba230a68bdb1&extensions=all",success:function(n){},fail:function(n){}})}},onPullDownRefresh:function(){uni.stopPullDownRefresh()}};t.default=r},bb83:function(n,t,e){var i=e("965d");i.__esModule&&(i=i.default),"string"===typeof i&&(i=[[n.i,i,""]]),i.locals&&(n.exports=i.locals);var a=e("4f06").default;a("550c1164",i,!0,{sourceMap:!1,shadowMode:!1})},c106:function(n,t,e){"use strict";var i=e("bb83"),a=e.n(i);a.a},ca27:function(n,t,e){"use strict";e.r(t);var i=e("f326"),a=e("fcb3");for(var s in a)["default"].indexOf(s)<0&&function(n){e.d(t,n,(function(){return a[n]}))}(s);e("c106");var o=e("f0c5"),r=Object(o["a"])(a["default"],i["b"],i["c"],!1,null,"ea817e60",null,!1,i["a"],void 0);t["default"]=r.exports},f326:function(n,t,e){"use strict";e.d(t,"b",(function(){return a})),e.d(t,"c",(function(){return s})),e.d(t,"a",(function(){return i}));var i={uSticky:e("a6d7").default,uTabs:e("cd9e").default,uButton:e("8226").default},a=function(){var n=this,t=n.$createElement,i=n._self._c||t;return i("v-uni-view",{staticStyle:{"background-color":"#fff"}},[i("u-sticky",{attrs:{customNavHeight:"0"}},[i("v-uni-view",{staticClass:"head_top"},[i("u-tabs",{attrs:{list:n.tabsList,itemStyle:"font-size: 32rpx;height: 74rpx;",current:n.current,lineColor:"#FF6D20",lineWidth:"105rpx",height:"7rpx"},on:{change:function(t){arguments[0]=t=n.$handleEvent(t),n.changeCurrent.apply(void 0,arguments)}}})],1)],1),i("v-uni-view",{staticStyle:{"background-color":"#f4f4f4",height:"30rpx"}}),0==n.current?i("v-uni-view",{staticClass:"address-box",staticStyle:{padding:"0"}},[i("v-uni-map",{staticStyle:{width:"750rpx",height:"750rpx"},attrs:{longitude:n.longitude,latitude:n.latitude,markers:[n.markers],"show-location":!0},on:{click:function(t){arguments[0]=t=n.$handleEvent(t),n.handleMapTap.apply(void 0,arguments)}}}),i("v-uni-view",{staticClass:"head_item",staticStyle:{padding:"10rpx 20rpx"}},[i("v-uni-view",{staticClass:"re-location"},[i("v-uni-view",{staticStyle:{width:"120rpx"}},[i("v-uni-text",{staticClass:"text"},[n._v("当前位置:")])],1),i("v-uni-view",{staticStyle:{flex:"1"}},[i("v-uni-text",{staticClass:"text"},[n._v(n._s(n.locationInfo.formatted_addresses?n.locationInfo.formatted_addresses.recommend:n.locationInfo.address))])],1)],1),i("v-uni-view",{staticClass:"re-btn",on:{click:function(t){arguments[0]=t=n.$handleEvent(t),n.reGetLocation.apply(void 0,arguments)}}},[i("v-uni-image",{staticClass:"re-address-img",attrs:{src:e("96e5")}}),i("v-uni-text",{staticClass:"text"},[n._v("重新定位")])],1)],1),i("u-button",{attrs:{text:"确认"},on:{click:function(t){arguments[0]=t=n.$handleEvent(t),n.submitAddress.apply(void 0,arguments)}}})],1):n._e(),1==n.current?i("v-uni-view",{staticClass:"address-box"},[i("v-uni-view",{staticClass:"head_item_tips"},[i("v-uni-view",[i("v-uni-text",{staticClass:"text"},[n._v("泸州区县")])],1)],1),i("v-uni-view",{staticClass:"area"},n._l(n.areaList,(function(t,e){return i("v-uni-view",{key:e,staticClass:"area-item",class:{"area-item-on":t.code==n.area_change},on:{click:function(e){arguments[0]=e=n.$handleEvent(e),n.changeArea(t)}}},[i("v-uni-text",{staticClass:"text"},[n._v(n._s(t.name))])],1)})),1),i("v-uni-view",{staticClass:"head_item_tips"},[i("v-uni-view",[i("v-uni-text",{staticClass:"text"},[n._v("选择街道/镇")])],1)],1),i("v-uni-view",{staticClass:"street"},n._l(n.mapKey,(function(t){return i("v-uni-view",{key:t,staticClass:"letter-item"},[i("v-uni-view",{staticClass:"letter"},[i("v-uni-text",{staticClass:"text"},[n._v(n._s(t))])],1),i("v-uni-view",{staticClass:"item-box"},n._l(n.mapList[t],(function(t){return i("v-uni-view",{key:t.code,staticClass:"street-item",on:{click:function(e){arguments[0]=e=n.$handleEvent(e),n.changeStreet(t)}}},[i("v-uni-text",{staticClass:"text"},[n._v(n._s(t.name))])],1)})),1)],1)})),1)],1):n._e()],1)},s=[]},fcb3:function(n,t,e){"use strict";e.r(t);var i=e("9842"),a=e.n(i);for(var s in i)["default"].indexOf(s)<0&&function(n){e.d(t,n,(function(){return i[n]}))}(s);t["default"]=a.a}}]);