1 line
3.5 KiB
JavaScript
1 line
3.5 KiB
JavaScript
(window.webpackJsonp=window.webpackJsonp||[]).push([[16],{415:function(t,e,n){"use strict";var r=n(13),o=n(2),c=n(121),f=n(24),m=n(14),h=n(53),l=n(258),d=n(84),N=n(257),v=n(5),I=n(70),T=n(85).f,S=n(45).f,E=n(23).f,_=n(416).trim,w="Number",y=o.Number,x=y.prototype,A=h(I(x))==w,M=function(t){if(d(t))throw TypeError("Cannot convert a Symbol value to a number");var e,n,r,o,c,f,m,code,h=N(t,"number");if("string"==typeof h&&h.length>2)if(43===(e=(h=_(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,!y(" 0o1")||!y("0b1")||y("+0x1"))){for(var O,R=function(t){var e=arguments.length<1?0:t,n=this;return n instanceof R&&(A?v((function(){x.valueOf.call(n)})):h(n)!=w)?l(new y(M(e)),n,R):M(e)},F=r?T(y):"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(","),C=0;F.length>C;C++)m(y,O=F[C])&&!m(R,O)&&E(R,O,S(y,O));R.prototype=x,x.constructor=R,f(o,w,R)}},416:function(t,e,n){var r=n(28),o=n(11),c="["+n(417)+"]",f=RegExp("^"+c+c+"*"),m=RegExp(c+c+"*$"),h=function(t){return function(e){var n=o(r(e));return 1&t&&(n=n.replace(f,"")),2&t&&(n=n.replace(m,"")),n}};t.exports={start:h(1),end:h(2),trim:h(3)}},417:function(t,e){t.exports="\t\n\v\f\r \u2028\u2029\ufeff"},429:function(t,e,n){"use strict";n.r(e);n(415),n(71),n(54),n(19),n(87),n(69),n(86);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(7),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}}]); |