11 lines
4.0 KiB
JavaScript
11 lines
4.0 KiB
JavaScript
(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["tuniao-ui/components/tn-count-down/tn-count-down"],{3232:function(t,e,o){"use strict";var n=o("4ea4");Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=n(o("16ca")),s={name:"tn-count-down",mixins:[r.default],props:{timestamp:{type:Number,default:0},autoplay:{type:Boolean,default:!0},height:{type:[String,Number],default:"auto"},separator:{type:String,default:"en"},separatorSize:{type:Number,default:30},separatorColor:{type:String,default:"#080808"},showBorder:{type:Boolean,default:!1},borderColor:{type:String,default:"#080808"},showSeconds:{type:Boolean,default:!0},showMinutes:{type:Boolean,default:!0},showHours:{type:Boolean,default:!0},showDays:{type:Boolean,default:!0},hideZeroDay:{type:Boolean,default:!1}},computed:{itemStyle:function(){var t={};return this.height&&(t.height=this.$tn.string.getLengthUnitValue(this.height),t.width=t.height),this.showBorder&&(t.borderStyle="solid",t.borderColor=this.borderColor,t.borderWidth="1rpx"),t.backgroundColor=this.backgroundColorStyle||"#FFFFFF",t},letterStyle:function(){var t={};return t.fontSize=this.fontSizeStyle||"30rpx",t.color=this.fontColorStyle||"#080808",t}},data:function(){return{d:"00",h:"00",m:"00",s:"00",timer:null,seconds:0}},watch:{timestamp:function(t){this.clearTimer(),this.start()}},mounted:function(){this.autoplay&&this.timestamp&&this.start()},beforeDestroy:function(){this.clearTimer()},methods:{start:function(){var t=this;this.clearTimer(),this.timestamp<=0||(this.seconds=Number(this.timestamp),this.formatTime(this.seconds),this.timer=setInterval((function(){if(t.seconds--,t.$emit("change",t.seconds),t.seconds<0)return t.end();t.formatTime(t.seconds)}),1e3))},formatTime:function(t){t<=0&&this.end();var e,o=0,n=0,r=0;o=Math.floor(t/86400),e=Math.floor(t/3600)-24*o;var s=null;s=this.showDays?e:Math.floor(t/3600),n=Math.floor(t/60)-60*e-24*o*60,r=Math.floor(t)-60*n-60*e*60-24*o*60*60,s=this.$tn.number.formatNumberAddZero(s),n=this.$tn.number.formatNumberAddZero(n),r=this.$tn.number.formatNumberAddZero(r),o=this.$tn.number.formatNumberAddZero(o),this.d=o,this.h=s,this.m=n,this.s=r},end:function(){this.clearTimer(),this.$emit("end")},clearTimer:function(){null!==this.timer&&(clearInterval(this.timer),this.timer=null)}}};e.default=s},"414a":function(t,e,o){"use strict";o.r(e);var n=o("cbdf"),r=o("b5e7");for(var s in r)["default"].indexOf(s)<0&&function(t){o.d(e,t,(function(){return r[t]}))}(s);o("ce28");var i=o("f0c5"),a=Object(i["a"])(r["default"],n["b"],n["c"],!1,null,"226cade5",null,!1,n["a"],void 0);e["default"]=a.exports},9220:function(t,e,o){},b5e7:function(t,e,o){"use strict";o.r(e);var n=o("3232"),r=o.n(n);for(var s in n)["default"].indexOf(s)<0&&function(t){o.d(e,t,(function(){return n[t]}))}(s);e["default"]=r.a},cbdf:function(t,e,o){"use strict";o.d(e,"b",(function(){return n})),o.d(e,"c",(function(){return r})),o.d(e,"a",(function(){}));var n=function(){var t=this,e=t.$createElement,o=(t._self._c,t.showDays&&(t.hideZeroDay||!t.hideZeroDay&&"00"!=t.d)?t.__get_style([t.itemStyle]):null),n=t.showDays&&(t.hideZeroDay||!t.hideZeroDay&&"00"!=t.d)?t.__get_style([t.letterStyle]):null,r=t.showHours?t.__get_style([t.itemStyle]):null,s=t.showHours?t.__get_style([t.letterStyle]):null,i=t.showMinutes?t.__get_style([t.itemStyle]):null,a=t.showMinutes?t.__get_style([t.letterStyle]):null,l=t.showSeconds?t.__get_style([t.itemStyle]):null,u=t.showSeconds?t.__get_style([t.letterStyle]):null;t.$mp.data=Object.assign({},{$root:{s0:o,s1:n,s2:r,s3:s,s4:i,s5:a,s6:l,s7:u}})},r=[]},ce28:function(t,e,o){"use strict";var n=o("9220"),r=o.n(n);r.a}}]);
|
|
;(global["webpackJsonp"] = global["webpackJsonp"] || []).push([
|
|
'tuniao-ui/components/tn-count-down/tn-count-down-create-component',
|
|
{
|
|
'tuniao-ui/components/tn-count-down/tn-count-down-create-component':(function(module, exports, __webpack_require__){
|
|
__webpack_require__('543d')['createComponent'](__webpack_require__("414a"))
|
|
})
|
|
},
|
|
[['tuniao-ui/components/tn-count-down/tn-count-down-create-component']]
|
|
]);
|