1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
| changeMusicList: function () { const playlists = [ { id: "9367151983", server: "tencent" }, { id: "7579081163", server: "netease" }, { id: "7852948439", server: "tencent" }, { custom: true,id: "home", server: "home" }, ];
const currentIndex = parseInt(new URLSearchParams(window.location.search).get("index")) || 0;
const nextIndex = (currentIndex + 1) % playlists.length;
const nextPlaylist = playlists[nextIndex]; if (nextPlaylist.custom) { const newUrl = `/music/`; console.info("切换到默认歌单:", newUrl); window.location.href = newUrl; } else { const newUrl = `/music/?id=${nextPlaylist.id}&server=${nextPlaylist.server}&index=${nextIndex}`; console.info("切换到新歌单:", newUrl); window.location.href = newUrl; } },
|