import{L as e,r as l,e as a,f as t,w as o,g as r,x as s,h as c,F as u,i as d,M as n,v as b,A as f,j as i,t as p,p as g,B as y,N as k,D as h,O as C,P as v,b as _,d as S,l as P,K as m}from"./index-DVkgSHpn.js";import{_ as x}from"./el-layout._U-vZTft.js";const j=x({__name:"el-tabbar",props:{placeholder:{type:Boolean,default:!0},color:{type:String,default:"#333"},selectedColor:{type:String,default:"#1b43c4"},borderStyle:{type:String,default:"black"},backgroundColor:{type:String,default:"#ffffff"},list:{type:Array,default:[]}},setup(k){const h=k;let C=e(),v=l(C[C.length-1].route);const _=e=>v.value==e;return(e,l)=>{const C=g,S=y;return a(),t(C,null,{default:o((()=>[r(C,{class:"tabbar",style:s({"background-color":h.backgroundColor})},{default:o((()=>[r(C,{class:"tabbar-border",style:s({"background-color":"black"==h.borderStyle?"rgba(0, 0, 0, 0.33)":"#fff"})},null,8,["style"]),(a(!0),c(u,null,d(h.list,((l,c)=>(a(),t(C,{class:"tabbar-item",key:c,onClick:e=>(e=>{if(e.pagePath.length<=0||v.value==e.pagePath)return!1;p(e.pagePath)})(l)},{default:o((()=>[n(e.$slots,"default",{},(()=>[r(C,{class:"tabbar-item-wrap"},{default:o((()=>[r(C,{class:"icon"},{default:o((()=>[r(S,{src:_(l.pagePath)?l.selectedIconPath:l.iconPath},null,8,["src"])])),_:2},1024),r(C,{class:"text",style:s({color:_(l.pagePath)?h.selectedColor:h.color})},{default:o((()=>[b(f(l.text),1)])),_:2},1032,["style"]),null!=l.count&&l.count>0?(a(),t(C,{key:0,class:"reddot"},{default:o((()=>[b(f(l.count),1)])),_:2},1024)):i("",!0)])),_:2},1024)]),!0)])),_:2},1032,["onClick"])))),128))])),_:3},8,["style"]),k.placeholder?(a(),t(C,{key:0,class:"placeholder"})):i("",!0)])),_:3})}}},[["__scopeId","data-v-d15b606b"]]),w={__name:"tabbar",setup(e){const o=k(),{type:r,color:s,selectedColor:c,borderStyle:u,backgroundColor:d,list:n}=h(o);let b=l();C((()=>n.value),((e,l)=>{e&&f()}));const f=()=>{if(!(n.value.length<=0)){for(let e in n.value){if("pages/index/cart"==n.value[e].pagePath){uni.$http.get("cart/count").then((l=>{l.code&&(n.value[e].count=l.data)}));break}v({success:()=>{},fail:()=>{}})}b.value={color:s.value,selectedColor:c.value,borderStyle:u.value,backgroundColor:d.value,list:n.value}}};return f(),(e,l)=>{const o=_(S("el-tabbar"),j);return P(m)(P(b))?i("",!0):(a(),t(o,{key:0,color:P(b).color,selectedColor:P(b).selectedColor,borderStyle:P(b).borderStyle,backgroundColor:P(b).backgroundColor,list:P(b).list},null,8,["color","selectedColor","borderStyle","backgroundColor","list"]))}}};export{w as _};
//# sourceMappingURL=tabbar.CESuM5GW.js.map
