Files
aiot-platform-ui/apps/web-antd/dist/js/index-DulceDus.js
lzh 35c3d0e06e
All checks were successful
Web UI CI/CD / build-and-deploy (push) Successful in 8s
chore: build and deploy web-antd
2026-03-18 16:18:59 +08:00

2 lines
4.1 KiB
JavaScript

var S=Object.defineProperty,I=Object.defineProperties;var $=Object.getOwnPropertyDescriptors;var h=Object.getOwnPropertySymbols;var L=Object.prototype.hasOwnProperty,j=Object.prototype.propertyIsEnumerable;var v=(e,t,o)=>t in e?S(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,x=(e,t)=>{for(var o in t||(t={}))L.call(t,o)&&v(e,o,t[o]);if(h)for(var o of h(t))j.call(t,o)&&v(e,o,t[o]);return e},k=(e,t)=>I(e,$(t));var C=(e,t,o)=>new Promise((f,u)=>{var b=r=>{try{n(o.next(r))}catch(c){u(c)}},s=r=>{try{n(o.throw(r))}catch(c){u(c)}},n=r=>r.done?f(r.value):Promise.resolve(r.value).then(b,s);n((o=o.apply(e,t)).next())});import{b as P}from"./index-DTsisiJ7.js";import{aC as w}from"./bootstrap-CW2RsBQq.js";import{m as z,b9 as T,w as U,ad as a,b2 as l,I as N,bb as V,aT as i,ac as y,ae as d,j as B,u as m,aR as g,bp as p,d1 as R,ab as D}from"../jse/index-index-Cy8amzIl.js";const E={key:0,class:"absolute left-0 top-0 z-[1] items-center justify-center"},W={class:"text-xs"},F={class:"absolute bottom-2 right-2"},H=z({name:"ProductCard",__name:"index",props:{property:{}},setup(e){const t=e,o=T([]);U(()=>t.property.spuIds,()=>C(null,null,function*(){o.value=yield P(t.property.spuIds)}),{immediate:!0,deep:!0});function f(s){const n=t.property.layoutType==="twoCol"?2:1,r=s%n===0?"0":`${t.property.space}px`,c=s<n?"0":`${t.property.space}px`;return{marginLeft:r,marginTop:c}}const u=T();function b(){let s="100%";return t.property.layoutType==="twoCol"&&(s=`${(u.value.offsetWidth-t.property.space)/2}px`),{width:s}}return(s,n)=>(l(),a("div",{class:"box-content flex min-h-[30px] w-full flex-row flex-wrap",ref_key:"containerRef",ref:u},[(l(!0),a(N,null,V(o.value,(r,c)=>(l(),a("div",{class:"relative box-content flex flex-row flex-wrap overflow-hidden",style:i(k(x(x({},f(c)),b()),{borderTopLeftRadius:`${e.property.borderRadiusTop}px`,borderTopRightRadius:`${e.property.borderRadiusTop}px`,borderBottomLeftRadius:`${e.property.borderRadiusBottom}px`,borderBottomRightRadius:`${e.property.borderRadiusBottom}px`})),key:c},[e.property.badge.show&&e.property.badge.imgUrl?(l(),a("div",E,[B(m(w),{src:e.property.badge.imgUrl,preview:!1,class:"h-6 w-8 object-cover"},null,8,["src"])])):y("",!0),d("div",{class:g(["h-36",[{"w-full":e.property.layoutType!=="oneColSmallImg","w-36":e.property.layoutType==="oneColSmallImg"}]])},[B(m(w),{class:"h-full w-full object-cover",src:r.picUrl,preview:!1},null,8,["src"])],2),d("div",{class:g(["box-border flex flex-col gap-2 p-2",[{"w-full":e.property.layoutType!=="oneColSmallImg","w-[calc(100vh-140px-16px)]":e.property.layoutType==="oneColSmallImg"}]])},[e.property.fields.name.show?(l(),a("div",{key:0,class:g(["text-sm",[{truncate:e.property.layoutType!=="oneColSmallImg","line-clamp-2 overflow-ellipsis":e.property.layoutType==="oneColSmallImg"}]]),style:i({color:e.property.fields.name.color})},p(r.name),7)):y("",!0),e.property.fields.introduction.show?(l(),a("div",{key:1,class:"truncate text-xs",style:i({color:e.property.fields.introduction.color})},p(r.introduction),5)):y("",!0),d("div",null,[e.property.fields.price.show?(l(),a("span",{key:0,class:"text-base",style:i({color:e.property.fields.price.color})}," ¥"+p(m(R)(r.price)),5)):y("",!0),e.property.fields.marketPrice.show&&r.marketPrice?(l(),a("span",{key:1,class:"ml-1 text-xs line-through",style:i({color:e.property.fields.marketPrice.color})},"¥"+p(m(R)(r.marketPrice)),5)):y("",!0)]),d("div",W,[e.property.fields.salesCount.show?(l(),a("span",{key:0,style:i({color:e.property.fields.salesCount.color})}," 已售"+p((r.salesCount||0)+(r.virtualSalesCount||0))+"件 ",5)):y("",!0),e.property.fields.stock.show?(l(),a("span",{key:1,style:i({color:e.property.fields.stock.color})}," 库存"+p(r.stock||0),5)):y("",!0)])],2),d("div",F,[e.property.btnBuy.type==="text"?(l(),a("span",{key:0,class:"rounded-full px-3 py-1 text-sm text-white",style:i({background:`linear-gradient(to right, ${e.property.btnBuy.bgBeginColor}, ${e.property.btnBuy.bgEndColor}`})},p(e.property.btnBuy.text),5)):(l(),D(m(w),{key:1,class:"size-7 rounded-full object-cover",src:e.property.btnBuy.imgUrl,preview:!1},null,8,["src"]))])],4))),128))],512))}});export{H as default};