1 line
7.5 KiB
JavaScript
1 line
7.5 KiB
JavaScript
"use strict";(self["webpackChunkset_vue"]=self["webpackChunkset_vue"]||[]).push([[506],{6769:function(e,t,a){a.r(t),a.d(t,{default:function(){return $}});var n=a(4726),l=a(6768),o=a(144),s=a(5828),i=a(6370),r=a(7905),c=a(4612),u=a(9725),d=a(6591),f=a(4397);const[v,h]=(0,s.YX)("tabbar"),p={route:Boolean,fixed:i.Rd,border:i.Rd,zIndex:i.VQ,placeholder:Boolean,activeColor:String,beforeChange:Function,inactiveColor:String,modelValue:(0,i.TU)(0),safeAreaInsetBottom:{type:Boolean,default:null}},g=Symbol(v);var b=(0,l.pM)({name:v,props:p,emits:["change","update:modelValue"],setup(e,{emit:t,slots:a}){const n=(0,o.KR)(),{linkChildren:s}=(0,d.Py)(g),i=(0,f.h)(n,h),v=()=>{var t;return null!=(t=e.safeAreaInsetBottom)?t:e.fixed},p=()=>{var t;const{fixed:o,zIndex:s,border:i}=e;return(0,l.bF)("div",{ref:n,role:"tablist",style:(0,r.AO)(s),class:[h({fixed:o}),{[c.pT]:i,"van-safe-area-bottom":v()}]},[null==(t=a.default)?void 0:t.call(a)])},b=(a,n)=>{(0,u.m)(e.beforeChange,{args:[a],done(){t("update:modelValue",a),t("change",a),n()}})};return s({props:e,setActive:b}),()=>e.fixed&&e.placeholder?i(p):p()}});const m=(0,n.G)(b);a(6647);var x=a(8442),T=a(4548),F=a(5632),k=a(3408);const[D,C]=(0,s.YX)("tabbar-item"),V=(0,x.X$)({},T.aI,{dot:Boolean,icon:String,name:i.VQ,badge:i.VQ,badgeProps:Object,iconPrefix:String});var B=(0,l.pM)({name:D,props:V,emits:["click"],setup(e,{emit:t,slots:a}){const n=(0,T.lq)(),o=(0,l.nI)().proxy,{parent:s,index:i}=(0,d.cJ)(g);if(!s)return void 0;const r=(0,l.EW)((()=>{var t;const{route:a,modelValue:n}=s.props;if(a&&"$route"in o){const{$route:t}=o,{to:a}=e,n=(0,x.Gv)(a)?a:{path:a};return!!t.matched.find((e=>{const t="path"in n&&n.path===e.path,a="name"in n&&n.name===e.name;return t||a}))}return(null!=(t=e.name)?t:i.value)===n})),c=a=>{var l;r.value||s.setActive(null!=(l=e.name)?l:i.value,n),t("click",a)},u=()=>a.icon?a.icon({active:r.value}):e.icon?(0,l.bF)(F.In,{name:e.icon,classPrefix:e.iconPrefix},null):void 0;return()=>{var t;const{dot:n,badge:o}=e,{activeColor:i,inactiveColor:d}=s.props,f=r.value?i:d;return(0,l.bF)("div",{role:"tab",class:C({active:r.value}),style:{color:f},tabindex:0,"aria-selected":r.value,onClick:c},[(0,l.bF)(k.Ex,(0,l.v6)({dot:n,class:C("icon"),content:o},e.badgeProps),{default:u}),(0,l.bF)("div",{class:C("text")},[null==(t=a.default)?void 0:t.call(a,{active:r.value})])])}}});const A=(0,n.G)(B);a(7708),a(7484);const I={class:"footer"};function R(e,t,a,n,o,s){const i=(0,l.g2)("router-view"),r=A,c=m;return(0,l.uX)(),(0,l.CE)("div",I,[(0,l.bF)(i),(0,l.bF)(c,{modelValue:n.active,"onUpdate:modelValue":t[0]||(t[0]=e=>n.active=e),onChange:n.onChange},{default:(0,l.k6)((()=>[(0,l.bF)(r,{icon:"home-o",name:"home"},{default:(0,l.k6)((()=>[(0,l.eW)("系统设置")])),_:1}),(0,l.bF)(r,{icon:"setting-o",name:"info"},{default:(0,l.k6)((()=>[(0,l.eW)("系统信息")])),_:1})])),_:1},8,["modelValue","onChange"])])}a(4114);var S=a(1387),w={setup(){const e=(0,o.KR)("home"),t=(0,S.rd)(),a=(0,S.lq)(),n=e=>{t.push({name:e})};return(0,l.nT)((()=>{e.value=a.name})),{active:e,onChange:n}}},y=a(1241);const Y=(0,y.A)(w,[["render",R]]);var $=Y},4758:function(e,t,a){a.d(t,{A:function(){return k}});var n=a(4726),l=a(6768),o=a(144),s=a(5828),i=a(6370),r=a(7905),c=a(4612),u=a(4397),d=a(5632);const[f,v]=(0,s.YX)("nav-bar"),h={title:String,fixed:Boolean,zIndex:i.VQ,border:i.Rd,leftText:String,rightText:String,leftDisabled:Boolean,rightDisabled:Boolean,leftArrow:Boolean,placeholder:Boolean,safeAreaInsetTop:Boolean,clickable:i.Rd};var p=(0,l.pM)({name:f,props:h,emits:["clickLeft","clickRight"],setup(e,{emit:t,slots:a}){const n=(0,o.KR)(),s=(0,u.h)(n,v),i=a=>{e.leftDisabled||t("clickLeft",a)},f=a=>{e.rightDisabled||t("clickRight",a)},h=()=>a.left?a.left():[e.leftArrow&&(0,l.bF)(d.In,{class:v("arrow"),name:"arrow-left"},null),e.leftText&&(0,l.bF)("span",{class:v("text")},[e.leftText])],p=()=>a.right?a.right():(0,l.bF)("span",{class:v("text")},[e.rightText]),g=()=>{const{title:t,fixed:o,border:s,zIndex:u}=e,d=(0,r.AO)(u),g=e.leftArrow||e.leftText||a.left,b=e.rightText||a.right;return(0,l.bF)("div",{ref:n,style:d,class:[v({fixed:o}),{[c.n_]:s,"van-safe-area-top":e.safeAreaInsetTop}]},[(0,l.bF)("div",{class:v("content")},[g&&(0,l.bF)("div",{class:[v("left",{disabled:e.leftDisabled}),e.clickable&&!e.leftDisabled?c.Dk:""],onClick:i},[h()]),(0,l.bF)("div",{class:[v("title"),"van-ellipsis"]},[a.title?a.title():t]),b&&(0,l.bF)("div",{class:[v("right",{disabled:e.rightDisabled}),e.clickable&&!e.rightDisabled?c.Dk:""],onClick:f},[p()])])])};return()=>e.fixed&&e.placeholder?s(g):g()}});const g=(0,n.G)(p);a(6647),a(7708),a(7484);const b={class:"custom-nav-bar"};function m(e,t,a,n,o,s){const i=g;return(0,l.uX)(),(0,l.CE)("div",b,[(0,l.bF)(i,{title:a.title},null,8,["title"])])}var x={name:"Header",props:{title:{type:String,default:"标题"}}},T=a(1241);const F=(0,T.A)(x,[["render",m],["__scopeId","data-v-fc10581e"]]);var k=F},4397:function(e,t,a){a.d(t,{h:function(){return c}});var n=a(6768),l=a(6591),o=a(144),s=a(240),i=a(8957);const r=(e,t)=>{const a=(0,o.KR)(),r=()=>{a.value=(0,l.yD)(e).height};return(0,n.sV)((()=>{if((0,n.dY)(r),t)for(let e=1;e<=3;e++)setTimeout(r,100*e)})),(0,i.V)((()=>(0,n.dY)(r))),(0,n.wB)([s.Xw,s.C7],r),a};function c(e,t){const a=r(e,!0);return e=>(0,n.bF)("div",{class:t("placeholder"),style:{height:a.value?`${a.value}px`:void 0}},[e()])}},6987:function(e,t,a){a.d(t,{j5:function(){return x}});var n=a(4726),l=(a(4114),a(6768)),o=a(144),s=a(5828),i=a(6370),r=a(240),c=a(6591),u=a(4390),d=a(2094);const[f,v,h]=(0,s.YX)("pull-refresh"),p=50,g=["pulling","loosing","success"],b={disabled:Boolean,modelValue:Boolean,headHeight:(0,i.TU)(p),successText:String,pullingText:String,loosingText:String,loadingText:String,pullDistance:i.VQ,successDuration:(0,i.TU)(500),animationDuration:(0,i.TU)(300)};var m=(0,l.pM)({name:f,props:b,emits:["change","refresh","update:modelValue"],setup(e,{emit:t,slots:a}){let n;const s=(0,o.KR)(),i=(0,o.KR)(),f=(0,c.f$)(s),b=(0,o.Kh)({status:"normal",distance:0,duration:0}),m=(0,u.P)(),x=()=>{if(e.headHeight!==p)return{height:`${e.headHeight}px`}},T=()=>"loading"!==b.status&&"success"!==b.status&&!e.disabled,F=t=>{const a=+(e.pullDistance||e.headHeight);return t>a&&(t=t<2*a?a+(t-a)/2:1.5*a+(t-2*a)/4),Math.round(t)},k=(a,n)=>{const l=+(e.pullDistance||e.headHeight);b.distance=a,b.status=n?"loading":0===a?"normal":a<l?"pulling":"loosing",t("change",{status:b.status,distance:a})},D=()=>{const{status:t}=b;return"normal"===t?"":e[`${t}Text`]||h(t)},C=()=>{const{status:e,distance:t}=b;if(a[e])return a[e]({distance:t});const n=[];return g.includes(e)&&n.push((0,l.bF)("div",{class:v("text")},[D()])),"loading"===e&&n.push((0,l.bF)(d.Rh,{class:v("loading")},{default:D})),n},V=()=>{b.status="success",setTimeout((()=>{k(0)}),+e.successDuration)},B=e=>{n=0===(0,r.hY)(f.value),n&&(b.duration=0,m.start(e))},A=e=>{T()&&B(e)},I=e=>{if(T()){n||B(e);const{deltaY:t}=m;m.move(e),n&&t.value>=0&&m.isVertical()&&((0,r.wo)(e),k(F(t.value)))}},R=()=>{n&&m.deltaY.value&&T()&&(b.duration=+e.animationDuration,"loosing"===b.status?(k(+e.headHeight,!0),t("update:modelValue",!0),(0,l.dY)((()=>t("refresh")))):k(0))};return(0,l.wB)((()=>e.modelValue),(t=>{b.duration=+e.animationDuration,t?k(+e.headHeight,!0):a.success||e.successText?V():k(0,!1)})),(0,c.ML)("touchmove",I,{target:i}),()=>{var e;const t={transitionDuration:`${b.duration}ms`,transform:b.distance?`translate3d(0,${b.distance}px, 0)`:""};return(0,l.bF)("div",{ref:s,class:v()},[(0,l.bF)("div",{ref:i,class:v("track"),style:t,onTouchstartPassive:A,onTouchend:R,onTouchcancel:R},[(0,l.bF)("div",{class:v("head"),style:x()},[C()]),null==(e=a.default)?void 0:e.call(a)])])}}});const x=(0,n.G)(m)},6463:function(e,t,a){a(6647),a(7265)}}]); |