1 |
- import{d as R,r as b,w as B,o as r,c as o,F as I,P,aG as l,f as g,E as s,C as y,ac as c,D as a,a as d,dx as _,A as S,__tla as $}from"./index-c2da86da.js";import{E,__tla as L}from"./el-image-6dce49fe.js";import{__tla as U}from"./el-image-viewer-629c4c05.js";import{h as j,__tla as z}from"./spu-fc6ed430.js";let v,A=Promise.all([(()=>{try{return $}catch{}})(),(()=>{try{return L}catch{}})(),(()=>{try{return U}catch{}})(),(()=>{try{return z}catch{}})()]).then(async()=>{let u,x,f;u={key:0,class:"absolute left-0 top-0 z-1 items-center justify-center"},x={class:"text-12px"},f={class:"absolute bottom-8px right-8px"},v=R({name:"ProductCard",__name:"index",props:{property:{}},setup(k){const p=k,m=b([]);B(()=>p.property.spuIds,async()=>{m.value=await j(p.property.spuIds)},{immediate:!0,deep:!0});const C=t=>{const i=p.property.layoutType==="twoCol"?2:1;return{marginLeft:t%i==0?"0":p.property.space+"px",marginTop:t<i?"0":p.property.space+"px"}},h=b(),T=()=>{let t="100%";return p.property.layoutType==="twoCol"&&(t=(h.value.offsetWidth-p.property.space)/2+"px"),{width:t}};return(t,i)=>{const n=E;return r(),o("div",{class:c("box-content min-h-30px w-full flex flex-row flex-wrap"),ref_key:"containerRef",ref:h},[(r(!0),o(I,null,P(d(m),(e,w)=>(r(),o("div",{class:"relative box-content flex flex-row flex-wrap overflow-hidden bg-white",style:l({...C(w),...T(),borderTopLeftRadius:`${t.property.borderRadiusTop}px`,borderTopRightRadius:`${t.property.borderRadiusTop}px`,borderBottomLeftRadius:`${t.property.borderRadiusBottom}px`,borderBottomRightRadius:`${t.property.borderRadiusBottom}px`}),key:w},[t.property.badge.show?(r(),o("div",u,[g(n,{fit:"cover",src:t.property.badge.imgUrl,class:"h-26px w-38px"},null,8,["src"])])):s("",!0),y("div",{class:c(["h-140px",{"w-full":t.property.layoutType!=="oneColSmallImg","w-140px":t.property.layoutType==="oneColSmallImg"}])},[g(n,{fit:"cover",class:"h-full w-full",src:e.picUrl},null,8,["src"])],2),y("div",{class:c([" flex flex-col gap-8px p-8px box-border",{"w-full":t.property.layoutType!=="oneColSmallImg","w-[calc(100%-140px-16px)]":t.property.layoutType==="oneColSmallImg"}])},[t.property.fields.name.show?(r(),o("div",{key:0,class:c(["text-14px ",{truncate:t.property.layoutType!=="oneColSmallImg","overflow-ellipsis line-clamp-2":t.property.layoutType==="oneColSmallImg"}]),style:l({color:t.property.fields.name.color})},a(e.name),7)):s("",!0),t.property.fields.introduction.show?(r(),o("div",{key:1,class:"truncate text-12px",style:l({color:t.property.fields.introduction.color})},a(e.introduction),5)):s("",!0),y("div",null,[t.property.fields.price.show?(r(),o("span",{key:0,class:"text-16px",style:l({color:t.property.fields.price.color})}," \uFFE5"+a(d(_)(e.price)),5)):s("",!0),t.property.fields.marketPrice.show&&e.marketPrice?(r(),o("span",{key:1,class:"ml-4px text-10px line-through",style:l({color:t.property.fields.marketPrice.color})},"\uFFE5"+a(d(_)(e.marketPrice)),5)):s("",!0)]),y("div",x,[t.property.fields.salesCount.show?(r(),o("span",{key:0,style:l({color:t.property.fields.salesCount.color})}," \u5DF2\u552E"+a((e.salesCount||0)+(e.virtualSalesCount||0))+"\u4EF6 ",5)):s("",!0),t.property.fields.stock.show?(r(),o("span",{key:1,style:l({color:t.property.fields.stock.color})}," \u5E93\u5B58"+a(e.stock||0),5)):s("",!0)])],2),y("div",f,[t.property.btnBuy.type==="text"?(r(),o("span",{key:0,class:"rounded-full p-x-12px p-y-4px text-12px text-white",style:l({background:`linear-gradient(to right, ${t.property.btnBuy.bgBeginColor}, ${t.property.btnBuy.bgEndColor}`})},a(t.property.btnBuy.text),5)):(r(),S(n,{key:1,class:"h-28px w-28px rounded-full",fit:"cover",src:t.property.btnBuy.imgUrl},null,8,["src"]))])],4))),128))],512)}}})});export{A as __tla,v as default};
|