1 |
- System.register(["./index-legacy.eb062188.js","./index.module-legacy.d054e180.js","./index-legacy.ad813f4d.js","./index-legacy.fad72574.js","./index-legacy.918b8c74.js","./index-legacy.11f1ea5f.js","./use-tab-status-legacy.91417466.js"],(function(t){"use strict";var e,a,s,i,n,o,l,r,d,c,u,p,f,g,h,m,A,C,S,v,y,b,k,w,E,T,R,J,j,P,x,O,Y;return{setters:[function(t){e=t.t,a=t.w,s=t.z,i=t.d,n=t.R,o=t.r,l=t.aq,r=t.y,d=t.a1,c=t.W,u=t.as,p=t.a0,f=t.c,g=t.an,h=t.a4,m=t.aZ,A=t.aR,C=t.D,S=t.ag,v=t.$,y=t.q,b=t.a5,k=t.B,w=t.ak,E=t.al,T=t.bd,R=t.m,J=t.o},function(t){j=t.s},function(t){P=t.O},function(t){x=t.L},function(t){O=t.C},function(t){Y=t.T},function(){}],execute:function(){const[U,q]=e("swipe-cell"),G={name:a(""),disabled:Boolean,leftWidth:s,rightWidth:s,beforeClose:Function,stopPropagation:Boolean};var V=i({name:U,props:G,emits:["open","close","click"],setup(t,{emit:e,slots:a}){let s,i,C;const S=n(),v=n(),y=n(),b=o({offset:0,dragging:!1}),k=l(),w=t=>t.value?g(t).width:0,E=r((()=>d(t.leftWidth)?+t.leftWidth:w(v))),T=r((()=>d(t.rightWidth)?+t.rightWidth:w(y))),R=a=>{b.offset="left"===a?E.value:-T.value,s||(s=!0,e("open",{name:t.name,position:a}))},J=a=>{b.offset=0,s&&(s=!1,e("close",{name:t.name,position:a}))},j=e=>{t.disabled||(C=b.offset,k.start(e))},P=()=>{b.dragging&&(b.dragging=!1,(t=>{const e=Math.abs(b.offset),a=s?.85:.15,i="left"===t?E.value:T.value;i&&e>i*a?R(t):J(t)})(b.offset>0?"left":"right"),setTimeout((()=>{i=!1}),0))},x=(a="outside")=>{e("click",a),s&&!i&&A(t.beforeClose,{args:[{name:t.name,position:a}],done:()=>J(a)})},O=(t,e)=>a=>{e&&a.stopPropagation(),x(t)},Y=(t,e)=>{const s=a[t];if(s)return f("div",{ref:e,class:q(t),onClick:O(t,!0)},[s()])};return c({open:R,close:J}),u(S,(()=>x("outside")),{eventName:"touchstart"}),p("touchmove",(e=>{if(t.disabled)return;const{deltaX:a}=k;k.move(e),k.isHorizontal()&&(i=!0,b.dragging=!0,(!s||a.value*C<0)&&h(e,t.stopPropagation),b.offset=m(a.value+C,-T.value,E.value))}),{target:S}),()=>{var t;const e={transform:`translate3d(${b.offset}px, 0, 0)`,transitionDuration:b.dragging?"0s":".6s"};return f("div",{ref:S,class:q(),onClick:O("cell",i),onTouchstartPassive:j,onTouchend:P,onTouchcancel:P},[f("div",{class:q("wrapper"),style:e},[Y("left",v),null==(t=a.default)?void 0:t.call(a),Y("right",y)])])}}});const W=C(V);t("default",i({name:"shop-address",setup(){const t=S(),e=o({isClick:!1,list:[],listState:{dataShow:!0,loading:!1,finished:!1},params:{page:1,rows:20},selectItem:{}}),a=async()=>{try{if(e.isClick)return;e.isClick=!0;const t=await R.post("/api-student/userReceiveAddress/page",{data:{...e.params}});e.listState.loading=!1;const a=t.data||{};if(e.list.length>0&&1===a.current)return;e.list=e.list.concat(a.rows||[]),e.listState.finished=a.current>=a.pages,e.params.page=a.current+1,e.listState.dataShow=e.list.length>0,e.isClick=!1}catch{e.listState.dataShow=!1,e.listState.finished=!0,e.isClick=!1}};return v((()=>{a()})),()=>{let s;return f("div",{class:[j.shopAddress,!e.listState.dataShow&&"emptyRootContainer"]},[e.listState.dataShow?f(x,{finished:e.listState.finished,finishedText:" ",class:[j.liveList],onLoad:a,immediateCheck:!1},(i=s=e.list.map((s=>f(W,{class:j.swipeCell,beforeClose:t=>(({position:t},s)=>{if("right"!==t)return!0;T({title:"确定删除吗?"}).then((async()=>(await R.post("/api-student/userReceiveAddress/remove",{requestType:"form",data:{id:s.id}}),setTimeout((()=>{J("删除成功")}),100),setTimeout((()=>{e.params.page=1,e.list=[],e.listState.dataShow=!0,e.listState.loading=!1,e.listState.finished=!1,a()}),1100),!0)))})(t,s)},{default:()=>f(O,{center:!0,onClick:()=>(e=>{sessionStorage.setItem("addressDetails",JSON.stringify(e)),t.back()})(s)},{title:()=>f("div",{class:j.title},[f("span",{class:j.name},[s.name]),f("span",{class:j.phone},[s.phoneNumber]),s.defaultStatus&&f(Y,{round:!0,color:"#FF8057"},{default:()=>[y("默认")]})]),label:()=>f("div",{class:j.content},[s.provinceName,s.cityName,s.regionName,s.detailAddress]),"right-icon":()=>f(b,{name:"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=",size:"18",onClick:e=>{e.stopPropagation(),(e=>{t.push({path:"/addressOperation",query:{id:e.id}})})(s)}},null)}),right:()=>f(k,{type:"danger"},{default:()=>[y("删除")]})}))),"function"==typeof i||"[object Object]"===Object.prototype.toString.call(i)&&!E(i)?s:{default:()=>[s]})):f(w,{btnStatus:!1,tips:"暂无收货地址"},null),f(P,{position:"bottom"},{default:()=>[f("div",{class:"btnGroup"},[f(k,{type:"primary",round:!0,block:!0,onClick:()=>{t.push("addressOperation")}},{default:()=>[y("新建收货地址")]})])]})]);var i}}}))}}}));
|