index-6eb08d2a.js 2.6 KB

1
  1. import{d as z,r as l,O as w,z as B,o,j,w as C,k as x,ax as s,a as t,c as i,F as L,C as I,i as b,l as v,a0 as P,t as g,a_ as U,b5 as E,__tla as F}from"./index-20ebf448.js";import{E as G,__tla as O}from"./el-image-46b9dd8b.js";import{__tla as S}from"./el-image-viewer-b5599f30.js";import{f as W,__tla as q}from"./spu-c43b7da0.js";let R,A=Promise.all([(()=>{try{return F}catch{}})(),(()=>{try{return O}catch{}})(),(()=>{try{return S}catch{}})(),(()=>{try{return q}catch{}})()]).then(async()=>{let m;m={key:0,class:"absolute left-0 top-0 z-1 items-center justify-center"},R=z({name:"ProductList",__name:"index",props:{property:{}},setup($){const r=$,p=l([]);w(()=>r.property.spuIds,async()=>{p.value=await W(r.property.spuIds)},{immediate:!0,deep:!0});const u=l(375),_=l(),a=l(2),c=l("100%"),d=l("0"),y=l("");return w(()=>[r.property,u,p.value.length],()=>{a.value=r.property.layoutType==="twoCol"?2:3;const e=(u.value-r.property.space*(a.value-1))/a.value;d.value=a.value===2?"64px":`${e}px`,r.property.layoutType==="horizSwiper"?(y.value=`repeat(auto-fill, ${e}px)`,c.value=e*p.value.length+r.property.space*(p.value.length-1)+"px"):(y.value=`repeat(${a.value}, auto)`,c.value="100%")},{immediate:!0,deep:!0}),B(()=>{var e,n;u.value=((n=(e=_.value)==null?void 0:e.wrapRef)==null?void 0:n.offsetWidth)||375}),(e,n)=>{const h=G,T=E;return o(),j(T,{class:"z-1 min-h-30px","wrap-class":"w-full",ref_key:"containerRef",ref:_},{default:C(()=>[x("div",{class:"grid overflow-x-auto",style:s({gridGap:`${e.property.space}px`,gridTemplateColumns:t(y),width:t(c)})},[(o(!0),i(L,null,I(t(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:t(d),height:t(d)})},null,8,["src","style"]),x("div",{class:P(["flex flex-col gap-8px p-8px box-border",{"w-[calc(100%-64px)]":t(a)===2,"w-full":t(a)===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(t(U)(f.price)),5)):v("",!0)])],2)],4))),128))],4)]),_:1},512)}}})});export{A as __tla,R as default};