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

2 lines
15 KiB
JavaScript

/*! For license information please see 7991.2601dd72.js.LICENSE.txt */
(self.webpackChunk=self.webpackChunk||[]).push([["7991"],{50492:function(e,t,a){"use strict";a.r(t);var l=a("89249");a("5488");let i=l.Z;t.default=i},89249:function(e,t,a){"use strict";var l=a("80681"),i=a("11848"),n=a("57122"),r=a("59973"),o=a("32823"),u=a("54369"),s=a("24647"),c=a("13118"),v=["src"],d={class:"custom-indicator"};t.Z=(0,l.aZ)({__name:"index",setup(e){var t=(0,u.q)({"zh-CN":{title2:"\u61D2\u52A0\u8F7D",title3:"\u76D1\u542C change \u4E8B\u4EF6",title4:"\u7EB5\u5411\u6EDA\u52A8",title5:"\u81EA\u5B9A\u4E49\u6ED1\u5757\u5927\u5C0F",title6:"\u81EA\u5B9A\u4E49\u6307\u793A\u5668",message:"\u5F53\u524D Swipe \u7D22\u5F15\uFF1A"},"en-US":{title2:"Lazy Render",title3:"Change Event",title4:"Vertical Scrolling",title5:"Set SwipeItem Size",title6:"Custom indicator",message:"Current Swipe index:"}}),a=[(0,s.RQ)("apple-1.jpeg"),(0,s.RQ)("apple-2.jpeg"),(0,s.RQ)("apple-3.jpeg"),(0,s.RQ)("apple-4.jpeg")],f=e=>(0,c.CF)(t("message")+e);return(e,u)=>{var s=(0,l.up)("demo-block");return(0,l.wg)(),(0,l.iD)(l.HY,null,[(0,l.Wm)(s,{title:(0,i.SU)(t)("basicUsage")},{default:(0,l.w5)(()=>[(0,l.Wm)((0,i.SU)(r.ZP),{autoplay:3e3,"indicator-color":"white"},{default:(0,l.w5)(()=>[(0,l.Wm)((0,i.SU)(o.Z),null,{default:(0,l.w5)(()=>[(0,l.Uk)("1")]),_:1}),(0,l.Wm)((0,i.SU)(o.Z),null,{default:(0,l.w5)(()=>[(0,l.Uk)("2")]),_:1}),(0,l.Wm)((0,i.SU)(o.Z),null,{default:(0,l.w5)(()=>[(0,l.Uk)("3")]),_:1}),(0,l.Wm)((0,i.SU)(o.Z),null,{default:(0,l.w5)(()=>[(0,l.Uk)("4")]),_:1})]),_:1})]),_:1},8,["title"]),(0,l.Wm)(s,{title:(0,i.SU)(t)("title2")},{default:(0,l.w5)(()=>[(0,l.Wm)((0,i.SU)(r.ZP),{autoplay:3e3,"lazy-render":""},{default:(0,l.w5)(()=>[((0,l.wg)(),(0,l.iD)(l.HY,null,(0,l.Ko)(a,e=>(0,l.Wm)((0,i.SU)(o.Z),{key:e},{default:(0,l.w5)(()=>[(0,l._)("img",{src:e},null,8,v)]),_:2},1024)),64))]),_:1})]),_:1},8,["title"]),(0,l.Wm)(s,{title:(0,i.SU)(t)("title3")},{default:(0,l.w5)(()=>[(0,l.Wm)((0,i.SU)(r.ZP),{"indicator-color":"white",onChange:f},{default:(0,l.w5)(()=>[(0,l.Wm)((0,i.SU)(o.Z),null,{default:(0,l.w5)(()=>[(0,l.Uk)("1")]),_:1}),(0,l.Wm)((0,i.SU)(o.Z),null,{default:(0,l.w5)(()=>[(0,l.Uk)("2")]),_:1}),(0,l.Wm)((0,i.SU)(o.Z),null,{default:(0,l.w5)(()=>[(0,l.Uk)("3")]),_:1}),(0,l.Wm)((0,i.SU)(o.Z),null,{default:(0,l.w5)(()=>[(0,l.Uk)("4")]),_:1})]),_:1})]),_:1},8,["title"]),(0,l.Wm)(s,{title:(0,i.SU)(t)("title4")},{default:(0,l.w5)(()=>[(0,l.Wm)((0,i.SU)(r.ZP),{vertical:"",autoplay:3e3,"indicator-color":"white",style:{height:"200px"},class:"demo-swipe--vertical"},{default:(0,l.w5)(()=>[(0,l.Wm)((0,i.SU)(o.Z),null,{default:(0,l.w5)(()=>[(0,l.Uk)("1")]),_:1}),(0,l.Wm)((0,i.SU)(o.Z),null,{default:(0,l.w5)(()=>[(0,l.Uk)("2")]),_:1}),(0,l.Wm)((0,i.SU)(o.Z),null,{default:(0,l.w5)(()=>[(0,l.Uk)("3")]),_:1}),(0,l.Wm)((0,i.SU)(o.Z),null,{default:(0,l.w5)(()=>[(0,l.Uk)("4")]),_:1})]),_:1})]),_:1},8,["title"]),(0,l.Wm)(s,{title:(0,i.SU)(t)("title5")},{default:(0,l.w5)(()=>[(0,l.Wm)((0,i.SU)(r.ZP),{width:300,loop:!1,"indicator-color":"white"},{default:(0,l.w5)(()=>[(0,l.Wm)((0,i.SU)(o.Z),null,{default:(0,l.w5)(()=>[(0,l.Uk)("1")]),_:1}),(0,l.Wm)((0,i.SU)(o.Z),null,{default:(0,l.w5)(()=>[(0,l.Uk)("2")]),_:1}),(0,l.Wm)((0,i.SU)(o.Z),null,{default:(0,l.w5)(()=>[(0,l.Uk)("3")]),_:1}),(0,l.Wm)((0,i.SU)(o.Z),null,{default:(0,l.w5)(()=>[(0,l.Uk)("4")]),_:1})]),_:1})]),_:1},8,["title"]),(0,l.Wm)(s,{title:(0,i.SU)(t)("title6")},{default:(0,l.w5)(()=>[(0,l.Wm)((0,i.SU)(r.ZP),null,{indicator:(0,l.w5)(e=>{var{active:t,total:a}=e;return[(0,l._)("div",d,(0,n.zw)(t+1)+"/"+(0,n.zw)(a),1)]}),default:(0,l.w5)(()=>[(0,l.Wm)((0,i.SU)(o.Z),null,{default:(0,l.w5)(()=>[(0,l.Uk)("1")]),_:1}),(0,l.Wm)((0,i.SU)(o.Z),null,{default:(0,l.w5)(()=>[(0,l.Uk)("2")]),_:1}),(0,l.Wm)((0,i.SU)(o.Z),null,{default:(0,l.w5)(()=>[(0,l.Uk)("3")]),_:1}),(0,l.Wm)((0,i.SU)(o.Z),null,{default:(0,l.w5)(()=>[(0,l.Uk)("4")]),_:1})]),_:1})]),_:1},8,["title"])],64)}}})},24647:function(e,t,a){"use strict";a.d(t,{RQ:function(){return l}});var l=e=>"https://fastly.jsdelivr.net/npm/@vant/assets/".concat(e)},95786:function(e,t,a){"use strict";a.d(t,{gb:function(){return n}});var l=a("63112"),i=a("2309"),n=(0,l.n)(i.Z);t.ZP=n},32823:function(e,t,a){"use strict";a.d(t,{j:function(){return n}});var l=a("63112"),i=a("89408"),n=(0,l.n)(i.Z);t.Z=n},59973:function(e,t,a){"use strict";a.d(t,{oF:function(){return n}});var l=a("63112"),i=a("87373"),n=(0,l.n)(i.ZP);t.ZP=n},20897:function(e,t,a){"use strict";a.d(t,{G:function(){return i}});var l=0;function i(e){e?(!l&&document.body.classList.add("van-toast--unclickable"),l++):l&&!--l&&document.body.classList.remove("van-toast--unclickable")}},84285:function(e,t,a){"use strict";a.d(t,{H:function(){return u},o:function(){return o}});var l=a("11848"),i=a("39594"),n=a("12308"),r=a("10023");function o(){var e=(0,l.qj)({show:!1}),t=t=>{e.show=t},a=a=>{(0,n.l7)(e,a,{transitionAppear:!0}),t(!0)},i=()=>t(!1);return(0,r.F)({open:a,close:i,toggle:t}),{open:a,close:i,state:e,toggle:t}}function u(e){var t=(0,i.ri)(e),a=document.createElement("div");return document.body.appendChild(a),{instance:t.mount(a),unmount(){t.unmount(),document.body.removeChild(a)}}}},2309:function(e,t,a){"use strict";a("82116"),a("17989"),a("66786"),a("14529");var l=a("80681"),i=a("62568"),n=a("78335"),r=a("12308"),o=a("20358"),[u,s]=(0,i.do)("loading"),c=Array(12).fill(null).map((e,t)=>(0,l.Wm)("i",{class:s("line",String(t+1))},null)),v=(0,l.Wm)("svg",{class:s("circular"),viewBox:"25 25 50 50"},[(0,l.Wm)("circle",{cx:"50",cy:"50",r:"20",fill:"none"},null)]),d={size:n.Or,type:(0,n.SQ)("circular"),color:String,vertical:Boolean,textSize:n.Or,textColor:String};t.Z=(0,l.aZ)({name:u,props:d,setup(e,t){var{slots:a}=t,i=(0,l.Fl)(()=>(0,r.l7)({color:e.color},(0,o.Xn)(e.size))),n=()=>{var t="spinner"===e.type?c:v;return(0,l.Wm)("span",{class:s("spinner",e.type),style:i.value},[a.icon?a.icon():t])},u=()=>{if(a.default){var t;return(0,l.Wm)("span",{class:s("text"),style:{fontSize:(0,o.Nn)(e.textSize),color:null!==(t=e.textColor)&&void 0!==t?t:e.color}},[a.default()])}};return()=>{var{type:t,vertical:a}=e;return(0,l.Wm)("div",{class:s([t,{vertical:a}]),"aria-live":"polite","aria-busy":!0},[n(),u()])}}})},89408:function(e,t,a){"use strict";a("82116"),a("17989");var l=a("80681"),i=a("11848"),n=a("62568"),r=a("87373"),o=a("22300"),u=a("10023"),[s,c]=(0,n.do)("swipe-item");t.Z=(0,l.aZ)({name:s,setup(e,t){var a,{slots:n}=t,s=(0,i.qj)({offset:0,inited:!1,mounted:!1}),{parent:v,index:d}=(0,o.NB)(r.PG);if(v){var f=(0,l.Fl)(()=>{var e={},{vertical:t}=v.props;return v.size.value&&(e[t?"height":"width"]="".concat(v.size.value,"px")),s.offset&&(e.transform="translate".concat(t?"Y":"X","(").concat(s.offset,"px)")),e}),p=(0,l.Fl)(()=>{var{loop:e,lazyRender:t}=v.props;if(!t||a)return!0;if(!s.mounted)return!1;var l=v.activeIndicator.value,i=v.count.value-1;return a=d.value===l||d.value===(0===l&&e?i:l-1)||d.value===(l===i&&e?0:l+1)});return(0,l.bv)(()=>{(0,l.Y3)(()=>{s.mounted=!0})}),(0,u.F)({setOffset:e=>{s.offset=e}}),()=>{var e;return(0,l.Wm)("div",{class:c(),style:f.value},[p.value?null===(e=n.default)||void 0===e?void 0:e.call(n):null])}}}})},87373:function(e,t,a){"use strict";a.d(t,{PG:function(){return h}}),a("82116"),a("17989"),a("86795"),a("31564"),a("8649"),a("70629"),a("66786"),a("14529");var l=a("80681"),i=a("11848"),n=a("62568"),r=a("78335"),o=a("20358"),u=a("82210"),s=a("22300"),c=a("29609"),v=a("10023"),d=a("65170"),[f,p]=(0,n.do)("swipe"),m={loop:r.J5,width:r.Or,height:r.Or,vertical:Boolean,autoplay:(0,r.SI)(0),duration:(0,r.SI)(500),touchable:r.J5,lazyRender:Boolean,initialSwipe:(0,r.SI)(0),indicatorColor:String,showIndicators:r.J5,stopPropagation:r.J5},h=Symbol(f);t.ZP=(0,l.aZ)({name:f,props:m,emits:["change","dragStart","dragEnd"],setup(e,t){var a,n,{emit:r,slots:f}=t,m=(0,i.iH)(),w=(0,i.iH)(),g=(0,i.qj)({rect:null,width:0,height:0,offset:0,active:0,swiping:!1}),S=!1,y=(0,c.o)(),{children:U,linkChildren:W}=(0,s.$E)(h),Z=(0,l.Fl)(()=>U.length),k=(0,l.Fl)(()=>g[e.vertical?"height":"width"]),_=(0,l.Fl)(()=>e.vertical?y.deltaY.value:y.deltaX.value),C=(0,l.Fl)(()=>g.rect?(e.vertical?g.rect.height:g.rect.width)-k.value*Z.value:0),b=(0,l.Fl)(()=>k.value?Math.ceil(Math.abs(C.value)/k.value):Z.value),x=(0,l.Fl)(()=>Z.value*k.value),P=(0,l.Fl)(()=>(g.active+Z.value)%Z.value),O=(0,l.Fl)(()=>{var t=e.vertical?"vertical":"horizontal";return y.direction.value===t}),z=(0,l.Fl)(()=>{var t={transitionDuration:"".concat(g.swiping?0:e.duration,"ms"),transform:"translate".concat(e.vertical?"Y":"X","(").concat(+g.offset.toFixed(2),"px)")};if(k.value){var a=e.vertical?"height":"width",l=e.vertical?"width":"height";t[a]="".concat(x.value,"px"),t[l]=e[l]?"".concat(e[l],"px"):""}return t}),F=t=>{var{active:a}=g;if(t)return e.loop?(0,o.uZ)(a+t,-1,Z.value):(0,o.uZ)(a+t,0,b.value);return a},Y=function(t){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,l=t*k.value;!e.loop&&(l=Math.min(l,-C.value));var i=a-l;return!e.loop&&(i=(0,o.uZ)(i,C.value,0)),i},j=t=>{var{pace:a=0,offset:l=0,emitChange:i}=t;if(!(Z.value<=1)){var{active:n}=g,o=F(a),u=Y(o,l);if(e.loop){if(U[0]&&u!==C.value){var s=u<C.value;U[0].setOffset(s?x.value:0)}if(U[Z.value-1]&&0!==u){var c=u>0;U[Z.value-1].setOffset(c?-x.value:0)}}g.active=o,g.offset=u,i&&o!==n&&r("change",P.value)}},B=()=>{g.swiping=!0,g.active<=-1?j({pace:Z.value}):g.active>=Z.value&&j({pace:-Z.value})},T=()=>{B(),y.reset(),(0,s.d1)(()=>{g.swiping=!1,j({pace:1,emitChange:!0})})},I=()=>clearTimeout(a),M=()=>{I(),+e.autoplay>0&&Z.value>1&&(a=setTimeout(()=>{T(),M()},+e.autoplay))},H=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:+e.initialSwipe;if(m.value){var a=()=>{if(!(0,u.xj)(m)){var a,l,i={width:m.value.offsetWidth,height:m.value.offsetHeight};g.rect=i,g.width=+(null!==(a=e.width)&&void 0!==a?a:i.width),g.height=+(null!==(l=e.height)&&void 0!==l?l:i.height)}Z.value&&-1===(t=Math.min(Z.value-1,t))&&(t=Z.value-1),g.active=t,g.swiping=!0,g.offset=Y(t),U.forEach(e=>{e.setOffset(0)}),M()};(0,u.xj)(m)?(0,l.Y3)().then(a):a()}},Q=()=>H(g.active),R=t=>{e.touchable&&!(t.touches.length>1)&&(y.start(t),S=!1,n=Date.now(),I(),B())},E=()=>{if(e.touchable&&g.swiping){var t=Date.now()-n;if((Math.abs(_.value/t)>.25||Math.abs(_.value)>k.value/2)&&O.value){var a=e.vertical?y.offsetY.value:y.offsetX.value,l=0;j({pace:l=e.loop?a>0?_.value>0?-1:1:0:-Math[_.value>0?"ceil":"floor"](_.value/k.value),emitChange:!0})}else _.value&&j({pace:0});S=!1,g.swiping=!1,r("dragEnd",{index:P.value}),M()}},G=(t,a)=>{var i=a===P.value,n=i?{backgroundColor:e.indicatorColor}:void 0;return(0,l.Wm)("i",{style:n,class:p("indicator",{active:i})},null)},J=()=>f.indicator?f.indicator({active:P.value,total:Z.value}):e.showIndicators&&Z.value>1?(0,l.Wm)("div",{class:p("indicators",{vertical:e.vertical})},[Array(Z.value).fill("").map(G)]):void 0;return(0,v.F)({prev:()=>{B(),y.reset(),(0,s.d1)(()=>{g.swiping=!1,j({pace:-1,emitChange:!0})})},next:T,state:g,resize:Q,swipeTo:function(t){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};B(),y.reset(),(0,s.d1)(()=>{var l;l=e.loop&&t===Z.value?0===g.active?0:t:t%Z.value,a.immediate?(0,s.d1)(()=>{g.swiping=!1}):g.swiping=!1,j({pace:l-g.active,emitChange:!0})})}}),W({size:k,props:e,count:Z,activeIndicator:P}),(0,l.YP)(()=>e.initialSwipe,e=>H(+e)),(0,l.YP)(Z,()=>H(g.active)),(0,l.YP)(()=>e.autoplay,M),(0,l.YP)([u.bn,u.uK,()=>e.width,()=>e.height],Q),(0,l.YP)((0,s.d9)(),e=>{"visible"===e?M():I()}),(0,l.bv)(H),(0,l.dl)(()=>H(g.active)),(0,d.h)(()=>H(g.active)),(0,l.se)(I),(0,l.Jd)(I),(0,s.OR)("touchmove",t=>{e.touchable&&g.swiping&&(y.move(t),O.value&&!(!e.loop&&(0===g.active&&_.value>0||g.active===Z.value-1&&_.value<0))&&((0,u.PF)(t,e.stopPropagation),j({offset:_.value}),!S&&(r("dragStart",{index:P.value}),S=!0)))},{target:w}),()=>{var t;return(0,l.Wm)("div",{ref:m,class:p()},[(0,l.Wm)("div",{ref:w,style:z.value,class:p("track",{vertical:e.vertical}),onTouchstartPassive:R,onTouchend:E,onTouchcancel:E},[null===(t=f.default)||void 0===t?void 0:t.call(f)]),J()])}}})},21083:function(e,t,a){"use strict";a("82116"),a("17989");var l=a("80681"),i=a("62568"),n=a("78335"),r=a("12308"),o=a("20897"),u=a("96528"),s=a("97760"),c=a("95786"),[v,d]=(0,i.do)("toast"),f=["show","overlay","teleport","transition","overlayClass","overlayStyle","closeOnClickOverlay","zIndex"],p={icon:String,show:Boolean,type:(0,n.SQ)("text"),overlay:Boolean,message:n.Or,iconSize:n.Or,duration:(0,n.qM)(2e3),position:(0,n.SQ)("middle"),teleport:[String,Object],wordBreak:String,className:n.Vg,iconPrefix:String,transition:(0,n.SQ)("van-fade"),loadingType:String,forbidClick:Boolean,overlayClass:n.Vg,overlayStyle:Object,closeOnClick:Boolean,closeOnClickOverlay:Boolean,zIndex:n.Or};t.Z=(0,l.aZ)({name:v,props:p,emits:["update:show"],setup(e,t){var a,{emit:i,slots:n}=t,v=!1,p=()=>{var t=e.show&&e.forbidClick;v!==t&&(v=t,(0,o.G)(v))},m=e=>i("update:show",e),h=()=>{e.closeOnClick&&m(!1)},w=()=>clearTimeout(a),g=()=>{var{icon:t,type:a,iconSize:i,iconPrefix:n,loadingType:r}=e;return t||"success"===a||"fail"===a?(0,l.Wm)(u.JO,{name:t||a,size:i,class:d("icon"),classPrefix:n},null):"loading"===a?(0,l.Wm)(c.gb,{class:d("loading"),size:i,type:r},null):void 0},S=()=>{var{type:t,message:a}=e;return n.message?(0,l.Wm)("div",{class:d("text")},[n.message()]):(0,r.Xq)(a)&&""!==a?"html"===t?(0,l.Wm)("div",{key:0,class:d("text"),innerHTML:String(a)},null):(0,l.Wm)("div",{class:d("text")},[a]):void 0};return(0,l.YP)(()=>[e.show,e.forbidClick],p),(0,l.YP)(()=>[e.show,e.type,e.message,e.duration],()=>{w(),e.show&&e.duration>0&&(a=setTimeout(()=>{m(!1)},e.duration))}),(0,l.bv)(p),(0,l.Ah)(p),()=>(0,l.Wm)(s.GI,(0,l.dG)({class:[d([e.position,"normal"===e.wordBreak?"break-normal":e.wordBreak,{[e.type]:!e.icon}]),e.className],lockScroll:!1,onClick:h,onClosed:w,"onUpdate:show":m},(0,r.ei)(e,f)),{default:()=>[g(),S()]})}})},13118:function(e,t,a){"use strict";a.d(t,{CF:function(){return d},LJ:function(){return h},XA:function(){return m},di:function(){return p},yg:function(){return w}}),a("24836"),a("41712"),a("80855"),a("10502"),a("7978"),a("66746"),a("17530"),a("87604"),a("57024"),a("22175"),a("85322"),a("47897"),a("48943"),a("43356"),a("82116"),a("17989"),a("96245"),a("37232"),a("70629"),a("61557"),a("31564"),a("8649");var l=a("80681"),i=a("11848"),n=a("12308"),r=a("84285"),o=a("21083"),u=[],s=(0,n.l7)({},{icon:"",type:"text",message:"",className:"",overlay:!1,onClose:void 0,onOpened:void 0,duration:2e3,teleport:"body",iconSize:void 0,iconPrefix:void 0,position:"middle",transition:"van-fade",forbidClick:!1,loadingType:void 0,overlayClass:"",overlayStyle:void 0,closeOnClick:!1,closeOnClickOverlay:!1}),c=new Map;function v(e){return(0,n.Kn)(e)?e:{message:e}}function d(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!n._f)return{};var t=function(){if(!u.length){var e=function(){var{instance:e,unmount:t}=(0,r.H)({setup(){var e=(0,i.iH)(""),{open:t,state:a,close:n,toggle:u}=(0,r.o)(),s=()=>{};return(0,l.YP)(e,e=>{a.message=e}),(0,l.FN)().render=()=>(0,l.Wm)(o.Z,(0,l.dG)(a,{onClosed:s,"onUpdate:show":u}),null),{open:t,close:n,message:e}}});return e}();u.push(e)}return u[u.length-1]}(),a=v(e);return t.open((0,n.l7)({},s,c.get(a.type||s.type),a)),t}var f=e=>t=>d((0,n.l7)({type:e},v(t))),p=f("loading"),m=f("success"),h=f("fail"),w=e=>{if(u.length){if(e)u.forEach(e=>{e.close()}),u=[];else{var t;u[0].close()}}}},5488:function(e,t,a){"use strict";a.r(e.exports={})},20953:function(e,t,a){"use strict";a.r(e.exports={})}}]);