index-40bf2ad8.js 2.6 KB

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