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

2 lines
4.5 KiB
JavaScript

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