You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
yanzong/public/assets/pages-shop-extract.8827a980.js

1 lines
2.6 KiB

import{o as e,c as t,w as s,i as o,a as i,b as a,d as n,F as l,e as d,k as c,r as u,f as h,t as p}from"./index-ae8bbb19.js";import{l as f}from"./shop.128443fb.js";import{E as _}from"./index.97c7afee.js";import{_ as r}from"./_plugin-vue_export-helper.1b428a4d.js";const g=r({components:{Empty:_},data:()=>({isLoading:!0,isAuthor:!0,selectedId:null,shopList:[]}),onLoad({selectedId:e}){const t=this;t.selectedId=e||null,t.getShopList(),t.getLocation((e=>{t.getShopList(e.longitude,e.latitude)}))},methods:{getShopList(e,t){const s=this;s.isLoading=!0,f({isCheck:1,longitude:e||"",latitude:t||""}).then((e=>s.shopList=e.data.list)).finally((()=>s.isLoading=!1))},getLocation(e){const t=this;uni.getLocation({type:"wgs84",success:e,fail(){t.$toast("获取定位失败,请点击右下角按钮重新尝试定位"),t.isAuthor=!1}})},onAuthorize(){const e=this;e.getLocation((t=>{e.getShopList(t.longitude,t.latitude)}))},onSelectedShop(e){this.selectedId=e,uni.$emit("syncSelectedId",e),uni.navigateBack({delta:1})}}},[["render",function(f,_,r,g,m,L){const y=c,k=o,x=u("empty");return e(),t(k,{class:"container b-f"},{default:s((()=>[i(k,{class:"shop-list"},{default:s((()=>[(e(!0),a(l,null,n(m.shopList,((o,a)=>(e(),t(k,{key:a,onClick:e=>L.onSelectedShop(o.shop_id),class:"shop-item dis-flex flex-y-center"},{default:s((()=>[i(k,{class:"shop-item__content flex-box"},{default:s((()=>[i(k,{class:"shop-item__title"},{default:s((()=>[i(y,null,{default:s((()=>[h(p(o.shop_name),1)])),_:2},1024)])),_:2},1024),i(k,{class:"shop-item__address"},{default:s((()=>[i(y,null,{default:s((()=>[h("地址:"+p(o.region.province)+p(o.region.city)+p(o.region.region)+p(o.address),1)])),_:2},1024)])),_:2},1024),i(k,{class:"shop-item__phone"},{default:s((()=>[i(y,null,{default:s((()=>[h("联系电话:"+p(o.phone),1)])),_:2},1024)])),_:2},1024),o.distance?(e(),t(k,{key:0,class:"shop-item__distance"},{default:s((()=>[i(y,{class:"iconfont icon-dingwei"}),i(y,{class:"f-24"},{default:s((()=>[h(p(o.distance_unit),1)])),_:2},1024)])),_:2},1024)):d("",!0)])),_:2},1024),o.shop_id==m.selectedId?(e(),t(k,{key:0,class:"shop-item__right"},{default:s((()=>[i(y,{class:"iconfont icon-check1"})])),_:1})):d("",!0)])),_:2},1032,["onClick"])))),128))])),_:1}),m.isAuthor?d("",!0):(e(),t(k,{key:0,class:"widget-location dis-flex flex-x-center flex-y-center",onClick:_[0]||(_[0]=e=>L.onAuthorize())},{default:s((()=>[i(y,{class:"iconfont icon-locate"})])),_:1})),m.shopList.length?d("",!0):(e(),t(x,{key:1,isLoading:m.isLoading,tips:"亲,暂无自提门店哦"},null,8,["isLoading"]))])),_:1})}],["__scopeId","data-v-1b29f21d"]]);export{g as default};