import{au as It,ac as ot,av as wt,aw as Wt,q as w,Z as Ht,ax as Gt,ay as Yt,P as Kt,a6 as zt,i as O,n as P,m as rt,l as Q,d as M,az as Tt,$ as _t,D as _,aA as Mt,aB as kt,aC as Xt,x,a7 as Lt,aD as st,L as j,aa as E,aE as xt,aF as Jt,g as e,w as Z,aG as tt,E as Zt,a8 as lt,t as q,aH as Bt,aI as te,aJ as ee,a5 as ie,j as ht,ad as nt,aK as ae,aL as oe,aM as gt,am as se,aN as ne,aO as re,aP as le,aQ as ce,aR as de,Y as ue,aS as fe,aT as he,J as ge,ab as ve,R as me,T as ye,o as be,aU as vt,S as pe,a9 as Ae,h as N,ap as Ce,a as Rt,aV as Se,at as Ie,B as mt,I as et,a3 as we}from"./index-bc617d61.js";import{I as yt}from"./index-e80a7d08.js";import{T as ze,L as Te}from"./index-94680c8b.js";import{R as _e,a as bt}from"./index-92939616.js";import{C as Me}from"./index-917ed250.js";import{T as J}from"./index-154c7237.js";import{C as ke}from"./index-9c05dfa7.js";import{O as Le}from"./index-f0184086.js";import{S as xe,a as Be}from"./index-64babbe9.js";import{R as Re,C as it}from"./index-9ae54693.js";import"./Checker-9a3c6d3f.js";import"./index-2226937d.js";function Fe(t,i,o){let n,r=0;const a=t.scrollLeft,c=o===0?1:Math.round(o*1e3/16);function d(){It(n)}function g(){t.scrollLeft+=(i-a)/c,++ri||!c&&ai?r=ot(p):n&&(r=ot(n))}return p(),y}function Ne(){const t=w([]),i=[];return Ht(()=>{t.value=[]}),[t,n=>(i[n]||(i[n]=r=>{t.value[n]=r}),i[n])]}function Ft(t,i){if(!Gt||!window.IntersectionObserver)return;const o=new IntersectionObserver(a=>{i(a[0].intersectionRatio>0)},{root:document.body}),n=()=>{t.value&&o.observe(t.value)},r=()=>{t.value&&o.unobserve(t.value)};Yt(r),Kt(r),zt(n)}const[Pe,De]=O("sticky"),Qe={zIndex:P,position:rt("top"),container:Object,offsetTop:Q(0),offsetBottom:Q(0)};var Ee=M({name:Pe,props:Qe,emits:["scroll","change"],setup(t,{emit:i,slots:o}){const n=w(),r=Tt(n),a=_t({fixed:!1,width:0,height:0,transform:0}),c=w(!1),d=_(()=>Mt(t.position==="top"?t.offsetTop:t.offsetBottom)),g=_(()=>{if(c.value)return;const{fixed:h,height:I,width:f}=a;if(h)return{width:`${f}px`,height:`${I}px`}}),y=_(()=>{if(!a.fixed||c.value)return;const h=kt(Xt(t.zIndex),{width:`${a.width}px`,height:`${a.height}px`,[t.position]:`${d.value}px`});return a.transform&&(h.transform=`translate3d(0, ${a.transform}px, 0)`),h}),p=h=>i("scroll",{scrollTop:h,isFixed:a.fixed}),k=()=>{if(!n.value||st(n))return;const{container:h,position:I}=t,f=E(n),S=wt(window);if(a.width=f.width,a.height=f.height,I==="top")if(h){const u=E(h),L=u.bottom-d.value-a.height;a.fixed=d.value>f.top&&u.bottom>0,a.transform=L<0?L:0}else a.fixed=d.value>f.top;else{const{clientHeight:u}=document.documentElement;if(h){const L=E(h),m=u-L.top-d.value-a.height;a.fixed=u-d.valueL.top,a.transform=m<0?-m:0}else a.fixed=u-d.valuea.fixed,h=>i("change",h)),Lt("scroll",k,{target:r,passive:!0}),Ft(n,k),x([xt,Jt],()=>{!n.value||st(n)||!a.fixed||(c.value=!0,j(()=>{const h=E(n);a.width=h.width,a.height=h.height,c.value=!1}))}),()=>{var h;return e("div",{ref:n,style:g.value},[e("div",{class:De({fixed:a.fixed&&!c.value}),style:y.value},[(h=o.default)==null?void 0:h.call(o)])])}}});const Oe=Z(Ee),[$e,pt]=O("tabs");var Ue=M({name:$e,props:{count:tt(Number),inited:Boolean,animated:Boolean,duration:tt(P),swipeable:Boolean,lazyRender:Boolean,currentIndex:tt(Number)},emits:["change"],setup(t,{emit:i,slots:o}){const n=w(),r=d=>i("change",d),a=()=>{var d;const g=(d=o.default)==null?void 0:d.call(o);return t.animated||t.swipeable?e(xe,{ref:n,loop:!1,class:pt("track"),duration:+t.duration*1e3,touchable:t.swipeable,lazyRender:t.lazyRender,showIndicators:!1,onChange:r},{default:()=>[g]}):g},c=d=>{const g=n.value;g&&g.state.active!==d&&g.swipeTo(d,{immediate:!t.inited})};return x(()=>t.currentIndex,c),Zt(()=>{c(t.currentIndex)}),lt({swipeRef:n}),()=>e("div",{class:pt("content",{animated:t.animated||t.swipeable})},[a()])}});const[jt,X]=O("tabs"),Ve={type:rt("line"),color:String,border:Boolean,sticky:Boolean,shrink:Boolean,active:Q(0),duration:Q(.3),animated:Boolean,ellipsis:q,swipeable:Boolean,scrollspy:Boolean,offsetTop:Q(0),background:String,lazyRender:q,lineWidth:P,lineHeight:P,beforeChange:Function,swipeThreshold:Q(5),titleActiveColor:String,titleInactiveColor:String},Nt=Symbol(jt);var qe=M({name:jt,props:Ve,emits:["change","scroll","rendered","clickTab","update:active"],setup(t,{emit:i,slots:o}){let n,r,a,c,d;const g=w(),y=w(),p=w(),k=w(),h=Bt(),I=Tt(g),[f,S]=Ne(),{children:u,linkChildren:L}=te(Nt),m=_t({inited:!1,position:"",lineStyle:{},currentIndex:-1}),$=_(()=>u.length>+t.swipeThreshold||!t.ellipsis||t.shrink),W=_(()=>({borderColor:t.color,background:t.background})),U=(s,l)=>{var v;return(v=s.name)!=null?v:l},H=_(()=>{const s=u[m.currentIndex];if(s)return U(s,m.currentIndex)}),D=_(()=>Mt(t.offsetTop)),ct=_(()=>t.sticky?D.value+n:0),V=s=>{const l=y.value,v=f.value;if(!$.value||!l||!v||!v[m.currentIndex])return;const A=v[m.currentIndex].$el,b=A.offsetLeft-(l.offsetWidth-A.offsetWidth)/2;c&&c(),c=Fe(l,b,s?0:+t.duration)},B=()=>{const s=m.inited;j(()=>{const l=f.value;if(!l||!l[m.currentIndex]||t.type!=="line"||st(g.value))return;const v=l[m.currentIndex].$el,{lineWidth:A,lineHeight:b}=t,z=v.offsetLeft+v.offsetWidth/2,R={width:ht(A),backgroundColor:t.color,transform:`translateX(${z}px) translateX(-50%)`};if(s&&(R.transitionDuration=`${t.duration}s`),nt(b)){const K=ht(b);R.height=K,R.borderRadius=K}m.lineStyle=R})},Pt=s=>{const l=s=0&&s{const v=Pt(s);if(!nt(v))return;const A=u[v],b=U(A,v),z=m.currentIndex!==null;m.currentIndex!==v&&(m.currentIndex=v,l||V(),B()),b!==t.active&&(i("update:active",b),z&&i("change",b,A.title)),a&&!t.scrollspy&&oe(Math.ceil(gt(g.value)-D.value))},Y=(s,l)=>{const v=u.find((b,z)=>U(b,z)===s),A=v?u.indexOf(v):0;G(A,l)},dt=(s=!1)=>{if(t.scrollspy){const l=u[m.currentIndex].$el;if(l&&I.value){const v=gt(l,I.value)-ct.value;r=!0,d&&d(),d=je(I.value,v,s?0:+t.duration,()=>{r=!1})}}},Dt=(s,l,v)=>{const{title:A,disabled:b}=u[l],z=U(u[l],l);b||(se(t.beforeChange,{args:[z],done:()=>{G(l),dt()}}),ne(s)),i("clickTab",{name:z,title:A,event:v,disabled:b})},Qt=s=>{a=s.isFixed,i("scroll",s)},Et=s=>{j(()=>{Y(s),dt(!0)})},Ot=()=>{for(let s=0;sct.value)return s===0?0:s-1}return u.length-1},$t=()=>{if(t.scrollspy&&!r){const s=Ot();G(s)}},Ut=()=>{if(t.type==="line"&&u.length)return e("div",{class:X("line"),style:m.lineStyle},null)},ut=()=>{var s,l,v;const{type:A,border:b,sticky:z}=t,R=[e("div",{ref:z?void 0:p,class:[X("wrap"),{[ae]:A==="line"&&b}]},[e("div",{ref:y,role:"tablist",class:X("nav",[A,{shrink:t.shrink,complete:$.value}]),style:W.value,"aria-orientation":"horizontal"},[(s=o["nav-left"])==null?void 0:s.call(o),u.map(K=>K.renderTitle(Dt)),Ut(),(l=o["nav-right"])==null?void 0:l.call(o)])]),(v=o["nav-bottom"])==null?void 0:v.call(o)];return z?e("div",{ref:p},[R]):R},ft=()=>{B(),j(()=>{var s,l;V(!0),(l=(s=k.value)==null?void 0:s.swipeRef.value)==null||l.resize()})};x(()=>[t.color,t.duration,t.lineWidth,t.lineHeight],B),x(xt,ft),x(()=>t.active,s=>{s!==H.value&&Y(s)}),x(()=>u.length,()=>{m.inited&&(Y(t.active),B(),j(()=>{V(!0)}))});const Vt=()=>{Y(t.active,!0),j(()=>{m.inited=!0,p.value&&(n=E(p.value).height),V(!0)})},qt=(s,l)=>i("rendered",s,l);return lt({resize:ft,scrollTo:Et}),ee(B),ie(B),zt(Vt),Ft(g,B),Lt("scroll",$t,{target:I,passive:!0}),L({id:h,props:t,setLine:B,scrollable:$,onRendered:qt,currentName:H,setTitleRefs:S,scrollIntoView:V}),()=>e("div",{ref:g,class:X([t.type])},[t.sticky?e(Oe,{container:g.value,offsetTop:D.value,onScroll:Qt},{default:()=>[ut()]}):ut(),e(Ue,{ref:k,count:u.length,inited:m.inited,animated:t.animated,duration:t.duration,swipeable:t.swipeable,lazyRender:t.lazyRender,currentIndex:m.currentIndex,onChange:G},{default:()=>{var s;return[(s=o.default)==null?void 0:s.call(o)]}})])}});const[We,At]=O("tab"),He=M({name:We,props:{id:String,dot:Boolean,type:String,color:String,title:String,badge:P,shrink:Boolean,isActive:Boolean,disabled:Boolean,controls:String,scrollable:Boolean,activeColor:String,inactiveColor:String,showZeroBadge:q},setup(t,{slots:i}){const o=_(()=>{const r={},{type:a,color:c,disabled:d,isActive:g,activeColor:y,inactiveColor:p}=t;c&&a==="card"&&(r.borderColor=c,d||(g?r.backgroundColor=c:r.color=c));const h=g?y:p;return h&&(r.color=h),r}),n=()=>{const r=e("span",{class:At("text",{ellipsis:!t.scrollable})},[i.title?i.title():t.title]);return t.dot||nt(t.badge)&&t.badge!==""?e(re,{dot:t.dot,content:t.badge,showZero:t.showZeroBadge},{default:()=>[r]}):r};return()=>e("div",{id:t.id,role:"tab",class:[At([t.type,{grow:t.scrollable&&!t.shrink,shrink:t.shrink,active:t.isActive,disabled:t.disabled}])],style:o.value,tabindex:t.disabled?void 0:t.isActive?0:-1,"aria-selected":t.isActive,"aria-disabled":t.disabled||void 0,"aria-controls":t.controls},[n()])}}),[Ge,at]=O("tab"),Ye=kt({},le,{dot:Boolean,name:P,badge:P,title:String,disabled:Boolean,titleClass:ce,titleStyle:[String,Object],showZeroBadge:q});var Ke=M({name:Ge,props:Ye,setup(t,{slots:i}){const o=Bt(),n=w(!1),r=pe(),{parent:a,index:c}=de(Nt);if(!a)return;const d=()=>{var f;return(f=t.name)!=null?f:c.value},g=()=>{n.value=!0,a.props.lazyRender&&j(()=>{a.onRendered(d(),t.title)})},y=_(()=>{const f=d()===a.currentName.value;return f&&!n.value&&g(),f}),p=w(""),k=w("");ue(()=>{const{titleClass:f,titleStyle:S}=t;p.value=f?fe(f):"",k.value=S&&typeof S!="string"?he(ge(S)):S});const h=f=>e(He,be({key:o,id:`${a.id}-${c.value}`,ref:a.setTitleRefs(c.value),style:k.value,class:p.value,isActive:y.value,controls:o,scrollable:a.scrollable.value,activeColor:a.props.titleActiveColor,inactiveColor:a.props.titleInactiveColor,onClick:S=>f(r.proxy,c.value,S)},vt(a.props,["type","color","shrink"]),vt(t,["dot","badge","title","disabled","showZeroBadge"])),{title:i.title}),I=w(!y.value);return x(y,f=>{f?I.value=!1:ve(()=>{I.value=!0})}),x(()=>t.title,()=>{a.setLine(),a.scrollIntoView()}),me(ze,y),lt({id:o,renderTitle:h}),()=>{var f;const S=`${a.id}-${c.value}`,{animated:u,swipeable:L,scrollspy:m,lazyRender:$}=a.props;if(!i.default&&!u)return;const W=m||y.value;if(u||L)return e(Be,{id:o,role:"tabpanel",class:at("panel-wrapper",{inactive:I.value}),tabindex:y.value?0:-1,"aria-hidden":!y.value,"aria-labelledby":S},{default:()=>{var D;return[e("div",{class:at("panel")},[(D=i.default)==null?void 0:D.call(i)])]}});const H=n.value||m||!$?(f=i.default)==null?void 0:f.call(i):null;return ye(e("div",{id:o,role:"tabpanel",class:at("panel"),tabindex:W?0:-1,"aria-labelledby":S},[H]),[[Ae,W]])}}});const Xe=Z(Ke),Je=Z(qe),[Ze,ti]=O("divider"),ei={dashed:Boolean,hairline:q,vertical:Boolean,contentPosition:rt("center")};var ii=M({name:Ze,props:ei,setup(t,{slots:i}){return()=>{var o;return e("div",{role:"separator",class:ti({dashed:t.dashed,hairline:t.hairline,vertical:t.vertical,[`content-${t.contentPosition}`]:!!i.default&&!t.vertical})},[!t.vertical&&((o=i.default)==null?void 0:o.call(i))])}}});const ai=Z(ii),oi="_goods_126oz_1",si="_goodsSection_126oz_9",ni="_sellOut_126oz_14",ri="_sellOutImg_126oz_25",li="_goodsImg_126oz_29",ci="_goodsInfo_126oz_33",di="_goodsName_126oz_37",ui="_goodsSale_126oz_43",fi="_pre_126oz_48",hi="_goodsPrice_126oz_51",gi="_addCart_126oz_57",vi="_addCartDisabled_126oz_62",T={goods:oi,goodsSection:si,sellOut:ni,sellOutImg:ri,goodsImg:li,goodsInfo:ci,goodsName:di,goodsSale:ui,pre:fi,goodsPrice:hi,addCart:gi,addCartDisabled:vi},mi=""+new URL("icon-sell-out-437e8d6c.png",import.meta.url).href,yi=M({name:"goods",props:{showAdd:{type:Boolean,default:!0},item:{type:Object,default:{}},onItemClick:{type:Function,default:t=>{}},onBuyClick:{type:Function,default:t=>{}}},render(){const t=this.item;return e("div",{class:T.goods,onClick:()=>this.onItemClick(t)},[e("div",{class:T.goodsSection},[e(yt,{src:t.pic,fit:"cover",class:T.goodsImg},null),t.stock<=0&&e("div",{class:T.sellOut},[e(yt,{src:mi,fit:"cover",class:T.sellOutImg},null)])]),e("div",{class:T.goodsInfo},[e("div",{class:[T.goodsName,"van-ellipsis"]},[t.name]),e("div",{class:T.goodsBuy},[e("p",{class:T.goodsPrice},[e("span",{class:T.pre},[N("¥")]),Ce(t.price)])])])])}}),bi="_tabList_38jza_1",pi="_goodsList_38jza_6",Ct={tabList:bi,goodsList:pi},Ai=M({name:"tab-list",props:{showAdd:{type:Boolean,default:!0},typeId:{type:Number,default:0},productAttributeCategoryId:{type:Number,default:0},brandId:{type:Number,default:0},sort:{type:Number,defalut:0},keyword:{type:String,defalut:""},isTab:{type:Boolean,default:!1},onOpenWebView:{type:Function,default:t=>{}}},data(){return{list:[],loading:!1,finished:!1,params:{productCategoryId:void 0,productAttributeCategoryId:void 0,brandId:null,sort:null,keyword:"",pageNum:1,pageSize:20},addGoodsShow:!1,selectGoodsItem:{}}},mounted(){this.getList()},methods:{onSearch(){this.finished=!1,this.list=[],this.params.pageNum=1,this.getList()},async getList(){this.loading=!0;try{let t=this.params;t.productCategoryId=this.typeId?this.typeId:void 0,t.productAttributeCategoryId=this.productAttributeCategoryId?this.productAttributeCategoryId:void 0,t.brandId=this.brandId?this.brandId:void 0,t.sort=this.sort?this.sort:void 0,t.keyword=this.keyword?this.keyword:void 0;const o=(await Rt.post("/edu-app/open/mall/productSearch",{data:{...t}})).data||{};if(this.list.length>0&&o.pageNum===1)return;this.list=this.list.concat(o.list||[]),this.finished=o.pageNum>=o.totalPage,this.params.pageNum=o.pageNum+1}catch(t){this.finished=!0}this.loading=!1},onDetailClick(t){if(this.isTab){let i=this.$router.resolve({path:"/goodsDetail",query:{id:t.id}}).fullPath;this.onOpenWebView(i);return}this.$router.push({path:"/goodsDetail",query:{id:t.id}})},onBuyClick(t){this.selectGoodsItem=t,this.addGoodsShow=!0}},render(){return e("div",{class:Ct.tabList},[e(Te,{loading:this.loading,"onUpdate:loading":t=>this.loading=t,finished:this.finished,finishedText:"",immediateCheck:!1,class:[Ct.goodsList,"mb12"],onLoad:this.getList},{default:()=>[this.list.length&&this.list.map(t=>e(yi,{item:t,onItemClick:this.onDetailClick,onBuyClick:this.onBuyClick,showAdd:this.showAdd},null))||null,!this.loading&&!this.list.length&&e(Se,{description:"暂无商品"},null)||null]})])}}),Ci="_active_gviry_19",Si="_filterBtn_gviry_23",Ii="_filterTagWrap_gviry_26",wi="_filterTag_gviry_26",zi="_filterSort_gviry_72",Ti="_iconSort_gviry_82",C={"filter-top":"_filter-top_gviry_7",active:Ci,filterBtn:Si,filterTagWrap:Ii,filterTag:wi,"filter-productCategory":"_filter-productCategory_gviry_42","filter-tag":"_filter-tag_gviry_58","filter-tag-checked":"_filter-tag-checked_gviry_68",filterSort:zi,"icon-active":"_icon-active_gviry_79",iconSort:Ti},_i="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAkCAMAAADfNcjQAAAAAXNSR0IArs4c6QAAAMlQTFRFAAAAAAAAAAAAMzMzKysrLi4uKysrMzMzMDAwLS0tNjY2MTExNzc3MDAwMzMzMDAwMTExNDQ0MjIyNTU1NDQ0MjIyMjIyMjIyMjIyNDQ0MzMzMzMzMjIyNDQ0MzMzMzMzMzMzMjIyMzMzMjIyMjIyNDQ0MjIyNDQ0NDQ0MzMzMjIyMzMzMzMzNDQ0MzMzNDQ0MzMzMjIyNDQ0MzMzMzMzMzMzMzMzMjIyMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMjIyMzMzMzMzfELI5AAAAEJ0Uk5TAAECBQYLDA8QERMVHCAjJSoxMzo7R0xRUlNVWlxeZGlvcH6Ej4+eo62ut7m6vL/BxMXGyMnNz9DY3O3w8fb3/P3+hqpolgAAALVJREFUOMvtk8cOwjAQRB1CDZ3Qe+gdQu/B8/8fxSFSso4SS9xA4t3W87SSPTJjfz5CbU83psNymPXksR1EnjVRGMPLI01zzQLvFXWH8hnoU0EHDsLGBjChcw64JunBABjRWbkAJ82dDQ5UhJUlixoGB2aKeI0mMQwOrCPel3KNrm/uGinLP7eNY5wlbgG5bWyjLFMNBzXWegGLkKzTDgfy0tb3gC4VzC8QVkBBKtTvc/UHv9wbexcnAljN7tMAAAAASUVORK5CYII=",Mi="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAgCAYAAAAFQMh/AAAAAXNSR0IArs4c6QAABG1JREFUWEe9l2lsVFUUx3/nTQsFRBuMSiIGoxGsUSORYIQoFe28oZWgDWlnWoU0aFyiRQ3ilkgjCUSMitaFithIpDMlsqRN6LyhFrAijUuIaFw+uASjn8AEiFpmOnPMW2YrpU5x8H0879z/755zz733XKGAT7dWXYVh1CJ6KyoVwMUI41FOAr8AhxDZw6TSLlnU/VcBkshoTtpRNR/xPQ96G4zu6+mcQIyNjIuvl9qPjo2mPSJYt/gnUSpvI9yDFgQczjgK+pCEYh+eCX4aWD9YOA1fqguYlRmkpBA+xWAXQj/4jkAyTqKkHGOoApFqYDGql2ZBqoi0SNB6YSR4HtiFJgdAcgQkhugqCVpfjbosLZUlzBx/H2gLyCU5vm9KyHpk+NgMWNsryygb1w8y23MaQnWFNMTeKqRY0j66zZxCku1AZWacyIMSjLbl6mTBYfMd4H7vZwIxFkuwp2cs0Ay87cZSzr+oA3SJZ4uT0rnSGPsy7eOAdZs5hyQHAcP5IUazBHtazwaahS+ayAXxAyg3uJo6IMHYzfngiNmNcqdrlJiEouZ/gWbgkTsqwHcYpcSxpSQgjVHLnUfYfxmIfQjY0aYoNWbLkp5DxQA72QwH3gVd7urpTgnFaj1woBn0NdfOx9JgzS8W1JHsCFyPaHpHDOI7MUXqDv4tGjbtCnRmgcFKqbdeLibYjdr8GbjcTTcLpNHaK9phfo8w0zPeJI3WZ+cAvAW41y0hHpWg9YZoxDyBMtkx+hLTpK7vt6KDI4F1qD7t6a6VkPWcneohG+kYB09NkKZ9g0UHh/0rQV7yIt4gQevx/IjjiWmy7BxEHA6sBX3Gq+x1Eoo9a0f8AzDDnY3MkWD086JH3GG+j7DU3TnaLA2xVnsf7wC524XJExKKvlp0cNj/I8gVHvh2aYj12VX9GEIatk9Cln3pF+3TiP9aVL72BE+R0AtlaexP0a3V0zGSP2VOLpVZ0hA9XCyyRgIbUX3A0+uSkLXY3VV22iPmbpSF3jrvlmC0phhgjVTPQJPfAKWOnsECqbf2ZsFh/1yQTzJ91Qj351gnMsL9nreM2fs4Yr6H0uQB4hjUSL3VO1agk0G3G7FPq1BGj9Q8Ce35Iq2XBbcNuz8hDvKwhKKbxwLX9spyJpR1ourPjDNkhdRHX8/Vye+53EIbAKZmnES6YegpCfZ+N9oEtAWDq81lqK7J79k4hi95pdT1Hj8j2EnT9urpJFLdqF6XhTOEsh9hF9BPsuQIyUScsnHlaKKClN1lqn0WuDfQ8E/kAPGUaW+j01Kd66ub501m4nmbgPqxpDnH9yjQhdCU7culj8HBmvRd8C8vCX8VhrEa1XkFTuA4QjsGa6TO+kM7zVWkeDFnbA++X++Sum/jo4LTA5zTJyW1GNyCco3zdnJbJXvdfrcbOVT2k9Aduel0li4caAFdnYXrTqbG6woCjxStXUzSQqqQTGiHfz0iT+b4bjprcCHAvLqJmK0o7otCOPn/ge3HX6f5CshyRDf8A+1CqQq9qjYSAAAAAElFTkSuQmCC",ki="_loading_8jqo2_1",Li="_titlePopup_8jqo2_7",xi="_title_8jqo2_7",Bi="_radio_8jqo2_21",Ri="_filterAction_8jqo2_58",F={loading:ki,titlePopup:Li,title:xi,"radio-group":"_radio-group_8jqo2_21",radio:Bi,filterAction:Ri},St=()=>({productAttributeCategoryList:null,brandList:null}),Fi=M({name:"goods-filter-list",props:{setFilter:{type:Function,default:t=>{}},cateGoryId:{type:Number,default:0}},data(){return{dataShow:!0,loading:!1,brandList:[],productAttributeCategoryList:[],productCategorySmallVoList:[],params:St()}},mounted(){this.getFilterList()},methods:{async getFilterList(){this.loading=!0;try{const t=await Rt.get("/edu-app/open/mall/search/condition");this.dataShow=t.code===200;const{brandList:i=[],productAttributeCategoryList:o=[]}=t.data||{};this.brandList=i,this.productAttributeCategoryList=o}catch(t){this.dataShow=!1}this.loading=!1},onFilterClick(){this.setFilter({productCategory:this.productCategorySmallVoList[this.params.productCategorySmallVoList],productAttributeCategory:this.productAttributeCategoryList[this.params.productAttributeCategoryList],brand:this.brandList[this.params.brandList]})},setParams(t){this.params[t]=null}},render(){return e("div",null,[this.loading&&e("div",{class:F.loading},[e(Ie,{color:"var(--van-primary)"},null)]),e("div",{class:F.filterWrap},[e("div",{class:F.titlePopup},[N("筛选")]),Object.keys(this.params).map(t=>e(Me,{border:!1},{title:()=>e("div",null,[t==="productAttributeCategoryList"?"商品类型":"品牌"]),label:()=>e(_e,{class:F["radio-group"],modelValue:this.params[t],"onUpdate:modelValue":i=>this.params[t]=i},{default:()=>[t==="productAttrbuteCategoryList"?this.productAttributeCategoryList.map((i,o)=>{const r=o===this.params[t]?"primary":"default";return e(bt,{class:F.radio,name:o,onClick:()=>{}},{default:()=>[e(J,{size:"large",type:r},{default:()=>[i.name]})]})}):this.brandList.map((i,o)=>{const r=o===this.params[t]?"primary":"default";return e(bt,{class:F.radio,name:o,onClick:()=>{}},{default:()=>[e(J,{size:"large",type:r},{default:()=>[i.name]})]})})]})})),e(ai,{style:{margin:"0"}},null),e("div",{class:F.filterAction},[e(mt,{round:!0,style:{marginRight:"8px"},onClick:()=>this.params=St()},{default:()=>[N("重置")]}),e(mt,{round:!0,type:"primary",color:"linear-gradient(121deg, #FFD892 0%, #FFCB75 100%)",style:{marginLeft:"8px"},onClick:()=>this.onFilterClick()},{default:()=>[N("确认")]})])])])}}),Hi=M({name:"goods-list",data(){const t=this.$route.query;return{tabListShow:!t.id,typeId:0,filterActive:0,filterListShow:!1,productCategory:{active:0,name:t.tag||"",id:Number(t.id)||0,children:[]},productAttributeCategory:{children:[],name:"",id:0},brand:{name:"",id:0},keyword:"",autofocus:!1}},computed:{getProductAttributeCategory(){if(this.productCategory.id){if(this.productCategory.children)return(this.productCategory.children[this.productCategory.active]||{}).id||"";this.productCategory.id}return 0}},async mounted(){this.$nextTick(()=>{this.$route.query.input==="focus"&&document.querySelector(".van-field__control").focus()}),this.tabListShow=!0},methods:{onFilter(t){this.filterActive===3&&t===3&&(t=4),this.filterActive===4&&t===3&&(t=3),this.filterActive!==t&&(this.filterActive=t,this.$nextTick(()=>{this.onSearch()}))},setFilter({productCategory:t,productAttributeCategory:i,brand:o}){t&&t.active===void 0&&(t.active=0),this.productCategory=t||{id:0,name:""},this.productAttributeCategory=i||{id:0,name:""},this.brand=o||{id:0,name:""},this.$nextTick(()=>{this.onSearch(),this.filterListShow=!1})},onToggleTag(){this.$refs.tabList.loading||this.$nextTick(()=>{this.onSearch()})},onClearTag(t){t==="productCategory"?this.productCategory={id:0,name:""}:t==="productAttributeCategory"?this.productAttributeCategory={id:0,name:""}:this.brand={id:0,name:""};let i=this.$refs.goodsFilter;i&&(t==="productAttributeCategory"?i.setParams("productAttributeCategoryList"):i.setParams("brandList")),this.$nextTick(()=>{this.onSearch()})},onSearch(){this.$refs.tabList.onSearch()},searchBtn(t){this.keyword=t,this.$nextTick(()=>{this.onSearch()})}},render(){return e("div",null,[e(Le,null,{default:()=>[e(ke,{modelValue:this.keyword,searchIcon:Mi,onSearch:this.searchBtn,placeholder:"请输入商品名称"},null),e(Re,{class:C["filter-top"],align:"center"},{default:()=>[e(it,{span:6,class:this.filterActive===0?C.active:"",onClick:()=>this.onFilter(0)},{default:()=>[N("综合排序")]}),e(it,{span:6,class:this.filterActive===3||this.filterActive===4?C.active:"",onClick:()=>this.onFilter(3)},{default:()=>[N("价格"),e("div",{class:C.filterSort},[e(et,{class:this.filterActive===3?C["icon-active"]:"",style:{transform:"rotate(-90deg)"},name:"play",size:12},null),e(et,{class:[C.iconSort,this.filterActive===4?[C["icon-active"]]:""],style:{transform:"rotate(90deg)"},name:"play",size:12},null)])]}),e(it,{style:{marginLeft:"auto"},span:6,class:C.filterBtn,onClick:()=>this.filterListShow=!0},{default:()=>[N("筛选"),e(et,{name:_i,size:18},null)]})]}),this.productCategory.id&&this.productCategory.children&&this.productCategory.children.length?e(Je,{class:C["filter-productCategory"],shrink:!0,ellipsis:!1,active:this.productCategory.active,"onUpdate:active":t=>this.productCategory.active=t,onChange:()=>this.onToggleTag()},{default:()=>[this.productCategory&&this.productCategory.children.map((t,i)=>e(Xe,{name:i,title:t.name},{title:()=>e("div",{class:[C["filter-tag"],this.productCategory.active===i?C["filter-tag-checked"]:""]},[t.name])}))]}):null]}),e("div",{class:C.filterTagWrap},[this.productAttributeCategory.id?e(J,{class:C.filterTag,closeable:!0,onClose:()=>this.onClearTag("productAttributeCategory")},{default:()=>[this.productAttributeCategory.name]}):"",this.brand.id?e(J,{class:C.filterTag,closeable:!0,onClose:()=>this.onClearTag("brand")},{default:()=>[this.brand.name]}):""]),this.tabListShow?e(Ai,{ref:"tabList",style:{height:"calc(100vh - var(--header-height))"},showAdd:!1,productAttributeCategoryId:this.productAttributeCategory.id,brandId:this.brand.id,sort:this.filterActive,keyword:this.keyword},null):null,e(we,{show:this.filterListShow,closeable:!0,position:"bottom",round:!0,onClose:()=>{this.filterListShow=!1}},{default:()=>[e(Fi,{cateGoryId:this.productCategory.id,ref:"goodsFilter",setFilter:this.setFilter},null)]})])}});export{Hi as default};