;(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&&_this3.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},sort:{type:Number,defalut:0},keyword:{type:String,defalut:''}},data:function data(){return{list:[],dataShow:true,// 判断是否有数据 loading:false,finished:false,params:{productCategoryId:null,productAttributeCategoryId:null,brandId:null,sort:null,// 1->按新品;2->按销量;3->价格从低到高;4->价格从高到低 keyword:'',pageNum:1,pageSize:20},addGoodsShow:false,selectGoodsItem:{}};},mounted:function mounted(){this.getList();},methods:{onSearch:function onSearch(){this.loading=false;this.finished=false;this.list=[];this.params.pageNum=1;if(!this.dataShow)this.getList();// list组件没有触发, 手动触发获取数据 this.dataShow=true;// this.getList() },getList:function getList(){var _this4=this;return _asyncToGenerator(/*#__PURE__*/regeneratorRuntime.mark(function _callee2(){var params,res,result;return regeneratorRuntime.wrap(function _callee2$(_context2){while(1){switch(_context2.prev=_context2.next){case 0:_context2.prev=0;params=_this4.params;// this.typeId && (params.productCategoryId = this.typeId) params.productCategoryId=_this4.typeId?_this4.typeId:undefined;params.productAttributeCategoryId=_this4.productAttributeCategoryId?_this4.productAttributeCategoryId:undefined;params.brandId=_this4.brandId?_this4.brandId:undefined;params.sort=_this4.sort?_this4.sort:undefined;params.keyword=_this4.keyword?_this4.keyword:undefined;_context2.next=9;return request.post('/api-mall-portal/product/search',{data:_objectSpread({},params)});case 9:res=_context2.sent;_this4.loading=false;result=res.data||{};// 处理重复请求数据 if(!(_this4.list.length>0&&result.pageNum===1)){_context2.next=14;break;}return _context2.abrupt("return");case 14:_this4.list=_this4.list.concat(result.list||[]);_this4.finished=result.pageNum>=result.totalPage;_this4.params.pageNum=result.pageNum+1;_this4.dataShow=_this4.list.length>0;_context2.next=24;break;case 20:_context2.prev=20;_context2.t0=_context2["catch"](0);_this4.dataShow=false;_this4.finished=true;case 24:case"end":return _context2.stop();}}},_callee2,null,[[0,20]]);}))();},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 _this5=this;var _slot;return createVNode("div",{"class":styles.tabList},[this.dataShow?createVNode(List,{"loading":this.loading,"onUpdate:loading":function onUpdateLoading($event){return _this5.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":_this5.onDetailClick,"onBuyClick":_this5.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(){_this5.addGoodsShow=false;}},{default:function _default(){return[createVNode(AddGoodsCart,{"item":_this5.selectGoodsItem},null)];}})]);}}));}};});})();