pages-user-address-list.c52352a5.js 2.3 KB

1
  1. import{v as s,n as e,ae as a,I as t,L as o,e as r,f as i,w as d,l,k as n,r as c,F as m,g as u,j as p,u as f,s as _,p as y,a8 as g,m as b,i as x,C as k,D as h,at as v}from"./index-9880b451.js";import{_ as j}from"./s-address-item.6ee3b96c.js";import{a as w,_ as A}from"./s-layout.dfc5b0b5.js";import{_ as C}from"./s-empty.74111684.js";import{A as N,a as S}from"./address.46f090d1.js";import{_ as D}from"./_plugin-vue_export-helper.1b428a4d.js";/* empty css */const $=D({__name:"list",setup(D){const $=s({list:[],loading:!0});function E(){let s={};_.$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)||_.$router.go("/pages/user/address/edit",{data:JSON.stringify(s)})}})}return e((async()=>{$.list=(await N.getAddressList()).data,$.loading=!1})),a((()=>{t("areaData")||S.getAreaTree().then((s=>{0===s.code&&o("areaData",s.data)}))})),(s,e)=>{const a=l(b("s-address-item"),j),t=x,o=k,g=h,N=l(b("su-fixed"),w),S=l(b("s-empty"),C),D=l(b("s-layout"),A);return r(),i(D,{title:"收货地址",bgStyle:{color:"#FFF"}},{default:d((()=>[$.list.length?(r(),i(t,{key:0},{default:d((()=>[(r(!0),n(m,null,c($.list,(s=>(r(),i(a,{hasBorderBottom:"",key:s.id,item:s,onClick:e=>(v("SELECT_ADDRESS",{addressInfo:s}),void _.$router.back())},null,8,["item","onClick"])))),128))])),_:1})):u("",!0),p(N,{bottom:"",placeholder:""},{default:d((()=>[p(t,{class:"footer-box ss-flex ss-row-between ss-p-20"},{default:d((()=>[["WechatMiniProgram","WechatOfficialAccount"].includes(f(_).$platform.name)?(r(),i(g,{key:0,onClick:E,class:"border ss-reset-button sync-wxaddress ss-m-20 ss-flex ss-row-center ss-col-center"},{default:d((()=>[p(o,{class:"cicon-weixin ss-p-r-10",style:{color:"#09bb07","font-size":"40rpx"}}),y(" 导入微信地址 ")])),_:1})):u("",!0),p(g,{class:"add-btn ss-reset-button ui-Shadow-Main",onClick:e[0]||(e[0]=s=>f(_).$router.go("/pages/user/address/edit"))},{default:d((()=>[y(" 新增收货地址 ")])),_:1})])),_:1})])),_:1}),0!==$.list.length||$.loading?u("",!0):(r(),i(S,{key:1,text:"暂无收货地址",icon:"/static/data-empty.png"}))])),_:1})}}},[["__scopeId","data-v-b75f7ca4"]]);export{$ as default};