import{C as s,x as e,s as a,a8 as t,g as o,N as r,o as i,e as d,w as l,b as n,f as c,h as m,F as u,k as p,i as _,u as f,y,a1 as g,d as b,m as x,A as h,B as k,ah as w}from"./index-520dfaee.js";import{_ as v}from"./s-address-item.5db1f0f7.js";import{b as j,a as N}from"./s-layout.5146c957.js";import{_ as $}from"./s-empty.b6c95127.js";import{_ as C}from"./_plugin-vue_export-helper.1b428a4d.js";/* empty css                                                                */const S=C({__name:"list",setup(C){const S=s({list:[],loading:!0});function A(){let s={};a.$platform.useProvider("wechat").jssdk.openAddress({success:e=>{s={consignee:e.userName,mobile:e.telNumber,province_name:e.provinceName,city_name:e.cityName,district_name:e.countryName,address:e.detailInfo,region:"",is_default:!1},g.isEmpty(s)||a.$router.go("/pages/user/address/edit",{data:JSON.stringify(s)})}})}return e((async()=>{S.list=(await a.$api.user.address.list()).data,S.loading=!1})),t((()=>{o("areaData")||a.$api.data.area().then((s=>{1===s.code&&r("areaData",s.data)}))})),(s,e)=>{const t=n(b("s-address-item"),v),o=x,r=h,g=k,C=n(b("su-fixed"),j),D=n(b("s-empty"),$),E=n(b("s-layout"),N);return i(),d(E,{title:"收货地址",bgStyle:{color:"#FFF"}},{default:l((()=>[S.list.length?(i(),d(o,{key:0},{default:l((()=>[(i(!0),c(u,null,m(S.list,(s=>(i(),d(t,{hasBorderBottom:"",key:s.id,item:s,onClick:e=>(w("SELECT_ADDRESS",{addressInfo:s}),void a.$router.back())},null,8,["item","onClick"])))),128))])),_:1})):p("",!0),_(C,{bottom:"",placeholder:""},{default:l((()=>[_(o,{class:"footer-box ss-flex ss-row-between ss-p-20"},{default:l((()=>[["WechatMiniProgram","WechatOfficialAccount"].includes(f(a).$platform.name)?(i(),d(g,{key:0,onClick:A,class:"border ss-reset-button sync-wxaddress ss-m-20 ss-flex ss-row-center ss-col-center"},{default:l((()=>[_(r,{class:"cicon-weixin ss-p-r-10",style:{color:"#09bb07","font-size":"40rpx"}}),y(" 导入微信地址 ")])),_:1})):p("",!0),_(g,{class:"add-btn ss-reset-button ui-Shadow-Main",onClick:e[0]||(e[0]=s=>f(a).$router.go("/pages/user/address/edit"))},{default:l((()=>[y(" 新增收货地址 ")])),_:1})])),_:1})])),_:1}),0!==S.list.length||S.loading?p("",!0):(i(),d(D,{key:1,text:"暂无收货地址",icon:"/static/data-empty.png"}))])),_:1})}}},[["__scopeId","data-v-c4e7648e"]]);export{S as default};
