icon_search-legacy.f720f3bd.js 13 KB

12345678910
  1. ;(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;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?ownKeys(Object(source),!0).forEach(function(key){_defineProperty(target,key,source[key]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(target,Object.getOwnPropertyDescriptors(source)):ownKeys(Object(source)).forEach(function(key){Object.defineProperty(target,key,Object.getOwnPropertyDescriptor(source,key));});}return target;}function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg);var value=info.value;}catch(error){reject(error);return;}if(info.done){resolve(value);}else{Promise.resolve(value).then(_next,_throw);}}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value);}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err);}_next(undefined);});};}var __vite_style__=document.createElement('style');__vite_style__.innerHTML="._goods_126oz_1{width:4.48rem;background:#ffffff;border-radius:.21333rem;overflow:hidden;margin-bottom:.37333rem;--van-image-placeholder-background-color: #f1f1f1}._goodsSection_126oz_9{position:relative;height:4.48rem;width:100%}._goodsSection_126oz_9 ._sellOut_126oz_14{display:flex;align-items:center;justify-content:center;position:absolute;top:0;left:0;right:0;bottom:0;background:rgba(0,0,0,.2)}._goodsSection_126oz_9 ._sellOut_126oz_14 ._sellOutImg_126oz_25{width:2.45333rem;height:2.45333rem}._goodsImg_126oz_29{width:100%;height:4.48rem}._goodsInfo_126oz_33{position:relative;padding:.37333rem .26667rem .26667rem}._goodsInfo_126oz_33 ._goodsName_126oz_37{font-size:.37333rem;color:#333;line-height:.53333rem;padding-bottom:.16rem}._goodsSale_126oz_43{font-size:.32rem;color:#999;line-height:.53333rem}._pre_126oz_48{font-size:.32rem}._goodsPrice_126oz_51{font-size:.48rem;font-weight:700;color:#fb1c00;line-height:.64rem}._addCart_126oz_57{position:absolute;bottom:.32rem;right:.32rem}._addCartDisabled_126oz_62 .van-icon__image{filter:grayscale(100%)}._tabList_1we34_1 .van-list__loading,._tabList_1we34_1 .van-list__finished-text,._tabList_1we34_1 .van-list__error-text{width:100%}._goodsList_1we34_6{display:flex;flex-wrap:wrap;justify-content:space-between;margin:0 .37333rem}\n";document.head.appendChild(__vite_style__);System.register(['./index-legacy.5deccbb1.js','./vendor-legacy.73abbe39.js','./index-legacy.8581423a.js','./index-legacy.aa973075.js','./index-legacy.f25f109a4.js','./index-legacy.0533982c.js'],function(exports){'use strict';var moneyFormat,request,ColResult,defineComponent,createVNode,Image,createTextVNode,Icon,List,Popup,AddGoodsCart,iconSellOut;return{setters:[function(module){moneyFormat=module.m;request=module.r;ColResult=module.C;},function(module){defineComponent=module.d;createVNode=module.b;Image=module.I;createTextVNode=module.j;Icon=module.q;List=module.t;Popup=module.P;},function(){},function(module){AddGoodsCart=module.A;},function(){},function(module){iconSellOut=module.i;}],execute:function execute(){var iconAddCart="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACwAAAAsCAYAAAAehFoBAAAAAXNSR0IArs4c6QAABv5JREFUWMO1mWtoHFUUx39ndlPdbjZWE1ub+EDSVmpq41uQanwQSOurRKEtCAZR2lTwhX5QNJakiKL4QdBWQYyoNAot+KiKASW2FkpbNWBEaqNNTarWqu1uamxN5vhh9nFn5s7s2mog7Myde88993/+59xzzxVO4E/fu2Q6RyevIuG0INKEMA+kDiGDACI54CCwG5EhVAbQqS1y064/j3dOOS5F317YhpPoQLgZNIWIIU3IK5v/Nd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goodsSection="_goodsSection_126oz_9";var sellOut="_sellOut_126oz_14";var sellOutImg="_sellOutImg_126oz_25";var goodsImg="_goodsImg_126oz_29";var goodsInfo="_goodsInfo_126oz_33";var goodsName="_goodsName_126oz_37";var goodsSale="_goodsSale_126oz_43";var pre="_pre_126oz_48";var goodsPrice="_goodsPrice_126oz_51";var addCart="_addCart_126oz_57";var addCartDisabled="_addCartDisabled_126oz_62";var styles$1={goods:goods,goodsSection:goodsSection,sellOut:sellOut,sellOutImg:sellOutImg,goodsImg:goodsImg,goodsInfo:goodsInfo,goodsName:goodsName,goodsSale:goodsSale,pre:pre,goodsPrice:goodsPrice,addCart:addCart,addCartDisabled:addCartDisabled};var Goods=defineComponent({name:'goods',props:{showAdd:{type:Boolean,default:true},item:{type:Object,default:{}},onItemClick:{type:Function,default:function _default(item){}},onBuyClick:{type:Function,default:function _default(item){}}},render:function render(){var _this=this;var item=this.item;return createVNode("div",{"class":styles$1.goods,"onClick":function onClick(){return _this.onItemClick(item);}},[createVNode("div",{"class":styles$1.goodsSection},[createVNode(Image,{"src":item.pic,"fit":"cover","class":styles$1.goodsImg},null),item.stock<=0&&createVNode("div",{"class":styles$1.sellOut},[createVNode(Image,{"src":iconSellOut,"fit":"cover","class":styles$1.sellOutImg},null)])]),createVNode("div",{"class":styles$1.goodsInfo},[createVNode("div",{"class":[styles$1.goodsName,'van-ellipsis']},[item.name]),createVNode("div",{"class":styles$1.goodsBuy},[createVNode("p",{"class":styles$1.goodsPrice},[createVNode("span",{"class":styles$1.pre},[createTextVNode("\uFFE5")]),moneyFormat(item.price)]),this.showAdd&&createVNode(Icon,{"class":[styles$1.addCart,item.stock<=0&&styles$1.addCartDisabled],"name":iconAddCart,"size":22,"onClick":function onClick(e){e.stopPropagation();item.stock>0&&_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
  2. typeId:{type:Number,default:0},// 商品类型ID
  3. productAttributeCategoryId:{type:Number,default:0},// 品牌 ID
  4. 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->价格从高到低
  5. 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组件没有触发, 手动触发获取数据
  6. },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;// 商品分类
  7. params.productAttributeCategoryId=_this2.productAttributeCategoryId// 商品类型
  8. ?_this2.productAttributeCategoryId:undefined;params.brandId=_this2.brandId?_this2.brandId:undefined;// 品牌
  9. 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||{};// 处理重复请求数据
  10. 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+sG9CuH82uHcuuHM2sHNOsG86oG86uH9CsHs2qHc6sHc+tHMuqHNCvH8qrHMqqG8ytH9CtH82uHs6tHsuqHc2sH86vH8ytHs6tHc6rHs6tHc2uH86tHs2tHc6sHcyrH82sHsyrHs6tHs6sHs6uHs2tHc2sH86tH8+uHs2tHs6uHsysHs6sHs2rHc6tH82tHs6tHs6uHs+tHs2sH82sHs2tHc6tHc2sH82rHs6tHs2sHc6tHc2sH8+tHsyrHs2sH86uHs2tHs6tHc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