mirror of
https://github.com/qier222/YesPlayMusic.git
synced 2024-11-25 09:41:49 +08:00
fix(player): 修复歌曲时长过长时的进度显示问题 (#1936)
原先进度条遇到时长超过 1hr 的歌曲, 不会呈现小时数的部分。这个 commit 将歌曲时长小时数加到分钟数中。
This commit is contained in:
parent
65f5df8a60
commit
b7f7ac8d31
|
@ -187,6 +187,7 @@ import '@/assets/css/slider.css';
|
|||
import ButtonIcon from '@/components/ButtonIcon.vue';
|
||||
import VueSlider from 'vue-slider-component';
|
||||
import { goToListSource, hasListSource } from '@/utils/playList';
|
||||
import { formatTrackTime } from '@/utils/common';
|
||||
|
||||
export default {
|
||||
name: 'Player',
|
||||
|
@ -239,10 +240,7 @@ export default {
|
|||
: this.$router.push({ name: 'next' });
|
||||
},
|
||||
formatTrackTime(value) {
|
||||
if (!value) return '';
|
||||
let min = ~~((value / 60) % 60);
|
||||
let sec = (~~(value % 60)).toString().padStart(2, '0');
|
||||
return `${min}:${sec}`;
|
||||
return formatTrackTime(value);
|
||||
},
|
||||
hasList() {
|
||||
return hasListSource();
|
||||
|
|
|
@ -221,7 +221,7 @@ export function bytesToSize(bytes) {
|
|||
|
||||
export function formatTrackTime(value) {
|
||||
if (!value) return '';
|
||||
let min = ~~((value / 60) % 60);
|
||||
let min = ~~(value / 60);
|
||||
let sec = (~~(value % 60)).toString().padStart(2, '0');
|
||||
return `${min}:${sec}`;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user