"use strict";const e=require("../../common/vendor.js"),n=require("../../common/assets.js"),t=require("../../api/api.js");if(!Array){(e.resolveComponent("uni-transition")+e.resolveComponent("orderList")+e.resolveComponent("cc-myTabbar"))()}Math||((()=>"../../uni_modules/uni-transition/components/uni-transition/uni-transition.js")+(()=>"../../components/orderList/orderList.js")+(()=>"../../uni_modules/cc-myTabbar/components/cc-myTabbar/cc-myTabbar.js"))();const o={__name:"index",setup(o){let a=e.ref(113.675688),i=e.ref(34.75527700365562),r=e.ref(null),u=e.ref(!1),s=e.ref(),l=e.ref([]),c=e.ref([]);e.onLoad((async()=>{r.value=e.index.createMapContext("map");const{longitude:n,latitude:t}=await e.index.getLocation({type:"gcj02"});i.value=t,a.value=n,d(),setTimeout((()=>{m()}),300)}));let d=async()=>{let e=(await t.aroundAreaMap({orderByType:1,lat:i.value,lon:a.value})).map(((e,n)=>({id:e.id,longitude:e.location.lng,latitude:e.location.lat,iconPath:"/static/icon/marker-pointer.png",width:20,height:23,content:"2",gunUseCount:e.gunUseCount,gunCount:e.gunCount,distance:e.distance,customCallout:{display:"ALWAYS",anchorX:0,anchorY:-10}})));e.unshift({longitude:a.value,latitude:i.value,iconPath:"/static/icon/my-location-default.png",width:45,height:45,id:-1}),c.value=e};const m=()=>{const e=a.value,n=i.value;r.value.moveToLocation({longitude:e,latitude:n})},p=e=>{"end"==e.type&&(console.log(e),console.log(e.detail.scale),u.value=!1,g(!1))},f=async n=>{var o;if(console.log(n,"eeeeeee"),-1==n.markerId)return;e.index.showLoading();let a=await t.infoAroundApi({id:n.markerId}),i=c.value.find((e=>e.id==n.markerId)),r=null==(o=null==a?void 0:a.priceList)?void 0:o.find((e=>1==e.isCurrent));l.value={...a,distance:i.distance,priceAmount:r.totalAmount},console.log(l,"infoDzinfoDz"),e.index.hideLoading(),u.value=!0,g(!0)},g=e=>{e?s.value.step({translateY:"-200rpx"},{timingFunction:"ease-in",duration:100}):s.value.step({translateY:"0rpx"},{timingFunction:"ease",duration:500}),s.value.run()};return(t,o)=>({a:e.f(e.unref(c),((n,t,o)=>({a:e.t(n.gunUseCount||0),b:e.t(n.gunCount||0),c:n.id}))),b:n._imports_0$1,c:e.unref(a),d:e.o(f),e:e.o(f),f:e.o(p),g:e.unref(c),h:e.unref(i),i:n._imports_1$1,j:e.o(m),k:e.sr(s,"1a922a9b-0",{k:"mapLocationRef"}),l:e.p({show:!0}),m:e.p({toNav:!0,Image:!0,info:e.unref(l),list:e.unref(l).pictures}),n:e.p({modeClass:"fade",show:e.unref(u)}),o:e.p({tabBarShow:1})})}};wx.createPage(o);
