← Back
Editing: index414.js
import{b as e}from"./validator.js?v=VERSION_NUMBER";import"./utils-lib.js?v=VERSION_NUMBER";import{c as t,r as l,g as a,p as s,a4 as o,q as n,v as r,y as i,z as x,J as p,B as u,F as d,a_ as c,K as v}from"./base-lib.js?v=VERSION_NUMBER";import"./index104.js?v=VERSION_NUMBER";import"./column.js?v=VERSION_NUMBER";import"./__commonjsHelpers__.js?v=VERSION_NUMBER";const m={class:"relative bg-white rounded-[16px] overflow-hidden shadow-2xl transform transition-all duration-500 scale-100"},f={class:"py-[40px] px-[20px]"},b={class:"flex flex-col items-center mb-[24px]"},F={class:"flex items-end"},g={class:"text-[#FF8C00] text-[50px] font-bold -mb-[12px]"},h={class:"bg-[#F5F5F5] rounded-[8px] p-[12px] mb-[20px]"},w={class:"flex justify-center space-x-[8px] items-center"},y=["disabled"],C="bt-coupon-countdown",S="bt-coupon-open-time",j=t({__name:"index",emits:["close"],setup(t,{emit:j}){const I=l(600),M=l(99),k=l(!1),D=l(!1),_=l([]),z=l("200~400"),B=j;let T=null;const J=()=>{const e={totalSeconds:I.value,milliseconds:M.value,timestamp:Date.now()};localStorage.setItem(C,JSON.stringify(e))},q=()=>{localStorage.removeItem(C),localStorage.removeItem(S)},A=()=>{const e=localStorage.getItem(S),t=Date.now();if(e)try{const l=parseInt(e,10),a=l+6e5-t;return a>0?(I.value=Math.floor(a/1e3),void(M.value=Math.floor(a%1e3/10))):(q(),void B("close"))}catch(l){q()}I.value=600,M.value=99,localStorage.setItem(S,Date.now().toString())},H=a((()=>Math.floor(I.value/60).toString().padStart(2,"0"))),K=a((()=>(I.value%60).toString().padStart(2,"0"))),N=a((()=>M.value.toString().padStart(2,"0"))),O=a((()=>I.value<=0&&M.value<=0)),E=()=>{O.value||(G(),q(),B("close"),e("绑定宝塔账号,享受更多服务","/?model=bind-cupon"))},G=()=>{D.value=!0,_.value=[];for(let e=0;e<50;e++)setTimeout((()=>{const t={id:Date.now()+e,x:100*Math.random(),y:100*Math.random(),size:8*Math.random()+4,color:L()};_.value.push(t),setTimeout((()=>{const e=_.value.findIndex((e=>e.id===t.id));e>-1&&_.value.splice(e,1)}),1e3)}),50*e);setTimeout((()=>{D.value=!1,_.value=[]}),3e3)},L=()=>{const e=["#FF8C00","#FFB84D","#FFA500","#FFCC80","#FF9500"];return e[Math.floor(Math.random()*e.length)]};return s((()=>{A(),T=setInterval((()=>{if(M.value-=1,M.value<0&&(M.value=99,I.value--),I.value<=0&&M.value<=0)return T&&(clearInterval(T),T=null),q(),void B("close");J()}),10)})),o((()=>{T&&clearInterval(T),J()})),(e,t)=>(n(),r("div",null,[i("div",{ref:"couponModal",class:p(["w-full relative overflow-hidden rounded-[16px]",{"scale-95 opacity-0":k.value}])},[i("div",m,[i("div",f,[t[7]||(t[7]=i("div",{class:"flex items-center justify-center mb-[16px]"},[i("i",{class:"fa fa-ticket text-[#FF8C00] text-[24px] mr-[8px]"}),i("h2",{class:"text-[clamp(1.2rem,2.5vw,1.8rem)] font-bold text-[#333333] text-shadow"},"绑定账号领取限时优惠券")],-1)),i("div",b,[t[2]||(t[2]=i("p",{class:"text-gray-500 text-[12px] mb-[4px]"},"领取随机金额优惠券",-1)),i("div",F,[t[0]||(t[0]=i("span",{class:"text-[#FF8C00] text-[24px] font-bold mr-[4px]"},"¥",-1)),i("span",g,x(z.value),1),t[1]||(t[1]=i("span",{class:"text-[#FF8C00] text-[16px] font-bold ml-[4px] mb-[4px]"},"元",-1))]),t[3]||(t[3]=i("p",{class:"text-gray-500 text-[12px] mt-[8px]"},"满1399元可用",-1))]),i("div",h,[t[6]||(t[6]=i("p",{class:"text-center text-gray-600 text-[14px] mb-[8px]"},"优惠券将在以下时间后过期",-1)),i("div",w,[i("div",{class:p(["text-white rounded-[8px] w-[56px] h-[40px] flex items-center justify-center font-bold text-[16px]",I.value<10?"bg-red-500":"bg-[#FF8C00]"])},[i("span",null,x(H.value),1)],2),t[4]||(t[4]=i("span",{class:"text-[#FF8C00] font-bold"},":",-1)),i("div",{class:p(["text-white rounded-[8px] w-[56px] h-[40px] flex items-center justify-center font-bold text-[16px]",I.value<10?"bg-red-500":"bg-[#FF8C00]"])},[i("span",null,x(K.value),1)],2),t[5]||(t[5]=i("span",{class:"text-[#FF8C00] font-bold"},":",-1)),i("div",{class:p(["text-white rounded-[8px] w-[56px] h-[40px] flex items-center justify-center font-bold text-[16px]",I.value<10?"bg-red-500":"bg-[#FF8C00]"])},[i("span",null,x(N.value),1)],2)])]),t[8]||(t[8]=i("div",{class:"mb-5"},[i("h3",{class:"text-gray-700 font-semibold text-[14px] mb-[8px] flex items-center"},[i("i",{class:"fa fa-info-circle text-[#FF8C00] mr-2"}),u(" 使用规则 ")]),i("ul",{class:"text-gray-600 text-[12px] space-y-1 pl-[20px] list-disc"},[i("li",null,"用户绑定账号专属优惠"),i("li",null,"有效期10分钟")])],-1)),i("button",{disabled:O.value,class:p(["w-full py-[10px] rounded-[8px] font-bold text-[16px] shadow-lg transform transition-all duration-300 flex items-center justify-center",O.value?"bg-gray-400 text-gray-600 opacity-50 cursor-not-allowed":"bg-gradient-to-r from-[#FF8C00] to-[#FFB84D] text-white hover:shadow-xl hover:-translate-y-1"]),onClick:E},[i("i",{class:p(O.value?"fa fa-clock-o mr-[8px]":"fa fa-gift mr-[8px]")},null,2),u(" "+x(O.value?"已过期":"立即领取优惠券"),1)],10,y)])]),t[9]||(t[9]=i("div",{class:"absolute -top-[20px] -right-[20px] w-[64px] h-[64px] bg-[#FFB84D] rounded-full opacity-20 animate-pulse-slow"},null,-1)),t[10]||(t[10]=i("div",{class:"absolute -bottom-[24px] -left-[24px] w-[96px] h-[96px] bg-[#FF8C00] rounded-full opacity-10 animate-pulse-slow"},null,-1))],2),i("div",{ref:"fireworksContainer",class:p(["fixed inset-0 pointer-events-none",{hidden:!D.value}])},[(n(!0),r(d,null,c(_.value,(e=>(n(),r("div",{key:e.id,class:"absolute rounded-full",style:v({width:e.size+"px",height:e.size+"px",backgroundColor:e.color,left:e.x+"%",top:e.y+"%",animation:"firework 1s ease-out forwards"})},null,4)))),128))],2)]))}});export{j as default};
Save File
Cancel