歌曲列表右击菜单新增跳转到当前歌曲源官方详情页菜单
parent
9eec1adf77
commit
5d91643637
|
@ -948,14 +948,13 @@ export default {
|
||||||
.progress {
|
.progress {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 3px;
|
height: 3px;
|
||||||
border-radius: 10px;
|
|
||||||
// overflow: hidden;
|
// overflow: hidden;
|
||||||
transition: @transition-theme;
|
transition: @transition-theme;
|
||||||
transition-property: background-color;
|
transition-property: background-color;
|
||||||
background-color: @color-player-progress;
|
background-color: @color-player-progress;
|
||||||
// background-color: #f5f5f5;
|
// background-color: #f5f5f5;
|
||||||
position: relative;
|
position: relative;
|
||||||
border-radius: @radius-progress-border;
|
border-radius: 20px;
|
||||||
}
|
}
|
||||||
.progress-mask {
|
.progress-mask {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
@ -972,7 +971,7 @@ export default {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
transform-origin: 0;
|
transform-origin: 0;
|
||||||
border-radius: @radius-progress-border;
|
border-radius: 20px;
|
||||||
}
|
}
|
||||||
.progress-bar1 {
|
.progress-bar1 {
|
||||||
background-color: @color-player-progress-bar1;
|
background-color: @color-player-progress-bar1;
|
||||||
|
@ -1008,6 +1007,7 @@ export default {
|
||||||
color: @color-player-status-text;
|
color: @color-player-status-text;
|
||||||
.mixin-ellipsis-1;
|
.mixin-ellipsis-1;
|
||||||
// padding: 0 5px;
|
// padding: 0 5px;
|
||||||
|
padding-right: 5px;
|
||||||
flex: 1 1 0;
|
flex: 1 1 0;
|
||||||
// text-align: center;
|
// text-align: center;
|
||||||
line-height: 1.2;
|
line-height: 1.2;
|
||||||
|
|
|
@ -49,6 +49,7 @@ div(:class="$style.songList")
|
||||||
<script>
|
<script>
|
||||||
import { mapGetters } from 'vuex'
|
import { mapGetters } from 'vuex'
|
||||||
import { scrollTo, clipboardWriteText, assertApiSupport, findParentNode } from '../../utils'
|
import { scrollTo, clipboardWriteText, assertApiSupport, findParentNode } from '../../utils'
|
||||||
|
import musicSdk from '../../utils/music'
|
||||||
export default {
|
export default {
|
||||||
name: 'MaterialSongList',
|
name: 'MaterialSongList',
|
||||||
model: {
|
model: {
|
||||||
|
@ -113,15 +114,20 @@ export default {
|
||||||
action: 'download',
|
action: 'download',
|
||||||
disabled: !this.listMenu.itemMenuControl.download,
|
disabled: !this.listMenu.itemMenuControl.download,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: this.$t('material.song_list.list_search'),
|
||||||
|
action: 'search',
|
||||||
|
disabled: !this.listMenu.itemMenuControl.search,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: this.$t('material.song_list.list_add_to'),
|
name: this.$t('material.song_list.list_add_to'),
|
||||||
action: 'addTo',
|
action: 'addTo',
|
||||||
disabled: !this.listMenu.itemMenuControl.addTo,
|
disabled: !this.listMenu.itemMenuControl.addTo,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: this.$t('material.song_list.list_search'),
|
name: this.$t('material.song_list.list_source_detail'),
|
||||||
action: 'search',
|
action: 'sourceDetail',
|
||||||
disabled: !this.listMenu.itemMenuControl.search,
|
disabled: !this.listMenu.itemMenuControl.sourceDetail,
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -169,6 +175,7 @@ export default {
|
||||||
addTo: true,
|
addTo: true,
|
||||||
download: true,
|
download: true,
|
||||||
search: true,
|
search: true,
|
||||||
|
sourceDetail: true,
|
||||||
},
|
},
|
||||||
menuLocation: {
|
menuLocation: {
|
||||||
x: 0,
|
x: 0,
|
||||||
|
@ -326,6 +333,7 @@ export default {
|
||||||
return assertApiSupport(source)
|
return assertApiSupport(source)
|
||||||
},
|
},
|
||||||
handleListItemRigthClick(event, index) {
|
handleListItemRigthClick(event, index) {
|
||||||
|
this.listMenu.itemMenuControl.sourceDetail = !!musicSdk[this.list[index].source].getMusicDetailPageUrl
|
||||||
let dom_selected = this.$refs.dom_tbody.querySelector('tr.selected')
|
let dom_selected = this.$refs.dom_tbody.querySelector('tr.selected')
|
||||||
if (dom_selected) dom_selected.classList.remove('selected')
|
if (dom_selected) dom_selected.classList.remove('selected')
|
||||||
this.$refs.dom_tbody.querySelectorAll('tr')[index].classList.add('selected')
|
this.$refs.dom_tbody.querySelectorAll('tr')[index].classList.add('selected')
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
"list_add_to": "Add to ...",
|
"list_add_to": "Add to ...",
|
||||||
"list_download": "Download",
|
"list_download": "Download",
|
||||||
"list_search": "Search",
|
"list_search": "Search",
|
||||||
|
"list_source_detail": "Song Page",
|
||||||
"name": "Name",
|
"name": "Name",
|
||||||
"singer": "Artist",
|
"singer": "Artist",
|
||||||
"album": "Album",
|
"album": "Album",
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
"menu_file": "Locate File",
|
"menu_file": "Locate File",
|
||||||
"menu_search": "Search",
|
"menu_search": "Search",
|
||||||
"menu_remove": "Remove",
|
"menu_remove": "Remove",
|
||||||
|
"menu_source_detail": "Song Page",
|
||||||
"name": "Name",
|
"name": "Name",
|
||||||
"progress": "Progress",
|
"progress": "Progress",
|
||||||
"status": "State",
|
"status": "State",
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
"list_move_to": "Move to ...",
|
"list_move_to": "Move to ...",
|
||||||
"list_download": "Download",
|
"list_download": "Download",
|
||||||
"list_remove": "Remove",
|
"list_remove": "Remove",
|
||||||
|
"list_source_detail": "Song Page",
|
||||||
"default_list": "Recently Played",
|
"default_list": "Recently Played",
|
||||||
"love_list": "Favorites",
|
"love_list": "Favorites",
|
||||||
"name": "Name",
|
"name": "Name",
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
"list_play": "Play",
|
"list_play": "Play",
|
||||||
"list_add_to": "Add to ...",
|
"list_add_to": "Add to ...",
|
||||||
"list_download": "Download",
|
"list_download": "Download",
|
||||||
|
"list_source_detail": "Song Page",
|
||||||
"name": "Name",
|
"name": "Name",
|
||||||
"singer": "Artist",
|
"singer": "Artist",
|
||||||
"album": "Album",
|
"album": "Album",
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
"list_play": "播放",
|
"list_play": "播放",
|
||||||
"list_add_to": "添加到...",
|
"list_add_to": "添加到...",
|
||||||
"list_download": "下载",
|
"list_download": "下载",
|
||||||
|
"list_source_detail": "歌曲详情页",
|
||||||
"list_search": "搜索",
|
"list_search": "搜索",
|
||||||
"name": "歌曲名",
|
"name": "歌曲名",
|
||||||
"singer": "歌手",
|
"singer": "歌手",
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
"menu_file": "定位文件",
|
"menu_file": "定位文件",
|
||||||
"menu_search": "搜索",
|
"menu_search": "搜索",
|
||||||
"menu_remove": "删除",
|
"menu_remove": "删除",
|
||||||
|
"menu_source_detail": "歌曲详情页",
|
||||||
"name": "歌曲名",
|
"name": "歌曲名",
|
||||||
"progress": "进度",
|
"progress": "进度",
|
||||||
"status": "状态",
|
"status": "状态",
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
"lists_remove": "删除",
|
"lists_remove": "删除",
|
||||||
"list_play": "播放",
|
"list_play": "播放",
|
||||||
"list_copy_name": "复制歌曲名",
|
"list_copy_name": "复制歌曲名",
|
||||||
|
"list_source_detail": "歌曲详情页",
|
||||||
"list_add_to": "添加到...",
|
"list_add_to": "添加到...",
|
||||||
"list_move_to": "移动到...",
|
"list_move_to": "移动到...",
|
||||||
"list_download": "下载",
|
"list_download": "下载",
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
"list_play": "播放",
|
"list_play": "播放",
|
||||||
"list_add_to": "添加到...",
|
"list_add_to": "添加到...",
|
||||||
"list_download": "下载",
|
"list_download": "下载",
|
||||||
|
"list_source_detail": "歌曲详情页",
|
||||||
"name": "歌曲名",
|
"name": "歌曲名",
|
||||||
"singer": "歌手",
|
"singer": "歌手",
|
||||||
"album": "专辑",
|
"album": "专辑",
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
"list_add_to": "添加到...",
|
"list_add_to": "添加到...",
|
||||||
"list_download": "下載",
|
"list_download": "下載",
|
||||||
"list_search": "搜索",
|
"list_search": "搜索",
|
||||||
|
"list_source_detail": "歌曲詳情頁",
|
||||||
"name": "歌曲名",
|
"name": "歌曲名",
|
||||||
"singer": "歌手",
|
"singer": "歌手",
|
||||||
"album": "專輯",
|
"album": "專輯",
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
"menu_file": "定位文件",
|
"menu_file": "定位文件",
|
||||||
"menu_search": "搜索",
|
"menu_search": "搜索",
|
||||||
"menu_remove": "刪除",
|
"menu_remove": "刪除",
|
||||||
|
"menu_source_detail": "歌曲詳情頁",
|
||||||
"name": "歌曲名",
|
"name": "歌曲名",
|
||||||
"progress": "進度",
|
"progress": "進度",
|
||||||
"status": "狀態",
|
"status": "狀態",
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
"list_move_to": "移動到...",
|
"list_move_to": "移動到...",
|
||||||
"list_download": "下載",
|
"list_download": "下載",
|
||||||
"list_remove": "刪除",
|
"list_remove": "刪除",
|
||||||
|
"list_source_detail": "歌曲詳情頁",
|
||||||
"default_list": "試聽列表",
|
"default_list": "試聽列表",
|
||||||
"love_list": "收藏列表",
|
"love_list": "收藏列表",
|
||||||
"name": "歌曲名",
|
"name": "歌曲名",
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
"list_play": "播放",
|
"list_play": "播放",
|
||||||
"list_add_to": "添加到...",
|
"list_add_to": "添加到...",
|
||||||
"list_download": "下載",
|
"list_download": "下載",
|
||||||
|
"list_source_detail": "歌曲詳情頁",
|
||||||
"name": "歌曲名",
|
"name": "歌曲名",
|
||||||
"singer": "歌手",
|
"singer": "歌手",
|
||||||
"album": "專輯",
|
"album": "專輯",
|
||||||
|
|
|
@ -33,6 +33,9 @@ const bd = {
|
||||||
getMusicInfo(songInfo) {
|
getMusicInfo(songInfo) {
|
||||||
return musicInfo.getMusicInfo(songInfo.songmid)
|
return musicInfo.getMusicInfo(songInfo.songmid)
|
||||||
},
|
},
|
||||||
|
getMusicDetailPageUrl(songInfo) {
|
||||||
|
return `http://music.taihe.com/song/${songInfo.songmid}`
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
export default bd
|
export default bd
|
||||||
|
|
|
@ -23,6 +23,9 @@ const kg = {
|
||||||
getPic(songInfo) {
|
getPic(songInfo) {
|
||||||
return pic.getPic(songInfo)
|
return pic.getPic(songInfo)
|
||||||
},
|
},
|
||||||
|
getMusicDetailPageUrl(songInfo) {
|
||||||
|
return `https://www.kugou.com/song/#hash=${songInfo.hash}`
|
||||||
|
},
|
||||||
// getPic(songInfo) {
|
// getPic(songInfo) {
|
||||||
// return apis('kg').getPic(songInfo)
|
// return apis('kg').getPic(songInfo)
|
||||||
// },
|
// },
|
||||||
|
|
|
@ -99,6 +99,10 @@ const kw = {
|
||||||
return pic.getPic(songInfo)
|
return pic.getPic(songInfo)
|
||||||
},
|
},
|
||||||
|
|
||||||
|
getMusicDetailPageUrl(songInfo) {
|
||||||
|
return `http://www.kuwo.cn/play_detail/${songInfo.songmid}`
|
||||||
|
},
|
||||||
|
|
||||||
init() {
|
init() {
|
||||||
getToken()
|
getToken()
|
||||||
},
|
},
|
||||||
|
|
|
@ -20,6 +20,9 @@ const mg = {
|
||||||
getPic(songInfo) {
|
getPic(songInfo) {
|
||||||
return pic.getPic(songInfo)
|
return pic.getPic(songInfo)
|
||||||
},
|
},
|
||||||
|
getMusicDetailPageUrl(songInfo) {
|
||||||
|
return `http://music.migu.cn/v3/music/song/${songInfo.copyrightId}`
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
export default mg
|
export default mg
|
||||||
|
|
|
@ -21,6 +21,9 @@ const tx = {
|
||||||
getPic(songInfo) {
|
getPic(songInfo) {
|
||||||
return apis('tx').getPic(songInfo)
|
return apis('tx').getPic(songInfo)
|
||||||
},
|
},
|
||||||
|
getMusicDetailPageUrl(songInfo) {
|
||||||
|
return `https://y.qq.com/n/yqq/song/${songInfo.songmid}.html`
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
export default tx
|
export default tx
|
||||||
|
|
|
@ -20,6 +20,9 @@ const wy = {
|
||||||
getPic(songInfo) {
|
getPic(songInfo) {
|
||||||
return getMusicInfo(songInfo.songmid).then(info => info.al.picUrl)
|
return getMusicInfo(songInfo.songmid).then(info => info.al.picUrl)
|
||||||
},
|
},
|
||||||
|
getMusicDetailPageUrl(songInfo) {
|
||||||
|
return `https://music.163.com/#/song?id=${songInfo.songmid}`
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
export default wy
|
export default wy
|
||||||
|
|
|
@ -23,6 +23,9 @@ const xm = {
|
||||||
return Promise.reject(new Error('fail'))
|
return Promise.reject(new Error('fail'))
|
||||||
// return pic.getPic(songInfo)
|
// return pic.getPic(songInfo)
|
||||||
},
|
},
|
||||||
|
getMusicDetailPageUrl(songInfo) {
|
||||||
|
return songInfo.songStringId ? `https://www.xiami.com/song/${songInfo.songStringId}` : null
|
||||||
|
},
|
||||||
// init() {
|
// init() {
|
||||||
// getToken()
|
// getToken()
|
||||||
// },
|
// },
|
||||||
|
|
|
@ -78,7 +78,7 @@ export default {
|
||||||
return arr.join('、')
|
return arr.join('、')
|
||||||
},
|
},
|
||||||
filterData(rawList) {
|
filterData(rawList) {
|
||||||
// console.log(rawList)
|
console.log(rawList)
|
||||||
let ids = new Set()
|
let ids = new Set()
|
||||||
const list = []
|
const list = []
|
||||||
rawList.forEach(songData => {
|
rawList.forEach(songData => {
|
||||||
|
@ -124,6 +124,7 @@ export default {
|
||||||
interval: formatPlayTime(parseInt(songData.length / 1000)),
|
interval: formatPlayTime(parseInt(songData.length / 1000)),
|
||||||
songmid: songData.songId,
|
songmid: songData.songId,
|
||||||
img: songData.albumLogo || songData.albumLogoS,
|
img: songData.albumLogo || songData.albumLogoS,
|
||||||
|
songStringId: songData.songStringId,
|
||||||
lrc: null,
|
lrc: null,
|
||||||
lrcUrl: songData.lyricInfo && songData.lyricInfo.lyricFile,
|
lrcUrl: songData.lyricInfo && songData.lyricInfo.lyricFile,
|
||||||
types,
|
types,
|
||||||
|
|
|
@ -76,6 +76,7 @@ export default {
|
||||||
interval: formatPlayTime(parseInt(songData.length / 1000)),
|
interval: formatPlayTime(parseInt(songData.length / 1000)),
|
||||||
songmid: songData.songId,
|
songmid: songData.songId,
|
||||||
img: songData.albumLogo || songData.albumLogoS,
|
img: songData.albumLogo || songData.albumLogoS,
|
||||||
|
songStringId: songData.songStringId,
|
||||||
lrc: null,
|
lrc: null,
|
||||||
lrcUrl: songData.lyricInfo && songData.lyricInfo.lyricFile,
|
lrcUrl: songData.lyricInfo && songData.lyricInfo.lyricFile,
|
||||||
types,
|
types,
|
||||||
|
|
|
@ -138,6 +138,7 @@ export default {
|
||||||
source: 'xm',
|
source: 'xm',
|
||||||
interval: formatPlayTime(parseInt(songData.length / 1000)),
|
interval: formatPlayTime(parseInt(songData.length / 1000)),
|
||||||
songmid: songData.songId,
|
songmid: songData.songId,
|
||||||
|
songStringId: songData.songStringId,
|
||||||
img: songData.albumLogo || songData.albumLogoS,
|
img: songData.albumLogo || songData.albumLogoS,
|
||||||
lrc: null,
|
lrc: null,
|
||||||
lrcUrl: songData.lyricInfo && songData.lyricInfo.lyricFile,
|
lrcUrl: songData.lyricInfo && songData.lyricInfo.lyricFile,
|
||||||
|
|
|
@ -36,7 +36,8 @@ div(:class="$style.download")
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { mapGetters, mapActions, mapMutations } from 'vuex'
|
import { mapGetters, mapActions, mapMutations } from 'vuex'
|
||||||
import { checkPath, openDirInExplorer, findParentNode } from '../utils'
|
import { checkPath, openDirInExplorer, findParentNode, openUrl } from '../utils'
|
||||||
|
import musicSdk from '../utils/music'
|
||||||
import path from 'path'
|
import path from 'path'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
@ -63,6 +64,7 @@ export default {
|
||||||
file: true,
|
file: true,
|
||||||
search: true,
|
search: true,
|
||||||
remove: true,
|
remove: true,
|
||||||
|
sourceDetail: true,
|
||||||
},
|
},
|
||||||
menuLocation: {
|
menuLocation: {
|
||||||
x: 0,
|
x: 0,
|
||||||
|
@ -145,6 +147,11 @@ export default {
|
||||||
action: 'file',
|
action: 'file',
|
||||||
hide: !this.listMenu.itemMenuControl.file,
|
hide: !this.listMenu.itemMenuControl.file,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: this.$t('view.download.menu_source_detail'),
|
||||||
|
action: 'sourceDetail',
|
||||||
|
disabled: !this.listMenu.itemMenuControl.sourceDetail,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: this.$t('view.download.menu_search'),
|
name: this.$t('view.download.menu_search'),
|
||||||
action: 'search',
|
action: 'search',
|
||||||
|
@ -359,6 +366,7 @@ export default {
|
||||||
this.selectdData = []
|
this.selectdData = []
|
||||||
},
|
},
|
||||||
handleListItemRigthClick(event, index) {
|
handleListItemRigthClick(event, index) {
|
||||||
|
this.listMenu.itemMenuControl.sourceDetail = !!musicSdk[this.showList[index].musicInfo.source].getMusicDetailPageUrl
|
||||||
let dom_selected = this.$refs.dom_tbody.querySelector('tr.selected')
|
let dom_selected = this.$refs.dom_tbody.querySelector('tr.selected')
|
||||||
if (dom_selected) dom_selected.classList.remove('selected')
|
if (dom_selected) dom_selected.classList.remove('selected')
|
||||||
this.$refs.dom_tbody.querySelectorAll('tr')[index].classList.add('selected')
|
this.$refs.dom_tbody.querySelectorAll('tr')[index].classList.add('selected')
|
||||||
|
@ -401,6 +409,7 @@ export default {
|
||||||
this.hideListMenu()
|
this.hideListMenu()
|
||||||
// let key
|
// let key
|
||||||
let item
|
let item
|
||||||
|
let url
|
||||||
|
|
||||||
switch (action && action.action) {
|
switch (action && action.action) {
|
||||||
case 'play':
|
case 'play':
|
||||||
|
@ -456,6 +465,11 @@ export default {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
break
|
break
|
||||||
|
case 'sourceDetail':
|
||||||
|
item = this.showList[index].musicInfo
|
||||||
|
url = musicSdk[item.source].getMusicDetailPageUrl(item)
|
||||||
|
if (!url) return
|
||||||
|
openUrl(url)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -23,6 +23,8 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { mapGetters, mapMutations, mapActions } from 'vuex'
|
import { mapGetters, mapMutations, mapActions } from 'vuex'
|
||||||
|
import { openUrl } from '../utils'
|
||||||
|
import musicSdk from '../utils/music'
|
||||||
export default {
|
export default {
|
||||||
name: 'Leaderboard',
|
name: 'Leaderboard',
|
||||||
data() {
|
data() {
|
||||||
|
@ -99,6 +101,8 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
handleMenuClick(info) {
|
handleMenuClick(info) {
|
||||||
|
let minfo
|
||||||
|
let url
|
||||||
switch (info.action) {
|
switch (info.action) {
|
||||||
case 'download':
|
case 'download':
|
||||||
if (this.selectedData.length) {
|
if (this.selectedData.length) {
|
||||||
|
@ -132,6 +136,11 @@ export default {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
break
|
break
|
||||||
|
case 'sourceDetail':
|
||||||
|
minfo = this.list[info.index]
|
||||||
|
url = musicSdk[minfo.source].getMusicDetailPageUrl(minfo)
|
||||||
|
if (!url) return
|
||||||
|
openUrl(url)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
testPlay(index) {
|
testPlay(index) {
|
||||||
|
|
|
@ -69,7 +69,8 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { mapMutations, mapGetters, mapActions } from 'vuex'
|
import { mapMutations, mapGetters, mapActions } from 'vuex'
|
||||||
import { throttle, scrollTo, clipboardWriteText, assertApiSupport, findParentNode } from '../utils'
|
import { throttle, scrollTo, clipboardWriteText, assertApiSupport, findParentNode, openUrl } from '../utils'
|
||||||
|
import musicSdk from '../utils/music'
|
||||||
export default {
|
export default {
|
||||||
name: 'List',
|
name: 'List',
|
||||||
data() {
|
data() {
|
||||||
|
@ -120,6 +121,7 @@ export default {
|
||||||
moveTo: true,
|
moveTo: true,
|
||||||
download: true,
|
download: true,
|
||||||
remove: true,
|
remove: true,
|
||||||
|
sourceDetail: true,
|
||||||
},
|
},
|
||||||
menuLocation: {
|
menuLocation: {
|
||||||
x: 0,
|
x: 0,
|
||||||
|
@ -211,6 +213,11 @@ export default {
|
||||||
action: 'copyName',
|
action: 'copyName',
|
||||||
disabled: !this.listMenu.itemMenuControl.copyName,
|
disabled: !this.listMenu.itemMenuControl.copyName,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: this.$t('view.list.list_source_detail'),
|
||||||
|
action: 'sourceDetail',
|
||||||
|
disabled: !this.listMenu.itemMenuControl.sourceDetail,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: this.$t('view.list.list_add_to'),
|
name: this.$t('view.list.list_add_to'),
|
||||||
action: 'addTo',
|
action: 'addTo',
|
||||||
|
@ -658,6 +665,7 @@ export default {
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
handleListItemRigthClick(event, index) {
|
handleListItemRigthClick(event, index) {
|
||||||
|
this.listMenu.itemMenuControl.sourceDetail = !!musicSdk[this.list[index].source].getMusicDetailPageUrl
|
||||||
let dom_selected = this.$refs.dom_tbody.querySelector('tr.selected')
|
let dom_selected = this.$refs.dom_tbody.querySelector('tr.selected')
|
||||||
if (dom_selected) dom_selected.classList.remove('selected')
|
if (dom_selected) dom_selected.classList.remove('selected')
|
||||||
this.$refs.dom_tbody.querySelectorAll('tr')[index].classList.add('selected')
|
this.$refs.dom_tbody.querySelectorAll('tr')[index].classList.add('selected')
|
||||||
|
@ -711,6 +719,7 @@ export default {
|
||||||
let index = this.listMenu.rightClickItemIndex
|
let index = this.listMenu.rightClickItemIndex
|
||||||
this.hideListMenu()
|
this.hideListMenu()
|
||||||
let minfo
|
let minfo
|
||||||
|
let url
|
||||||
switch (action && action.action) {
|
switch (action && action.action) {
|
||||||
case 'play':
|
case 'play':
|
||||||
this.testPlay(index)
|
this.testPlay(index)
|
||||||
|
@ -765,6 +774,11 @@ export default {
|
||||||
this.handleRemove(index)
|
this.handleRemove(index)
|
||||||
}
|
}
|
||||||
break
|
break
|
||||||
|
case 'sourceDetail':
|
||||||
|
minfo = this.list[index]
|
||||||
|
url = musicSdk[minfo.source].getMusicDetailPageUrl(minfo)
|
||||||
|
if (!url) return
|
||||||
|
openUrl(url)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -61,8 +61,8 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { mapGetters, mapActions, mapMutations } from 'vuex'
|
import { mapGetters, mapActions, mapMutations } from 'vuex'
|
||||||
import { scrollTo, clipboardWriteText, assertApiSupport, findParentNode } from '../utils'
|
import { scrollTo, clipboardWriteText, assertApiSupport, findParentNode, openUrl } from '../utils'
|
||||||
// import music from '../utils/music'
|
import musicSdk from '../utils/music'
|
||||||
export default {
|
export default {
|
||||||
name: 'Search',
|
name: 'Search',
|
||||||
data() {
|
data() {
|
||||||
|
@ -90,6 +90,7 @@ export default {
|
||||||
play: true,
|
play: true,
|
||||||
addTo: true,
|
addTo: true,
|
||||||
download: true,
|
download: true,
|
||||||
|
sourceDetail: true,
|
||||||
},
|
},
|
||||||
menuLocation: {
|
menuLocation: {
|
||||||
x: 0,
|
x: 0,
|
||||||
|
@ -178,6 +179,11 @@ export default {
|
||||||
action: 'addTo',
|
action: 'addTo',
|
||||||
disabled: !this.listMenu.itemMenuControl.addTo,
|
disabled: !this.listMenu.itemMenuControl.addTo,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: this.$t('view.search.list_source_detail'),
|
||||||
|
action: 'sourceDetail',
|
||||||
|
disabled: !this.listMenu.itemMenuControl.sourceDetail,
|
||||||
|
},
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
listInfo() {
|
listInfo() {
|
||||||
|
@ -414,6 +420,7 @@ export default {
|
||||||
return assertApiSupport(source)
|
return assertApiSupport(source)
|
||||||
},
|
},
|
||||||
handleListItemRigthClick(event, index) {
|
handleListItemRigthClick(event, index) {
|
||||||
|
this.listMenu.itemMenuControl.sourceDetail = !!musicSdk[this.listInfo.list[index].source].getMusicDetailPageUrl
|
||||||
let dom_selected = this.$refs.dom_tbody.querySelector('tr.selected')
|
let dom_selected = this.$refs.dom_tbody.querySelector('tr.selected')
|
||||||
if (dom_selected) dom_selected.classList.remove('selected')
|
if (dom_selected) dom_selected.classList.remove('selected')
|
||||||
this.$refs.dom_tbody.querySelectorAll('tr')[index].classList.add('selected')
|
this.$refs.dom_tbody.querySelectorAll('tr')[index].classList.add('selected')
|
||||||
|
@ -436,6 +443,7 @@ export default {
|
||||||
let index = this.listMenu.rightClickItemIndex
|
let index = this.listMenu.rightClickItemIndex
|
||||||
this.hideListMenu()
|
this.hideListMenu()
|
||||||
let minfo
|
let minfo
|
||||||
|
let url
|
||||||
switch (action && action.action) {
|
switch (action && action.action) {
|
||||||
case 'play':
|
case 'play':
|
||||||
if (this.selectedData.length) {
|
if (this.selectedData.length) {
|
||||||
|
@ -468,6 +476,12 @@ export default {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
break
|
break
|
||||||
|
case 'sourceDetail':
|
||||||
|
minfo = this.listInfo.list[index]
|
||||||
|
url = musicSdk[minfo.source].getMusicDetailPageUrl(minfo)
|
||||||
|
if (!url) return
|
||||||
|
openUrl(url)
|
||||||
|
break
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -61,8 +61,8 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { mapGetters, mapMutations, mapActions } from 'vuex'
|
import { mapGetters, mapMutations, mapActions } from 'vuex'
|
||||||
import { scrollTo, assertApiSupport } from '../utils'
|
import { scrollTo, assertApiSupport, openUrl } from '../utils'
|
||||||
// import music from '../utils/music'
|
import musicSdk from '../utils/music'
|
||||||
export default {
|
export default {
|
||||||
name: 'SongList',
|
name: 'SongList',
|
||||||
data() {
|
data() {
|
||||||
|
@ -203,6 +203,8 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
handleMenuClick(info) {
|
handleMenuClick(info) {
|
||||||
|
let minfo
|
||||||
|
let url
|
||||||
switch (info.action) {
|
switch (info.action) {
|
||||||
case 'download':
|
case 'download':
|
||||||
if (this.selectedData.length) {
|
if (this.selectedData.length) {
|
||||||
|
@ -236,6 +238,11 @@ export default {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
break
|
break
|
||||||
|
case 'sourceDetail':
|
||||||
|
minfo = this.listDetail.list[info.index]
|
||||||
|
url = musicSdk[minfo.source].getMusicDetailPageUrl(minfo)
|
||||||
|
if (!url) return
|
||||||
|
openUrl(url)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
testPlay(index) {
|
testPlay(index) {
|
||||||
|
|
Loading…
Reference in New Issue