index.0a173608.js 5.8 KB

1
  1. import{A as N,aa as G,E as J,d as V,S,Q as U,ah as M,V as B,L as D,aj as q,bt as Q,j as a,X as z,ap as F,ar as H,aB as I,N as X,P as K,U as Z,z as v,M as _,B as x,C as $,Z as tt,D as et,x as O,T as at}from"./index.40f4b64d.js";import{C as st}from"./index.7d1a23c4.js";import{T as ot}from"./index.fc52eb63.js";import{L as it}from"./index.5e0f25ab.js";import{s as d}from"./index.module.cacd2fd1.js";import{C as nt}from"./index.6d460317.js";import{C as lt}from"./index.c44a09c1.js";import"./use-tab-status.7423f29c.js";import"./index.489876c1.js";const[rt,k]=N("swipe-cell"),ct={name:G(""),disabled:Boolean,leftWidth:J,rightWidth:J,beforeClose:Function,stopPropagation:Boolean};var ut=V({name:rt,props:ct,emits:["open","close","click"],setup(s,{emit:e,slots:p}){let r,c,h;const i=S(),o=S(),f=S(),n=U({offset:0,dragging:!1}),g=M(),T=t=>t.value?z(t).width:0,m=B(()=>D(s.leftWidth)?+s.leftWidth:T(o)),C=B(()=>D(s.rightWidth)?+s.rightWidth:T(f)),E=t=>{n.offset=t==="left"?m.value:-C.value,r||(r=!0,e("open",{name:s.name,position:t}))},A=t=>{n.offset=0,r&&(r=!1,e("close",{name:s.name,position:t}))},j=t=>{const l=Math.abs(n.offset),u=.15,L=r?1-u:u,P=t==="left"?m.value:C.value;P&&l>P*L?E(t):A(t)},W=t=>{s.disabled||(h=n.offset,g.start(t))},Y=t=>{if(s.disabled)return;const{deltaX:l}=g;g.move(t),g.isHorizontal()&&(c=!0,n.dragging=!0,(!r||l.value*h<0)&&F(t,s.stopPropagation),n.offset=H(l.value+h,-C.value,m.value))},y=()=>{n.dragging&&(n.dragging=!1,j(n.offset>0?"left":"right"),setTimeout(()=>{c=!1},0))},b=(t="outside")=>{e("click",t),r&&!c&&I(s.beforeClose,{args:[{name:s.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 a("div",{ref:l,class:k(t),onClick:w(t,!0)},[u()])};return q({open:E,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 a("div",{ref:i,class:k(),onClick:w("cell",c),onTouchstart:W,onTouchmove:Y,onTouchend:y,onTouchcancel:y},[a("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(s){return typeof s=="function"||Object.prototype.toString.call(s)==="[object Object]"&&!tt(s)}var Et=V({name:"shop-address",setup(){const s=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 O.post("/api-mall-portal/member/address/delete/"+o.id,{requestType:"form",data:{}}),setTimeout(()=>{at("\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=>{s.push({path:"/addressOperation",query:{id:i.id}})},c=async()=>{try{if(e.isClick)return;e.isClick=!0;const i=await O.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)),s.back()};return Z(()=>{c()}),()=>{let i;return a("div",{class:[d.shopAddress]},[a(lt,null,null),e.listState.dataShow?a(it,{finished:e.listState.finished,finishedText:" ",class:[d.liveList],onLoad:c,immediateCheck:!1},pt(i=e.list.map(o=>a(dt,{class:d.swipeCell,beforeClose:f=>p(f,o)},{default:()=>a(st,{center:!0,onClick:()=>h(o)},{title:()=>a("div",{class:d.title},[a("span",{class:d.name},[o.name]),a("span",{class:d.phone},[o.phoneNumber]),o.defaultStatus&&a(ot,{plain:!0,color:"#FF8057"},{default:()=>[v("\u9ED8\u8BA4")]})]),label:()=>a("div",{class:d.content},[o.province,o.city,o.region,o.detailAddress]),"right-icon":()=>a(_,{name:ft,size:"18",onClick:f=>{f.stopPropagation(),r(o)}},null)}),right:()=>a(x,{type:"danger"},{default:()=>[v("\u5220\u9664")]})})))?i:{default:()=>[i]}):a("div",{style:{"min-height":"calc(100vh - var(--header-height))",display:"flex","align-items":"center"}},[a($,{type:"empty",tips:"\u6682\u65E0\u6536\u8D27\u5730\u5740",btnStatus:!1},null)]),a(nt,{position:"bottom"},{default:()=>[a("div",{class:"btnGroup"},[a(x,{type:"primary",round:!0,block:!0,class:d.createBtn,onClick:()=>{s.push("/addressOperation")}},{default:()=>[v("\u65B0\u5EFA\u6536\u8D27\u5730\u5740")]})])]})])}}});export{Et as default};