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