diff --git a/pages/customer/index.wxml b/pages/customer/index.wxml index deda417..a383322 100644 --- a/pages/customer/index.wxml +++ b/pages/customer/index.wxml @@ -1,3 +1,19 @@ + + var formatTime = function(time) { + // 总秒数 + var totalSecond = Math.floor(time); + //天 + var day = Math.floor(totalSecond / 3600 / 24); + // 小时 + var hour = Math.floor(totalSecond / 3600); + // 分钟 + var minute = Math.floor(totalSecond / 60) % 60; + // 秒 + var second = totalSecond % 60; + return day + '天' + hour + '小时' + minute + '分' + second + '秒'; + } + exports.formatTime = formatTime; + @@ -75,7 +91,7 @@ ({{item.mobile}}) - {{'距转派还剩'+item.left_time+'秒'}} + {{'距转派还剩'+tool.formatTime(item.left_time)}}