;(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:{showAdd:{type:Boolean,default:true},// 商品分类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,{"item":item,"onItemClick":_this3.onDetailClick,"onBuyClick":_this3.onBuyClick,"showAdd":_this3.showAdd},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)];}})]);}}));var iconSearch=exports('i',"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAgCAMAAAAynjhNAAAAAXNSR0IArs4c6QAAAddQTFRFAAAAAP//AP+AAL+AAL+/AMyZANWqIL+fIN+fIN+/HMaqGsyzF9GiF9G5FMSxIsyqIM+vHtK0HMaqHNWqG8muINWqHMaqHNCqHNCzG8itGsqnGc6tIc6tHsutHM+s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