zoukankan      html  css  js  c++  java
  • 得到剩余时间

     // 得到剩余审核时间
        getTimes(item) {
          console.log(this.changeDate(new Date(item.checkTimeStr)), this.changeDate(new Date(item.endTimeStr)))
    
          // examineTime审核时长  checkTime提交时间   endTime结束时间
          function countDown(examineTime, checkTime, endTime) {
            let nowTime = +new Date()
            console.log(nowTime)
            let examineTime1 = examineTime * 60000
            let checkTime1 = checkTime
            let endTime1 = endTime
            let times = 0
            
            if (checkTime1 + examineTime1 >= endTime1) {
              times = (endTime1 - nowTime) / 1000
            } else {
              times = (checkTime1 + examineTime1 - nowTime) / 1000
            }
    
            if (times <= 0) {
              return '审核超时'
            } else {
              let d = parseInt(times / 60 / 60 / 24)
              d = d < 10 ? '0' + d : d
              let h = parseInt((times / 60 / 60) % 24)
              h = h < 10 ? '0' + h : h
              let m = parseInt((times / 60) % 60)
              m = m < 10 ? '0' + m : m
              let s = parseInt(times % 60)
              s = s < 10 ? '0' + s : s
              return d + '天' + h + '时' + m + '分' + s + '秒'
            }
          }
          let hh = countDown(item.examineDuration, item.checkTimeStr, item.endTimeStr)
    
          return hh
        },
  • 相关阅读:
    WEB
    Python
    Git
    JavaScript
    鸡汤
    面向对象
    Python
    Python
    MongoDB
    Oracle 11g 安装
  • 原文地址:https://www.cnblogs.com/yadi001/p/14708725.html
Copyright © 2011-2022 走看看