import{j as e,f as s,w as t,p as a,t as r,z as i,y as l,g as o,C as d,r as n,e as c,u,ab as m,k as f,Q as p,B as g,s as y,i as _,q as b,D as k,v as x,o as h,n as S,aj as v,I as B,L as w,l as C,m as j,F as T,aC as $}from"./index-CWyPMHxb.js";import{_ as A}from"./_plugin-vue_export-helper.BCo6x5W8.js";import{_ as N,S as I}from"./s-layout.CUgh1tQ8.js";import{_ as z}from"./s-empty.Bcpb-H16.js";import{A as D,a as F}from"./address.kTRU-R-I.js";const M=A({name:"UniTag",emits:["click"],props:{type:{type:String,default:"default"},size:{type:String,default:"normal"},text:{type:String,default:""},disabled:{type:[Boolean,String],default:!1},inverted:{type:[Boolean,String],default:!1},circle:{type:[Boolean,String],default:!1},mark:{type:[Boolean,String],default:!1},customStyle:{type:String,default:""}},computed:{classes(){const{type:e,disabled:s,inverted:t,circle:a,mark:r,size:i,isTrue:l}=this;return["uni-tag--"+e,"uni-tag--"+i,l(s)?"uni-tag--disabled":"",l(t)?"uni-tag--"+e+"--inverted":"",l(a)?"uni-tag--circle":"",l(r)?"uni-tag--mark":"",l(t)?"uni-tag--inverted uni-tag-text--"+e:"","small"===i?"uni-tag-text--small":""].join(" ")}},methods:{isTrue:e=>!0===e||"true"===e,onClick(){this.isTrue(this.disabled)||this.$emit("click")}}},[["render",function(n,c,u,m,f,p){const g=d;return u.text?(e(),s(g,{key:0,class:i(["uni-tag",p.classes]),style:l(u.customStyle),onClick:p.onClick},{default:t((()=>[a(r(u.text),1)])),_:1},8,["class","style","onClick"])):o("",!0)}],["__scopeId","data-v-f9b60738"]]),E=A({__name:"s-address-item",props:{item:{type:Object,default(){}},hasBorderBottom:{type:Boolean,defult:!0}},setup(l){const d=l,x=()=>{y.$router.go("/pages/user/address/edit",{id:d.item.id})};return(l,h)=>{const S=n(c("uni-tag"),M),v=_,B=b,w=k;return e(),s(v,{class:i(["address-item ss-flex ss-row-between ss-col-center",[{"border-bottom":d.hasBorderBottom}]])},{default:t((()=>[u(m)(d.item)?(e(),s(v,{key:1},{default:t((()=>[f(v,{class:"address-text ss-m-b-10"},{default:t((()=>[a("请选择收货地址")])),_:1})])),_:1})):(e(),s(v,{key:0,class:"item-left"},{default:t((()=>[f(v,{class:"area-text ss-flex ss-col-center"},{default:t((()=>[d.item.defaultStatus?(e(),s(S,{key:0,class:"ss-m-r-10",size:"small","custom-style":"background-color: var(--ui-BG-Main); border-color: var(--ui-BG-Main); color: #fff;",text:"默认"})):o("",!0),a(" "+r(d.item.areaName),1)])),_:1}),f(v,{class:"address-text"},{default:t((()=>[a(r(d.item.detailAddress),1)])),_:1}),f(v,{class:"person-text"},{default:t((()=>[a(r(d.item.name)+" "+r(d.item.mobile),1)])),_:1})])),_:1})),p(l.$slots,"default",{},(()=>[f(w,{class:"ss-reset-button edit-btn",onClick:g(x,["stop"])},{default:t((()=>[f(v,{class:"edit-icon ss-flex ss-row-center ss-col-center"},{default:t((()=>[f(B,{src:u(y).$url.static("/static/img/shop/user/address/edit.png")},null,8,["src"])])),_:1})])),_:1})]),!0)])),_:3},8,["class"])}}},[["__scopeId","data-v-b80e6bc0"]]),L=A({__name:"list",setup(r){const i=x({list:[],loading:!0,openType:""});function l(){let e={};y.$platform.useProvider("wechat").jssdk.openAddress({success:s=>{e={consignee:s.userName,mobile:s.telNumber,province_name:s.provinceName,city_name:s.cityName,district_name:s.countryName,address:s.detailInfo,region:"",is_default:!1},m(e)||y.$router.go("/pages/user/address/edit",{data:JSON.stringify(e)})}})}return h((e=>{e.type&&(i.openType=e.type)})),S((async()=>{i.list=(await D.getAddressList()).data,i.loading=!1})),v((()=>{B("areaData")||F.getAreaTree().then((e=>{0===e.code&&w("areaData",e.data)}))})),(r,m)=>{const p=n(c("s-address-item"),E),g=_,b=d,x=k,h=n(c("su-fixed"),N),S=n(c("s-empty"),z),v=n(c("s-layout"),I);return e(),s(v,{title:"收货地址",bgStyle:{color:"#FFF"}},{default:t((()=>[i.list.length?(e(),s(g,{key:0},{default:t((()=>[(e(!0),C(T,null,j(i.list,(t=>(e(),s(p,{hasBorderBottom:"",key:t.id,item:t,onClick:e=>{return s=t,void("select"===i.openType&&($("SELECT_ADDRESS",{addressInfo:s}),y.$router.back()));var s}},null,8,["item","onClick"])))),128))])),_:1})):o("",!0),f(h,{bottom:"",placeholder:""},{default:t((()=>[f(g,{class:"footer-box ss-flex ss-row-between ss-p-20"},{default:t((()=>[["WechatMiniProgram","WechatOfficialAccount"].includes(u(y).$platform.name)?(e(),s(x,{key:0,onClick:l,class:"border ss-reset-button sync-wxaddress ss-m-20 ss-flex ss-row-center ss-col-center"},{default:t((()=>[f(b,{class:"cicon-weixin ss-p-r-10",style:{color:"#09bb07","font-size":"40rpx"}}),a(" 导入微信地址 ")])),_:1})):o("",!0),f(x,{class:"add-btn ss-reset-button ui-Shadow-Main",onClick:m[0]||(m[0]=e=>u(y).$router.go("/pages/user/address/edit"))},{default:t((()=>[a(" 新增收货地址 ")])),_:1})])),_:1})])),_:1}),0!==i.list.length||i.loading?o("",!0):(e(),s(S,{key:1,text:"暂无收货地址",icon:"/static/data-empty.png"}))])),_:1})}}},[["__scopeId","data-v-0f5d866d"]]);export{L as default};
