1 line
3.4 KiB
JavaScript
Executable File
1 line
3.4 KiB
JavaScript
Executable File
(window.webpackJsonp=window.webpackJsonp||[]).push([[16],{404:function(t,e,n){"use strict";var r=n(11),o=n(5),c=n(116),f=n(23),m=n(15),h=n(52),l=n(251),d=n(81),N=n(7),I=n(83),v=n(82).f,T=n(42).f,S=n(22).f,E=n(405).trim,_="Number",w=o.Number,x=w.prototype,A=h(I(x))==_,M=function(t){var e,n,r,o,c,f,m,code,h=d(t,!1);if("string"==typeof h&&h.length>2)if(43===(e=(h=E(h)).charCodeAt(0))||45===e){if(88===(n=h.charCodeAt(2))||120===n)return NaN}else if(48===e){switch(h.charCodeAt(1)){case 66:case 98:r=2,o=49;break;case 79:case 111:r=8,o=55;break;default:return+h}for(f=(c=h.slice(2)).length,m=0;m<f;m++)if((code=c.charCodeAt(m))<48||code>o)return NaN;return parseInt(c,r)}return+h};if(c(_,!w(" 0o1")||!w("0b1")||w("+0x1"))){for(var y,O=function(t){var e=arguments.length<1?0:t,n=this;return n instanceof O&&(A?N((function(){x.valueOf.call(n)})):h(n)!=_)?l(new w(M(e)),n,O):M(e)},R=r?v(w):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger,fromString,range".split(","),F=0;R.length>F;F++)m(w,y=R[F])&&!m(O,y)&&S(O,y,T(w,y));O.prototype=x,x.constructor=O,f(o,_,O)}},405:function(t,e,n){var r=n(27),o="["+n(406)+"]",c=RegExp("^"+o+o+"*"),f=RegExp(o+o+"*$"),m=function(t){return function(e){var n=String(r(e));return 1&t&&(n=n.replace(c,"")),2&t&&(n=n.replace(f,"")),n}};t.exports={start:m(1),end:m(2),trim:m(3)}},406:function(t,e){t.exports="\t\n\v\f\r \u2028\u2029\ufeff"},417:function(t,e,n){"use strict";n.r(e);n(404),n(69),n(53),n(18),n(85),n(68),n(84);var r=6e4,o=36e5,c=24*o;function f(t){return(0+t.toString()).slice(-2)}var m={components:{},props:{isSlot:{type:Boolean,default:!1},time:{type:Number,default:0},format:{type:String,default:"hh:mm:ss"},autoStart:{type:Boolean,default:!0}},watch:{time:{immediate:!0,handler:function(t){t&&this.reset()}}},data:function(){return{timeObj:{},formateTime:0}},created:function(){},computed:{},methods:{createTimer:function(t){return setTimeout(t,100)},isSameSecond:function(t,e){return Math.floor(t)===Math.floor(e)},start:function(){this.counting||(this.counting=!0,this.endTime=Date.now()+1e3*this.remain,this.setTimer())},setTimer:function(){var t=this;this.tid=this.createTimer((function(){var e=t.getRemain();t.isSameSecond(e,t.remain)&&0!==e||t.setRemain(e),0!==t.remain&&t.setTimer()}))},getRemain:function(){return Math.max(this.endTime-Date.now(),0)},pause:function(){this.counting=!1,clearTimeout(this.tid)},reset:function(){this.pause(),this.remain=this.time,this.setRemain(this.remain),this.autoStart&&this.start()},setRemain:function(t){var e=this.format;this.remain=t;var time,n=(time=t,{days:Math.floor(time/c),hours:f(Math.floor(time%c/o)),minutes:f(Math.floor(time%o/r)),seconds:f(Math.floor(time%r/1e3))});this.formateTime=function(t,e){var n=e.days,r=e.hours,o=e.minutes,c=e.seconds;return-1!==t.indexOf("dd")&&(t=t.replace("dd",n)),-1!==t.indexOf("hh")&&(t=t.replace("hh",f(r))),-1!==t.indexOf("mm")&&(t=t.replace("mm",f(o))),-1!==t.indexOf("ss")&&(t=t.replace("ss",f(c))),t}(e,n),this.$emit("change",n),0===t&&(this.pause(),this.$emit("finish"))}}},h=n(8),component=Object(h.a)(m,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return t.time>=0?n("div",[n("client-only",[t.isSlot?t._t("default"):n("span",[t._v(t._s(t.formateTime))])],2)],1):t._e()}),[],!1,null,null,null);e.default=component.exports}}]); |