1 |
- import{E as N,ab as q,G as P,d as V,U as S,S as U,ai as L,W as D,M as O,ak as M,bx as Q,j as s,Y as F,aq as H,as as z,aC as I,O as X,Q as K,V as Z,A as v,N as _,B as x,C as $,$ as tt,D as et,y as B,T as st}from"./ResizeObserver.es.b7226882.js";import{C as at}from"./index.40f703b6.js";import{T as ot}from"./index.ed3a5560.js";import{L as it}from"./index.9fec2202.js";import{s as d}from"./index.module.cacd2fd1.js";import{C as nt}from"./index.0b42adfa.js";import{C as lt}from"./index.969bba7f.js";import"./use-tab-status.db1f6d2e.js";import"./index.1eaf642c.js";const[rt,k]=N("swipe-cell"),ct={name:q(""),disabled:Boolean,leftWidth:P,rightWidth:P,beforeClose:Function,stopPropagation:Boolean};var ut=V({name:rt,props:ct,emits:["open","close","click"],setup(a,{emit:e,slots:p}){let r,c,h;const i=S(),o=S(),f=S(),n=U({offset:0,dragging:!1}),g=L(),T=t=>t.value?F(t).width:0,m=D(()=>O(a.leftWidth)?+a.leftWidth:T(o)),C=D(()=>O(a.rightWidth)?+a.rightWidth:T(f)),y=t=>{n.offset=t==="left"?m.value:-C.value,r||(r=!0,e("open",{name:a.name,position:t}))},A=t=>{n.offset=0,r&&(r=!1,e("close",{name:a.name,position:t}))},W=t=>{const l=Math.abs(n.offset),u=.15,G=r?1-u:u,J=t==="left"?m.value:C.value;J&&l>J*G?y(t):A(t)},Y=t=>{a.disabled||(h=n.offset,g.start(t))},j=t=>{if(a.disabled)return;const{deltaX:l}=g;g.move(t),g.isHorizontal()&&(c=!0,n.dragging=!0,(!r||l.value*h<0)&&H(t,a.stopPropagation),n.offset=z(l.value+h,-C.value,m.value))},E=()=>{n.dragging&&(n.dragging=!1,W(n.offset>0?"left":"right"),setTimeout(()=>{c=!1},0))},b=(t="outside")=>{e("click",t),r&&!c&&I(a.beforeClose,{args:[{name:a.name,position:t}],done:()=>A(t)})},w=(t,l)=>u=>{l&&u.stopPropagation(),b(t)},R=(t,l)=>{const u=p[t];if(u)return s("div",{ref:l,class:k(t),onClick:w(t,!0)},[u()])};return M({open:y,close:A}),Q(i,()=>b("outside"),{eventName:"touchstart"}),()=>{var t;const l={transform:`translate3d(${n.offset}px, 0, 0)`,transitionDuration:n.dragging?"0s":".6s"};return s("div",{ref:i,class:k(),onClick:w("cell",c),onTouchstart:Y,onTouchmove:j,onTouchend:E,onTouchcancel:E},[s("div",{class:k("wrapper"),style:l},[R("left",o),(t=p.default)==null?void 0:t.call(p),R("right",f)])])}}});const dt=X(ut);var ft="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAYAAADhAJiYAAAAAXNSR0IArs4c6QAAA15JREFUWEft2E+ME2UYx/HvMxJhu0ZMWJAbwUTihRgucjDKn13+XEhQsp0uRuPJRDkAwSgK275Tl4UTSmIkcPK2O2nCv10SE9iEg9EDF8GDR5EEhXQPBg7ALjuPmXa2NLXzr50mHJhT23n7vp/+5nneaSs8Y4f0yqPGfh/kS9A3gX+BCzz2RuV4pRq1Zk9A6hQMqqU2C9/iibdVxip/hqEyB6nJl0FGGwsq1xHWAgPBa3/xxNsShsoUpE6+jDYwHsJnUnLPqBkZQLyrKP7l849QVGYgNYVvQI8GC3pYfCpF9+xiUjr+3grmX5yJQ2UCUmOPAUfCMJEo9d4Vp3J7cUzXoKSYCNQvYty3MwGpyR8D+ToumdaOql++pb+i+nr9nLdBTOU3/1HHCXWKaSRVtg/jcTx4vkeMe65jkJrCOOhXaZNpYMzHy+DhNWBj7TWLt6ToXu8IpE5hHO0Cc3C4j+VyEWRbDSPcoOhuEEFTg9TYfsSHO07Gx7zywkVUFzFV5tkkY+4fqYs6E8xy6xIwFCRTRa0hMRM3m4s+UVGryZ+o3yjrLdG66bV20f+66uRwH/ebMDAL1mArJtElU6cwimq5S8wUMBjMEYqJBakzsg31fqr1QafJPLCm0GSYSJCazUvg1d+BN4JPdkiMezLu8jxt7V056JsC2ZokmdiiVpPfDXK+PlCuiJncng7TPwWaChOTkD0BFGoI9d4Rp/JzEpCaXTk0N42wJU0yCRKybwFrEO5JyV2dGCO5abQzTGhC9fpZNQfibwszYtz63hFx1JIhdxnY3EjGYkiK7o249zafb7sPqRleDdY/Qf1MiJncG4n5/MN+Xpqb7hYTnlB5eD2eVd9BhVNScg+EgdR88DIsXALd1E0ykTWkTmEQ1asB6KiU3GPtQMG4H4B1WWAiasj2u8vvMj+hL5hnmiW6EmElC7IKS14D3QGsb4LexWJn2ppp/aDta8jJ70Pl+xTFOAPykZjJv1O8p+3Q9qCivR+L72ImnwO9gqenpVzxuyuTI6TLRgbAOwWsoHZnpopKFQv/Z/AsunAH+m+K+fFRJoqmSRJ9/ch60aj5noPi0n72Egq+K/s78bI4fY/PPwL5VtTYfucs/lXS4zVjp58VdQo26n0CsjR2eE8H6GPEOvsf2eN7gbiHuWgAAAAASUVORK5CYII=";function pt(a){return typeof a=="function"||Object.prototype.toString.call(a)==="[object Object]"&&!tt(a)}var yt=V({name:"shop-address",setup(){const a=K(),e=U({isClick:!1,list:[],listState:{dataShow:!0,loading:!1,finished:!1},params:{page:1,rows:20},selectItem:{}}),p=({position:i},o)=>{if(i==="right")et.confirm({title:"\u63D0\u793A",message:"\u786E\u5B9A\u5220\u9664\u5417\uFF1F",confirmButtonColor:"#FF8021"}).then(async()=>(await B.post("/api-mall-portal/member/address/delete/"+o.id,{requestType:"form",data:{}}),setTimeout(()=>{st("\u5220\u9664\u6210\u529F")},100),setTimeout(()=>{e.params.page=1,e.list=[],e.listState.dataShow=!0,e.listState.loading=!1,e.listState.finished=!1,c()},1100),!0));else return!0},r=i=>{a.push({path:"/addressOperation",query:{id:i.id}})},c=async()=>{try{if(e.isClick)return;e.isClick=!0;const i=await B.get("/api-mall-portal/member/address/list",{params:{...e.params}});e.listState.loading=!1;const o=i.data||{};if(e.list.length>0&&o.current===1)return;e.list=e.list.concat(o||[]),e.listState.finished=!0,e.params.page=o.current+1,e.listState.dataShow=e.list.length>0,e.isClick=!1}catch{e.listState.dataShow=!1,e.listState.finished=!0,e.isClick=!1}},h=i=>{sessionStorage.setItem("addressDetails",JSON.stringify(i)),a.back()};return Z(()=>{c()}),()=>{let i;return s("div",{class:[d.shopAddress]},[s(lt,null,null),e.listState.dataShow?s(it,{finished:e.listState.finished,finishedText:" ",class:[d.liveList],onLoad:c,immediateCheck:!1},pt(i=e.list.map(o=>s(dt,{class:d.swipeCell,beforeClose:f=>p(f,o)},{default:()=>s(at,{center:!0,onClick:()=>h(o)},{title:()=>s("div",{class:d.title},[s("span",{class:d.name},[o.name]),s("span",{class:d.phone},[o.phoneNumber]),o.defaultStatus&&s(ot,{plain:!0,color:"#FF8057"},{default:()=>[v("\u9ED8\u8BA4")]})]),label:()=>s("div",{class:d.content},[o.province,o.city,o.region,o.detailAddress]),"right-icon":()=>s(_,{name:ft,size:"18",onClick:f=>{f.stopPropagation(),r(o)}},null)}),right:()=>s(x,{type:"danger"},{default:()=>[v("\u5220\u9664")]})})))?i:{default:()=>[i]}):s("div",{style:{"min-height":"calc(100vh - var(--header-height))",display:"flex","align-items":"center"}},[s($,{type:"empty",tips:"\u6682\u65E0\u6536\u8D27\u5730\u5740",btnStatus:!1},null)]),s(nt,{position:"bottom"},{default:()=>[s("div",{class:"btnGroup"},[s(x,{type:"primary",round:!0,block:!0,class:d.createBtn,onClick:()=>{a.push("/addressOperation")}},{default:()=>[v("\u65B0\u5EFA\u6536\u8D27\u5730\u5740")]})])]})])}}});export{yt as default};
|