|
|
|
@ -1,6 +1,6 @@
|
|
|
|
|
<template> |
|
|
|
|
<view> |
|
|
|
|
<view class="card" v-for="(item,index) in list" :key="index"> |
|
|
|
|
<view class="card" v-for="(item,index) in list" :key="index" > |
|
|
|
|
<view class="card-left"> |
|
|
|
|
<view class="card-up-list"> |
|
|
|
|
<view class="card-up-list-list"> |
|
|
|
@ -88,6 +88,7 @@
|
|
|
|
|
|
|
|
|
|
this.getArr(); |
|
|
|
|
this.isMenu(); |
|
|
|
|
this.getTime() |
|
|
|
|
}, |
|
|
|
|
onShow() { |
|
|
|
|
this.getData() |
|
|
|
@ -151,6 +152,9 @@
|
|
|
|
|
getData(){ |
|
|
|
|
firstCheckLists({type:1}).then(res => { |
|
|
|
|
this.list = res; |
|
|
|
|
this.list.map(item=>{ |
|
|
|
|
this.dateFormat(item.open_time) |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
stopLine(item){ |
|
|
|
@ -201,7 +205,83 @@
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
getTime:function(){ |
|
|
|
|
|
|
|
|
|
var date = new Date(), |
|
|
|
|
year = date.getFullYear(), |
|
|
|
|
month = date.getMonth() + 1, |
|
|
|
|
day = date.getDate(), |
|
|
|
|
hour = date.getHours() < 10 ? "0" + date.getHours() : date.getHours(), |
|
|
|
|
minute = date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes(), |
|
|
|
|
second = date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds(); |
|
|
|
|
month >= 1 && month <= 9 ? (month = "0" + month) : ""; |
|
|
|
|
day >= 0 && day <= 9 ? (day = "0" + day) : ""; |
|
|
|
|
var timer = year + '-' + month + '-' + day + ' ' + hour + ':' + minute + ':' + second; |
|
|
|
|
console.log("当前时间",timer) |
|
|
|
|
return timer; |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
dateFormat(second){ |
|
|
|
|
console.log("开线时间",second) |
|
|
|
|
var dd,hh,mm,ss; |
|
|
|
|
|
|
|
|
|
second = typeof second === 'string' ? parseInt(second) : second; |
|
|
|
|
|
|
|
|
|
if(!second || second < 0){ |
|
|
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//天 |
|
|
|
|
|
|
|
|
|
dd = second / (24 * 3600) | 0; |
|
|
|
|
|
|
|
|
|
second = Math.round(second) - dd * 24 * 3600; |
|
|
|
|
|
|
|
|
|
//小时 |
|
|
|
|
|
|
|
|
|
hh = second / 3600 | 0; |
|
|
|
|
|
|
|
|
|
second = Math.round(second) - hh * 3600; |
|
|
|
|
|
|
|
|
|
//分 |
|
|
|
|
|
|
|
|
|
mm = second / 60 | 0; |
|
|
|
|
|
|
|
|
|
//秒 |
|
|
|
|
|
|
|
|
|
ss = Math.round(second) - mm * 60; |
|
|
|
|
|
|
|
|
|
if(Math.round(dd) < 10){ |
|
|
|
|
|
|
|
|
|
dd = dd > 0 ? '0' + dd : ''; |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if(Math.round(hh) < 10){ |
|
|
|
|
|
|
|
|
|
hh = '0' + hh; |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if(Math.round(mm) < 10){ |
|
|
|
|
|
|
|
|
|
mm = '0' + mm; |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if(Math.round(ss) < 10){ |
|
|
|
|
|
|
|
|
|
ss = '0' + ss; |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// alert( dd + ' ' + hh + ':' + mm + ':' + ss); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
</script> |
|
|
|
|