import{v as e,_ as s,o as t,I as a,r as l,e as o,f as r,w as d,s as u,L as i,aF as n,j as c,k as _,l as f,m as g,F as m,i as p,p as x,t as h,a2 as y,B as k,ar as b,aC as w,q as j,C as v}from"./index-CWyPMHxb.js";import{S as C}from"./s-layout.CUgh1tQ8.js";import{D as L}from"./delivery.DEVrqYD3.js";import{_ as N}from"./_plugin-vue_export-helper.BCo6x5W8.js";const F=N({__name:"index",setup(N){const F=e({loaded:!1,loading:!1,storeList:[],system_store:{},locationShow:!1,user_latitude:0,user_longitude:0}),S=async()=>{if(F.loading||F.loaded)return;F.loading=!0;const{data:e,code:s}=await L.getDeliveryPickUpStoreList({latitude:F.user_latitude,longitude:F.user_longitude});0===s&&(F.loading=!1,F.storeList=e)};return s((()=>{F.user_latitude&&F.user_longitude||(()=>{const e=u.$platform.useProvider("wechat").jsWxSdk;e.isWechat()?e.getLocation((e=>{F.user_latitude=e.latitude,F.user_longitude=e.longitude,i("user_latitude",e.latitude),i("user_longitude",e.longitude),S()})):n({type:"gcj02",success:e=>{try{F.user_latitude=e.latitude,F.user_longitude=e.longitude,i("user_latitude",e.latitude),i("user_longitude",e.longitude)}catch(s){console.error(s)}S()},complete:()=>{S()}})})(),S()})),t((()=>{try{F.user_latitude=a("user_latitude"),F.user_longitude=a("user_longitude")}catch(e){console.error(e)}})),(e,s)=>{const t=j,a=p,i=v,n=l(o("s-layout"),C);return c(),r(n,{title:"选择自提门店",bgStyle:{color:"#FFF"}},{default:d((()=>[_(a,{class:"storeBox",ref:"container"},{default:d((()=>[(c(!0),f(m,null,g(F.storeList,((e,s)=>(c(),r(a,{class:"storeBox-box",key:s,onClick:s=>(w("SELECT_PICK_UP_INFO",{addressInfo:e}),void u.$router.back())},{default:d((()=>[_(a,{class:"store-img"},{default:d((()=>[_(t,{src:e.logo,class:"img"},null,8,["src"])])),_:2},1024),_(a,{class:"store-cent-left"},{default:d((()=>[_(a,{class:"store-name"},{default:d((()=>[x(h(e.name),1)])),_:2},1024),_(a,{class:"store-address line1"},{default:d((()=>[x(h(e.areaName)+h(", "+e.detailAddress),1)])),_:2},1024)])),_:2},1024),_(a,{class:"row-right ss-flex-col ss-col-center"},{default:d((()=>[_(a,null,{default:d((()=>[y("a",{class:"store-phone",href:"tel:"+e.phone},[_(a,{class:"iconfont"},{default:d((()=>[_(a,{class:"ss-rest-button"},{default:d((()=>[_(i,{class:"_icon-forward"})])),_:1})])),_:1})],8,["href"])])),_:2},1024),_(a,{class:"store-distance ss-flex ss-row-center",onClick:k((s=>(e=>{const s=u.$platform.useProvider("wechat").jsWxSdk;s.isWechat()?s.openLocation({latitude:Number(e.latitude),longitude:Number(e.longitude),name:e.name,address:`${e.areaName}-${e.detailAddress}`}):b({latitude:Number(e.latitude),longitude:Number(e.longitude),name:e.name,address:`${e.areaName}-${e.detailAddress}`,success:function(){console.log("success")}})})(e)),["stop"])},{default:d((()=>[e.distance?(c(),r(i,{key:0,class:"addressTxt"},{default:d((()=>[x(" 距离"+h(e.distance.toFixed(2))+"千米 ",1)])),_:2},1024)):(c(),r(i,{key:1,class:"addressTxt"},{default:d((()=>[x("查看地图")])),_:1})),_(a,{class:"iconfont"},{default:d((()=>[_(a,{class:"ss-rest-button"},{default:d((()=>[_(i,{class:"_icon-forward"})])),_:1})])),_:1})])),_:2},1032,["onClick"])])),_:2},1024)])),_:2},1032,["onClick"])))),128))])),_:1},512)])),_:1})}}},[["__scopeId","data-v-b9625f09"]]);export{F as default};
