vant/static/js/async/4257.dab6ccb1.js
2024-04-20 08:49:23 +00:00

2 lines
10 KiB
JavaScript

/*! For license information please see 4257.dab6ccb1.js.LICENSE.txt */
(self.webpackChunk=self.webpackChunk||[]).push([["4257"],{92453:function(e,t,r){"use strict";r.r(t);var l=r("83378");r("51328");let o=l.Z;t.default=o},83378:function(e,t,r){"use strict";r("40944");var l=r("80681"),o=r("11848"),i=r("68079"),a=r("99497"),n=r("99742"),s=r("1829"),c=r("54369"),u=r("24647"),d=r("45802");t.Z=(0,l.aZ)({__name:"index",setup(e){var t=(0,c.q)({"zh-CN":{select:"\u9009\u62E9",delete:"\u5220\u9664",collect:"\u6536\u85CF",title:"\u5355\u5143\u683C",confirm:"\u786E\u5B9A\u5220\u9664\u5417\uFF1F",cardTitle:"\u5546\u54C1\u6807\u9898",beforeClose:"\u5F02\u6B65\u5173\u95ED",customContent:"\u81EA\u5B9A\u4E49\u5185\u5BB9"},"en-US":{select:"Select",delete:"Delete",collect:"Collect",title:"Cell",confirm:"Are you sure to delete?",cardTitle:"Title",beforeClose:"Before Close",customContent:"Custom Content"}}),r=(0,u.RQ)("ipad.jpeg"),v=e=>{var{position:r}=e;switch(r){case"left":case"cell":case"outside":return!0;case"right":return new Promise(e=>{(0,d.WD)({title:t("confirm")}).then(()=>e(!0)).catch(()=>e(!1))})}};return(e,c)=>{var u=(0,l.up)("demo-block");return(0,l.wg)(),(0,l.iD)(l.HY,null,[(0,l.Wm)(u,{title:(0,o.SU)(t)("basicUsage")},{default:(0,l.w5)(()=>[(0,l.Wm)((0,o.SU)(i.ZP),null,{left:(0,l.w5)(()=>[(0,l.Wm)((0,o.SU)(a.ZP),{square:"",type:"primary",text:(0,o.SU)(t)("select")},null,8,["text"])]),right:(0,l.w5)(()=>[(0,l.Wm)((0,o.SU)(a.ZP),{square:"",type:"danger",text:(0,o.SU)(t)("delete")},null,8,["text"]),(0,l.Wm)((0,o.SU)(a.ZP),{square:"",type:"primary",text:(0,o.SU)(t)("collect")},null,8,["text"])]),default:(0,l.w5)(()=>[(0,l.Wm)((0,o.SU)(n.ZP),{border:!1,title:(0,o.SU)(t)("title"),value:(0,o.SU)(t)("content")},null,8,["title","value"])]),_:1})]),_:1},8,["title"]),(0,l.Wm)(u,{title:(0,o.SU)(t)("customContent")},{default:(0,l.w5)(()=>[(0,l.Wm)((0,o.SU)(i.ZP),null,{right:(0,l.w5)(()=>[(0,l.Wm)((0,o.SU)(a.ZP),{square:"",type:"danger",class:"delete-button",text:(0,o.SU)(t)("delete")},null,8,["text"])]),default:(0,l.w5)(()=>[(0,l.Wm)((0,o.SU)(s.ZP),{num:"2",price:"2.00",desc:(0,o.SU)(t)("desc"),title:(0,o.SU)(t)("cardTitle"),thumb:(0,o.SU)(r)},null,8,["desc","title","thumb"])]),_:1})]),_:1},8,["title"]),(0,l.Wm)(u,{title:(0,o.SU)(t)("beforeClose")},{default:(0,l.w5)(()=>[(0,l.Wm)((0,o.SU)(i.ZP),{"before-close":v},{left:(0,l.w5)(()=>[(0,l.Wm)((0,o.SU)(a.ZP),{square:"",type:"primary",text:(0,o.SU)(t)("select")},null,8,["text"])]),right:(0,l.w5)(()=>[(0,l.Wm)((0,o.SU)(a.ZP),{square:"",type:"danger",text:(0,o.SU)(t)("delete")},null,8,["text"])]),default:(0,l.w5)(()=>[(0,l.Wm)((0,o.SU)(n.ZP),{border:!1,title:(0,o.SU)(t)("title"),value:(0,o.SU)(t)("content")},null,8,["title","value"])]),_:1})]),_:1},8,["title"])],64)}}})},24647:function(e,t,r){"use strict";r.d(t,{RQ:function(){return l}});var l=e=>"https://fastly.jsdelivr.net/npm/@vant/assets/".concat(e)},1829:function(e,t,r){"use strict";var l=r("63112"),o=r("71368"),i=(0,l.n)(o.Z);t.ZP=i},7197:function(e,t,r){"use strict";r.d(t,{Ee:function(){return i}});var l=r("63112"),o=r("46858"),i=(0,l.n)(o.Z);t.ZP=i},68079:function(e,t,r){"use strict";var l=r("63112"),o=r("96540"),i=(0,l.n)(o.Z);t.ZP=i},88102:function(e,t,r){"use strict";r.d(t,{Vp:function(){return i}});var l=r("63112"),o=r("8291"),i=(0,l.n)(o.Z);t.ZP=i},71368:function(e,t,r){"use strict";r("82116"),r("17989"),r("89176"),r("59644");var l=r("80681"),o=r("62568"),i=r("78335"),a=r("12308"),n=r("88102"),s=r("7197"),[c,u]=(0,o.do)("card"),d={tag:String,num:i.Or,desc:String,thumb:String,title:String,price:i.Or,centered:Boolean,lazyLoad:Boolean,currency:(0,i.SQ)("\xa5"),thumbLink:String,originPrice:i.Or};t.Z=(0,l.aZ)({name:c,props:d,emits:["clickThumb"],setup(e,t){var{slots:r,emit:o}=t,i=()=>r.title?r.title():e.title?(0,l.Wm)("div",{class:[u("title"),"van-multi-ellipsis--l2"]},[e.title]):void 0,c=()=>{if(r.tag||e.tag)return(0,l.Wm)("div",{class:u("tag")},[r.tag?r.tag():(0,l.Wm)(n.Vp,{mark:!0,type:"primary"},{default:()=>[e.tag]})])},d=()=>r.thumb?r.thumb():(0,l.Wm)(s.Ee,{src:e.thumb,fit:"cover",width:"100%",height:"100%",lazyLoad:e.lazyLoad},null),v=()=>{if(r.thumb||e.thumb)return(0,l.Wm)("a",{href:e.thumbLink,class:u("thumb"),onClick:e=>o("clickThumb",e)},[d(),c()])},m=()=>r.desc?r.desc():e.desc?(0,l.Wm)("div",{class:[u("desc"),"van-ellipsis"]},[e.desc]):void 0,f=()=>{var t=e.price.toString().split(".");return(0,l.Wm)("div",null,[(0,l.Wm)("span",{class:u("price-currency")},[e.currency]),(0,l.Wm)("span",{class:u("price-integer")},[t[0]]),(0,l.Uk)("."),(0,l.Wm)("span",{class:u("price-decimal")},[t[1]])])};return()=>{var t,o,n,s=r.num||(0,a.Xq)(e.num),c=r.price||(0,a.Xq)(e.price),d=r["origin-price"]||(0,a.Xq)(e.originPrice),g=s||c||d||r.bottom,p=c&&(0,l.Wm)("div",{class:u("price")},[r.price?r.price():f()]),h=d&&(0,l.Wm)("div",{class:u("origin-price")},[r["origin-price"]?r["origin-price"]():"".concat(e.currency," ").concat(e.originPrice)]),S=s&&(0,l.Wm)("div",{class:u("num")},[r.num?r.num():"x".concat(e.num)]),W=r.footer&&(0,l.Wm)("div",{class:u("footer")},[r.footer()]),b=g&&(0,l.Wm)("div",{class:u("bottom")},[null===(t=r["price-top"])||void 0===t?void 0:t.call(r),p,h,S,null===(o=r.bottom)||void 0===o?void 0:o.call(r)]);return(0,l.Wm)("div",{class:u()},[(0,l.Wm)("div",{class:u("header")},[v(),(0,l.Wm)("div",{class:u("content",{centered:e.centered})},[(0,l.Wm)("div",null,[i(),m(),null===(n=r.tags)||void 0===n?void 0:n.call(r)]),b])]),W])}}})},46858:function(e,t,r){"use strict";r("82116"),r("17989");var l=r("80681"),o=r("11848"),i=r("62568"),a=r("78335"),n=r("20358"),s=r("12308"),c=r("96528"),[u,d]=(0,i.do)("image"),v={src:String,alt:String,fit:String,position:String,round:Boolean,block:Boolean,width:a.Or,height:a.Or,radius:a.Or,lazyLoad:Boolean,iconSize:a.Or,showError:a.J5,errorIcon:(0,a.SQ)("photo-fail"),iconPrefix:String,showLoading:a.J5,loadingIcon:(0,a.SQ)("photo"),crossorigin:String,referrerpolicy:String};t.Z=(0,l.aZ)({name:u,props:v,emits:["load","error"],setup(e,t){var{emit:r,slots:i}=t,a=(0,o.iH)(!1),u=(0,o.iH)(!0),v=(0,o.iH)(),{$Lazyload:m}=(0,l.FN)().proxy,f=(0,l.Fl)(()=>{var t={width:(0,n.Nn)(e.width),height:(0,n.Nn)(e.height)};return(0,s.Xq)(e.radius)&&(t.overflow="hidden",t.borderRadius=(0,n.Nn)(e.radius)),t});(0,l.YP)(()=>e.src,()=>{a.value=!1,u.value=!0});var g=e=>{u.value&&(u.value=!1,r("load",e))},p=()=>{var e=new Event("load");Object.defineProperty(e,"target",{value:v.value,enumerable:!0}),g(e)},h=e=>{a.value=!0,u.value=!1,r("error",e)},S=(t,r,o)=>o?o():(0,l.Wm)(c.JO,{name:t,size:e.iconSize,class:r,classPrefix:e.iconPrefix},null),W=()=>u.value&&e.showLoading?(0,l.Wm)("div",{class:d("loading")},[S(e.loadingIcon,d("loading-icon"),i.loading)]):a.value&&e.showError?(0,l.Wm)("div",{class:d("error")},[S(e.errorIcon,d("error-icon"),i.error)]):void 0,b=()=>{if(!a.value&&e.src){var t={alt:e.alt,class:d("img"),style:{objectFit:e.fit,objectPosition:e.position},crossorigin:e.crossorigin,referrerpolicy:e.referrerpolicy};return e.lazyLoad?(0,l.wy)((0,l.Wm)("img",(0,l.dG)({ref:v},t),null),[[(0,l.Q2)("lazy"),e.src]]):(0,l.Wm)("img",(0,l.dG)({ref:v,src:e.src,onLoad:g,onError:h},t),null)}},y=e=>{var{el:t}=e,r=()=>{t===v.value&&u.value&&p()};v.value?r():(0,l.Y3)(r)},w=e=>{var{el:t}=e;t===v.value&&!a.value&&h()};return m&&s._f&&(m.$on("loaded",y),m.$on("error",w),(0,l.Jd)(()=>{m.$off("loaded",y),m.$off("error",w)})),(0,l.bv)(()=>{(0,l.Y3)(()=>{var t;(null===(t=v.value)||void 0===t?void 0:t.complete)&&!e.lazyLoad&&p()})}),()=>{var t;return(0,l.Wm)("div",{class:d({round:e.round,block:e.block}),style:f.value},[b(),W(),null===(t=i.default)||void 0===t?void 0:t.call(i)])}}})},96540:function(e,t,r){"use strict";r("82116"),r("17989");var l=r("80681"),o=r("11848"),i=r("62568"),a=r("78335"),n=r("12308"),s=r("82210"),c=r("20358"),u=r("55987"),d=r("22300"),v=r("29609"),m=r("10023"),[f,g]=(0,i.do)("swipe-cell"),p={name:(0,a.SI)(""),disabled:Boolean,leftWidth:a.Or,rightWidth:a.Or,beforeClose:Function,stopPropagation:Boolean};t.Z=(0,l.aZ)({name:f,props:p,emits:["open","close","click"],setup(e,t){var r,i,a,f,{emit:p,slots:h}=t,S=(0,o.iH)(),W=(0,o.iH)(),b=(0,o.iH)(),y=(0,o.qj)({offset:0,dragging:!1}),w=(0,v.o)(),P=e=>e.value?(0,d.EL)(e).width:0,Z=(0,l.Fl)(()=>(0,n.Xq)(e.leftWidth)?+e.leftWidth:P(W)),U=(0,l.Fl)(()=>(0,n.Xq)(e.rightWidth)?+e.rightWidth:P(b)),x=t=>{y.offset="left"===t?Z.value:-U.value,!r&&(r=!0,p("open",{name:e.name,position:t}))},C=t=>{y.offset=0,r&&(r=!1,p("close",{name:e.name,position:t}))},k=e=>{var t=Math.abs(y.offset),l=r?.85:.15,o="left"===e?Z.value:U.value;o&&t>o*l?x(e):C(e)},q=t=>{!e.disabled&&(a=y.offset,w.start(t))},z=()=>{y.dragging&&(y.dragging=!1,k(y.offset>0?"left":"right"),setTimeout(()=>{i=!1},0))},O=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"outside";!f&&(p("click",t),r&&!i&&(f=!0,(0,u.I)(e.beforeClose,{args:[{name:e.name,position:t}],done:()=>{f=!1,C(t)},canceled:()=>f=!1,error:()=>f=!1})))},B=(e,t)=>r=>{t&&r.stopPropagation(),O(e)},L=(e,t)=>{var r=h[e];if(r)return(0,l.Wm)("div",{ref:t,class:g(e),onClick:B(e,!0)},[r()])};return(0,m.F)({open:x,close:C}),(0,d.Vd)(S,()=>O("outside"),{eventName:"touchstart"}),(0,d.OR)("touchmove",t=>{if(!e.disabled){var{deltaX:l}=w;w.move(t),w.isHorizontal()&&(i=!0,y.dragging=!0,(!r||l.value*a<0)&&(0,s.PF)(t,e.stopPropagation),y.offset=(0,c.uZ)(l.value+a,-U.value,Z.value))}},{target:S}),()=>{var e,t={transform:"translate3d(".concat(y.offset,"px, 0, 0)"),transitionDuration:y.dragging?"0s":".6s"};return(0,l.Wm)("div",{ref:S,class:g(),onClick:B("cell",i),onTouchstartPassive:q,onTouchend:z,onTouchcancel:z},[(0,l.Wm)("div",{class:g("wrapper"),style:t},[L("left",W),null===(e=h.default)||void 0===e?void 0:e.call(h),L("right",b)])])}}})},8291:function(e,t,r){"use strict";r("82116"),r("17989");var l=r("80681"),o=r("39594"),i=r("62568"),a=r("78335"),n=r("8051"),s=r("96528"),[c,u]=(0,i.do)("tag"),d={size:String,mark:Boolean,show:a.J5,type:(0,a.SQ)("default"),color:String,plain:Boolean,round:Boolean,textColor:String,closeable:Boolean};t.Z=(0,l.aZ)({name:c,props:d,emits:["close"],setup(e,t){var{slots:r,emit:i}=t,a=e=>{e.stopPropagation(),i("close",e)},c=()=>e.plain?{color:e.textColor||e.color,borderColor:e.color}:{color:e.textColor,background:e.color},d=()=>{var t,{type:o,mark:i,plain:d,round:v,size:m,closeable:f}=e,g={mark:i,plain:d,round:v};m&&(g[m]=m);var p=f&&(0,l.Wm)(s.JO,{name:"cross",class:[u("close"),n.e9],onClick:a},null);return(0,l.Wm)("span",{style:c(),class:u([g,o])},[null===(t=r.default)||void 0===t?void 0:t.call(r),p])};return()=>(0,l.Wm)(o.uT,{name:e.closeable?"van-fade":void 0},{default:()=>[e.show?d():null]})}})},51328:function(e,t,r){"use strict";r.r(e.exports={})},97824:function(e,t,r){"use strict";r.r(e.exports={})}}]);