- 设置audio的autoplay="autoplay"后,src的值变换都会自动播放;
- audio还有play,pause触发事件;
query:function(){
var that = this;
axios.get("https://autumnfish.cn/search?keywords="+this.keyword)
.then(function(response){
that.songs = response.data.result.songs;
},function(err){
})
},
playMusic:function(musicId){
var that = this;
axios.get("https://autumnfish.cn/song/url?id="+musicId)
.then(function(response){
console.log(response);
that.musicUrl = response.data.data[0].url;
},function(err){})
axios.get("https://autumnfish.cn/song/detail?ids="+musicId)
.then(function(response){
that.picUrl=response.data.songs[0].al.picUrl;
},function(err){});
axios.get("https://autumnfish.cn/comment/hot?type=0&id="+musicId)
.then(function(response){
that.comments = response.data.hotComments;
},function(err){})
},
playMv:function(mvId){
var that = this;
axios.get("https://autumnfish.cn/mv/url?id="+mvId)
.then(function(response){
that.mvUrl = response.data.data.url;
that.mvIsPlaying = true;
},function(err){})
}