Commit 59ce73b8 by 李嘉林

测试赛倒计时组件

parent a09e1405
...@@ -55,8 +55,10 @@ export default { ...@@ -55,8 +55,10 @@ export default {
let month = (new Date().getMonth() + 1) < 10 ? '0'+(new Date().getMonth() + 1):(new Date().getMonth() + 1); let month = (new Date().getMonth() + 1) < 10 ? '0'+(new Date().getMonth() + 1):(new Date().getMonth() + 1);
let day = new Date().getDate() < 10 ?'0'+new Date().getDate():new Date().getDate(); let day = new Date().getDate() < 10 ?'0'+new Date().getDate():new Date().getDate();
let today = `${year}/${month}/${day} 00:00:00`; let today = `${year}/${month}/${day} 00:00:00`;
console.log(today,'------------58') // console.log(today,'------------58')
let ts = new Date(this.endTime).getTime() - new Date(today).getTime(); //计算剩余的毫秒数 // let ts = new Date(this.endTime).getTime() - new Date(today).getTime(); //计算剩余的毫秒数
let ts = new Date(this.endTime).getTime() - new Date().getTime(); //计算剩余的毫秒数
console.log(ts,'------60----ts')
ts = parseInt(ts / 1000 / 60 / 60 / 24, 10); //计算剩余的天数 ts = parseInt(ts / 1000 / 60 / 60 / 24, 10); //计算剩余的天数
console.log(ts,'----------------------59') console.log(ts,'----------------------59')
return ts; return ts;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment