1 |
- {"version":3,"sources":["webpack:///D:/yzm/worknew/wardrobe/tm-vuetify/components/tm-countdown/tm-countdown.vue?14af","webpack:///D:/yzm/worknew/wardrobe/tm-vuetify/components/tm-countdown/tm-countdown.vue?4796","webpack:///D:/yzm/worknew/wardrobe/tm-vuetify/components/tm-countdown/tm-countdown.vue?2627","webpack:///D:/yzm/worknew/wardrobe/tm-vuetify/components/tm-countdown/tm-countdown.vue?98af","uni-app:///tm-vuetify/components/tm-countdown/tm-countdown.vue"],"names":[],"mappings":";;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAyH;AACzH;AACgE;AACL;;;AAG3D;AACmM;AACnM,gBAAgB,0MAAU;AAC1B,EAAE,kFAAM;AACR,EAAE,uFAAM;AACR,EAAE,gGAAe;AACjB;AACA;AACA;AACA;AACA;AACA,EAAE,2FAAU;AACZ;AACA;;AAEA;AACe,gF;;;;;;;;;;;;ACtBf;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;;;;;;;;;;;ACAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;AChBA;AAAA;AAAA;AAAA;AAAywB,CAAgB,uwBAAG,EAAC,C;;;;;;;;;;;;;;;;;;;ACO7xB;;;;;;;;;;;;;;AAcA;AACA,sBADA;AAEA;AACA;AACA,kBADA;AAEA,wBAFA,EADA;;AAKA;AACA,kBADA;AAEA,8BAFA,EALA;;AASA;AACA,mBADA;AAEA,mBAFA,EATA,EAFA;;;AAgBA,MAhBA,kBAgBA;AACA;AACA,iBADA;AAEA,YAFA;AAGA,mBAHA;;AAKA,GAtBA;AAuBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KATA;AAUA;AACA;AACA;AACA,KAbA,EAvBA;;AAsCA,WAtCA,uBAsCA;AACA;AACA,GAxCA;AAyCA,SAzCA,qBAyCA;AACA;AACA;AACA;AACA;;AAEA,GA/CA;AAgDA;AACA,cADA,sBACA,OADA,EACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4DAFA,EAEA;AACA,qEAHA,EAGA;AACA,qEAJA,CAIA;AACA;AALA;AAOA;AACA;AACA,KAhBA;AAiBA;AACA,SAlBA,mBAkBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAXA,EAWA,EAXA;AAYA,KAjCA;AAkCA;AACA,QAnCA,kBAmCA;AACA;AACA;AACA,KAtCA;AAuCA;AACA,SAxCA,mBAwCA;AACA;AACA,KA1CA;AA2CA;AACA,WA5CA,qBA4CA;AACA;AACA;AACA,KA/CA,EAhDA,E","file":"tm-vuetify/components/tm-countdown/tm-countdown.js","sourcesContent":["import { render, staticRenderFns, recyclableRender, components } from \"./tm-countdown.vue?vue&type=template&id=f33d0fa6&\"\nvar renderjs\nimport script from \"./tm-countdown.vue?vue&type=script&lang=js&\"\nexport * from \"./tm-countdown.vue?vue&type=script&lang=js&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../../exe/HBuilderX.3.4.7.20220422/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null,\n false,\n components,\n renderjs\n)\n\ncomponent.options.__file = \"tm-vuetify/components/tm-countdown/tm-countdown.vue\"\nexport default component.exports","export * from \"-!../../../../../exe/HBuilderX.3.4.7.20220422/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../../../exe/HBuilderX.3.4.7.20220422/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--16-0!../../../../../exe/HBuilderX.3.4.7.20220422/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/template.js!../../../../../exe/HBuilderX.3.4.7.20220422/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-uni-app-loader/page-meta.js!../../../../../exe/HBuilderX.3.4.7.20220422/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/index.js??vue-loader-options!../../../../../exe/HBuilderX.3.4.7.20220422/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./tm-countdown.vue?vue&type=template&id=f33d0fa6&\"","var components\nvar render = function() {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n if (_vm.$scope.data.scopedSlotsCompiler === \"augmented\") {\n _vm.$setScopedSlotsParams(\"default\", {\n timeData: {\n data: _vm.time_data,\n finish: _vm.isfinish\n }\n })\n }\n}\nvar recyclableRender = false\nvar staticRenderFns = []\nrender._withStripped = true\n\nexport { render, staticRenderFns, recyclableRender, components }","import mod from \"-!../../../../../exe/HBuilderX.3.4.7.20220422/HBuilderX/plugins/uniapp-cli/node_modules/babel-loader/lib/index.js!../../../../../exe/HBuilderX.3.4.7.20220422/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--12-1!../../../../../exe/HBuilderX.3.4.7.20220422/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/script.js!../../../../../exe/HBuilderX.3.4.7.20220422/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/index.js??vue-loader-options!../../../../../exe/HBuilderX.3.4.7.20220422/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./tm-countdown.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../../exe/HBuilderX.3.4.7.20220422/HBuilderX/plugins/uniapp-cli/node_modules/babel-loader/lib/index.js!../../../../../exe/HBuilderX.3.4.7.20220422/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--12-1!../../../../../exe/HBuilderX.3.4.7.20220422/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/script.js!../../../../../exe/HBuilderX.3.4.7.20220422/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/index.js??vue-loader-options!../../../../../exe/HBuilderX.3.4.7.20220422/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./tm-countdown.vue?vue&type=script&lang=js&\"","<template>\r\n\t<view class=\"tm-countdown d-inline-block text-size-n\">\r\n\t\t<slot name=\"default\" :timeData=\"{data:time_data,finish:isfinish}\">{{text}}</slot>\r\n\t</view>\r\n</template>\r\n\r\n<script>\r\n\t/**\r\n\t * 倒计时\r\n\t * @description 倒计时。\r\n\t * @property {Number} time = [] 默认 10*1000,单位毫秒,倒计时的总时长。\r\n\t * @property {String} format = [] 默认 'DD天HH小时MM分SS秒',格式。如果只想要秒:SS秒。\r\n\t * @property {Boolean} autoStart = [] 默认 true,自动开始倒计时。\r\n\t * @property {Function} change 时间变化时触发。\r\n\t * @property {Function} finish 倒计时结束时触发。\r\n\t * @example <tm-button size=\"s\"><tm-countdown format=\"SS秒\" :time=\"6*1000\">\r\n\t\t\t\t<template v-slot:default=\"{timeData}\">\r\n\t\t\t\t\t{{timeData.finish?'结束':timeData.data.seconds}}\r\n\t\t\t\t</template>\r\n\t\t\t</tm-countdown></tm-button>\r\n\t */\r\n\texport default {\r\n\t\tname:\"tm-countdown\",\r\n\t\tprops:{\r\n\t\t\ttime:{\r\n\t\t\t\ttype:Number,\r\n\t\t\t\tdefault:10 * 1000\r\n\t\t\t},\r\n\t\t\tformat:{\r\n\t\t\t\ttype:String,\r\n\t\t\t\tdefault:'DD天HH小时MM分SS秒'\r\n\t\t\t},\r\n\t\t\tautoStart:{\r\n\t\t\t\ttype:Boolean,\r\n\t\t\t\tdefault:true\r\n\t\t\t}\r\n\t\t},\r\n\t\tdata() {\r\n\t\t\treturn {\r\n\t\t\t\ttimid:null,\r\n\t\t\t\tnow:0,\r\n\t\t\t\ttime_data:{}\r\n\t\t\t};\r\n\t\t},\r\n\t\tcomputed:{\r\n\t\t\ttext:function(){\r\n\t\t\t\tlet minaox = this.formatTime(this.time - this.now);\r\n\t\t\t\tlet ps = this.format;\r\n\t\t\t\tps = ps.replace(/(DD)/g,minaox.day);\r\n\t\t\t\tps = ps.replace(/(MM)/g,minaox.minutes);\r\n\t\t\t\tps = ps.replace(/(HH)/g,minaox.hour);\r\n\t\t\t\tps = ps.replace(/(SS)/g,minaox.seconds);\r\n\t\t\t\treturn ps;\r\n\t\t\t},\r\n\t\t\tisfinish:function(){\r\n\t\t\t\tif(this.now == this.time) return true;\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t},\r\n\t\tdestroyed() {\r\n\t\t\tclearInterval(this.time);\r\n\t\t},\r\n\t\tmounted() {\r\n\t\t\tthis.formatTime(this.time);\r\n\t\t\tif(this.autoStart){\r\n\t\t\t\tthis.start();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t},\r\n\t\tmethods: {\r\n\t\t\tformatTime(my_time){\r\n\t\t\t\t// var daysRound = Math.floor(my_time/1000/60/60/24);\r\n\t\t\t\tvar hoursRound = Math.floor(my_time/1000/60/60%24);\r\n\t\t\t\tvar minutesRound = Math.floor(my_time/1000/60%60);\r\n\t\t\t\tvar secondsRound = Math.floor(my_time/1000%60);\r\n\t\t\t\t// var millisecondRound = Math.floor(my_time % 1000);\r\n\t\t\t\tlet time = {\r\n\t\t\t\t\t\t// day:daysRound>9?daysRound:'0'+daysRound,//天\r\n\t\t\t\t\t\thour:hoursRound>9?hoursRound:'0'+hoursRound,//小时,\r\n\t\t\t\t\t\tminutes:minutesRound>9?minutesRound:'0'+minutesRound,//分.\r\n\t\t\t\t\t\tseconds:secondsRound>9?secondsRound:'0'+secondsRound,//秒。\r\n\t\t\t\t\t\t// millisecond:millisecondRound>9?millisecondRound:'0'+millisecondRound//毫秒。\r\n\t\t\t\t\t};\r\n\t\t\t\t\tthis.time_data = time;\r\n\t\t\t\treturn time;\r\n\t\t\t},\r\n\t\t\t// 开始或者继续。\r\n\t\t\tstart() {\r\n\t\t\t\tlet t = this;\r\n\t\t\t\tclearInterval(this.timid);\r\n\t\t\t\tthis.timid = setInterval(()=>{\r\n\t\t\t\t\tlet lst = t.now + 50;\r\n\t\t\t\t\tif(lst == t.time){\r\n\t\t\t\t\t\tt.$emit('finish')\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(lst > t.time){\r\n\t\t\t\t\t\tclearInterval(t.timid);\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tt.now =lst;\r\n\t\t\t\t\tt.$emit('change',t.time_data)\r\n\t\t\t\t},50)\r\n\t\t\t},\r\n\t\t\t// 停止,直接结束。\r\n\t\t\tstop(){\r\n\t\t\t\tclearInterval(this.timid);\r\n\t\t\t\tthis.now = this.time;\r\n\t\t\t},\r\n\t\t\t// 暂停。\r\n\t\t\tpause(){\r\n\t\t\t\tclearInterval(this.timid);\r\n\t\t\t},\r\n\t\t\t// 重置。\r\n\t\t\tresinit(){\r\n\t\t\t\tclearInterval(this.timid);\r\n\t\t\t\tthis.now = 0;\r\n\t\t\t}\r\n\t\t},\r\n\t}\r\n</script>\r\n\r\n<style lang=\"scss\">\r\n\r\n</style>\r\n"],"sourceRoot":""}
|