This commit is contained in:
Starlight-0208 2022-11-19 17:18:26 +08:00
parent da09e7072a
commit a42f34825b
4 changed files with 52 additions and 7 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.vscode

View File

@ -48,7 +48,7 @@
border: 1px solid #4da7fe;
}
#btngreen{
#btnorange{
background-color: #ff6e06;
border: 1px solid #ff6e06;
border-radius: 5px;
@ -58,7 +58,17 @@
margin-top: 5px;
}
#btngreen:hover{
#btnred{
background-color: #ff3d40;
border: 1px solid #ff3d40;
border-radius: 5px;
color: #fff;
padding: 5px 10px;
cursor: pointer;
margin-top: 5px;
}
#btnorange:hover{
background-color: #ffa632;
border: 1px solid #ffa632;
}

View File

@ -15,11 +15,15 @@
<input type="text" id="search-song">
<button type="button" onclick="getsongs()" id="searchbtn">搜索</button>
</div>
<button type="button" onclick="getplaylist()" id="btngreen">查看列表</button>
<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="ClearList()" id="btngreen">清空记录</button>
<button type="button" onclick="getplaylist()" id="btnorange">查看列表</button>
<button type="button" onclick="playthelist()" id="btnorange">播放列表</button>
<button type="button" onclick="playnext()" id="btnorange">立即切歌</button>
<button type="button" onclick="gethistory()" id="btnorange">播放历史</button>
<button type="button" onclick="ClearList()" id="btnorange">清空记录</button>
<br />
<input type="text" placeholder="列表ID" name="listID" id="listid"/>
<button type="button" onclick="" id="btnred">接收云列表</button>
<button type="button" onclick="" id="btnred">上传云列表</button>
<div>
<div id="nowplaystat">Now Playing: <span id="nowplay">None</span></div>
<audio src="#" controls id="Player"></audio>

View File

@ -266,9 +266,39 @@ function ClearthePlaylist(){
// 推送到云播放列表
function PushToCloud(){
// Cloud Prepareing...
var server_api = "";
var xhr = new XMLHttpRequest();
var historyList = JSON.parse(localStorage.getItem("historyList"));
msg = JSON.stringify({
"length": historyList.length,
"payload": historyList
});
xhr.open("POST", server_api, true);
xhr.send();
xhr.onreadystatechange = function(){
var obj = JSON.parse(xhr.responseText);
if(obj.statusCode == 0){
console.log("Success!");
}else{
console.log("Send Failed.");
}
}
}
// 拉取云播放列表
function PullToCloud(){
// Cloud Prepareing...
var listid = document.getElementById("listid").value;
var server_api = `http://localhost:12345/getMusicList?listid=${listid}`;
var xhr = new XMLHttpRequest();
xhr.open("GET", server_api, true);
xhr.send();
xhr.onreadystatechange = function(){
var obj = JSON.parse(xhr.responseText);
if(true){
;
}else{
;
}
}
}