diff --git "a/\346\230\223\346\226\207\350\220\215\347\232\204\344\275\234\344\270\232/2022-04-06-vue\344\275\234\344\270\232/RushPurchase.html" "b/\346\230\223\346\226\207\350\220\215\347\232\204\344\275\234\344\270\232/2022-04-06-vue\344\275\234\344\270\232/RushPurchase.html" new file mode 100644 index 0000000000000000000000000000000000000000..096b689a94fbd464b494b3057ae4abb79e375250 --- /dev/null +++ "b/\346\230\223\346\226\207\350\220\215\347\232\204\344\275\234\344\270\232/2022-04-06-vue\344\275\234\344\270\232/RushPurchase.html" @@ -0,0 +1,42 @@ + + + + + + Document + + + + + + + +
+

京东秒杀

+ +

18:00点场 倒计时

+
+ {{h}} + : + {{m}} + : + {{s}} +
+ + 全场折扣: + {{DisCount}}{{count}}折 + +
+ + \ No newline at end of file diff --git "a/\346\230\223\346\226\207\350\220\215\347\232\204\344\275\234\344\270\232/2022-04-06-vue\344\275\234\344\270\232/RushPurchase.js" "b/\346\230\223\346\226\207\350\220\215\347\232\204\344\275\234\344\270\232/2022-04-06-vue\344\275\234\344\270\232/RushPurchase.js" new file mode 100644 index 0000000000000000000000000000000000000000..f1279f47fdc62f010bb2088f8fd6b6d84f616660 --- /dev/null +++ "b/\346\230\223\346\226\207\350\220\215\347\232\204\344\275\234\344\270\232/2022-04-06-vue\344\275\234\344\270\232/RushPurchase.js" @@ -0,0 +1,55 @@ +window.onload = () => { + let vm = new Vue({ + el:"#box", + data:function () { + return{ + Timedown:true, + h:0, + m:0, + s:0, + ms:"", + conut:"" + } + }, + mounted:function () { + this.countdown(); + }, + methods:{ + go:function(){ + this.Timedown = true; + }, + }, + computed:{ + DisCount:function (){ + let only = new Date().getTime() + 3600000; + let come = setInterval( ()=>{ + let now = only - new Date().getTime(); + let hours = parseInt((now % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)) + let minutes = parseInt((now % (1000 * 60 * 60)) / (1000 * 60)) + let seconds = parseInt((now % (1000 * 60)) / 1000) + this.h = hours > 9 ? hours:'0' +hours;//格式化时间hh:mm:ss + this.m = minutes >9 ? minutes:'0' +minutes; + this.s = seconds >9 ? seconds:'0' +seconds; + if(this.s < 0){ + clearInterval(come); + } + if(this.h <= 1 && this.m>50){ + this.count = "6" // 1小时- 50分钟:6折 + }else if (this.h==0 && this.m<=50 && this.m>40){ + this.count = "5.5" // 50分钟 - 40分钟:5.5折 + }else if (this.h==0 && this.m<=40 && this.m>30){ + this.count = "5" // 40分钟 - 30分钟:5折 + }else if (this.h==0 && this.m<=30 && this.m>20){ + this.count = "4.5" // 30分钟 - 20分钟:4.5折 + }else if (this.h==0 && this.m<=20 && this.m>10){ + this.count = "4" // 20分钟 - 10分钟:4折 + }else if (this.h==0 && this.m<=10 && this.m>0){ + this.count = "3.5" // 10分钟 - 0分钟:3.5折 + }else if(this.h==0 && this.m==0 && this.s==0){ + alert('活动结束!') + } + },100) + }, + } + }) +} \ No newline at end of file diff --git "a/\346\230\223\346\226\207\350\220\215\347\232\204\344\275\234\344\270\232/2022-04-06-vue\344\275\234\344\270\232/details.css" "b/\346\230\223\346\226\207\350\220\215\347\232\204\344\275\234\344\270\232/2022-04-06-vue\344\275\234\344\270\232/details.css" new file mode 100644 index 0000000000000000000000000000000000000000..2fa19277469606c71c7c3c65eb1d6a6e9cab6e72 --- /dev/null +++ "b/\346\230\223\346\226\207\350\220\215\347\232\204\344\275\234\344\270\232/2022-04-06-vue\344\275\234\344\270\232/details.css" @@ -0,0 +1,49 @@ +#box{ + margin-left: 100px; + width: 230px; + height: 320px; + background: #E72D21; +} +h1{ + padding-top: 50px; + text-align: center; + color: white; +} +img{ + margin-left: 100px; +} +h4{ + color: white; + text-align: center; +} +#logo{ + width: 200px; + height: 130px; +} +#small-box{ + margin-left: 60px; + margin-bottom: 20px; +} +#time{ + padding: 3px 4px 3px 4px; + width: 10px; + height: 10px; + background-color: #2F3430; + color: white; +} +#bubbling{ + color: white; + background-color: #E72D21; +} +#qczk{ + margin-left: 55px; + color: white; +} +#discount{ + padding: 3px 4px 3px 4px; + border: 1px solid #E72D21; + width: 10px; + height: 10px; + background-color: white; + color: #E72D21; +} \ No newline at end of file diff --git "a/\346\230\223\346\226\207\350\220\215\347\232\204\344\275\234\344\270\232/2022-04-06-vue\344\275\234\344\270\232/\344\272\254\344\270\234logo.webp" "b/\346\230\223\346\226\207\350\220\215\347\232\204\344\275\234\344\270\232/2022-04-06-vue\344\275\234\344\270\232/\344\272\254\344\270\234logo.webp" new file mode 100644 index 0000000000000000000000000000000000000000..05ce4888b52825a817081cc47a2103b7fa2b4301 Binary files /dev/null and "b/\346\230\223\346\226\207\350\220\215\347\232\204\344\275\234\344\270\232/2022-04-06-vue\344\275\234\344\270\232/\344\272\254\344\270\234logo.webp" differ diff --git "a/\346\230\223\346\226\207\350\220\215\347\232\204\344\275\234\344\270\232/2022-04-06-vue\344\275\234\344\270\232/\351\227\252\347\224\265.png" "b/\346\230\223\346\226\207\350\220\215\347\232\204\344\275\234\344\270\232/2022-04-06-vue\344\275\234\344\270\232/\351\227\252\347\224\265.png" new file mode 100644 index 0000000000000000000000000000000000000000..d4d7247b92bcadc87c07b8a5f7c10910c9b457d5 Binary files /dev/null and "b/\346\230\223\346\226\207\350\220\215\347\232\204\344\275\234\344\270\232/2022-04-06-vue\344\275\234\344\270\232/\351\227\252\347\224\265.png" differ