1 |
- import{d as T,r as t,w as b,b as B,o as p,A as I,B as _,C as n,aE as s,a,c as l,F as C,P as E,f as h,E as f,aa as j,D as g,a$ as z}from"./index-24b5bd0d.js";import{E as L}from"./el-image-614d8096.js";import"./el-image-viewer-d766f6eb.js";import{g as P}from"./spu-25b62903.js";import{g as U}from"./seckillActivity-ab8416b7.js";const A={key:0,class:"absolute left-0 top-0 z-1 items-center justify-center"},D=T({name:"PromotionSeckill",__name:"index",props:{property:{}},setup(R){const o=R,i=t([]);b(()=>o.property.activityId,async()=>{if(!o.property.activityId)return;const e=await U(o.property.activityId);e!=null&&e.spuId&&(i.value=[await P(e.spuId)])},{immediate:!0,deep:!0});const d=t(375),m=t(),r=t(2),v=t("100%"),c=t("0"),x=t("");return b(()=>[o.property,d,i.value.length],()=>{r.value=o.property.layoutType==="oneCol"?1:3;const e=(d.value-o.property.space*(r.value-1))/r.value;c.value=r.value===2?"64px":`${e}px`,x.value=`repeat(${r.value}, auto)`,v.value="100%"},{immediate:!0,deep:!0}),B(()=>{var e,u;d.value=((u=(e=m.value)==null?void 0:e.wrapRef)==null?void 0:u.offsetWidth)||375}),(e,u)=>{const w=L,$=z;return p(),I($,{class:"z-1 min-h-30px","wrap-class":"w-full",ref_key:"containerRef",ref:m},{default:_(()=>[n("div",{class:"grid overflow-x-auto",style:s({gridGap:`${e.property.space}px`,gridTemplateColumns:a(x),width:a(v)})},[(p(!0),l(C,null,E(a(i),(y,k)=>(p(),l("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?(p(),l("div",A,[h(w,{fit:"cover",src:e.property.badge.imgUrl,class:"h-26px w-38px"},null,8,["src"])])):f("",!0),h(w,{fit:"cover",src:y.picUrl,style:s({width:a(c),height:a(c)})},null,8,["src","style"]),n("div",{class:j(["flex flex-col gap-8px p-8px box-border",{"w-[calc(100%-64px)]":a(r)===2,"w-full":a(r)===3}])},[e.property.fields.name.show?(p(),l("div",{key:0,class:"truncate text-12px",style:s({color:e.property.fields.name.color})},g(y.name),5)):f("",!0),n("div",null,[e.property.fields.price.show?(p(),l("span",{key:0,class:"text-12px",style:s({color:e.property.fields.price.color})}," \uFFE5"+g(y.price),5)):f("",!0)])],2)],4))),128))],4)]),_:1},512)}}});export{D as default};
|