index-legacy.2d030016.js 6.3 KB

1
  1. !function(){function e(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,i)}return o}function t(t){for(var i=1;i<arguments.length;i++){var n=null!=arguments[i]?arguments[i]:{};i%2?e(Object(n),!0).forEach((function(e){o(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):e(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function o(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}function i(e,t,o,i,n,r,s){try{var a=e[r](s),d=a.value}catch(l){return void o(l)}a.done?t(d):Promise.resolve(d).then(i,n)}var n=document.createElement("style");n.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(n),System.register(["./index-legacy.b2528a15.js","./index-legacy.9cbe7ce8.js","./index-legacy.439ea58a.js","./index-legacy.ca42ae97.js","./icon-sell-out-legacy.ae9d997a.js"],(function(e){"use strict";var o,n,r,s,a,d,l,c,u,g,_;return{setters:[function(e){o=e.d,n=e.i,r=e.A,s=e.by,a=e.e,d=e.C,l=e.aT},function(e){c=e.L},function(e){u=e.A},function(e){g=e.I},function(e){_=e.i}],execute:function(){var f={goods:"_goods_126oz_1",goodsSection:"_goodsSection_126oz_9",sellOut:"_sellOut_126oz_14",sellOutImg:"_sellOutImg_126oz_25",goodsImg:"_goodsImg_126oz_29",goodsInfo:"_goodsInfo_126oz_33",goodsName:"_goodsName_126oz_37",goodsSale:"_goodsSale_126oz_43",pre:"_pre_126oz_48",goodsPrice:"_goodsPrice_126oz_51",addCart:"_addCart_126oz_57",addCartDisabled:"_addCartDisabled_126oz_62"},p=o({name:"goods",props:{showAdd:{type:Boolean,default:!0},item:{type:Object,default:{}},onItemClick:{type:Function,default:function(e){}},onBuyClick:{type:Function,default:function(e){}}},render:function(){var e=this,t=this.item;return n("div",{class:f.goods,onClick:function(){return e.onItemClick(t)}},[n("div",{class:f.goodsSection},[n(g,{src:t.pic,fit:"cover",class:f.goodsImg},null),t.stock<=0&&n("div",{class:f.sellOut},[n(g,{src:_,fit:"cover",class:f.sellOutImg},null)])]),n("div",{class:f.goodsInfo},[n("div",{class:[f.goodsName,"van-ellipsis"]},[t.name]),n("div",{class:f.goodsBuy},[n("p",{class:f.goodsPrice},[n("span",{class:f.pre},[r("¥")]),s(t.price)])])])])}}),m="_tabList_1we34_1",h="_goodsList_1we34_6";e("T",o({name:"tab-list",props:{showAdd:{type:Boolean,default:!0},typeId:{type:Number,default:0},productAttributeCategoryId:{type:Number,default:0},brandId:{type:Number,default:0},sort:{type:Number,defalut:0},keyword:{type:String,defalut:""},isTab:{type:Boolean,default:!1},onOpenWebView:{type:Function,default:function(e){}}},data:function(){return{list:[],loading:!1,finished:!1,params:{productCategoryId:void 0,productAttributeCategoryId:void 0,brandId:null,sort:null,keyword:"",pageNum:1,pageSize:20},addGoodsShow:!1,selectGoodsItem:{}}},mounted:function(){this.getList()},methods:{onSearch:function(){this.finished=!1,this.list=[],this.params.pageNum=1,this.getList()},getList:function(){var e,o=this;return(e=regeneratorRuntime.mark((function e(){var i,n,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o.loading=!0,e.prev=1,(i=o.params).productCategoryId=o.typeId?o.typeId:void 0,i.productAttributeCategoryId=o.productAttributeCategoryId?o.productAttributeCategoryId:void 0,i.brandId=o.brandId?o.brandId:void 0,i.sort=o.sort?o.sort:void 0,i.keyword=o.keyword?o.keyword:void 0,e.next=10,a.post("/api-mall-portal/product/search",{data:t({},i)});case 10:if(n=e.sent,r=n.data||{},!(o.list.length>0&&1===r.pageNum)){e.next=14;break}return e.abrupt("return");case 14:o.list=o.list.concat(r.list||[]),o.finished=r.pageNum>=r.totalPage,o.params.pageNum=r.pageNum+1,e.next=22;break;case 19:e.prev=19,e.t0=e.catch(1),o.finished=!0;case 22:o.loading=!1;case 23:case"end":return e.stop()}}),e,null,[[1,19]])})),function(){var t=this,o=arguments;return new Promise((function(n,r){var s=e.apply(t,o);function a(e){i(s,n,r,a,d,"next",e)}function d(e){i(s,n,r,a,d,"throw",e)}a(void 0)}))})()},onDetailClick:function(e){if(this.isTab){var t=this.$router.resolve({path:"/goodsDetail",query:{id:e.id}}).fullPath;this.onOpenWebView(t)}else this.$router.push({path:"/goodsDetail",query:{id:e.id}})},onBuyClick:function(e){this.selectGoodsItem=e,this.addGoodsShow=!0}},render:function(){var e=this;return n("div",{class:m},[n(c,{loading:this.loading,"onUpdate:loading":function(t){return e.loading=t},finished:this.finished,finishedText:" ",immediateCheck:!1,class:[h,"mb12"],onLoad:this.getList},{default:function(){return[e.list.length&&e.list.map((function(t){return n(p,{item:t,onItemClick:e.onDetailClick,onBuyClick:e.onBuyClick,showAdd:e.showAdd},null)}))||null,!e.loading&&!e.list.length&&n(d,{btnStatus:!1,classImgSize:"SMALL",tips:"暂无商品"},null)||null]}}),n(l,{show:this.addGoodsShow,closeable:!0,position:"bottom",round:!0,onClose:function(){e.addGoodsShow=!1}},{default:function(){return[n(u,{show:e.addGoodsShow,item:e.selectGoodsItem},null)]}})])}}))}}}))}();