Files
aiot-platform-ui/apps/web-antd/dist/js/index-DyoWJsjC.js
lzh cd38d89fe5
All checks were successful
Web UI CI/CD / build-and-deploy (push) Successful in 40s
chore: build and deploy web-antd
2026-02-24 15:02:09 +08:00

2 lines
4.5 KiB
JavaScript

var L=Object.defineProperty,$=Object.defineProperties;var P=Object.getOwnPropertyDescriptors;var C=Object.getOwnPropertySymbols;var j=Object.prototype.hasOwnProperty,A=Object.prototype.propertyIsEnumerable;var I=(e,t,o)=>t in e?L(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,g=(e,t)=>{for(var o in t||(t={}))j.call(t,o)&&I(e,o,t[o]);if(C)for(var o of C(t))A.call(t,o)&&I(e,o,t[o]);return e},B=(e,t)=>$(e,P(t));var T=(e,t,o)=>new Promise((d,u)=>{var h=r=>{try{f(o.next(r))}catch(a){u(a)}},x=r=>{try{f(o.throw(r))}catch(a){u(a)}},f=r=>r.done?d(r.value):Promise.resolve(r.value).then(h,x);f((o=o.apply(e,t)).next())});import{b as z}from"./index-C7XrLt_Y.js";import{e as U}from"./combinationActivity-BNhdHAtQ.js";import{aA as w}from"./bootstrap-CvlyDbJT.js";import{m as E,b9 as v,w as N,ad as s,b2 as i,I as V,bb as D,aT as c,ac as n,ae as m,j as R,u as b,aR as k,bp as y,cX as S,ab as W}from"../jse/index-index-z6BnWIKe.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:"PromotionCombination",__name:"index",props:{property:{}},setup(e){const t=e,o=v([]),d=v([]),u=v([]);N(()=>t.property.activityIds,()=>T(null,null,function*(){try{const r=t.property.activityIds;Array.isArray(r)&&r.length>0&&(u.value=yield U(r),o.value=[],d.value=u.value.map(a=>a.spuId).filter(a=>typeof a=="number"),d.value.length>0&&(o.value=yield z(d.value)),u.value.forEach(a=>{const l=o.value.find(p=>p.id===a.spuId);l&&(l.price=Math.min(a.combinationPrice||1/0,l.price||1/0))}))}catch(r){console.error("获取拼团活动细节或 SPU 细节时出错:",r)}}),{immediate:!0,deep:!0});function h(r){const a=t.property.layoutType==="twoCol"?2:1,l=r%a===0?"0":`${t.property.space}px`,p=r<a?"0":`${t.property.space}px`;return{marginLeft:l,marginTop:p}}const x=v();function f(){let r="100%";return t.property.layoutType==="twoCol"&&(r=`${(x.value.offsetWidth-t.property.space)/2}px`),{width:r}}return(r,a)=>(i(),s("div",{class:"box-content flex min-h-8 w-full flex-row flex-wrap",ref_key:"containerRef",ref:x},[(i(!0),s(V,null,D(o.value,(l,p)=>(i(),s("div",{class:"relative box-content flex flex-row flex-wrap overflow-hidden bg-card",style:c(B(g(g({},h(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?(i(),s("div",F,[R(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"}]])},[R(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?(i(),s("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?(i(),s("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?(i(),s("span",{key:0,class:"text-base",style:c({color:e.property.fields.price.color})}," ¥"+y(b(S)(l.price||1/0)),5)):n("",!0),e.property.fields.marketPrice.show&&l.marketPrice?(i(),s("span",{key:1,class:"ml-1 text-xs line-through",style:c({color:e.property.fields.marketPrice.color})}," ¥"+y(b(S)(l.marketPrice)),5)):n("",!0)]),m("div",M,[e.property.fields.salesCount.show?(i(),s("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?(i(),s("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"?(i(),s("span",{key:0,class:"rounded-full px-3 py-1 text-sm text-white",style:c({background:`linear-gradient(to right, ${e.property.btnBuy.bgBeginColor}, ${e.property.btnBuy.bgEndColor}`})},y(e.property.btnBuy.text),5)):(i(),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};