Files
aiot-platform-ui/apps/web-antd/dist/js/index-BCBPZvAg.js
lzh 19d36d1ffb
All checks were successful
Web UI CI/CD / build-and-deploy (push) Successful in 8s
chore: build and deploy web-antd
2026-03-09 13:05:46 +08:00

2 lines
2.9 KiB
JavaScript

var h=(e,o,l)=>new Promise((i,d)=>{var v=n=>{try{r(l.next(n))}catch(t){d(t)}},y=n=>{try{r(l.throw(n))}catch(t){d(t)}},r=n=>n.done?i(n.value):Promise.resolve(n.value).then(v,y);r((l=l.apply(e,o)).next())});import{g as k}from"./couponTemplate-m26Yuodi.js";import{CouponDiscount as x,CouponDiscountDesc as b,CouponValidTerm as w}from"./component-CalaeLHR.js";import{m as j,b9 as f,w as g,v as I,ad as s,b2 as a,ae as u,I as D,bb as V,aT as m,j as c,u as p,ac as W,bp as $}from"../jse/index-index-CMeVxoEG.js";import"./bootstrap-CRjSNGHY.js";import"./biz-mall-enum-Bmxc7Ei7.js";const B={key:0,class:"ml-4 flex flex-row justify-between p-2"},L={class:"flex flex-col justify-evenly gap-1"},N={class:"flex flex-col justify-evenly"},T={key:1,class:"ml-4 flex flex-row justify-between p-2"},z={class:"flex flex-col justify-evenly gap-1"},R={key:0},S={key:1},E={class:"flex flex-col"},F={key:2,class:"flex flex-col items-center justify-around gap-1 p-1"},J=j({name:"CouponCard",__name:"index",props:{property:{}},setup(e){const o=e,l=f([]),i=f(375),d=f(),v=f("100%"),y=f(375);return g(()=>o.property.couponIds,()=>h(null,null,function*(){var r;((r=o.property.couponIds)==null?void 0:r.length)>0&&(l.value=yield k(o.property.couponIds))}),{immediate:!0,deep:!0}),g(()=>[o.property,i,l.value.length],()=>{y.value=(i.value-o.property.space*(o.property.columns-1))/o.property.columns,v.value=`${y.value*l.value.length+o.property.space*(l.value.length-1)}px`},{immediate:!0,deep:!0}),I(()=>{var r;i.value=((r=d.value)==null?void 0:r.offsetWidth)||375}),(r,n)=>(a(),s("div",{class:"z-10 min-h-8 overflow-x-auto",ref_key:"containerRef",ref:d},[u("div",{class:"flex flex-row text-xs",style:m({gap:`${e.property.space}px`,width:v.value})},[(a(!0),s(D,null,V(l.value,(t,C)=>(a(),s("div",{class:"box-content",style:m({background:e.property.bgImg?`url(${e.property.bgImg}) 100% center / 100% 100% no-repeat`:"#fff",width:`${y.value}px`,color:e.property.textColor}),key:C},[e.property.columns===1?(a(),s("div",B,[u("div",L,[c(p(x),{coupon:t},null,8,["coupon"]),c(p(b),{coupon:t},null,8,["coupon"]),c(p(w),{coupon:t},null,8,["coupon"])]),u("div",N,[u("div",{class:"rounded-full px-2 py-0.5",style:m({color:e.property.button.color,background:e.property.button.bgColor})}," 立即领取 ",4)])])):e.property.columns===2?(a(),s("div",T,[u("div",z,[c(p(x),{coupon:t},null,8,["coupon"]),c(p(b),{coupon:t},null,8,["coupon"]),t.totalCount>=0?(a(),s("div",R," 仅剩:"+$(t.totalCount-t.takeCount)+"张 ",1)):t.totalCount===-1?(a(),s("div",S,"仅剩:不限制")):W("",!0)]),u("div",E,[u("div",{class:"h-full w-5 rounded-full px-0.5 py-2 text-center",style:m({color:e.property.button.color,background:e.property.button.bgColor})}," 立即领取 ",4)])])):(a(),s("div",F,[c(p(x),{coupon:t},null,8,["coupon"]),c(p(b),{coupon:t},null,8,["coupon"]),u("div",{class:"rounded-full px-2 py-0.5",style:m({color:e.property.button.color,background:e.property.button.bgColor})}," 立即领取 ",4)]))],4))),128))],4)],512))}});export{J as default};