webpackJsonp([47],{"43Bj":function(e,t){},ZbCR:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s=a("mvHQ"),r=a.n(s),i=a("7zYZ"),n=a("RXN1"),l=a("PGxA"),c=a("nfsg"),o=a("Au9i"),d={name:"preferredProducts",components:{CommonLoginTop:i.a,LogoNavbar:n.a,DivButtom:l.a,TopRow:c.a},data:function(){return{classTree:[],defaultProps:{children:"children",label:"NVC_CLASS_NAME"},pageModel:{pageIndex:1,pageSize:12,orderField:"ID",isAscending:!0,searchInfo:"[]"},searchInfo:[],productTotal:0,productPage:1,brandList:[],isAllBrand:-1,classDefaultTree:[],classCurrentTree:{classField:"",classCode:""},selectedSort:"鍏ㄩ儴",productList:[],searchValue:"",brandTags:[],isShowHighLight:!1}},mounted:function(){window.scrollTo(0,0),this.getClassTreeWithCount()},methods:{selectedAllBrands:function(){this.searchValue="",this.brandTags=[],this.isAllBrand=-1,this.searchInfo=[],this.productPage=1,this.searchInfo[this.searchInfo.length++]={field:this.classCurrentTree.classField,value:this.classCurrentTree.classCode,opt:"1",group:"1",link:!0},this.getProducts()},goSupplier:function(e){var t=this.$router.resolve({name:"supplierDetail",query:{id:e}});window.open(t.href,"_blank")},brandTagClose:function(e){if(this.brandTags.splice(this.brandTags.indexOf(e),1),0==this.brandTags.length)this.selectedAllBrands();else{for(var t=0;t<this.searchInfo.length;t++)"NVC_PRODUCT_NAME"==this.searchInfo[t].field?this.searchInfo.splice(t,1):this.searchInfo[t].value==e&&this.searchInfo.splice(t,1);this.productPage=1,this.searchValue="",this.getProducts()}},goProduct:function(e){var t=this.$router.resolve({name:"product",query:{productId:e.ID}});window.open(t.href,"_blank")},handleNodeClick:function(e){var t=this;this.searchValue="",this.brandTags=[],this.isAllBrand=-1,this.searchInfo=[],this.productPage=1,this.selectedSort=e.NVC_CLASS_NAME,this.$nextTick(function(){t.$refs.elTree.setCurrentKey(e.NVC_CODE)});var a="",s=Number(e.NVC_PARENT_CODE);a=0==s?"NVC_ONE_CLASSCODE":s>0&&s<100?"NVC_TWO_CLASSCODE":"NVC_THREE_CLASSCODE",this.classCurrentTree.classField=a,this.classCurrentTree.classCode=e.NVC_CODE,this.searchInfo[this.searchInfo.length++]={field:a,value:e.NVC_CODE,opt:"1",group:"1",link:!0},this.getBrands()},selectedBrandName:function(e){if(-1!=this.brandTags.indexOf(e.NVC_BRAND_NAME))return!1;this.searchValue="",this.brandTags.push(e.NVC_BRAND_NAME),this.isAllBrand=1,this.productPage=1;for(var t=0;t<this.searchInfo.length;t++)"NVC_PRODUCT_NAME"==this.searchInfo[t].field&&this.searchInfo.splice(t,1);this.searchInfo[this.searchInfo.length++]={field:"NVC_BRAND_NAME",value:e.NVC_BRAND_NAME,opt:"1",group:"2",link:!1},this.getProducts()},goSearch:function(){this.productPage=1,this.searchInfo[this.searchInfo.length++]={field:"NVC_PRODUCT_NAME",value:this.searchValue,opt:"9",group:"1",link:!0},this.getProducts()},handleCurrentChange:function(e){this.productPage=e,this.getProducts()},getProducts:function(){var e=this;this.pageModel.pageIndex=this.productPage,this.pageModel.searchInfo=r()(this.searchInfo),o.Indicator.open();var t=this;this.$axios({method:"POST",url:"/Mall/Optimize/GetProducts?date="+(new Date).getTime(),transformRequest:[function(e){return e=r()(e)}],data:this.pageModel}).then(function(a){o.Indicator.close();for(var s=0;s<a.data.data.length;s++){for(var r=[],i=0;i<a.data.data[s].NVC_PARAMETERS.length&&!(r.length>=3);i++)""!=a.data.data[s].NVC_PARAMETERS[i].value&&r.push(a.data.data[s].NVC_PARAMETERS[i]);a.data.data[s].NVC_PARAMETERS=r}for(t.productTotal=a.data.total,t.productList=a.data.data,s=0;s<e.productList.length;s++)e.productList[s].NVC_COVER_IMAGE=""+e.productList[s].NVC_COVER_IMAGE,e.productList[s].NVC_LOGO=""+e.productList[s].NVC_LOGO}).catch(function(e){o.Indicator.close()})},getBrands:function(){var e=this;r()(this.searchInfo);o.Indicator.open(),this.$axios({method:"POST",url:"/Mall/Optimize/GetBrands?date="+(new Date).getTime(),transformRequest:[function(e){return e=r()(e)}],data:r()(this.searchInfo)}).then(function(t){o.Indicator.close(),e.brandList=t.data.data,e.getProducts()}).catch(function(e){o.Indicator.close()})},getClassTreeWithCount:function(){var e=this;o.Indicator.open(),this.$axios({method:"GET",url:"/Mall/Optimize/GetClassTreeWithCount?type=0&date="+(new Date).getTime(),data:{}}).then(function(t){for(var a in o.Indicator.close(),e.classTree=t.data.data,e.classTree)if(e.classTree[a].NVC_CLASS_NAME=e.classTree[a].NVC_CLASS_NAME+"("+e.classTree[a].count+")",0!=e.classTree[a].children.length)for(var s in e.classTree[a].children)if(e.classTree[a].children[s].NVC_CLASS_NAME=e.classTree[a].children[s].NVC_CLASS_NAME+"("+e.classTree[a].children[s].count+")",0!=e.classTree[a].children[s].children.length)for(var r in e.classTree[a].children[s].children)e.classTree[a].children[s].children[r].NVC_CLASS_NAME=e.classTree[a].children[s].children[r].NVC_CLASS_NAME+"("+e.classTree[a].children[s].children[r].count+")";if(void 0!==e.$route.params.code){var i=e.$route.params.code,n=e.$route.params.field;e.selectedSort=e.$route.params.name,e.classDefaultTree=e.$route.params.key.split(","),e.classCurrentTree.classField=n,e.classCurrentTree.classCode=i,e.searchInfo[e.searchInfo.length++]={field:n,value:i,opt:"1",group:"1",link:!0},e.$nextTick(function(){e.$refs.elTree.setCurrentKey(i)})}else e.selectedSort=e.classTree[0].NVC_CLASS_NAME,e.classDefaultTree.push(e.classTree[0].NVC_CODE),e.classCurrentTree.classField="NVC_ONE_CLASSCODE",e.classCurrentTree.classCode=e.classTree[0].NVC_CODE,e.searchInfo[e.searchInfo.length++]={field:"NVC_ONE_CLASSCODE",value:e.classTree[0].NVC_CODE,opt:"1",group:"1",link:!0},e.$nextTick(function(){e.$refs.elTree.setCurrentKey(e.classCurrentTree.classCode)});e.getBrands()}).catch(function(e){o.Indicator.close()})}},beforeRouteEnter:function(e,t,a){document.title="浼橀€変骇鍝� - 涓熆浜戝钩鍙�",a()}},h={render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{attrs:{id:"preferredProducts"}},[s("CommonLoginTop"),e._v(" "),s("LogoNavbar",{attrs:{tabActive:"0"}}),e._v(" "),s("img",{staticStyle:{width:"100%"},attrs:{src:a("nxPH")}}),e._v(" "),s("TopRow",{attrs:{activeId:"2"}}),e._v(" "),s("div",{staticStyle:{width:"1200px",margin:"30px auto"}},[s("el-container",[s("el-aside",{staticStyle:{border:"1px solid #ebebeb","margin-right":"10px","font-size":"14px",background:"white"},attrs:{width:"280px"}},[s("p",{staticStyle:{height:"50px","line-height":"50px","font-weight":"bold",background:"#f0f5fb",padding:"0 15px","font-size":"18px",color:"#466bb2"}},[e._v("\n            鐩稿叧鍒嗙被")]),e._v(" "),s("div",{staticClass:"related-categories"},[s("el-tree",{ref:"elTree",attrs:{data:e.classTree,props:e.defaultProps,"node-key":"NVC_CODE","default-expanded-keys":e.classDefaultTree,"highlight-current":""},on:{"node-click":e.handleNodeClick}})],1)]),e._v(" "),s("el-main",[s("div",{staticStyle:{"padding-bottom":"10px","background-color":"#FFFFFF",border:"1px solid #ebebeb"}},[s("div",{staticClass:"brand-head"},[e._v(e._s(e.selectedSort))]),e._v(" "),s("div",{staticClass:"brand-class"},[s("div",{staticStyle:{width:"128px","margin-top":"8px",color:"#5e6d82","padding-left":"10px"}},[e._v("鍝佺墝鍚嶇О锛�")]),e._v(" "),s("div",{staticStyle:{width:"900px"}},[s("ul",[s("li",{staticClass:"brand-name",class:{"brand-name-active":-1==e.isAllBrand},on:{click:e.selectedAllBrands}},[s("a",[e._v("鍏ㄩ儴")])]),e._v(" "),e._l(e.brandList,function(t,a){return s("li",{key:a,staticClass:"brand-name",class:{"brand-name-active":-1!=e.brandTags.indexOf(t.NVC_BRAND_NAME)},on:{click:function(a){return e.selectedBrandName(t)}}},[s("a",[e._v(e._s(t.NVC_BRAND_NAME))])])})],2)])]),e._v(" "),e.brandTags.length>0?s("div",{staticClass:"brand-tag"},[s("span",{staticStyle:{"line-height":"35px"}},[e._v("宸蹭负鎮ㄧ瓫閫夛細")]),e._v(" "),s("span",e._l(e.brandTags,function(t,a){return s("el-tag",{key:a,staticStyle:{"margin-left":"8px"},attrs:{closable:"","disable-transitions":!1},on:{close:function(a){return e.brandTagClose(t)},click:function(a){return e.brandTagClick(t)}}},[e._v("\n                  "+e._s(t)+"\n                ")])}),1)]):e._e()]),e._v(" "),s("div",{staticStyle:{display:"flex",background:"white","margin-top":"10px","font-size":"14px",padding:"8px 0",border:"1px solid #ebebeb",color:"#5e6d82"}},[s("div",{staticStyle:{"margin-left":"30px","line-height":"40px"}},[e._v("鍦ㄧ粨鏋滀腑鎼滅储锛�")]),e._v(" "),s("el-input",{staticStyle:{"margin-right":"10px",width:"60%","text-indent":"6px"},attrs:{placeholder:"璇疯緭鍏ヤ骇鍝佸悕绉�"},model:{value:e.searchValue,callback:function(t){e.searchValue=t},expression:"searchValue"}}),e._v(" "),s("el-button",{attrs:{icon:"el-icon-search",circle:""},on:{click:e.goSearch}})],1),e._v(" "),s("div",{staticStyle:{background:"white","margin-top":"10px","font-size":"14px",padding:"8px 0",border:"1px solid #ebebeb",color:"#5e6d82"}},[s("div",{staticStyle:{"margin-left":"30px",height:"30px"}},[e._v("绗﹀悎鏉′欢鐨勫叡"),s("span",{staticStyle:{color:"red","font-weight":"bold"}},[e._v(e._s(e.productTotal))]),e._v("鏉′骇鍝乗n            ")]),e._v(" "),s("div",{staticStyle:{"padding-top":"10px"}},[e._l(e.productList,function(t,a){return s("div",{key:a,staticClass:"product-content-list"},[s("div",{staticStyle:{"flex-shrink":"0"}},[s("img",{staticClass:"product-img",attrs:{src:t.NVC_COVER_IMAGE}})]),e._v(" "),s("div",{staticStyle:{"flex-shrink":"0",width:"50%"}},[s("div",{staticStyle:{"font-size":"16px","font-weight":"700",padding:"15px"}},[e._v("\n                    "+e._s(t.NVC_PRODUCT_NAME)+"\n                      "),0==t.DCL_PRICE?s("span",[e._v("\n                        [闈㈣]\n                      ")]):s("span",{staticStyle:{color:"red"}},[e._v("\n                        ["+e._s(t.DCL_PRICE+"鍏�")+"]\n                      ")])]),e._v(" "),s("div",{staticStyle:{"font-size":"12px","padding-left":"25px"}},e._l(t.NVC_PARAMETERS,function(t,a){return s("div",{key:a,staticStyle:{overflow:"hidden","white-space":"nowrap","text-overflow":"ellipsis"},attrs:{title:t.value}},[e._v("\n                      "+e._s(t.name)+"锛�"+e._s(t.value)+"\n                    ")])}),0)]),e._v(" "),s("div",{staticStyle:{"flex-shrink":"0",cursor:"pointer",margin:"60px auto 0"},on:{click:function(a){return e.goSupplier(t.NVC_SUPPLIER_ID)}}},[s("div",[s("img",{staticStyle:{width:"100px",height:"31px"},attrs:{src:t.NVC_LOGO}})]),e._v(" "),s("div",{staticStyle:{color:"#545454",display:"inline-block","font-size":"13px",width:"100%","text-align":"center"}},[e._v("\n                    ["+e._s(t.NVC_BRAND_NAME)+"]\n                  ")])]),e._v(" "),s("div",{staticStyle:{"flex-shrink":"0",height:"100%","line-height":"165px",padding:"0 20px"}},[s("el-button",{attrs:{type:"primary",plain:""},on:{click:function(a){return e.goProduct(t)}}},[e._v("鏌ョ湅璇︽儏")])],1)])}),e._v(" "),s("div",[s("el-pagination",{staticStyle:{"text-align":"center"},attrs:{"current-page":e.productPage,"page-size":12,layout:"total, prev, pager, next",total:e.productTotal},on:{"current-change":e.handleCurrentChange,"update:currentPage":function(t){e.productPage=t},"update:current-page":function(t){e.productPage=t}}})],1)],2)])])],1)],1),e._v(" "),s("DivButtom")],1)},staticRenderFns:[]};var u=a("VU/8")(d,h,!1,function(e){a("mq3v"),a("43Bj")},"data-v-2afdcbb2",null);t.default=u.exports},mq3v:function(e,t){}});
//# sourceMappingURL=47.92b430a0ec3e500763f9.js.map