新增功能

This commit is contained in:
Starlight_0208 2022-04-29 14:00:02 +08:00
parent d4a6adf857
commit be57a10b28
2 changed files with 4 additions and 1 deletions

View File

@ -9,6 +9,7 @@
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<h1>This is a Web Player for 163 CloudMusic.</h1>
<div>
<div id="searchbox">
<input type="text" id="search-song">
@ -18,6 +19,7 @@
<button type="button" onclick="playthelist()" id="btngreen">播放列表</button>
<button type="button" onclick="playnext()" id="btngreen">立即切歌</button>
<button type="button" onclick="gethistory()" id="btngreen">播放历史</button>
<button type="button" onclick="removehistory()" id="btngreen">清空记录</button>
<div>
<div id="nowplaystat">Now Playing: <span id="nowplay">None</span></div>
<audio src="#" controls id="Player"></audio>

View File

@ -212,7 +212,8 @@ function gethistory(){
var reslist = document.getElementById("reslist");
reslist.innerHTML = "";
for(var i = 0; i < historyList.length; i++){
reslist.innerHTML += `<li>${historyList[i].songname} - ${historyList[i].artist}</li>`;
reslist.innerHTML += `<li>${historyList[i].songname} - ${historyList[i].artist}` +
`<button type="button" id="playbtn" onclick="addlist(${historyList[i].songid}, '${historyList[i].songname}', '${historyList[i].artist}')">加入播放列表</button></li>`;
}
document.getElementById('keyword').innerHTML = "历史记录";
}