index-e7e69857.js 2.6 KB

1
  1. import{d as B,r as a,K as w,k as z,o,q as L,w as j,g as x,at as s,a as l,c as i,F as C,n as I,f as b,O as v,Y as P,t as g,bn as U,__tla as q}from"./index-2eab2d23.js";import{E,__tla as F}from"./el-image-2171f3ff.js";import{__tla as G}from"./el-image-viewer-5d14bc77.js";import{e as K,__tla as O}from"./spu-73047b60.js";let R,S=Promise.all([(()=>{try{return q}catch{}})(),(()=>{try{return F}catch{}})(),(()=>{try{return G}catch{}})(),(()=>{try{return O}catch{}})()]).then(async()=>{let m;m={key:0,class:"absolute left-0 top-0 z-1 items-center justify-center"},R=B({name:"ProductList",__name:"index",props:{property:{}},setup($){const t=$,p=a([]);w(()=>t.property.spuIds,async()=>{p.value=await K(t.property.spuIds)},{immediate:!0,deep:!0});const u=a(375),_=a(),r=a(2),c=a("100%"),d=a("0"),y=a("");return w(()=>[t.property,u,p.value.length],()=>{r.value=t.property.layoutType==="twoCol"?2:3;const e=(u.value-t.property.space*(r.value-1))/r.value;d.value=r.value===2?"64px":`${e}px`,t.property.layoutType==="horizSwiper"?(y.value=`repeat(auto-fill, ${e}px)`,c.value=e*p.value.length+t.property.space*(p.value.length-1)+"px"):(y.value=`repeat(${r.value}, auto)`,c.value="100%")},{immediate:!0,deep:!0}),z(()=>{var e,n;u.value=((n=(e=_.value)==null?void 0:e.wrapRef)==null?void 0:n.offsetWidth)||375}),(e,n)=>{const h=E,T=U;return o(),L(T,{class:"z-1 min-h-30px","wrap-class":"w-full",ref_key:"containerRef",ref:_},{default:j(()=>[x("div",{class:"grid overflow-x-auto",style:s({gridGap:`${e.property.space}px`,gridTemplateColumns:l(y),width:l(c)})},[(o(!0),i(C,null,I(l(p),(f,k)=>(o(),i("div",{class:"relative box-content flex flex-row flex-wrap overflow-hidden bg-white",style:s({borderTopLeftRadius:`${e.property.borderRadiusTop}px`,borderTopRightRadius:`${e.property.borderRadiusTop}px`,borderBottomLeftRadius:`${e.property.borderRadiusBottom}px`,borderBottomRightRadius:`${e.property.borderRadiusBottom}px`}),key:k},[e.property.badge.show?(o(),i("div",m,[b(h,{fit:"cover",src:e.property.badge.imgUrl,class:"h-26px w-38px"},null,8,["src"])])):v("",!0),b(h,{fit:"cover",src:f.picUrl,style:s({width:l(d),height:l(d)})},null,8,["src","style"]),x("div",{class:P(["flex flex-col gap-8px p-8px box-border",{"w-[calc(100%-64px)]":l(r)===2,"w-full":l(r)===3}])},[e.property.fields.name.show?(o(),i("div",{key:0,class:"truncate text-12px",style:s({color:e.property.fields.name.color})},g(f.name),5)):v("",!0),x("div",null,[e.property.fields.price.show?(o(),i("span",{key:0,class:"text-12px",style:s({color:e.property.fields.price.color})}," \uFFE5"+g(f.price),5)):v("",!0)])],2)],4))),128))],4)]),_:1},512)}}})});export{S as __tla,R as default};