index-legacy.6425dbd8.js 12 KB

1
  1. !function(){function t(t,e,r,i,n,a,o){try{var l=t[a](o),c=l.value}catch(u){return void r(u)}l.done?e(c):Promise.resolve(c).then(i,n)}function e(e){return function(){var r=this,i=arguments;return new Promise((function(n,a){var o=e.apply(r,i);function l(e){t(o,n,a,l,c,"next",e)}function c(e){t(o,n,a,l,c,"throw",e)}l(void 0)}))}}var r=document.createElement("style");r.innerHTML="._filter-top_1vale_1{height:.98667rem;font-size:.37333rem;color:#666;transition:color cubic-bezier(.075,.82,.165,1);background:#ffffff}._filter-top_1vale_1 .van-col{display:flex;align-items:center;justify-content:center}._filter-top_1vale_1 ._active_1vale_13{color:#333;font-weight:500}._filter-top_1vale_1 ._filterBtn_1vale_17{color:#333}._filterTagWrap_1vale_20{display:flex;padding:.16rem 0 0 .37333rem;flex-wrap:wrap}._filterTagWrap_1vale_20 ._filterTag_1vale_20{border:.02667rem solid var(--van-primary-color)!important;color:var(--van-primary-color)!important;border-radius:.32rem;font-size:.32rem;background-color:#f7f8f9;padding:.10667rem .26667rem;margin-right:.21333rem;margin-bottom:.21333rem;font-weight:500}._filter-productCategory_1vale_36{font-size:.37333rem;color:#666}._filter-productCategory_1vale_36 .van-tab{padding:0}._filter-productCategory_1vale_36 .van-tabs__line{display:none!important}._filter-productCategory_1vale_36 .van-col{height:.98667rem;display:flex;align-items:center;justify-content:center}._filter-productCategory_1vale_36 ._filter-tag_1vale_52{padding:.13333rem .26667rem;height:80%;border-radius:.53333rem;display:flex;justify-content:center;align-items:center;margin:0 .13333rem;min-width:1.33333rem}._filter-productCategory_1vale_36 ._filter-tag-checked_1vale_62{background:var(--van-primary);color:#fff}._filterSort_1vale_66{display:flex;flex-direction:column;justify-content:center;align-items:center;margin-left:.13333rem}._filterSort_1vale_66 ._icon-active_1vale_73{color:#2dc7aa}._filterSort_1vale_66 ._iconSort_1vale_76{margin-top:-.13333rem;margin-left:-.02667rem}._loading_1wy15_1{height:.8rem;display:flex;justify-content:center;align-items:center}._titlePopup_1wy15_7{padding:.48rem;text-align:center;color:#000;font-weight:500;font-size:.48rem}._title_1wy15_7{color:#333;font-size:.37333rem;line-height:.53333rem;padding-left:.42667rem;font-weight:500}._radio-group_1wy15_21{display:flex;flex-wrap:wrap;margin-top:.37333rem}._radio_1wy15_21{margin-right:.26667rem;margin-bottom:.21333rem}._radio_1wy15_21 .van-radio__icon{display:none}._radio_1wy15_21 .van-tag{box-sizing:border-box;font-size:.37333rem;display:flex;align-items:center;justify-content:center;border-radius:.42667rem;padding:.16rem .32rem;border:.02667rem solid transparent;height:.85333rem;line-height:.85333rem;min-width:2.13333rem}._radio_1wy15_21 .van-tag--default{color:#999}._radio_1wy15_21 .van-tag--primary{background-color:#f7f8f9;border:.02667rem solid var(--van-primary);color:var(--van-primary)}._radio_1wy15_21 .van-radio__label{margin-left:0}._filterAction_1wy15_57{padding:.29333rem .42667rem;display:flex;align-items:center}._filterAction_1wy15_57 .van-button{flex:1;height:1.12rem;line-height:1.12rem}\n",document.head.appendChild(r),System.register(["./index-legacy.b2528a15.js","./index-legacy.d3645f16.js","./index-legacy.edff980f.js","./index-legacy.4f922f18.js","./index-legacy.3f4943f0.js","./index-legacy.7e6f30e7.js","./index-legacy.2d030016.js","./index-legacy.a87134f4.js","./index-legacy.207dc8c2.js","./index-legacy.5147af42.js","./index-legacy.7d3d7cf1.js","./index-legacy.a6f94c68.js","./hooks-legacy.fb8d6c34.js","./use-id-legacy.4f071235.js","./use-tab-status-legacy.5c2c2da3.js","./use-refs-legacy.2f8acfce.js","./index-legacy.9cbe7ce8.js","./index-legacy.439ea58a.js","./index-legacy.ca42ae97.js","./index-legacy.7755cfa7.js","./icon-sell-out-legacy.ae9d997a.js","./shop-mall-legacy.cc5cb0f7.js","./index-legacy.ab501af1.js"],(function(t){"use strict";var r,i,n,a,o,l,c,u,d,s,f,g,p,y,_,m,h,v,b,C,w,x,L;return{setters:[function(t){r=t.d,i=t.e,n=t.i,a=t.aS,o=t.A,l=t.B,c=t.$,u=t.N,d=t.aT},function(t){s=t.R,f=t.C},function(t){g=t.T},function(t){p=t.S},function(){},function(t){y=t.T,_=t.a},function(t){m=t.T},function(t){h=t.C,v=t.i},function(t){b=t.C},function(t){C=t.R,w=t.a},function(){},function(t){x=t.D},function(t){L=t.u},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){}],execute:function(){var S="_filter-top_1vale_1",A="_active_1vale_13",k="_filterBtn_1vale_17",j="_filterTagWrap_1vale_20",T="_filterTag_1vale_20",F="_filter-productCategory_1vale_36",V="_filter-tag_1vale_52",z="_filter-tag-checked_1vale_62",P="_filterSort_1vale_66",$="_icon-active_1vale_73",I="_iconSort_1vale_76",R={loading:"_loading_1wy15_1",titlePopup:"_titlePopup_1wy15_7",title:"_title_1wy15_7","radio-group":"_radio-group_1wy15_21",radio:"_radio_1wy15_21",filterAction:"_filterAction_1wy15_57"};var B=r({name:"goods-filter-list",props:{setFilter:{type:Function,default:function(t){}},cateGoryId:{type:Number,default:0}},data:function(){return{dataShow:!0,loading:!1,brandList:[],productAttributeCategoryList:[],productCategorySmallVoList:[],params:{productCategorySmallVoList:null,productAttributeCategoryList:null,brandList:null}}},mounted:function(){this.getFilterList()},methods:{getFilterList:function(){var t=this;return e(regeneratorRuntime.mark((function e(){var r,n,a,o,l,c,u,d,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.loading=!0,e.prev=1,e.next=4,i.get("/api-mall-portal/product/search/condition");case 4:r=e.sent,t.dataShow=200===r.code,n=r.data||{},a=n.brandList,o=void 0===a?[]:a,l=n.productAttributeCategoryList,c=void 0===l?[]:l,u=n.productCategorySmallVoList,d=void 0===u?[]:u,t.brandList=o,t.productAttributeCategoryList=c,t.productCategorySmallVoList=d,t.cateGoryId&&(s=d.findIndex((function(e){return e.id==t.cateGoryId})),t.params.productCategorySmallVoList=s>-1?s:null),e.next=16;break;case 13:e.prev=13,e.t0=e.catch(1),t.dataShow=!1;case 16:t.loading=!1;case 17:case"end":return e.stop()}}),e,null,[[1,13]])})))()},onFilterClick:function(){this.setFilter({productCategory:this.productCategorySmallVoList[this.params.productCategorySmallVoList],productAttributeCategory:this.productAttributeCategoryList[this.params.productAttributeCategoryList],brand:this.brandList[this.params.brandList]})},setParams:function(t){this.params[t]=null}},render:function(){var t=this;return n("div",null,[this.loading&&n("div",{class:R.loading},[n(a,{color:"var(--van-primary)"},null)]),n("div",{class:R.filterWrap},[n("div",{class:R.titlePopup},[o("筛选")]),Object.keys(this.params).map((function(e){return n(b,{border:!1},{title:function(){return n("div",null,["productCategorySmallVoList"===e?"商品分类":"productAttributeCategoryList"===e?"商品类型":"品牌"])},label:function(){var r,i;return n(C,{class:R["radio-group"],modelValue:t.params[e],"onUpdate:modelValue":function(r){return t.params[e]=r}},(i=r=t[e].map((function(r,i){var a=i===t.params[e]?"primary":"default";return n(w,{class:R.radio,name:i,onClick:function(){}},{default:function(){return[n(g,{size:"large",type:a},{default:function(){return[r.name]}})]}})})),"function"==typeof i||"[object Object]"===Object.prototype.toString.call(i)&&!c(i)?r:{default:function(){return[r]}}))}})})),n(x,{style:{margin:"0"}},null),n("div",{class:R.filterAction},[n(l,{round:!0,style:{marginRight:"8px"},onClick:function(){return t.params={productCategorySmallVoList:null,productAttributeCategoryList:null,brandList:null}}},{default:function(){return[o("重置")]}}),n(l,{round:!0,type:"primary",style:{marginLeft:"8px"},onClick:function(){return t.onFilterClick()}},{default:function(){return[o("确认")]}})])])])}});t("default",r({name:"goods-list",data:function(){var 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:function(){if(this.productCategory.id){if(this.productCategory.children)return(this.productCategory.children[this.productCategory.active]||{}).id||"";this.productCategory.id}return 0}},mounted:function(){var t=this;return e(regeneratorRuntime.mark((function e(){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.$nextTick((function(){"focus"===t.$route.query.input&&document.querySelector(".van-field__control").focus()})),!t.productCategory.id){e.next=11;break}return e.prev=2,e.next=5,i.get("/api-mall-portal/product/search/condition");case 5:200===(r=e.sent).code&&t.setFilter({productCategory:r.data.productCategorySmallVoList.find((function(e){return e.id===t.productCategory.id})),productAttributeCategory:void 0,brand:void 0}),e.next=11;break;case 9:e.prev=9,e.t0=e.catch(2);case 11:t.tabListShow=!0,L("商品列表");case 13:case"end":return e.stop()}}),e,null,[[2,9]])})))()},methods:{onFilter:function(t){var e=this;3===this.filterActive&&3===t&&(t=4),4===this.filterActive&&3===t&&(t=3),this.filterActive!==t&&(this.filterActive=t,this.$nextTick((function(){e.onSearch()})))},setFilter:function(t){var e=this,r=t.productCategory,i=t.productAttributeCategory,n=t.brand;r&&void 0===r.active&&(r.active=0),this.productCategory=r||{id:0,name:""},this.productAttributeCategory=i||{id:0,name:""},this.brand=n||{id:0,name:""},this.$nextTick((function(){e.onSearch(),e.filterListShow=!1}))},onToggleTag:function(){var t=this;this.$refs.tabList.loading||this.$nextTick((function(){t.onSearch()}))},onClearTag:function(t){var e=this;this[t]={id:0,name:""};var r=this.$refs.goodsFilter;r&&("productCategory"===t?r.setParams("productCategorySmallVoList"):"productAttributeCategory"===t?r.setParams("productAttributeCategoryList"):r.setParams("brandList")),this.$nextTick((function(){e.onSearch()}))},onSearch:function(){this.$refs.tabList.onSearch()},searchBtn:function(t){var e=this;this.keyword=t,console.log(this.keyword),this.$nextTick((function(){e.onSearch()}))}},render:function(){var t=this;return n("div",null,[n(p,null,{default:function(){return[n(h,{modelValue:t.keyword,onSearch:t.searchBtn},null),n(s,{class:S,align:"center"},{default:function(){return[n(f,{span:6,class:0===t.filterActive?A:"",onClick:function(){return t.onFilter(0)}},{default:function(){return[o("综合排序")]}}),n(f,{span:6,class:3===t.filterActive||4===t.filterActive?A:"",onClick:function(){return t.onFilter(3)}},{default:function(){return[o("价格"),n("div",{class:P},[n(u,{class:3===t.filterActive?$:"",style:{transform:"rotate(-90deg)"},name:"play",size:12},null),n(u,{class:[I,4===t.filterActive?[$]:""],style:{transform:"rotate(90deg)"},name:"play",size:12},null)])]}}),n(f,{style:{marginLeft:"auto"},span:6,class:k,onClick:function(){return t.filterListShow=!0}},{default:function(){return[o("筛选"),n(u,{name:v,size:18},null)]}})]}}),t.productCategory.id&&t.productCategory.children&&t.productCategory.children.length?n(y,{class:F,shrink:!0,ellipsis:!1,active:t.productCategory.active,"onUpdate:active":function(e){return t.productCategory.active=e},onChange:function(){return t.onToggleTag()}},{default:function(){return[t.productCategory&&t.productCategory.children.map((function(e,r){return n(_,{name:r,title:e.name},{title:function(){return n("div",{class:[V,t.productCategory.active===r?z:""]},[e.name])}})}))]}}):null]}}),n("div",{class:j},[this.productAttributeCategory.id?n(g,{class:T,closeable:!0,onClose:function(){return t.onClearTag("productAttributeCategory")}},{default:function(){return[t.productAttributeCategory.name]}}):"",this.brand.id?n(g,{class:T,closeable:!0,onClose:function(){return t.onClearTag("brand")}},{default:function(){return[t.brand.name]}}):""]),this.tabListShow?n(m,{ref:"tabList",typeId:Number(this.getProductAttributeCategory),productAttributeCategoryId:this.productAttributeCategory.id,brandId:this.brand.id,sort:this.filterActive,keyword:this.keyword},null):null,n(d,{show:this.filterListShow,closeable:!0,position:"bottom",round:!0,onClose:function(){t.filterListShow=!1}},{default:function(){return[n(B,{cateGoryId:t.productCategory.id,ref:"goodsFilter",setFilter:t.setFilter},null)]}})])}}))}}}))}();