Commit 3436e73e720b5a15cf038369a88f2e99c1ad17f5

Authored by 648540858
1 parent 9c3967d6

修复云端录像时间显示错误

web_src/src/components/CloudRecord.vue
@@ -264,14 +264,16 @@ export default { @@ -264,14 +264,16 @@ export default {
264 }); 264 });
265 }, 265 },
266 formatTime(time) { 266 formatTime(time) {
267 - const h = parseInt(time / 3600)  
268 - const minute = parseInt(time / 60 % 60)  
269 - const second = Math.ceil(time % 60)  
270 -  
271 - return (h > 0 ? h + `小时` : '') + (minute > 0 ? minute + '分' : '') + second + '秒' 267 + const h = parseInt(time / 3600 / 1000)
  268 + const minute = parseInt((time - h * 3600 * 1000) / 60 / 1000)
  269 + let second = Math.ceil((time - h * 3600 * 1000 - minute * 60 * 1000) / 1000)
  270 + if (second < 0) {
  271 + second = 0;
  272 + }
  273 + return (h > 0 ? h + `小时` : '') + (minute > 0 ? minute + '分' : '') + (second > 0 ? second + '秒' : '')
272 }, 274 },
273 formatTimeStamp(time) { 275 formatTimeStamp(time) {
274 - return moment.unix(time).format('yyyy-MM-DD HH:mm:ss') 276 + return moment.unix(time/1000).format('yyyy-MM-DD HH:mm:ss')
275 } 277 }
276 278
277 } 279 }