index-52236bc4.js 1.8 KB

1
  1. import{b1 as p,c as m,b as h,m as S,t as g,d as r,ai as _,e as D,w as v,X as x,a as i,k as C,r as P,y as f,R as y,V as H,F as T}from"./index-a87f3a47.js";function b(e,s){const{days:t}=s;let{hours:n,minutes:l,seconds:a,milliseconds:u}=s;if(e.includes("DD")?e=e.replace("DD",p(t)):n+=t*24,e.includes("HH")?e=e.replace("HH",p(n)):l+=n*60,e.includes("mm")?e=e.replace("mm",p(l)):a+=l*60,e.includes("ss")?e=e.replace("ss",p(a)):u+=a*1e3,e.includes("S")){const o=p(u,3);e.includes("SSS")?e=e.replace("SSS",o):e.includes("SS")?e=e.replace("SS",o.slice(0,2)):e=e.replace("S",o.charAt(0))}return e}const[k,F]=m("count-down"),O={time:h(0),format:S("HH:mm:ss"),autoStart:g,millisecond:Boolean};var N=r({name:k,props:O,emits:["change","finish"],setup(e,{emit:s,slots:t}){const{start:n,pause:l,reset:a,current:u}=_({time:+e.time,millisecond:e.millisecond,onChange:w=>s("change",w),onFinish:()=>s("finish")}),o=D(()=>b(e.format,u.value)),d=()=>{a(+e.time),e.autoStart&&n()};return v(()=>e.time,d,{immediate:!0}),x({start:n,pause:l,reset:d}),()=>i("div",{role:"timer",class:F()},[t.default?t.default(u.value):o.value])}});const M=C(N),B="_wxPopupDialog_1sfd3_1",V="_popupContainer_1sfd3_16",A="_title1_1sfd3_22",E="_popupTips_1sfd3_29",c={wxPopupDialog:B,popupContainer:V,title1:A,popupTips:E},R=r({name:"m-wx-tip",props:{show:{type:Boolean,default:!0},title:{type:String,default:"温馨提示"},message:{type:String,default:"请使用微信打开"}},setup(e){const s=P(!1);return f(()=>{if(!y().weixin&&e.show){s.value=!0;return}}),()=>i(T,null,[i(H,{show:s.value,"onUpdate:show":t=>s.value=t,round:!0,style:{width:"88%"},closeOnClickOverlay:!1,class:c.wxPopupDialog},{default:()=>[i("div",{class:c.popupContainer},[i("p",{class:c.title1},[e.title]),i("p",{class:c.popupTips},[e.message])])]})])}});export{M as C,R as O};