1 |
- var c=Object.defineProperty;var i=Object.getOwnPropertySymbols;var h=Object.prototype.hasOwnProperty,g=Object.prototype.propertyIsEnumerable;var a=(t,e,s)=>e in t?c(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s,l=(t,e)=>{for(var s in e||(e={}))h.call(e,s)&&a(t,s,e[s]);if(i)for(var s of i(e))g.call(e,s)&&a(t,s,e[s]);return t};import{t as p,r as m,C as f}from"./index.937d41ec.js";import{d as n,a as o,I as r,j as _,M as y,P as I}from"./vendor.75613d65.js";/* empty css */import{A as b}from"./index.3692bf2d.js";/* empty css */import{i as C}from"./icon-sell-out.98742fd0.js";const w="_goods_126oz_1",S="_goodsSection_126oz_9",k="_sellOut_126oz_14",L="_sellOutImg_126oz_25",v="_goodsImg_126oz_29",N="_goodsInfo_126oz_33",z="_goodsName_126oz_37",A="_goodsSale_126oz_43",O="_pre_126oz_48",G="_goodsPrice_126oz_51",j="_addCart_126oz_57",B="_addCartDisabled_126oz_62";var d={goods:w,goodsSection:S,sellOut:k,sellOutImg:L,goodsImg:v,goodsInfo:N,goodsName:z,goodsSale:A,pre:O,goodsPrice:G,addCart:j,addCartDisabled:B},P=n({name:"goods",props:{showAdd:{type:Boolean,default:!0},item:{type:Object,default:{}},onItemClick:{type:Function,default:t=>{}},onBuyClick:{type:Function,default:t=>{}}},render(){const t=this.item;return o("div",{class:d.goods,onClick:()=>this.onItemClick(t)},[o("div",{class:d.goodsSection},[o(r,{src:t.pic,fit:"cover",class:d.goodsImg},null),t.stock<=0&&o("div",{class:d.sellOut},[o(r,{src:C,fit:"cover",class:d.sellOutImg},null)])]),o("div",{class:d.goodsInfo},[o("div",{class:[d.goodsName,"van-ellipsis"]},[t.name]),o("div",{class:d.goodsBuy},[o("p",{class:d.goodsPrice},[o("span",{class:d.pre},[_("\uFFE5")]),p(t.price)])])])])}});const x="_tabList_1we34_1",D="_goodsList_1we34_6";var u={tabList:x,goodsList:D},E=n({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:t=>{}}},data(){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(){this.getList()},methods:{onSearch(){this.finished=!1,this.list=[],this.params.pageNum=1,this.getList()},async getList(){this.loading=!0;try{let t=this.params;t.productCategoryId=this.typeId?this.typeId:void 0,t.productAttributeCategoryId=this.productAttributeCategoryId?this.productAttributeCategoryId:void 0,t.brandId=this.brandId?this.brandId:void 0,t.sort=this.sort?this.sort:void 0,t.keyword=this.keyword?this.keyword:void 0;const s=(await m.post("/api-mall-portal/product/search",{data:l({},t)})).data||{};if(this.list.length>0&&s.pageNum===1)return;this.list=this.list.concat(s.list||[]),this.finished=s.pageNum>=s.totalPage,this.params.pageNum=s.pageNum+1}catch{this.finished=!0}this.loading=!1},onDetailClick(t){if(this.isTab){let e=this.$router.resolve({path:"/goodsDetail",query:{id:t.id}}).fullPath;this.onOpenWebView(e);return}this.$router.push({path:"/goodsDetail",query:{id:t.id}})},onBuyClick(t){this.selectGoodsItem=t,this.addGoodsShow=!0}},render(){return o("div",{class:u.tabList},[o(y,{loading:this.loading,"onUpdate:loading":t=>this.loading=t,finished:this.finished,finishedText:" ",immediateCheck:!1,class:[u.goodsList,"mb12"],onLoad:this.getList},{default:()=>[this.list.length&&this.list.map(t=>o(P,{item:t,onItemClick:this.onDetailClick,onBuyClick:this.onBuyClick,showAdd:this.showAdd},null))||null,!this.loading&&!this.list.length&&o(f,{btnStatus:!1,classImgSize:"SMALL",tips:"\u6682\u65E0\u5546\u54C1"},null)||null]}),o(I,{show:this.addGoodsShow,closeable:!0,position:"bottom",round:!0,onClose:()=>{this.addGoodsShow=!1}},{default:()=>[o(b,{show:this.addGoodsShow,item:this.selectGoodsItem},null)]})])}});export{E as T};
|