;(function(){function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);enumerableOnly&&(symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable;})),keys.push.apply(keys,symbols);}return keys;}function _objectSpread(target){for(var i=1;i0&&_this2.onBuyClick(item);}},null)])])]);}});var tabList="_tabList_1we34_1";var goodsList="_goodsList_1we34_6";var styles={tabList:tabList,goodsList:goodsList};function _isSlot(s){return typeof s==='function'||Object.prototype.toString.call(s)==='[object Object]'&&!isVNode(s);}var TabList=exports('T',defineComponent({name:'tab-list',props:{// 商品分类ID typeId:{type:Number,default:0},// 商品类型ID productAttributeCategoryId:{type:Number,default:0},// 品牌 ID brandId:{type:Number,default:0}},data:function data(){return{list:[],dataShow:true,// 判断是否有数据 loading:false,finished:false,params:{productCategoryId:null,productAttributeCategoryId:null,brandId:null,pageNum:1,pageSize:20},addGoodsShow:false,selectGoodsItem:{}};},mounted:function mounted(){this.getList();},methods:{onSearch:function onSearch(){this.dataShow=true;this.loading=false;this.finished=false;this.list=[];this.params.pageNum=1;this.getList();},getList:function getList(){var _this3=this;return _asyncToGenerator(/*#__PURE__*/regeneratorRuntime.mark(function _callee(){var params,res,result;return regeneratorRuntime.wrap(function _callee$(_context){while(1){switch(_context.prev=_context.next){case 0:_context.prev=0;params=_this3.params;_this3.typeId&&(params.productCategoryId=_this3.typeId);_this3.productAttributeCategoryId&&(params.productAttributeCategoryId=_this3.productAttributeCategoryId);_this3.brandId&&(params.brandId=_this3.brandId);_context.next=7;return request.post('/api-mall-portal/product/search',{data:_objectSpread({},params)});case 7:res=_context.sent;_this3.loading=false;result=res.data||{};// 处理重复请求数据 if(!(_this3.list.length>0&&result.pageNum===1)){_context.next=12;break;}return _context.abrupt("return");case 12:_this3.list=_this3.list.concat(result.list||[]);_this3.finished=result.pageNum>=result.totalPage;_this3.params.pageNum=result.pageNum+1;_this3.dataShow=_this3.list.length>0;_context.next=22;break;case 18:_context.prev=18;_context.t0=_context["catch"](0);_this3.dataShow=false;_this3.finished=true;case 22:case"end":return _context.stop();}}},_callee,null,[[0,18]]);}))();},onDetailClick:function onDetailClick(item){this.$router.push({path:'/goodsDetail',query:{id:item.id}});},onBuyClick:function onBuyClick(item){this.selectGoodsItem=item;this.addGoodsShow=true;}},render:function render(){var _this4=this;var _slot;return createVNode("div",{"class":styles.tabList},[this.dataShow?createVNode(List,{"loading":this.loading,"onUpdate:loading":function onUpdateLoading($event){return _this4.loading=$event;},"finished":this.finished,"finishedText":" ","immediateCheck":false,"class":[styles.goodsList,'mb12'],"onLoad":this.getList},_isSlot(_slot=this.list.map(function(item){return createVNode(Goods,{"style":{marginTop:'12px'},"item":item,"onItemClick":_this4.onDetailClick,"onBuyClick":_this4.onBuyClick},null);}))?_slot:{default:function _default(){return[_slot];}}):createVNode(ColResult,{"btnStatus":false,"classImgSize":"SMALL","tips":"暂无商品"},null),createVNode(Popup,{"show":this.addGoodsShow,"closeable":true,"position":"bottom","round":true,"onClose":function onClose(){_this4.addGoodsShow=false;}},{default:function _default(){return[createVNode(AddGoodsCart,{"item":_this4.selectGoodsItem},null)];}})]);}}));}};});})();