File: /www/server/panel/BTPanel/static/js/index183.js
import{ez as N,W as D,cZ as k}from"./utils-lib.js?v=1777008528";import{c as T,aI as I,aC as y,bD as S,w as R,g as V,o as j,a8 as B,j as x,k as h,q as t,F as O,B as A,L as F,p as r,x as m,s as a,e as H,Q as $}from"./base-lib.js?v=1777008528";import{P}from"./store4.js?v=1777008528";import"./__commonjsHelpers__.js?v=1777008528";import"./index3.js?v=1777008528";import"./index119.js?v=1777008528";import"./index116.js?v=1777008528";const U={class:"flex flex-col"},Z={class:"flex flex-col absolute w-full"},z={class:"pt-2.6rem bottom-bg"},q={class:"px-3.6rem"},G={class:"voucher-list mt-2.6rem h-[235px] overflow-auto"},Q={class:"voucher-amount inline-block px-1.6rem relative w-12rem"},W={class:"font-bold text-large"},X={class:"text-large36"},Y={class:"text-tertiary mt-1rem"},J={class:"inline-block text-left mr-1rem text-secondary voucher-instructions flex-1 pl-1.6rem"},K={class:"text-base mb-1rem"},ee={class:"voucher-count-down mt-1.2rem text-left"},te={class:"text-danger mlr-[1rem] inline-block text-extraLarge"},oe={class:"px-[3.6rem] pb-1rem mt-1.4rem"},se={class:"voucher-count-down text-center text-medium leading-[3rem] mt-[2.6rem] text-secondary flex justify-center"},ne={class:"mt-[2rem] voucher-footer text-center"},le=T({__name:"index",props:{compData:{default:()=>({isCoupon:[],isHome:!1,isLimited:!1,close:()=>{}})}},setup(g){const _=P(),{couponItem:f,closeAfterReload:re,timeClose:v,timeNow:u}=I(_),{siteList:b,addZero:c,claimCouponEvent:w,changeCloseTimeEvent:C}=_,M=y("popupClose",()=>{}),E=s=>{if(s==null)return"时间未知";const e=Number(s);if(isNaN(e)||e<0)return"时间格式错误";if(e>Number.MAX_SAFE_INTEGER/1e3)return"时间过长";const i=Math.floor(e/86400),o=Math.floor(e%86400/3600),l=Math.floor(e%86400%3600/60),n=[];return i>0&&n.push("".concat(i,"天")),o>0&&n.push("".concat(o,"小时")),l>0&&n.push("".concat(l,"分")),n.length>0?n.join(""):"不足1分钟"},d=g,L=S();R(()=>L.value,s=>{u.value=s});const p=V(()=>{let s="00",e="00",i="00",o="00",l=Number(sessionStorage.getItem("HOME-ENDTIME"));(!l||u.value>=l)&&(l=u.value+2*3600*1e3,sessionStorage.setItem("HOME-ENDTIME",l.toString()));const n=l-u.value;return n>0?(s=c(Math.floor(n/(1e3*60*60))),e=c(Math.floor(n/(1e3*60)%60)),i=c(Math.floor(n/1e3%60)),o=c(Math.floor(n%1e3/10))):(s="00",e="00",i="00",o="00",n===0&&(sessionStorage.removeItem("HOME-ENDTIME"),C("week",!1))),{hour:s,minute:e,second:i,millisecond:o}});return j(()=>{d.compData.isCoupon.length&&(f.value=d.compData.isCoupon)}),B(()=>{var s,e;N((s=d.compData)==null?void 0:s.close)&&((e=d.compData)==null||e.close())}),(s,e)=>{const i=D;return x(),h("section",U,[e[9]||(e[9]=t("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"},[t("g",null,[t("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"}),t("path",{id:"直线 1",class:"coupon-line",d:"M15 318L387 318"})])],-1)),t("div",Z,[t("div",z,[t("div",q,[e[4]||(e[4]=t("div",{class:"text-extraLarge text-pro w-full text-center"},"免费限时领取【大额优惠券】",-1)),t("div",G,[(x(!0),h(O,null,A(r(f),(o,l)=>(x(),h("div",{key:l,class:F(["voucher-item flex items-center justify-between py-[1.6rem] rounded-base",l===r(f).length-1?"mb-[1.4rem]":"mb-[2.4rem]"])},[t("div",Q,[t("div",W,[e[2]||(e[2]=m(" ¥",-1)),t("span",X,a(o.val2),1)]),t("div",Y,"满"+a(o.val1)+"减"+a(o.val2),1)]),t("div",J,[t("div",K,"仅限"+a(o.name),1),t("div",ee,[e[3]||(e[3]=m(" 领取后有效期 ",-1)),t("div",te,a(E(o.timeout)),1)])])],2))),128))])])]),t("div",oe,[t("div",se,[e[5]||(e[5]=m(" 距结束",-1)),t("span",null,a(r(p).hour),1),e[6]||(e[6]=m("时",-1)),t("span",null,a(r(p).minute),1),e[7]||(e[7]=m("分",-1)),t("span",null,a(r(p).second),1),e[8]||(e[8]=m("秒",-1)),t("span",null,a(r(p).millisecond),1)]),t("div",ne,[t("span",{class:"text-white bg-pro hover:bg-[var(--bt-pro-sub-color)]",onClick:e[0]||(e[0]=o=>r(w)(r(M),g.compData.isLimited))},"一键领取"),H(i,{modelValue:r(v),"onUpdate:modelValue":e[1]||(e[1]=o=>$(v)?v.value=o:null),options:r(b),class:"reminder mt-1rem !w-[14rem]",placeholder:"选择不通知的时间",onChange:r(C)},null,8,["modelValue","options","onChange"])])])])])}}}),fe=k(le,[["__scopeId","data-v-d44eac63"]]);export{fe as default};