@@ -93,11 +93,21 @@
>
-
+
-
已添加到播放列表
@@ -121,10 +134,15 @@
hidefocus="true"
data-action="panel"
class="icn icn-list s-fc3"
- >1
+ >{{ playlist.length }}
-
循环
+
+ {{ currentMode.name }}
+
@@ -140,19 +158,24 @@
@@ -600,9 +682,15 @@ i {
margin: 11px 2px 0 0;
text-indent: -9999px;
}
+.m-playbar .icn-add:hover {
+ background-position: -88px -189px;
+}
.m-playbar .icn-add {
background-position: -88px -163px;
}
+.m-playbar .icn-share:hover {
+ background-position: -114px -189px;
+}
.m-playbar .icn-share {
background-position: -114px -163px;
}
@@ -662,6 +750,9 @@ i {
.m-playbar .icn-vol {
background-position: -2px -248px;
}
+.m-playbar .icn-vol:hover {
+ background-position: -31px -248px;
+}
.m-playbar .icn {
float: left;
width: 25px;
@@ -669,9 +760,24 @@ i {
margin: 11px 2px 0 0;
text-indent: -9999px;
}
+.m-playbar .icn-loop:hover {
+ background-position: -33px -344px;
+}
.m-playbar .icn-loop {
background-position: -3px -344px;
}
+.m-playbar .icn-one:hover {
+ background-position: -93px -344px;
+}
+.m-playbar .icn-one {
+ background-position: -66px -344px;
+}
+.m-playbar .icn-shuffle:hover {
+ background-position: -93px -248px;
+}
+.m-playbar .icn-shuffle {
+ background-position: -66px -248px;
+}
.m-playbar .add {
float: left;
width: 59px;
diff --git a/src/store/module/music/getters.js b/src/store/module/music/getters.js
index c7f5a1bd2ea2069f3b2bf4ac803f5b85755af619..277d87502b1182dfe723658c85493cd3319eaa82 100644
--- a/src/store/module/music/getters.js
+++ b/src/store/module/music/getters.js
@@ -1,22 +1,23 @@
import { isDef } from "common/utils";
import { playModeMap } from "common/config";
+function getRandomIndex(playlist, currentIndex) {
+ // 防止无限循环
+ if (playlist.length === 1) {
+ return currentIndex;
+ }
+ let index = Math.round(Math.random() * (playlist.length - 1));
+ if (index === currentIndex) {
+ index = getRandomIndex(playlist, currentIndex);
+ }
+ return index;
+}
+
export default {
currentIndex(state) {
const { currentSong, playlist } = state;
return playlist.findIndex(({ id }) => id === currentSong.id);
},
- getRandomIndex(playlist, currentIndex) {
- // 防止无限循环
- if (playlist.length === 1) {
- return currentIndex;
- }
- let index = Math.round(Math.random() * (playlist.length - 1));
- if (index === currentIndex) {
- index = getRandomIndex(playlist, currentIndex);
- }
- return index;
- },
nextSong(state, getters) {
const { playlist, playMode } = state;
const nextStratMap = {