1 |
- import{d as u,b as e,L as A,j as s,p as C,H as b,J as L,X as h,v as S,Z as _,B as m,_ as v,q as c,S as k,k as w,C as p,y as V,z as T,P as F}from"./vendor.2bcdc9cf.js";/* empty css *//* empty css *//* empty css *//* empty css */import{i as x,T as B}from"./icon_search.8aa425ea.js";import{r as g}from"./index.b8b9219f.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import"./index.bf47a6bc.js";/* empty css */import"./index.903a2347.js";import"./shop-mall.fff18e3c.js";const W="_active_14p51_13",j="_filterBtn_14p51_17",I="_filterTagWrap_14p51_20",q="_filterTag_14p51_20",G="_filterSort_14p51_66",P="_iconSort_14p51_76";var a={"filter-top":"_filter-top_14p51_1",active:W,filterBtn:j,filterTagWrap:I,filterTag:q,"filter-productCategory":"_filter-productCategory_14p51_36","filter-tag":"_filter-tag_14p51_52","filter-tag-checked":"_filter-tag-checked_14p51_62",filterSort:G,"icon-active":"_icon-active_14p51_73",iconSort:P},Z="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAA4CAMAAACfWMssAAAAAXNSR0IArs4c6QAAAWtQTFRFAAAAAAAAAICAgICAZmZmbW1tYGBgOcaqXV1dW1tbZmZmLdK0K8aqY2NjXl5eLsWuKcKtYmJiaGhoLsikampqMMenaGhoZGRkLcutZ2dnZWVlLsuqaWlpK8iqZ2dnY2NjaWlpK8muZWVlaGhoZmZmZGRkaWlpZ2dnLsesZmZmZ2dnY2NjZGRkaGhoZWVlZ2dnZ2dnZmZmLcirZ2dnZmZmZmZmZ2dnLcepZ2dnZmZmZmZmZmZmZWVlZmZmZmZmZmZmZmZmLMepZWVlZmZmLcaqLcapLcirZ2dnZmZmZ2dnZmZmLceqZmZmLMeqZmZmLceqLsiqZ2dnLcaqZmZmLceqZmZmZ2dnZmZmZmZmZWVlZmZmZmZmZ2dnZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmLciqZmZmZmZmZWVlZmZmLcerZmZmZWVlZmZmZmZmZmZmZmZmZWVlZmZmLceqZmZmUyQu0QAAAHd0Uk5TAAECAgUHCAkLDg8REhITFhkaGxwdICAhIiUmJycqKiwuLzAxMjMzNDc3OTtCQkdISktPUlVaY2VmaW5weXqChZSVl5iZnZ2foKmqrrGztLW4uLm7vMDCxcjJytDQ0dTW2Nvc3ubn6+zv8PDz9Pf4+Pn6+/z9/v5eDTrYAAABaElEQVRIx+2Wx1ICQRBAUVExZzCgYsSEOYs5rzkjJhQzBgTR9/keWEB0IxcLynea6am3tdPTPbsGwz+pRrfrDQUCx73SXk8QFYIOSdGNKkeS4jMIQwoI4JMUPXBnkc+A5Q7OJVfGgBOTnGc6A0al1wRgVU4UAEHuoaeAU3ptUvF1LLcQlDysvne4NcsnwBGA++rfcesjBLqUimcCuMj5Gc31AOPKZbcCrKfFxzI2gWWVes1yA1PxsWnAlalW6aU3EBr4HhkMwXWJeo90+sFXH5vbnuC1Q0t3jQJXBZFZoRcY1taXc8BOZLIHzGhsaOMhYA2P64ADo9aroB1oCg/tgF3zHdIcL9qSRvwoT0Q0ey+dhkREfSSnWLS4L7Kbr0tc+IxSqUvcinoP2brEkSWR2TaNe2xJNDmtfybm1YrUaBAbY2L/SzStFbrEtdg5lqmLVTFxI+pta9nkvD8ofrOKG0Rq0v//51KRLwGgwFyX9Ix7AAAAAElFTkSuQmCC";const z="_loading_1wy15_1",R="_titlePopup_1wy15_7",U="_title_1wy15_7",E="_radio_1wy15_21",Q="_filterAction_1wy15_57";var o={loading:z,titlePopup:R,title:U,"radio-group":"_radio-group_1wy15_21",radio:E,filterAction:Q};function D(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!S(t)}const y=()=>({productCategorySmallVoList:null,productAttributeCategoryList:null,brandList:null});var N=u({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:y()}},mounted(){this.getFilterList()},methods:{async getFilterList(){this.loading=!0;try{const t=await g.get("/api-mall-portal/product/search/condition");this.dataShow=t.code===200;const{brandList:i=[],productAttributeCategoryList:r=[],productCategorySmallVoList:l=[]}=t.data||{};if(this.brandList=i,this.productAttributeCategoryList=r,this.productCategorySmallVoList=l,this.cateGoryId){let n=l.findIndex(d=>d.id==this.cateGoryId);this.params.productCategorySmallVoList=n>-1?n:null}}catch{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:o.loading},[e(A,{color:"var(--van-primary)"},null)]),e("div",{class:o.filterWrap},[e("div",{class:o.titlePopup},[s("\u7B5B\u9009")]),Object.keys(this.params).map(t=>e(C,{border:!1},{title:()=>e("div",null,[t==="productCategorySmallVoList"?"\u5546\u54C1\u5206\u7C7B":t==="productAttributeCategoryList"?"\u5546\u54C1\u7C7B\u578B":"\u54C1\u724C"]),label:()=>{let i;return e(b,{class:o["radio-group"],modelValue:this.params[t],"onUpdate:modelValue":r=>this.params[t]=r},D(i=this[t].map((r,l)=>{const d=l===this.params[t]?"primary":"default";return e(L,{class:o.radio,name:l,onClick:()=>{}},{default:()=>[e(h,{size:"large",type:d},{default:()=>[r.name]})]})}))?i:{default:()=>[i]})}})),e(_,{style:{margin:"0"}},null),e("div",{class:o.filterAction},[e(m,{round:!0,style:{marginRight:"8px"},onClick:()=>this.params=y()},{default:()=>[s("\u91CD\u7F6E")]}),e(m,{round:!0,type:"primary",style:{marginLeft:"8px"},onClick:()=>this.onFilterClick()},{default:()=>[s("\u786E\u8BA4")]})])])])}});const $="_white_1n2ds_32",K="_searchBtn_1n2ds_35";var f={"col-search":"_col-search_1n2ds_13",default:"_default_1n2ds_29",white:$,searchBtn:K},M=u({name:"ColSearch",props:{modelValue:{type:String,default:""},showAction:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},autofocus:{type:Boolean,default:!1},placeholder:{type:String,default:"\u8BF7\u8F93\u5165\u641C\u7D22\u5173\u952E\u8BCD"},background:{type:String,default:"#fff"},inputBackground:{type:String,default:"default"},onSearch:{type:Function,default:t=>{}},onFilter:{type:Function,default:()=>{}},filterDot:{type:Boolean,default:!1}},emits:["click"],watch:{modelValue(){this.search=this.modelValue}},data(){return{search:this.modelValue||""}},render(){return e("div",null,[e(v,{class:[f["col-search"],f[this.inputBackground]],modelValue:this.search,"onUpdate:modelValue":t=>this.search=t,background:this.background,showAction:this.showAction,shape:"round",placeholder:this.placeholder,disabled:this.disabled,autofocus:this.autofocus,onSearch:t=>{this.onSearch(t)},onClear:()=>{this.search="",this.onSearch()},onClick:()=>this.$emit("click")},{left:()=>this.$slots.left&&this.$slots.left(),"left-icon":()=>e(c,{name:x,size:16},null),"right-icon":()=>e(m,{class:f.searchBtn,round:!0,type:"primary",size:"mini",onClick:()=>{this.onSearch(this.search)}},{default:()=>[s("\u641C\u7D22")]}),action:()=>e(c,{name:Z,size:28,dot:this.filterDot,onClick:()=>{this.onFilter()}},null)})])}}),ut=u({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(){if(this.$nextTick(()=>{this.$route.query.input==="focus"&&document.querySelector(".van-field__control").focus()}),this.productCategory.id)try{const t=await g.get("/api-mall-portal/product/search/condition");t.code===200&&this.setFilter({productCategory:t.data.productCategorySmallVoList.find(i=>i.id===this.productCategory.id),productAttributeCategory:void 0,brand:void 0})}catch{}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:r}){t&&t.active===void 0&&(t.active=0),this.productCategory=t||{id:0,name:""},this.productAttributeCategory=i||{id:0,name:""},this.brand=r||{id:0,name:""},this.$nextTick(()=>{this.onSearch(),this.filterListShow=!1})},onToggleTag(){this.$refs.tabList.loading||this.$nextTick(()=>{this.onSearch()})},onClearTag(t){this[t]={id:0,name:""};let i=this.$refs.goodsFilter;i&&(t==="productCategory"?i.setParams("productCategorySmallVoList"):t==="productAttributeCategory"?i.setParams("productAttributeCategoryList"):i.setParams("brandList")),this.$nextTick(()=>{this.onSearch()})},onSearch(){this.$refs.tabList.onSearch()},searchBtn(t){this.keyword=t,console.log(this.keyword),this.$nextTick(()=>{this.onSearch()})}},render(){return e("div",null,[e(k,null,{default:()=>[e(M,{modelValue:this.keyword,onSearch:this.searchBtn},null),e(w,{class:a["filter-top"],align:"center"},{default:()=>[e(p,{span:6,class:this.filterActive===0?a.active:"",onClick:()=>this.onFilter(0)},{default:()=>[s("\u7EFC\u5408\u6392\u5E8F")]}),e(p,{span:6,class:this.filterActive===3||this.filterActive===4?a.active:"",onClick:()=>this.onFilter(3)},{default:()=>[s("\u4EF7\u683C"),e("div",{class:a.filterSort},[e(c,{class:this.filterActive===3?a["icon-active"]:"",style:{transform:"rotate(-90deg)"},name:"play",size:12},null),e(c,{class:[a.iconSort,this.filterActive===4?[a["icon-active"]]:""],style:{transform:"rotate(90deg)"},name:"play",size:12},null)])]}),e(p,{style:{marginLeft:"auto"},span:6,class:a.filterBtn,onClick:()=>this.filterListShow=!0},{default:()=>[s("\u7B5B\u9009"),e(c,{name:Z,size:18},null)]})]}),this.productCategory.id&&this.productCategory.children&&this.productCategory.children.length?e(V,{class:a["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(T,{name:i,title:t.name},{title:()=>e("div",{class:[a["filter-tag"],this.productCategory.active===i?a["filter-tag-checked"]:""]},[t.name])}))]}):null]}),e("div",{class:a.filterTagWrap},[this.productAttributeCategory.id?e(h,{class:a.filterTag,closeable:!0,onClose:()=>this.onClearTag("productAttributeCategory")},{default:()=>[this.productAttributeCategory.name]}):"",this.brand.id?e(h,{class:a.filterTag,closeable:!0,onClose:()=>this.onClearTag("brand")},{default:()=>[this.brand.name]}):""]),this.tabListShow?e(B,{ref:"tabList",showAdd:!1,typeId:Number(this.getProductAttributeCategory),productAttributeCategoryId:this.productAttributeCategory.id,brandId:this.brand.id,sort:this.filterActive,keyword:this.keyword},null):null,e(F,{show:this.filterListShow,closeable:!0,position:"bottom",round:!0,onClose:()=>{this.filterListShow=!1}},{default:()=>[e(N,{cateGoryId:this.productCategory.id,ref:"goodsFilter",setFilter:this.setFilter},null)]})])}});export{ut as default};
|