export function CoutDown(Endtime) {

  let leftTime = (new Date(Endtime.replace(/-/g, '/'))) - new Date(); //计算剩余的毫秒数
  let days = parseInt(leftTime / 1000 / 60 / 60 / 24, 10); //计算剩余的天数
  let hours = parseInt(leftTime / 1000 / 60 / 60 % 24, 10); //计算剩余的小时
  let minutes = parseInt(leftTime / 1000 / 60 % 60, 10);//计算剩余的分钟
  let seconds = parseInt(leftTime / 1000 % 60, 10);//计算剩余的秒数

  days = checkTime(days);
  hours = checkTime(hours);
  minutes = checkTime(minutes);
  seconds = checkTime(seconds);

  if (days >= 0 || hours >= 0 || minutes >= 0 || seconds >= 0) {
    document.getElementById("timer").innerHTML = days + "天" + hours + "小时" + minutes + "分" + seconds + "秒";
  }
  function checkTime(i) { //将0-9的数字前面加上0，例1变为01
    if (i < 10) {
      i = "0" + i;
    }
    return i;
  }
}