import{t,p as e,w as a,x as i,y as s,H as o,Q as n,q as l,bw as c,bR as h,bS as r,$ as d,K as u,bT as g,o as p,v as m,D as A,E as f,F as w,B as b,R as B,bU as C,bV as y,bW as S,a6 as M,b1 as H,a_ as L,b2 as j}from"./index-P0fyQ2Em.js";import{_ as k}from"./_plugin-vue_export-helper.BCo6x5W8.js";import{r as v}from"./uni-app.es.DOtS5Ldl.js";import{_ as U}from"./u-search.CSVnMmHg.js";import{_ as I}from"./u-loading.D5Tc00lz.js";import{_ as P}from"./index.BuZ8YmVY.js";import{_ as x}from"./u-button.Chh1-6a-.js";import"./u-icon.wXcRZHbn.js";import"./resources.DEPsJg7u.js";const K=k({name:"u-top-tips",props:{navbarHeight:{type:[Number,String],default:44},zIndex:{type:[Number,String],default:""}},data:()=>({timer:null,isShow:!1,title:"",type:"primary",duration:2e3}),computed:{uZIndex(){return this.zIndex?this.zIndex:this.$u.zIndex.topTips}},methods:{show(t={}){clearTimeout(this.timer),t.duration&&(this.duration=t.duration),t.type&&(this.type=t.type),this.title=t.title,this.isShow=!0,this.timer=setTimeout((()=>{this.isShow=!1,clearTimeout(this.timer),this.timer=null}),this.duration)}}},[["render",function(c,h,r,d,u,g){const p=l;return t(),e(p,{class:o(["u-tips",["u-"+u.type,u.isShow?"u-tip-show":""]]),style:n({top:r.navbarHeight+"px",zIndex:g.uZIndex})},{default:a((()=>[i(s(u.title),1)])),_:1},8,["class","style"])}],["__scopeId","data-v-656f35e9"]]);const N=k({data:()=>({loading:!1,tabWidth:150,tabIndex:0,keyword:"",location:{longitude:116.404,latitude:39.915},circles:[],list:[],pagination:{currentPage:1,pageSize:50},total:0,currentLocation:{},selectId:"",selectItem:{},enableLocation:"",showPopup:!1,locateLoading:!1,polygons:[],enableLocationScope:!1,adjustmentScope:500,enableDesktopLocation:!1,locationScope:[],emitKey:""}),onLoad(t){const e=t.data?JSON.parse(t.data):{};this.enableLocationScope=e.enableLocationScope||!1,this.adjustmentScope=e.adjustmentScope||500,this.enableDesktopLocation=e.enableDesktopLocation||!1,this.locationScope=e.locationScope||[],this.emitKey=e.emitKey,this.init()},methods:{init(){this.circles=[],this.polygons=[],this.selectId="",this.list=[],this.locateLoading=!1,this.getLocation()},getLocation(){this.loading=!0,c({type:"gcj02",isHighAccuracy:!0,success:t=>{this.location.longitude=t.longitude,this.location.latitude=t.latitude,this.getList(),this.handelCircle(),this.handleScopeCircle()},fail:t=>{this.getList(),this.handelCircle(),this.handleScopeCircle()}})},handleGetCenter(){this.mapContext=h("maps",this),this.mapContext.getCenterLocation({type:"gcj02",geocode:!0,isHighAccuracy:!0,altitude:!0,success:t=>{if(this.location.longitude=t.longitude,this.location.latitude=t.latitude,this.enableLocationScope){if((this.jnpf.getDistance(this.currentLocation.latitude,this.currentLocation.longitude,this.location.latitude,this.location.longitude)||0)>(this.adjustmentScope||500))return this.$refs.uTips.show({title:"超出微调范围",type:"warning"})}this.getList()}})},handelCircle(){if(this.enableDesktopLocation&&this.locationScope.length)for(let t=0;t{this.handleResult(t)})).catch((()=>{this.loading=!1}))},handleResult(t){this.loading=!1,"1"==t.data.status?(this.list=[...this.list,...t.data.pois||[]],this.total=Number(t.data.count||0)):this.$u.toast(t.data.info)},onSelectValueChange(t,e){this.selectStatus=!0,this.selectId=t.id,this.selectItem=t;const[a,i]=(t.location||"").split(",");this.location={longitude:a,latitude:i}},handleConfirm(){if(!this.selectId)return this.$u.toast("请选择地址");const t=this.selectItem,[e,a]=t.location.split(",");if(this.enableLocationScope){if((this.jnpf.getDistance(this.currentLocation.latitude,this.currentLocation.longitude,a,e)||0)>(this.adjustmentScope||500))return this.$refs.uTips.show({title:"超出微调范围",type:"warning"})}if(this.enableDesktopLocation&&this.locationScope.length){let t=[];for(let i=0;is.radius)}if(t.every((t=>!0===t)))return this.$refs.uTips.show({title:"超出规定范围",type:"warning"})}const i=t.address&&t.address.length?t.address:"";let s=t.pname+t.cityname+t.adname+i+t.name;t.pname==t.cityname&&(s=t.pname+t.adname+i+t.name),t.pname==t.cityname&&t.pname==t.adname&&(s=t.pname+i+t.name),this.innerValue={pName:t.pname,cName:t.cityname,adName:t.adname,address:i,name:t.name,lng:e,lat:a,fullAddress:s},d(this.emitKey,JSON.stringify(this.innerValue)),this.close()},close(){u({delta:1})},getDistance(t,e,a,i){const s=t=>t*(Math.PI/180),o=s(a-t),n=s(i-e),l=Math.sin(o/2)*Math.sin(o/2)+Math.cos(s(t))*Math.cos(s(a))*Math.sin(n/2)*Math.sin(n/2);return 1e3*(6371*(2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l))))},search(){this.searchTimer&&clearTimeout(this.searchTimer),this.searchTimer=setTimeout((()=>{this.list=[],this.pagination.currentPage=1,this.keyword?this.handleSearch():this.getList()}),300)},handleSearch(){this.loading=!0;const t={key:this.define.aMapWebKey,keywords:this.keyword,radius:this.enableLocationScope?this.adjustmentScope||500:-1,offset:this.pagination.pageSize,page:this.pagination.currentPage};g(t).then((t=>{this.handleResult(t)}))},handleLocate(){this.locateLoading||(this.locateLoading=!0,c({type:"gcj02",isHighAccuracy:!0,success:t=>{this.locateLoading=!1,t.longitude&&t.latitude&&(this.mapContext=h("maps",this),this.mapContext.moveToLocation({longitude:t.longitude,latitude:t.latitude}))},fail:t=>{this.locateLoading=!1,this.$u.toast("获取定位失败")}}))}}},[["render",function(o,n,c,h,r,d){const u=v(p("u-top-tips"),K),g=v(p("u-search"),U),k=l,N=C,O=y,V=S,T=H,E=L,J=j,Z=v(p("u-loading"),I),q=v(p("JnpfEmpty"),P),D=M,F=v(p("u-button"),x);return t(),e(k,{class:"jnpf-location-map"},{default:a((()=>[m(u,{ref:"uTips"},null,512),m(k,{class:"content"},{default:a((()=>[m(k,{class:"user-select u-flex-col"},{default:a((()=>[m(k,{class:"user-select-search"},{default:a((()=>[m(g,{placeholder:o.$t("common.searchText"),modelValue:r.keyword,"onUpdate:modelValue":n[0]||(n[0]=t=>r.keyword=t),height:"72","show-action":!1,"bg-color":"#f0f2f6",shape:"square",onChange:d.search},null,8,["placeholder","modelValue","onChange"])])),_:1})])),_:1})])),_:1}),m(k,{class:"header"},{default:a((()=>[m(k,{class:"map-container"},{default:a((()=>[m(V,{class:"map",id:"maps",latitude:r.location.latitude,longitude:r.location.longitude,circles:r.circles,polygons:r.polygons,scale:15,onRegionchange:d.regionChange},{default:a((()=>[m(N,{class:"map-marker h5-map-marker",src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACYAAAA/CAMAAAC7OkrPAAABfVBMVEUAAAArAAMrAAM5dtc0cc9Ki/RJivNIiPFIiPFKi/QnYLhIifFJi/QtZ8I4dNUsZ8ErAANCgecrAAMrAAM/fuNFhew8etwybss4ddUlXbQ7eNsqY7xKi/VFhexBf+QxbMg0cc8kWa8rZb5Eg+o3dNMvasUlWq05ddcsZsBBgOUuaMMzb8w+e987d9lCgeZKi/U1ctAxbck9et0mXrU4ddQnYLgqZL1Dgugwa8cnPXc0cM08edxIiPBJifItZ8IlXrUpYro4ddVDguk/feE+fOA+fOApYrspYrtGhu1IiPFIiPEqHTtHh+8qHDlDl/1Gmf85k/k1kfZJmv8ykPRAlvw+lfo8lPo3kvcujvNMm/8ojPAli+8rjfFLmv8iie0fiOwch+tKlv1Kkvoog+UjdtUla8ZEkPU7i+42iOwih+o5guUxguMxfd0td9cqc9FClPhGlftKk/tLjvdGjvU9j/RDjfJEh+4xiu0rh+oghOYeg+Q5f+EkfNw1e9seedjot1/vAAAATnRSTlMAMioGFnYv/vjv5trTYEo4HhAOCPyCC/79/fz7+fTw7+zr5uPh4N3a2dfTzca3sqqln5eXko6AfXBsaV1bWVNQSTw69Ojkq6qGbWw3NjbCP4ZMAAACB0lEQVRIx43P11bbQBSF4W1Lci8YjOm999476ZWEAAlJnEiy3Bu9w7NHMg6SZc0M383c/GufNajgECZ87tZWt29CcIAgJHhPZCl6qIpK8olXCKEaJ7hlNdFFZbfAwcTh0yM99JlOr7mODy0cu9Zg8N4pRS1Jznd6teqUdgkk5yrKHC61InaujyiJeOVdCtnLQfP2dIfqtB4qvm2HoY0HUJ9gZQltrueIlR31ANsXn5kutrFwzs7OFzCeYGeJcQwV2VlxCO17bPvtCO89Qxjh/Wd4gZcH7Kr4CqNnB0xno5hOsrPkNFYyX5gyKwg1s7PmEDCWZFXJMQCB2+8MtwGoBlL0KjUAzVbjV6rGLZTMZmhVZhaPIr0pcpXqjaAscP+N6D6AJ5NZUpWdhI7vvLSuLjt5GCznfljKLaPCSNaqyo6gUrDBKmsIwmQq97tKbgpmfMeVubrq4FFlMf/TJL+IalxfrLKK9XGw4M+bxvywNBz7ZRAbhrX1gjErrINgMGYYGwSJv2AY84OE607/KUt3cyCaV/5nyjzI+JZ0eayFB8Wbu78ld69Bsxl/zOKboOE811p17eFANadomTIHumBcVMWDYPDciOKNBywziigqM2DZiKs3N0BXW/OpSRSbPtTUgqzObrPZ+h8e+tXHXgcSrbItdXUt2bSOlunstKN6VUf9gr3UmL/wDxHdyExUFSLOAAAAAElFTkSuQmCC"}),m(O,{class:"map-locate",onClick:d.handleLocate},{default:a((()=>[r.locateLoading?(t(),e(N,{key:1,class:"map-locate-img",src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAMAAABg3Am1AAAAclBMVEUAAABwcHBwcHBwcHBvb29ubm5wcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBvb29wcHBwcHBwcHBwcHBwcHBvb29wcHBvb29wcHBvb29vb29wcHBwcHBvb29wcHBwcHBwcHBubm5ycnJzc3NwcHBwcHCObYicAAAAJXRSTlMAgM6rGgzks4tm69S/mm9GQDncxqR2XlZPLiP04JWSE7ozMSqfqCPx0AAAAU1JREFUSMft1dt2gjAQBdCThDsC4gUQ79r8/y82mKYxBuvQ5UMfup8GVkZhPIl4k74r6xB0K6nsGlBlUmOgmUmjBkUivy1BsZQW6cXlnbm6LniW8QKey1qUl8dvOOJqyitc5Vbd3A6fuLfrOZCbOofjbB+63kpjDaYLf8gHqR1UPTdLTkBsG2KnYSG1BZTgdKtTVUa2IXIacudJw7SIWTVUO9uwG/21Ej9Vxgr3An0zw4PUNqRwO4bXE/BwO+JHfR1ghNDrBcgaEUWiwR+XfqwYXgjbsjJ1S5hCMIy30/VR3rT4CbsFLQRsOBnhYJjfp6IlnAxHfRF74fWd9X76wqJM4IVaBR7/pgs2oLFp4dV4UKsqhMsEZPYsFgk8m+cNeyn3uvIOywJjOs47jDjE6e8nkKv49pMm5m9awv4CXaL/c+n6oaHEBGGz3uA9PgHv9jcWQxBlJwAAAABJRU5ErkJggg=="})):(t(),e(N,{key:0,src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAMAAABg3Am1AAAATlBMVEUAAABwcHBwcHBwcHBtbW1vb29xcXFvb29wcHBvb29wcHBwcHBvb29wcHBvb29vb29wcHBxcXFxcXFubm5tbW12dnZmZmZwcHBvb29wcHBwam6PAAAAGXRSTlMAgNTBIc5pUED26ua3rKeVlHNYMxUNCttVsYONBQAAAWpJREFUSMe1VtuywiAMFHqBKtCrbfn/Hz3J9CAUKJoZ3SdDFwKbJXj7FqSk8WdrZ9IEZi0j0OsdJ+z1R+Sn6Ln9B+/F893aw92ecB+KecYHkrrG4JZM02H0GK/5CglVu7hDL22FI+qKv8HHZjqrNDUwuOX5FsDWWNaV4XiOj9lbH1Wvny3uM+Vrt04+t070gUF5aSz4OEb6P4peYKDuuR4D6LNeT1hBq+HkB6jvVKroBDUPXSJSHVINRRD2qGgJqG0fhNx2S3nC0lkeaGQxCsGMiUQDz9fhEVRUqcQPyh9CMnQOIJQdEQywgyOP++5QhTYJ7VC9KDMmcIE/hzli4/fvcKT4fEuu9ey4WvnQmHUPZW0iWbWOZG1AVnrh6Nagm49ub/oFol9R3wTawolt0jBVuc2ofKOUvjL81GQ2cqvMoso340KNdL7d67cPClc4QfHyg0J/suiPos8jcEui/snD7otF/bMx376EP60WJ6FsijOeAAAAAElFTkSuQmCC"}))])),_:1},8,["onClick"])])),_:1},8,["latitude","longitude","circles","polygons","onRegionchange"])])),_:1})])),_:1}),m(k,{class:"around-contain"},{default:a((()=>[m(D,{style:{height:"100%"},id:"scroll-view-h",class:"scroll-view2","refresher-enabled":!1,"refresher-threshold":50,"scroll-with-animation":!0,onScrolltolower:d.handleScrollToLower,"scroll-y":!0},{default:a((()=>[r.list.length?(t(!0),A(w,{key:0},f(r.list,((o,n)=>(t(),e(J,{class:"around-contain-item",key:n,onChange:t=>d.onSelectValueChange(o,n)},{default:a((()=>[m(E,{class:"u-radio-label"},{default:a((()=>[m(T,{class:"u-radio",value:o.id,checked:o.id===r.selectId},null,8,["value","checked"]),m(k,{class:"around-item-title-box"},{default:a((()=>[m(k,{class:"around-item-title u-line-1"},{default:a((()=>[i(s(o.name),1)])),_:2},1024),m(k,{class:"around-item-sub-title u-line-1"},{default:a((()=>[i(s(o.address),1)])),_:2},1024)])),_:2},1024)])),_:2},1024)])),_:2},1032,["onChange"])))),128)):b("",!0),r.loading?(t(),e(Z,{key:1,class:"loading",mode:"circle",size:"44"})):b("",!0),r.loading||r.list.length?b("",!0):(t(),e(q,{key:2}))])),_:1},8,["onScrolltolower"])])),_:1}),m(k,{class:"jnpf-bottom-actions"},{default:a((()=>[m(F,{class:"buttom-btn",onClick:n[1]||(n[1]=t=>d.close())},{default:a((()=>[i(s(o.$t("common.cancelText")),1)])),_:1}),m(F,{class:"buttom-btn",type:"primary",onClick:n[2]||(n[2]=B((t=>d.handleConfirm()),["stop"]))},{default:a((()=>[i(s(o.$t("common.okText")),1)])),_:1})])),_:1})])),_:1})}],["__scopeId","data-v-a11c0a69"]]);export{N as default};