index-18171cc3.js 26 KB

1
  1. import{am as kt,ab as ot,an as Tt,ao as Jt,r as z,ap as Kt,aq as Zt,ar as $t,as as te,at as Mt,c as U,n as P,m as rt,b as G,d as M,au as xt,x as Lt,e as T,aj as Nt,a7 as Bt,i as ee,w as N,Y as _t,av as st,z as F,Z as D,aw as jt,ax as ae,a as e,k as tt,ag as et,y as ie,X as lt,t as W,ay as Ft,a5 as oe,az as se,aA as ne,o as ht,W as nt,a6 as re,aB as le,aC as gt,$ as ce,aD as de,aE as ue,aF as fe,a3 as he,a8 as ge,ai as ye,aG as me,aH as ve,aI as be,aa as Ae,aJ as pe,g as Ce,h as Se,ac as yt,aK as we,v as Ie,A as R,P as ze,I as Z,D as Rt,a0 as ke,V as Pt,L as Te,C as mt,a1 as Me}from"./index-74c5a00f.js";import{S as xe,a as Le,i as Ne,A as Be}from"./index-2ef6bb5f.js";import{I as vt}from"./index-e0d9acc3.js";import{T as _e,L as je}from"./index-1a11c86f.js";import{C as bt}from"./index-ead23430.js";import{R as At,a as pt}from"./index-25c1446f.js";import{T as $}from"./index-639dabfd.js";import{M as Fe}from"./index-732d30df.js";import{M as Re}from"./index-f9dd09f7.js";import{R as Pe,C as at}from"./student-register-store-dc958511.js";import"./Checker-f587aabb.js";import"./index-dbba26f3.js";function Qe(t,a,o){let n,c=0;const i=t.scrollLeft,l=o===0?1:Math.round(o*1e3/16);function d(){kt(n)}function g(){t.scrollLeft+=(a-i)/l,++c<l&&(n=ot(g))}return g(),d}function Ge(t,a,o,n){let c,i=Tt(t);const l=i<a,d=o===0?1:Math.round(o*1e3/16),g=(a-i)/d;function v(){kt(c)}function A(){i+=g,(l&&i>a||!l&&i<a)&&(i=a),Jt(t,i),l&&i<a||!l&&i>a?c=ot(A):n&&(c=ot(n))}return A(),v}function De(){const t=z([]),a=[];return Kt(()=>{t.value=[]}),[t,n=>(a[n]||(a[n]=c=>{t.value[n]=c}),a[n])]}function Qt(t,a){if(!Zt||!window.IntersectionObserver)return;const o=new IntersectionObserver(i=>{a(i[0].intersectionRatio>0)},{root:document.body}),n=()=>{t.value&&o.observe(t.value)},c=()=>{t.value&&o.unobserve(t.value)};$t(c),te(c),Mt(n)}const[Ue,Ee]=U("sticky"),qe={zIndex:P,position:rt("top"),container:Object,offsetTop:G(0),offsetBottom:G(0)};var Ve=M({name:Ue,props:qe,emits:["scroll","change"],setup(t,{emit:a,slots:o}){const n=z(),c=xt(n),i=Lt({fixed:!1,width:0,height:0,transform:0}),l=z(!1),d=T(()=>Nt(t.position==="top"?t.offsetTop:t.offsetBottom)),g=T(()=>{if(l.value)return;const{fixed:h,height:w,width:f}=i;if(h)return{width:`${f}px`,height:`${w}px`}}),v=T(()=>{if(!i.fixed||l.value)return;const h=Bt(ee(t.zIndex),{width:`${i.width}px`,height:`${i.height}px`,[t.position]:`${d.value}px`});return i.transform&&(h.transform=`translate3d(0, ${i.transform}px, 0)`),h}),A=h=>a("scroll",{scrollTop:h,isFixed:i.fixed}),x=()=>{if(!n.value||st(n))return;const{container:h,position:w}=t,f=D(n),S=Tt(window);if(i.width=f.width,i.height=f.height,w==="top")if(h){const u=D(h),L=u.bottom-d.value-i.height;i.fixed=d.value>f.top&&u.bottom>0,i.transform=L<0?L:0}else i.fixed=d.value>f.top;else{const{clientHeight:u}=document.documentElement;if(h){const L=D(h),m=u-L.top-d.value-i.height;i.fixed=u-d.value<f.bottom&&u>L.top,i.transform=m<0?-m:0}else i.fixed=u-d.value<f.bottom}A(S)};return N(()=>i.fixed,h=>a("change",h)),_t("scroll",x,{target:c,passive:!0}),Qt(n,x),N([jt,ae],()=>{!n.value||st(n)||!i.fixed||(l.value=!0,F(()=>{const h=D(n);i.width=h.width,i.height=h.height,l.value=!1}))}),()=>{var h;return e("div",{ref:n,style:g.value},[e("div",{class:Ee({fixed:i.fixed&&!l.value}),style:v.value},[(h=o.default)==null?void 0:h.call(o)])])}}});const We=tt(Ve),[He,Ct]=U("tabs");var Ye=M({name:He,props:{count:et(Number),inited:Boolean,animated:Boolean,duration:et(P),swipeable:Boolean,lazyRender:Boolean,currentIndex:et(Number)},emits:["change"],setup(t,{emit:a,slots:o}){const n=z(),c=d=>a("change",d),i=()=>{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:Ct("track"),duration:+t.duration*1e3,touchable:t.swipeable,lazyRender:t.lazyRender,showIndicators:!1,onChange:c},{default:()=>[g]}):g},l=d=>{const g=n.value;g&&g.state.active!==d&&g.swipeTo(d,{immediate:!t.inited})};return N(()=>t.currentIndex,l),ie(()=>{l(t.currentIndex)}),lt({swipeRef:n}),()=>e("div",{class:Ct("content",{animated:t.animated||t.swipeable})},[i()])}});const[Gt,K]=U("tabs"),Oe={type:rt("line"),color:String,border:Boolean,sticky:Boolean,shrink:Boolean,active:G(0),duration:G(.3),animated:Boolean,ellipsis:W,swipeable:Boolean,scrollspy:Boolean,offsetTop:G(0),background:String,lazyRender:W,lineWidth:P,lineHeight:P,beforeChange:Function,swipeThreshold:G(5),titleActiveColor:String,titleInactiveColor:String},Dt=Symbol(Gt);var Xe=M({name:Gt,props:Oe,emits:["change","scroll","rendered","clickTab","update:active"],setup(t,{emit:a,slots:o}){let n,c,i,l,d;const g=z(),v=z(),A=z(),x=z(),h=Ft(),w=xt(g),[f,S]=De(),{children:u,linkChildren:L}=oe(Dt),m=Lt({inited:!1,position:"",lineStyle:{},currentIndex:-1}),E=T(()=>u.length>+t.swipeThreshold||!t.ellipsis||t.shrink),H=T(()=>({borderColor:t.color,background:t.background})),q=(s,r)=>{var y;return(y=s.name)!=null?y:r},Y=T(()=>{const s=u[m.currentIndex];if(s)return q(s,m.currentIndex)}),Q=T(()=>Nt(t.offsetTop)),ct=T(()=>t.sticky?Q.value+n:0),V=s=>{const r=v.value,y=f.value;if(!E.value||!r||!y||!y[m.currentIndex])return;const p=y[m.currentIndex].$el,b=p.offsetLeft-(r.offsetWidth-p.offsetWidth)/2;l&&l(),l=Qe(r,b,s?0:+t.duration)},B=()=>{const s=m.inited;F(()=>{const r=f.value;if(!r||!r[m.currentIndex]||t.type!=="line"||st(g.value))return;const y=r[m.currentIndex].$el,{lineWidth:p,lineHeight:b}=t,k=y.offsetLeft+y.offsetWidth/2,j={width:ht(p),backgroundColor:t.color,transform:`translateX(${k}px) translateX(-50%)`};if(s&&(j.transitionDuration=`${t.duration}s`),nt(b)){const J=ht(b);j.height=J,j.borderRadius=J}m.lineStyle=j})},Ut=s=>{const r=s<m.currentIndex?-1:1;for(;s>=0&&s<u.length;){if(!u[s].disabled)return s;s+=r}},O=(s,r)=>{const y=Ut(s);if(!nt(y))return;const p=u[y],b=q(p,y),k=m.currentIndex!==null;m.currentIndex!==y&&(m.currentIndex=y,r||V(),B()),b!==t.active&&(a("update:active",b),k&&a("change",b,p.title)),i&&!t.scrollspy&&le(Math.ceil(gt(g.value)-Q.value))},X=(s,r)=>{const y=u.find((b,k)=>q(b,k)===s),p=y?u.indexOf(y):0;O(p,r)},dt=(s=!1)=>{if(t.scrollspy){const r=u[m.currentIndex].$el;if(r&&w.value){const y=gt(r,w.value)-ct.value;c=!0,d&&d(),d=Ge(w.value,y,s?0:+t.duration,()=>{c=!1})}}},Et=(s,r,y)=>{const{title:p,disabled:b}=u[r],k=q(u[r],r);b||(ce(t.beforeChange,{args:[k],done:()=>{O(r),dt()}}),de(s)),a("clickTab",{name:k,title:p,event:y,disabled:b})},qt=s=>{i=s.isFixed,a("scroll",s)},Vt=s=>{F(()=>{X(s),dt(!0)})},Wt=()=>{for(let s=0;s<u.length;s++){const{top:r}=D(u[s].$el);if(r>ct.value)return s===0?0:s-1}return u.length-1},Ht=()=>{if(t.scrollspy&&!c){const s=Wt();O(s)}},Yt=()=>{if(t.type==="line"&&u.length)return e("div",{class:K("line"),style:m.lineStyle},null)},ut=()=>{var s,r,y;const{type:p,border:b,sticky:k}=t,j=[e("div",{ref:k?void 0:A,class:[K("wrap"),{[re]:p==="line"&&b}]},[e("div",{ref:v,role:"tablist",class:K("nav",[p,{shrink:t.shrink,complete:E.value}]),style:H.value,"aria-orientation":"horizontal"},[(s=o["nav-left"])==null?void 0:s.call(o),u.map(J=>J.renderTitle(Et)),Yt(),(r=o["nav-right"])==null?void 0:r.call(o)])]),(y=o["nav-bottom"])==null?void 0:y.call(o)];return k?e("div",{ref:A},[j]):j},ft=()=>{B(),F(()=>{var s,r;V(!0),(r=(s=x.value)==null?void 0:s.swipeRef.value)==null||r.resize()})};N(()=>[t.color,t.duration,t.lineWidth,t.lineHeight],B),N(jt,ft),N(()=>t.active,s=>{s!==Y.value&&X(s)}),N(()=>u.length,()=>{m.inited&&(X(t.active),B(),F(()=>{V(!0)}))});const Ot=()=>{X(t.active,!0),F(()=>{m.inited=!0,A.value&&(n=D(A.value).height),V(!0)})},Xt=(s,r)=>a("rendered",s,r);return lt({resize:ft,scrollTo:Vt}),se(B),ne(B),Mt(Ot),Qt(g,B),_t("scroll",Ht,{target:w,passive:!0}),L({id:h,props:t,setLine:B,scrollable:E,onRendered:Xt,currentName:Y,setTitleRefs:S,scrollIntoView:V}),()=>e("div",{ref:g,class:K([t.type])},[t.sticky?e(We,{container:g.value,offsetTop:Q.value,onScroll:qt},{default:()=>[ut()]}):ut(),e(Ye,{ref:x,count:u.length,inited:m.inited,animated:t.animated,duration:t.duration,swipeable:t.swipeable,lazyRender:t.lazyRender,currentIndex:m.currentIndex,onChange:O},{default:()=>{var s;return[(s=o.default)==null?void 0:s.call(o)]}})])}});const[Je,St]=U("tab"),Ke=M({name:Je,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:W},setup(t,{slots:a}){const o=T(()=>{const c={},{type:i,color:l,disabled:d,isActive:g,activeColor:v,inactiveColor:A}=t;l&&i==="card"&&(c.borderColor=l,d||(g?c.backgroundColor=l:c.color=l));const h=g?v:A;return h&&(c.color=h),c}),n=()=>{const c=e("span",{class:St("text",{ellipsis:!t.scrollable})},[a.title?a.title():t.title]);return t.dot||nt(t.badge)&&t.badge!==""?e(ue,{dot:t.dot,content:t.badge,showZero:t.showZeroBadge},{default:()=>[c]}):c};return()=>e("div",{id:t.id,role:"tab",class:[St([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()])}}),[Ze,it]=U("tab"),$e=Bt({},fe,{dot:Boolean,name:P,badge:P,title:String,disabled:Boolean,titleClass:he,titleStyle:[String,Object],showZeroBadge:W});var ta=M({name:Ze,props:$e,setup(t,{slots:a}){const o=Ft(),n=z(!1),c=we(),{parent:i,index:l}=ge(Dt);if(!i){console.error("[Vant] <Tab> must be a child component of <Tabs>.");return}const d=()=>{var f;return(f=t.name)!=null?f:l.value},g=()=>{n.value=!0,i.props.lazyRender&&F(()=>{i.onRendered(d(),t.title)})},v=T(()=>{const f=d()===i.currentName.value;return f&&!n.value&&g(),f}),A=z(""),x=z("");ye(()=>{const{titleClass:f,titleStyle:S}=t;A.value=f?me(f):"",x.value=S&&typeof S!="string"?ve(be(S)):S});const h=f=>e(Ke,Se({key:o,id:`${i.id}-${l.value}`,ref:i.setTitleRefs(l.value),style:x.value,class:A.value,isActive:v.value,controls:o,scrollable:i.scrollable.value,activeColor:i.props.titleActiveColor,inactiveColor:i.props.titleInactiveColor,onClick:S=>f(c.proxy,l.value,S)},yt(i.props,["type","color","shrink"]),yt(t,["dot","badge","title","disabled","showZeroBadge"])),{title:a.title}),w=z(!v.value);return N(v,f=>{f?w.value=!1:Ae(()=>{w.value=!0})}),N(()=>t.title,()=>{i.setLine(),i.scrollIntoView()}),pe(_e,v),lt({id:o,renderTitle:h}),()=>{var f;const S=`${i.id}-${l.value}`,{animated:u,swipeable:L,scrollspy:m,lazyRender:E}=i.props;if(!a.default&&!u)return;const H=m||v.value;if(u||L)return e(Le,{id:o,role:"tabpanel",class:it("panel-wrapper",{inactive:w.value}),tabindex:v.value?0:-1,"aria-hidden":!v.value,"aria-labelledby":S},{default:()=>{var Q;return[e("div",{class:it("panel")},[(Q=a.default)==null?void 0:Q.call(a)])]}});const Y=n.value||m||!E?(f=a.default)==null?void 0:f.call(a):null;return Ce(e("div",{id:o,role:"tabpanel",class:it("panel"),tabindex:H?0:-1,"aria-labelledby":S},[Y]),[[Ie,H]])}}});const ea=tt(ta),aa=tt(Xe),[ia,oa]=U("divider"),sa={dashed:Boolean,hairline:W,vertical:Boolean,contentPosition:rt("center")};var na=M({name:ia,props:sa,setup(t,{slots:a}){return()=>{var o;return e("div",{role:"separator",class:oa({dashed:t.dashed,hairline:t.hairline,vertical:t.vertical,[`content-${t.contentPosition}`]:!!a.default&&!t.vertical})},[!t.vertical&&((o=a.default)==null?void 0:o.call(a))])}}});const ra=tt(na),la="_goods_126oz_1",ca="_goodsSection_126oz_9",da="_sellOut_126oz_14",ua="_sellOutImg_126oz_25",fa="_goodsImg_126oz_29",ha="_goodsInfo_126oz_33",ga="_goodsName_126oz_37",ya="_goodsSale_126oz_43",ma="_pre_126oz_48",va="_goodsPrice_126oz_51",ba="_addCart_126oz_57",Aa="_addCartDisabled_126oz_62",I={goods:la,goodsSection:ca,sellOut:da,sellOutImg:ua,goodsImg:fa,goodsInfo:ha,goodsName:ga,goodsSale:ya,pre:ma,goodsPrice:va,addCart:ba,addCartDisabled:Aa},pa="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACwAAAAsCAYAAAAehFoBAAAAAXNSR0IArs4c6QAABv5JREFUWMO1mWtoHFUUx39ndlPdbjZWE1ub+EDSVmpq41uQanwQSOurRKEtCAZR2lTwhX5QNJakiKL4QdBWQYyoNAot+KiKASW2FkpbNWBEaqNNTarWqu1uamxN5vhh9nFn5s7s2mog7Myde88993/+59xzzxVO4E/fu2Q6RyevIuG0INKEMA+kDiGDACI54CCwG5EhVAbQqS1y064/j3dOOS5F317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kSuQmCC",Ca=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:I.goods,onClick:()=>this.onItemClick(t)},[e("div",{class:I.goodsSection},[e(vt,{src:t.pic,fit:"cover",class:I.goodsImg},null),t.stock<=0&&e("div",{class:I.sellOut},[e(vt,{src:Ne,fit:"cover",class:I.sellOutImg},null)])]),e("div",{class:I.goodsInfo},[e("div",{class:[I.goodsName,"van-ellipsis"]},[t.name]),e("div",{class:I.goodsBuy},[e("p",{class:I.goodsPrice},[e("span",{class:I.pre},[R("¥")]),ze(t.price)]),this.showAdd&&e(Z,{class:[I.addCart,t.stock<=0&&I.addCartDisabled],name:pa,size:22,onClick:a=>{a.stopPropagation(),t.stock>0&&this.onBuyClick(t)}},null)])])])}}),Sa="_tabList_1we34_1",wa="_goodsList_1we34_6",wt={tabList:Sa,goodsList:wa},Ia=M({name:"tab-list",props:{showAdd:{type:Boolean,default:!0},typeId:{type:Number,default:0},productAttributeCategoryId:{type:[Number,String],default:0},brandId:{type:[Number,String],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",{noAuthorization:!0,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 a=this.$router.resolve({path:"/goodsDetail",query:{id:t.id}}).fullPath;this.onOpenWebView(a);return}this.$router.push({path:"/goodsDetail",query:{id:t.id}})},onBuyClick(t){this.selectGoodsItem=t,this.addGoodsShow=!0}},render(){return e("div",{class:wt.tabList},[e(je,{loading:this.loading,"onUpdate:loading":t=>this.loading=t,finished:this.finished,finishedText:"",immediateCheck:!1,class:[wt.goodsList,"mb12"],style:{height:this.list.length?"auto":"100%"},onLoad:this.getList},{default:()=>[this.list.length&&this.list.map(t=>e(Ca,{item:t,onItemClick:this.onDetailClick,onBuyClick:this.onBuyClick,showAdd:this.showAdd},null))||null,!this.loading&&!this.list.length&&e(ke,{description:"暂无商品"},null)||null]}),e(Pt,{show:this.addGoodsShow,closeable:!0,position:"bottom",round:!0,onClose:()=>{this.addGoodsShow=!1}},{default:()=>[e(Be,{show:this.addGoodsShow,onClose:()=>{this.addGoodsShow=!1},item:this.selectGoodsItem},null)]})])}}),za="_active_gviry_19",ka="_filterBtn_gviry_23",Ta="_filterTagWrap_gviry_26",Ma="_filterTag_gviry_26",xa="_filterSort_gviry_72",La="_iconSort_gviry_82",C={"filter-top":"_filter-top_gviry_7",active:za,filterBtn:ka,filterTagWrap:Ta,filterTag:Ma,"filter-productCategory":"_filter-productCategory_gviry_42","filter-tag":"_filter-tag_gviry_58","filter-tag-checked":"_filter-tag-checked_gviry_68",filterSort:xa,"icon-active":"_icon-active_gviry_79",iconSort:La},Na="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAkCAMAAADfNcjQAAAAAXNSR0IArs4c6QAAAMlQTFRFAAAAAAAAAAAAMzMzKysrLi4uKysrMzMzMDAwLS0tNjY2MTExNzc3MDAwMzMzMDAwMTExNDQ0MjIyNTU1NDQ0MjIyMjI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Pn/ge3HX6f5CshyRDf8A+1CqQq9qjYSAAAAAElFTkSuQmCC",_a="_loading_8jqo2_1",ja="_titlePopup_8jqo2_7",Fa="_title_8jqo2_7",Ra="_radio_8jqo2_21",Pa="_filterAction_8jqo2_58",_={loading:_a,titlePopup:ja,title:Fa,"radio-group":"_radio-group_8jqo2_21",radio:Ra,filterAction:Pa};function It(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!Me(t)}const zt=()=>({productAttributeCategoryList:null,brandList:null}),Qa=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:zt()}},mounted(){this.getFilterList()},methods:{async getFilterList(){this.loading=!0;try{const t=await Rt.get("/edu-app/open/mall/search/condition",{noAuthorization:!0});this.dataShow=t.code===200;const{brandList:a=[],productAttributeCategoryList:o=[]}=t.data||{};this.brandList=a,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:_.loading},[e(Te,{color:"var(--van-primary)"},null)]),e("div",{class:_.filterWrap},[e("div",{class:_.titlePopup},[R("筛选")]),e(bt,{border:!1,title:"商品类型"},{label:()=>{let t;return e(At,{class:_["radio-group"],modelValue:this.params.productAttributeCategoryList,"onUpdate:modelValue":a=>this.params.productAttributeCategoryList=a},It(t=this.productAttributeCategoryList.map((a,o)=>e(pt,{key:a.id,class:_.radio,name:o,onClick:()=>{}},{default:()=>[e($,{size:"large",type:o===this.params.productAttributeCategoryList?"primary":"default"},{default:()=>[a.name]})]})))?t:{default:()=>[t]})}}),e(bt,{border:!1,title:"品牌"},{label:()=>{let t;return e(At,{class:_["radio-group"],modelValue:this.params.brandList,"onUpdate:modelValue":a=>this.params.brandList=a},It(t=this.brandList.map((a,o)=>e(pt,{key:a.id,class:_.radio,name:o,onClick:()=>{}},{default:()=>[e($,{size:"large",type:o===this.params.brandList?"primary":"default"},{default:()=>[a.name]})]})))?t:{default:()=>[t]})}}),e(ra,{style:{margin:"0"}},null),e("div",{class:_.filterAction},[e(mt,{round:!0,style:{marginRight:"8px"},onClick:()=>this.params=zt()},{default:()=>[R("重置")]}),e(mt,{round:!0,type:"primary",color:"linear-gradient(121deg, #FFD892 0%, #FFCB75 100%)",style:{marginLeft:"8px"},onClick:()=>this.onFilterClick()},{default:()=>[R("确认")]})])])])}}),Ka=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:a,brand:o}){t&&t.active===void 0&&(t.active=0),this.productCategory=t||{id:0,name:""},this.productAttributeCategory=a||{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 a=this.$refs.goodsFilter;a&&(t==="productAttributeCategory"?a.setParams("productAttributeCategoryList"):a.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(Re,null,{default:()=>[e(Fe,{modelValue:this.keyword,searchIcon:Ba,onSearch:this.searchBtn,placeholder:"请输入商品名称"},null),e(Pe,{class:C["filter-top"],align:"center"},{default:()=>[e(at,{span:6,class:this.filterActive===0?C.active:"",onClick:()=>this.onFilter(0)},{default:()=>[R("综合排序")]}),e(at,{span:6,class:this.filterActive===3||this.filterActive===4?C.active:"",onClick:()=>this.onFilter(3)},{default:()=>[R("价格"),e("div",{class:C.filterSort},[e(Z,{class:this.filterActive===3?C["icon-active"]:"",style:{transform:"rotate(-90deg)"},name:"play",size:12},null),e(Z,{class:[C.iconSort,this.filterActive===4?[C["icon-active"]]:""],style:{transform:"rotate(90deg)"},name:"play",size:12},null)])]}),e(at,{style:{marginLeft:"auto"},span:6,class:C.filterBtn,onClick:()=>this.filterListShow=!0},{default:()=>[R("筛选"),e(Z,{name:Na,size:18},null)]})]}),this.productCategory.id&&this.productCategory.children&&this.productCategory.children.length?e(aa,{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,a)=>e(ea,{name:a,title:t.name},{title:()=>e("div",{class:[C["filter-tag"],this.productCategory.active===a?C["filter-tag-checked"]:""]},[t.name])}))]}):null]}),e("div",{class:C.filterTagWrap},[this.productAttributeCategory.id?e($,{class:C.filterTag,closeable:!0,onClose:()=>this.onClearTag("productAttributeCategory")},{default:()=>[this.productAttributeCategory.name]}):"",this.brand.id?e($,{class:C.filterTag,closeable:!0,onClose:()=>this.onClearTag("brand")},{default:()=>[this.brand.name]}):""]),this.tabListShow?e(Ia,{ref:"tabList",style:{height:"calc(100vh - var(--header-height))"},showAdd:!0,productAttributeCategoryId:this.productAttributeCategory.id,brandId:this.brand.id,sort:this.filterActive,keyword:this.keyword},null):null,e(Pt,{show:this.filterListShow,closeable:!0,position:"bottom",round:!0,onClose:()=>{this.filterListShow=!1}},{default:()=>[e(Qa,{cateGoryId:this.productCategory.id,ref:"goodsFilter",setFilter:this.setFilter},null)]})])}});export{Ka as default};