2 lines
5.1 KiB
JavaScript
2 lines
5.1 KiB
JavaScript
var O=Object.defineProperty,E=Object.defineProperties;var G=Object.getOwnPropertyDescriptors;var T=Object.getOwnPropertySymbols;var M=Object.prototype.hasOwnProperty,Y=Object.prototype.propertyIsEnumerable;var z=(o,a,e)=>a in o?O(o,a,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[a]=e,b=(o,a)=>{for(var e in a||(a={}))M.call(a,e)&&z(o,e,a[e]);if(T)for(var e of T(a))Y.call(a,e)&&z(o,e,a[e]);return o},_=(o,a)=>E(o,G(a));import{a6 as j,aI as q,a5 as h,aJ as F,aM as J,a4 as L,d as I,aK as W,T as w,bY as Z,bZ as N,b_ as A,at as g,a8 as R,c as v,j as y,l as k,aa as C,s as $,w as n,k as r,aq as U,af as D,_ as Q,n as X,m as ee,t as ae,bK as te,b$ as se,x as B,r as H,aL as oe,W as ne,aU as le,az as re,bc as ie,u,a7 as ce,i as de,f as x,g as S,ae as ue,by as P}from"./index-B-O76M86.js";import{_ as me}from"./wd-img.St7DZ4lX.js";import{w as pe}from"./wd-badge.B92bS3IB.js";import{u as be}from"./useChildren.CuMc9-cW.js";const K=Symbol("wd-tabbar"),_e=_(b({},j),{modelValue:J(0),fixed:h(!1),bordered:h(!0),safeAreaInsetBottom:h(!1),shape:F("default"),activeColor:String,inactiveColor:String,placeholder:h(!1),zIndex:q(99)}),fe=_(b({},j),{title:String,name:L,icon:String,value:{type:[Number,String,null],default:null},isDot:{type:Boolean,default:void 0},max:Number,badgeProps:Object}),ge={name:"wd-tabbar-item",options:{addGlobalClass:!0,virtualHost:!0,styleIsolation:"shared"}},ve=I(_(b({},ge),{props:fe,setup(o){const a=o,{parent:e,index:i}=W(K),p=w(()=>{const t=Z(g(a.badgeProps)?N(a.badgeProps,A):{},N({max:a.max,isDot:a.isDot,modelValue:a.value},A));return g(t.max)||(t.max=99),t}),c=w(()=>{const t={};return e&&(l.value&&e.props.activeColor&&(t.color=e.props.activeColor),!l.value&&e.props.inactiveColor&&(t.color=e.props.inactiveColor)),`${R(t)}`}),l=w(()=>{const t=g(a.name)?a.name:i.value;return e?e.props.modelValue===t:!1});function m(){const t=g(a.name)?a.name:i.value;e&&e.setChange({name:t})}return(t,f)=>{const s=X,d=k;return y(),v(d,{class:$(`wd-tabbar-item ${t.customClass}`),style:C(t.customStyle),onClick:m},{default:n(()=>[r(pe,te(se(p.value)),{default:n(()=>[r(d,{class:"wd-tabbar-item__body"},{default:n(()=>[U(t.$slots,"icon",{active:l.value},void 0,!0),!t.$slots.icon&&t.icon?(y(),v(Q,{key:0,name:t.icon,"custom-style":c.value,"custom-class":`wd-tabbar-item__body-icon ${l.value?"is-active":"is-inactive"}`},null,8,["name","custom-style","custom-class"])):D("",!0),t.title?(y(),v(s,{key:1,style:C(c.value),class:$(`wd-tabbar-item__body-title ${l.value?"is-active":"is-inactive"}`)},{default:n(()=>[ee(ae(t.title),1)]),_:1},8,["style","class"])):D("",!0)]),_:3})]),_:3},16)]),_:3},8,["class","style"])}}})),ye=B(ve,[["__scopeId","data-v-ee9e8b0e"]]),he={name:"wd-tabbar",options:{addGlobalClass:!0,virtualHost:!0,styleIsolation:"shared"}},we=I(_(b({},he),{props:_e,emits:["change","update:modelValue"],setup(o,{emit:a}){const e=o,i=a,p=H(""),{proxy:c}=oe(),{linkChildren:l}=be(K);l({props:e,setChange:t});const m=w(()=>{const s={};return g(e.zIndex)&&(s["z-index"]=e.zIndex),`${R(s)}${e.customStyle}`});ne([()=>e.fixed,()=>e.placeholder],()=>{f()},{deep:!0,immediate:!1}),le(()=>{e.fixed&&e.placeholder&&re(()=>{f()})});function t(s){let d=s.name;i("update:modelValue",d),i("change",{value:d})}function f(){!e.fixed||!e.placeholder||ie(".wd-tabbar",!1,c).then(s=>{p.value=Number(s.height)})}return(s,d)=>{const V=k;return y(),v(V,{class:$({"wd-tabbar__placeholder":s.fixed&&s.placeholder&&s.safeAreaInsetBottom&&s.shape==="round"}),style:C({height:u(ce)(p.value)})},{default:n(()=>[r(V,{class:$(`wd-tabbar wd-tabbar--${s.shape} ${s.customClass} ${s.fixed?"is-fixed":""} ${s.safeAreaInsetBottom?"is-safe":""} ${s.bordered?"is-border":""}`),style:C(m.value)},{default:n(()=>[U(s.$slots,"default",{},void 0,!0)]),_:3},8,["class","style"])]),_:3},8,["class","style"])}}})),Ce=B(we,[["__scopeId","data-v-eb3a4869"]]),$e={},xe=I(_(b({},$e),{__name:"Tabbar",props:{tab:{type:String,default:"bill"}},setup(o){const a=de("OSS"),i=H(o.tab),p={handleChange:({value:c})=>{c==="bill"?P({url:"/bundle/parten/pages/bill/bill"}):c==="sub"?P({url:"/bundle/parten/pages/sub/sub"}):c==="my"&&P({url:"/bundle/parten/pages/my/my"})}};return(c,l)=>{const m=x(S("wd-img"),me),t=x(S("wd-tabbar-item"),ye),f=x(S("wd-tabbar"),Ce),s=k;return y(),v(s,null,{default:n(()=>[r(f,{modelValue:u(i),"onUpdate:modelValue":l[0]||(l[0]=d=>ue(i)?i.value=d:null),"active-color":"#4C9F44","inactive-color":"#707070",fixed:"",safeAreaInsetBottom:"",onChange:p.handleChange},{default:n(()=>[r(t,{title:"收益明细",name:"bill"},{icon:n(()=>[r(m,{height:"40rpx",width:"40rpx",src:o.tab==="bill"?`${u(a)}images/parten/parten_bill_s.png`:`${u(a)}images/parten/parten_bill.png`},null,8,["src"])]),_:1}),r(t,{title:"下级用户",name:"sub"},{icon:n(()=>[r(m,{height:"40rpx",width:"40rpx",src:o.tab==="sub"?`${u(a)}images/parten/parten_sub_s.png`:`${u(a)}images/parten/parten_sub.png`},null,8,["src"])]),_:1}),r(t,{title:"我的",name:"my"},{icon:n(()=>[r(m,{height:"40rpx",width:"40rpx",src:o.tab==="my"?`${u(a)}images/parten/parten_my_s.png`:`${u(a)}images/parten/parten_my.png`},null,8,["src"])]),_:1})]),_:1},8,["modelValue","onChange"])]),_:1})}}})),Ve=B(xe,[["__scopeId","data-v-0c2cfb92"]]);export{Ve as T};
|