import{ax as e,_ as t}from"./utils-lib.js?v=1761009159";import{c as s,s as o,aA as l,c8 as a,w as r,g as n,q as i,v as m,x as c,z as u,F as d,b0 as p,K as v,y as x,C as f,A as h,e as g,Q as b}from"./base-lib.js?v=1761009159";import{P as w}from"./store6.js?v=1761009159";import"./__commonjsHelpers__.js?v=1761009159";import"./validator.js?v=1761009159";import"./index106.js?v=1761009159";import"./column.js?v=1761009159";const C={class:"flex flex-col"},M={class:"flex flex-col absolute w-full"},E={class:"pt-2.6rem bottom-bg"},j={class:"px-3.6rem"},_={class:"voucher-list mt-2.6rem min-h-[230px] flex flex-col items-center justify-center"},L={class:"voucher-amount inline-block px-1.6rem relative w-12rem"},N={class:"font-bold text-large"},k={class:"text-large36"},y={class:"text-tertiary mt-1rem"},I={class:"inline-block text-left mr-1rem text-secondary voucher-instructions flex-1 pl-1.6rem"},D={class:"text-base mb-1rem"},A={class:"voucher-count-down mt-1.2rem text-left"},H={class:"text-danger mlr-[1rem] inline-block text-extraLarge"},S={class:"px-[3.6rem] pb-1rem mt-1.4rem"},T={class:"voucher-count-down text-center text-medium leading-[3rem] mt-[2.6rem] text-secondary flex justify-center"},O={class:"mt-[2rem] voucher-footer text-center"},V=t(s({__name:"index",props:{compData:{default:()=>({isCoupon:[],isHome:!1})}},setup(t){const s=w(),{couponItem:V,closeAfterReload:F,timeClose:R,timeNow:Z}=o(s),{siteList:q,addZero:z,claimCouponEvent:B,changeCloseTimeEvent:G}=s,K=l("popupClose",()=>{}),P=e=>{if(null==e)return"时间未知";const t=Number(e);if(isNaN(t)||t<0)return"时间格式错误";if(t>Number.MAX_SAFE_INTEGER/1e3)return"时间过长";const s=Math.floor(t/86400),o=Math.floor(t%86400/3600),l=Math.floor(t%86400%3600/60),a=[];return s>0&&a.push("".concat(s,"天")),o>0&&a.push("".concat(o,"小时")),l>0&&a.push("".concat(l,"分")),a.length>0?a.join(""):"不足1分钟"},Q=t,U=a();r(()=>U.value,e=>{Z.value=e});const X=n(()=>{let e="00",t="00",s="00",o="00",l=Number(sessionStorage.getItem("HOME-ENDTIME"));(!l||Z.value>=l)&&(l=Z.value+72e5,sessionStorage.setItem("HOME-ENDTIME",l.toString()));const a=l-Z.value;return a>0?(e=z(Math.floor(a/36e5)),t=z(Math.floor(a/6e4%60)),s=z(Math.floor(a/1e3%60)),o=z(Math.floor(a%1e3/10))):(e="00",t="00",s="00",o="00",0===a&&(sessionStorage.removeItem("HOME-ENDTIME"),G("week",!1))),{hour:e,minute:t,second:s,millisecond:o}});return i(()=>{Q.compData.isCoupon.length&&(V.value=Q.compData.isCoupon)}),(t,s)=>{const o=e;return m(),c("section",C,[s[9]||(s[9]=u("svg",{viewBox:"0 0 402 485",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",width:"402.000000",height:"485.000000",fill:"none"},[u("g",null,[u("path",{class:"coupon-background",d:"M402 10C402 4.47715 397.523 0 392 0L10 0C4.47715 0 0 4.47715 0 10L0 303.008C0.165974 303.003 0.332656 303 0.5 303C8.50813 303 15 309.492 15 317.5C15 325.508 8.50813 332 0.5 332C0.332656 332 0.165974 331.997 0 331.992L0 475C0 480.523 4.47715 485 10 485L392 485C397.523 485 402 480.523 402 475L402 331.992C394.223 331.728 388 325.341 388 317.5C388 309.659 394.223 303.272 402 303.008L402 10Z","fill-rule":"evenodd"}),u("path",{id:"直线 1",class:"coupon-line",d:"M15 318L387 318"})])],-1)),u("div",M,[u("div",E,[u("div",j,[s[4]||(s[4]=u("div",{class:"text-extraLarge text-pro w-full text-center"},"免费限时领取【大额优惠券】",-1)),u("div",_,[(m(!0),c(d,null,p(x(V),(e,t)=>(m(),c("div",{key:t,class:v(["voucher-item flex items-center justify-between py-[1.6rem] rounded-base",t===x(V).length-1?"mb-[1.4rem]":"mb-[2.4rem]"])},[u("div",L,[u("div",N,[s[2]||(s[2]=f(" ￥",-1)),u("span",k,h(e.val2),1)]),u("div",y,"满"+h(e.val1)+"减"+h(e.val2),1)]),u("div",I,[u("div",D,"仅限"+h(e.name),1),u("div",A,[s[3]||(s[3]=f(" 领取后有效期 ",-1)),u("div",H,h(P(e.timeout)),1)])])],2))),128))])])]),u("div",S,[u("div",T,[s[5]||(s[5]=f(" 距结束",-1)),u("span",null,h(x(X).hour),1),s[6]||(s[6]=f("时",-1)),u("span",null,h(x(X).minute),1),s[7]||(s[7]=f("分",-1)),u("span",null,h(x(X).second),1),s[8]||(s[8]=f("秒",-1)),u("span",null,h(x(X).millisecond),1)]),u("div",O,[u("span",{class:"text-white bg-pro hover:bg-[var(--bt-pro-sub-color)]",onClick:s[0]||(s[0]=e=>x(B)(x(K)))},"一键领取"),g(o,{modelValue:x(R),"onUpdate:modelValue":s[1]||(s[1]=e=>b(R)?R.value=e:null),options:x(q),class:"reminder mt-1rem !w-[14rem]",placeholder:"选择不通知的时间",onChange:x(G)},null,8,["modelValue","options","onChange"])])])])])}}}),[["__scopeId","data-v-1a1ddaa3"]]);export{V as default};
