;(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&&_this.onBuyClick(item);}},null)])])]);}});var tabList="_tabList_1we34_1";var goodsList="_goodsList_1we34_6";var styles={tabList:tabList,goodsList:goodsList};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:''},isTab:{type:Boolean,default:false},onOpenWebView:{type:Function,default:function _default(a){}}},data:function data(){return{list:[],loading:false,finished:false,params:{productCategoryId:undefined,productAttributeCategoryId:undefined,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.finished=false;this.list=[];this.params.pageNum=1;this.getList();// list组件没有触发, 手动触发获取数据 },getList:function getList(){var _this2=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:_this2.loading=true;_context.prev=1;params=_this2.params;params.productCategoryId=_this2.typeId?_this2.typeId:undefined;// 商品分类 params.productAttributeCategoryId=_this2.productAttributeCategoryId// 商品类型 ?_this2.productAttributeCategoryId:undefined;params.brandId=_this2.brandId?_this2.brandId:undefined;// 品牌 params.sort=_this2.sort?_this2.sort:undefined;params.keyword=_this2.keyword?_this2.keyword:undefined;_context.next=10;return request.post('/api-mall-portal/product/search',{data:_objectSpread({},params)});case 10:res=_context.sent;result=res.data||{};// 处理重复请求数据 if(!(_this2.list.length>0&&result.pageNum===1)){_context.next=14;break;}return _context.abrupt("return");case 14:_this2.list=_this2.list.concat(result.list||[]);_this2.finished=result.pageNum>=result.totalPage;_this2.params.pageNum=result.pageNum+1;_context.next=22;break;case 19:_context.prev=19;_context.t0=_context["catch"](1);_this2.finished=true;case 22:_this2.loading=false;case 23:case"end":return _context.stop();}}},_callee,null,[[1,19]]);}))();},onDetailClick:function onDetailClick(item){if(this.isTab){var url=this.$router.resolve({path:'/goodsDetail',query:{id:item.id}}).fullPath;this.onOpenWebView(url);return;}this.$router.push({path:'/goodsDetail',query:{id:item.id}});},onBuyClick:function onBuyClick(item){this.selectGoodsItem=item;this.addGoodsShow=true;}},render:function render(){var _this3=this;return createVNode("div",{"class":styles.tabList},[createVNode(List,{"loading":this.loading,"onUpdate:loading":function onUpdateLoading($event){return _this3.loading=$event;},"finished":this.finished,"finishedText":"","immediateCheck":false,"class":[styles.goodsList,'mb12'],"onLoad":this.getList},{default:function _default(){return[_this3.list.length&&_this3.list.map(function(item){return createVNode(Goods,{"style":{marginTop:'12px'},"item":item,"onItemClick":_this3.onDetailClick,"onBuyClick":_this3.onBuyClick},null);})||null,!_this3.loading&&!_this3.list.length&&createVNode(ColResult,{"btnStatus":false,"classImgSize":"SMALL","tips":"暂无商品"},null)||null];}}),createVNode(Popup,{"show":this.addGoodsShow,"closeable":true,"position":"bottom","round":true,"onClose":function onClose(){_this3.addGoodsShow=false;}},{default:function _default(){return[createVNode(AddGoodsCart,{"show":_this3.addGoodsShow,"item":_this3.selectGoodsItem},null)];}})]);}}));}};});})();