index-eab77904.js 3.7 KB

1
  1. import{d as R,r as b,O as B,o as r,c as o,F as I,C as S,ax as l,i as _,l as s,k as y,a0 as i,t as a,a as u,a_ as g,j as P,__tla as $}from"./index-20ebf448.js";import{E as L,__tla as U}from"./el-image-46b9dd8b.js";import{__tla as j}from"./el-image-viewer-b5599f30.js";import{f as E,__tla as z}from"./spu-c43b7da0.js";let k,F=Promise.all([(()=>{try{return $}catch{}})(),(()=>{try{return U}catch{}})(),(()=>{try{return j}catch{}})(),(()=>{try{return z}catch{}})()]).then(async()=>{let d,x,f;d={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"},k=R({name:"ProductCard",__name:"index",props:{property:{}},setup(v){const p=v,m=b([]);B(()=>p.property.spuIds,async()=>{m.value=await E(p.property.spuIds)},{immediate:!0,deep:!0});const C=t=>{const c=p.property.layoutType==="twoCol"?2:1;return{marginLeft:t%c==0?"0":p.property.space+"px",marginTop:t<c?"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,c)=>{const n=L;return r(),o("div",{class:i("box-content min-h-30px w-full flex flex-row flex-wrap"),ref_key:"containerRef",ref:h},[(r(!0),o(I,null,S(u(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",d,[_(n,{fit:"cover",src:t.property.badge.imgUrl,class:"h-26px w-38px"},null,8,["src"])])):s("",!0),y("div",{class:i(["h-140px",{"w-full":t.property.layoutType!=="oneColSmallImg","w-140px":t.property.layoutType==="oneColSmallImg"}])},[_(n,{fit:"cover",class:"h-full w-full",src:e.picUrl},null,8,["src"])],2),y("div",{class:i([" 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:i(["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(u(g)(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(u(g)(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(),P(n,{key:1,class:"h-28px w-28px rounded-full",fit:"cover",src:t.property.btnBuy.imgUrl},null,8,["src"]))])],4))),128))],512)}}})});export{F as __tla,k as default};