更新音乐播放器

This commit is contained in:
jmal 2020-03-31 22:25:48 +08:00
parent 85950d56b0
commit cd0ee5a70b
4 changed files with 13 additions and 11 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

View File

@ -104,7 +104,7 @@ export default {
checkChunkUploadedByResponse: function(chunk, message) { checkChunkUploadedByResponse: function(chunk, message) {
const objMessage = JSON.parse(message) const objMessage = JSON.parse(message)
const res = objMessage.data const res = objMessage.data
if (res.pass) { if (res && res.pass) {
// 秒传 // 秒传
return true return true
} }

View File

@ -12,7 +12,7 @@
order.sync="list" order.sync="list"
:mini.sync="mini" :mini.sync="mini"
:audio="audio" :audio="audio"
:lrctype="3"> :lrc-type="0">
</aplayer> </aplayer>
<div v-show="closeBarShow" class="close-bar" @click="close"> <div v-show="closeBarShow" class="close-bar" @click="close">
<svg-icon class="audio-player-close" icon-class="close"/> <svg-icon class="audio-player-close" icon-class="close"/>
@ -50,13 +50,15 @@ export default {
Bus.$on('onAddAudio',newFile => { Bus.$on('onAddAudio',newFile => {
this.show = true this.show = true
let url = process.env.VUE_APP_BASE_FILE_API + 'preview/' + newFile.name + '?jmal-token=' + this.$store.state.user.token + '&fileIds=' + newFile.id let url = process.env.VUE_APP_BASE_FILE_API + 'preview/' + newFile.name + '?jmal-token=' + this.$store.state.user.token + '&fileIds=' + newFile.id
let music = newFile.music
let fileName = newFile.name.substring(0,newFile.name.length - newFile.suffix.length-1)
let musicOperation = { let musicOperation = {
id: newFile.id, id: newFile.id,
name: newFile.name, name: music.songName ? music.songName : fileName,
artist: newFile.name, artist: music.songName ? music.singer : fileName,
url: url, url: url,
type: newFile.contentType, type: newFile.contentType,
cover: 'https://images.unsplash.com/photo-1495420378468-78588a508652?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=2100&q=80', cover: music.songName ? 'data:image/png;base64,'+music.coverBase64 :'',
} }
let musicIndex = this.audio.findIndex(item => item.id===newFile.id) let musicIndex = this.audio.findIndex(item => item.id===newFile.id)
if(musicIndex < 0){ if(musicIndex < 0){
@ -85,7 +87,7 @@ export default {
}, },
onPicClick() { onPicClick() {
// this.mini = !this.mini // this.mini = !this.mini
console.log(this.$refs.audioPlayer) // console.log(this.$refs.audioPlayer)
}, },
}, },
destroyed() { destroyed() {

View File

@ -29,7 +29,7 @@ import Viewer from 'v-viewer'
import APlayer from '@moefe/vue-aplayer'; import APlayer from '@moefe/vue-aplayer';
Vue.use(APlayer, { Vue.use(APlayer, {
defaultCover: 'https://images.unsplash.com/photo-1495420378468-78588a508652?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=2100&q=80', // 设置播放器默认封面图片 defaultCover: 'https://images.unsplash.com/photo-1511671782779-c97d3d27a1d4?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=800&q=60', // 设置播放器默认封面图片
productionTip: false, // 是否在控制台输出版本信息 productionTip: false, // 是否在控制台输出版本信息
}); });