From 51f091d64891e9915f30720c75aa15db72fe73d3 Mon Sep 17 00:00:00 2001 From: liugongyu <290219706@qq.com> Date: Mon, 16 May 2022 11:49:13 +0800 Subject: [PATCH] 停车记录详情 --- common/common.js | 50 +++++++++++++++++++++++++++++++++++++++++++++++++- pages/parkRecordList/parkRecordList.vue | 10 ++++------ pages/parkRecordList/recordDetail.vue | 57 +++++++++++++++++++++------------------------------------ 3 files changed, 74 insertions(+), 43 deletions(-) diff --git a/common/common.js b/common/common.js index 23a0a8a..986721f 100644 --- a/common/common.js +++ b/common/common.js @@ -124,6 +124,54 @@ var moneyFormat = function (val) { return (val/100).toFixed(2) } +var dateFormat = function (msd) { // 时间转换 + var time = msd + + if (null != time && "" != time) { + + if (time > 60 && time < 60 * 60) { + + time = parseInt(time / 60.0) + "分钟" + parseInt((parseFloat(time / 60.0) - + + parseInt(time / 60.0)) * 60) + "秒"; + + } + + else if (time >= 60 * 60 && time < 60 * 60 * 24) { + + time = parseInt(time / 3600.0) + "小时" + parseInt((parseFloat(time / 3600.0) - + + parseInt(time / 3600.0)) * 60) + "分钟" + + + parseInt((parseFloat((parseFloat(time / 3600.0) - parseInt(time / 3600.0)) * 60) - + + parseInt((parseFloat(time / 3600.0) - parseInt(time / 3600.0)) * 60)) * 60) + "秒"; + + } else if (time >= 60 * 60 * 24) { + + time = parseInt(time / 3600.0 / 24) + "天" + parseInt((parseFloat(time / 3600.0 / 24) - + + parseInt(time / 3600.0 / 24)) * 24) + "小时" + parseInt((parseFloat(time / 3600.0) - + + parseInt(time / 3600.0)) * 60) + "分钟" + + + parseInt((parseFloat((parseFloat(time / 3600.0) - parseInt(time / 3600.0)) * 60) - + + parseInt((parseFloat(time / 3600.0) - parseInt(time / 3600.0)) * 60)) * 60) + "秒"; + + } + + else { + + time = parseInt(time) + "秒"; + + } + + } + + return time; +} + export default { // deviceInfo, @@ -136,7 +184,7 @@ export default { SetToken, requestSign, moneyFormat, - + dateFormat, // 接口 userLogin, indexInfo, diff --git a/pages/parkRecordList/parkRecordList.vue b/pages/parkRecordList/parkRecordList.vue index ce750b9..1599d13 100644 --- a/pages/parkRecordList/parkRecordList.vue +++ b/pages/parkRecordList/parkRecordList.vue @@ -28,7 +28,7 @@ - + {{i.plName}} @@ -59,8 +59,6 @@