新增网易云、酷狗排行榜音乐直接试听下载
parent
b8d07b365b
commit
78d2541c14
11
CHANGELOG.md
11
CHANGELOG.md
|
@ -6,6 +6,17 @@ Project versioning adheres to [Semantic Versioning](http://semver.org/).
|
||||||
Commit convention is based on [Conventional Commits](http://conventionalcommits.org).
|
Commit convention is based on [Conventional Commits](http://conventionalcommits.org).
|
||||||
Change log format is based on [Keep a Changelog](http://keepachangelog.com/).
|
Change log format is based on [Keep a Changelog](http://keepachangelog.com/).
|
||||||
|
|
||||||
|
## [0.2.0](https://github.com/lyswhut/lx-music-desktop/compare/v0.1.6...v0.2.0) - 2019-08-20
|
||||||
|
|
||||||
|
### 新增
|
||||||
|
|
||||||
|
- 新增网易云排行榜音乐直接试听与下载(目前仅支持128k音质)
|
||||||
|
- 新增酷狗排行榜音乐直接试听与下载(目前仅支持128k音质)
|
||||||
|
|
||||||
|
### 修复
|
||||||
|
|
||||||
|
- 修复更新弹窗历史版本描述多余的换行问题
|
||||||
|
|
||||||
## [0.1.6](https://github.com/lyswhut/lx-music-desktop/compare/v0.1.5...v0.1.6) - 2019-08-19
|
## [0.1.6](https://github.com/lyswhut/lx-music-desktop/compare/v0.1.5...v0.1.6) - 2019-08-19
|
||||||
|
|
||||||
### 修复
|
### 修复
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "lx-music-desktop",
|
"name": "lx-music-desktop",
|
||||||
"version": "0.1.6",
|
"version": "0.2.0",
|
||||||
"description": "一个免费的音乐下载助手",
|
"description": "一个免费的音乐下载助手",
|
||||||
"main": "./dist/electron/main.js",
|
"main": "./dist/electron/main.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|
|
@ -1,3 +1,8 @@
|
||||||
|
### 新增
|
||||||
|
|
||||||
|
- 新增网易云排行榜音乐直接试听与下载(目前仅支持128k音质)
|
||||||
|
- 新增酷狗排行榜音乐直接试听与下载(目前仅支持128k音质)
|
||||||
|
|
||||||
### 修复
|
### 修复
|
||||||
|
|
||||||
- 修复更新弹窗历史版本描述多余的换行问题
|
- 修复更新弹窗历史版本描述多余的换行问题
|
||||||
|
|
|
@ -7,11 +7,12 @@ const clearAssets = require('./utils/clearAssets')
|
||||||
const updateVersionFile = require('./utils/updateChangeLog')
|
const updateVersionFile = require('./utils/updateChangeLog')
|
||||||
// const copyFile = require('./utils/copyFile')
|
// const copyFile = require('./utils/copyFile')
|
||||||
// const githubRelease = require('./utils/githubRelease')
|
// const githubRelease = require('./utils/githubRelease')
|
||||||
const { parseArgv } = require('./utils')
|
// const { parseArgv } = require('./utils')
|
||||||
|
|
||||||
const run = async() => {
|
const run = async() => {
|
||||||
const params = parseArgv(process.argv.slice(2))
|
// const params = parseArgv(process.argv.slice(2))
|
||||||
const bak = await updateVersionFile(params.ver)
|
// const bak = await updateVersionFile(params.ver)
|
||||||
|
const bak = await updateVersionFile(process.argv.slice(2)[0])
|
||||||
|
|
||||||
try {
|
try {
|
||||||
console.log(chalk.blue('Clearing assets...'))
|
console.log(chalk.blue('Clearing assets...'))
|
||||||
|
|
|
@ -1,7 +1,11 @@
|
||||||
{
|
{
|
||||||
"version": "0.1.6",
|
"version": "0.2.0",
|
||||||
"desc": "<h3>修复</h3>\n<ul>\n<li>修复列表多选音源限制Bug</li>\n</ul>\n",
|
"desc": "<h3>新增</h3>\n<ul>\n<li>新增网易云排行榜音乐直接试听与下载(目前仅支持128k音质)</li>\n<li>新增酷狗排行榜音乐直接试听与下载(目前仅支持128k音质)</li>\n</ul>\n<h3>修复</h3>\n<ul>\n<li>修复更新弹窗历史版本描述多余的换行问题</li>\n</ul>\n",
|
||||||
"history": [
|
"history": [
|
||||||
|
{
|
||||||
|
"version": "0.1.6",
|
||||||
|
"desc": "<h3>修复</h3>\n<ul>\n<li>修复列表多选音源限制Bug</li>\n</ul>\n"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"version": "0.1.5",
|
"version": "0.1.5",
|
||||||
"desc": "<h3>新增</h3>\n<ul>\n<li>新增搜索列表批量试听与下载功能</li>\n<li>新增排行榜列表批量试听与下载功能</li>\n<li>新增试听列表批量移除与下载功能</li>\n<li>新增下载列表批量开始、暂停与移除功能</li>\n</ul>\n<h3>优化</h3>\n<ul>\n<li>优化歌曲切换机制</li>\n</ul>\n"
|
"desc": "<h3>新增</h3>\n<ul>\n<li>新增搜索列表批量试听与下载功能</li>\n<li>新增排行榜列表批量试听与下载功能</li>\n<li>新增试听列表批量移除与下载功能</li>\n<li>新增下载列表批量开始、暂停与移除功能</li>\n</ul>\n<h3>优化</h3>\n<ul>\n<li>优化歌曲切换机制</li>\n</ul>\n"
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<template lang="pug">
|
<template lang="pug">
|
||||||
button(:class="[$style.btn, min ? $style.min : '']" @click="$emit('click', $event)")
|
button(:class="[$style.btn, min ? $style.min : '']" :disabled="disabled" @click="$emit('click', $event)")
|
||||||
slot
|
slot
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -9,6 +9,10 @@ export default {
|
||||||
min: {
|
min: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
},
|
},
|
||||||
|
disabled: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
@ -27,6 +31,9 @@ export default {
|
||||||
outline: none;
|
outline: none;
|
||||||
transition: background-color 0.2s ease;
|
transition: background-color 0.2s ease;
|
||||||
background-color: @color-btn-background;
|
background-color: @color-btn-background;
|
||||||
|
&[disabled] {
|
||||||
|
opacity: .4;
|
||||||
|
}
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
background-color: @color-theme_2-hover;
|
background-color: @color-theme_2-hover;
|
||||||
|
|
|
@ -5,7 +5,7 @@ material-modal(:show="show" :bg-close="bgClose" @close="handleClose")
|
||||||
| {{ info.name }}
|
| {{ info.name }}
|
||||||
br
|
br
|
||||||
| {{ info.singer }}
|
| {{ info.singer }}
|
||||||
material-btn(:class="$style.btn" :key="type.type" @click="handleClick(type.type)" v-for="type in info.types") {{getTypeName(type.type)}} {{ type.type.toUpperCase() }}{{ type.size && ` - ${type.size.toUpperCase()}` }}
|
material-btn(:class="$style.btn" :title="!checkSource(type.type) && '目前酷狗、网易云音源仅支持下载128k音质'" :disabled="!checkSource(type.type)" :key="type.type" @click="handleClick(type.type)" v-for="type in info.types") {{getTypeName(type.type)}} {{ type.type.toUpperCase() }}{{ type.size && ` - ${type.size.toUpperCase()}` }}
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -49,6 +49,16 @@ export default {
|
||||||
return '普通音质'
|
return '普通音质'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
checkSource(type) {
|
||||||
|
switch (this.musicInfo.source) {
|
||||||
|
case 'wy':
|
||||||
|
case 'kg':
|
||||||
|
return type == '128k'
|
||||||
|
|
||||||
|
default:
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -37,18 +37,6 @@ export default {
|
||||||
handleClose() {
|
handleClose() {
|
||||||
this.$emit('close')
|
this.$emit('close')
|
||||||
},
|
},
|
||||||
getTypeName(type) {
|
|
||||||
switch (type) {
|
|
||||||
case 'flac':
|
|
||||||
case 'ape':
|
|
||||||
return '无损音质'
|
|
||||||
case '320k':
|
|
||||||
return '高品音质'
|
|
||||||
case '192k':
|
|
||||||
case '128k':
|
|
||||||
return '普通音质'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -55,7 +55,7 @@ const checkList = (list, musicInfo, type) => list.some(s => s.musicInfo.songmid
|
||||||
const getStartTask = (list, downloadStatus, maxDownloadNum) => {
|
const getStartTask = (list, downloadStatus, maxDownloadNum) => {
|
||||||
let downloadCount = 0
|
let downloadCount = 0
|
||||||
const waitList = list.filter(item => item.status == downloadStatus.WAITING ? true : (item.status === downloadStatus.RUN && ++downloadCount && false))
|
const waitList = list.filter(item => item.status == downloadStatus.WAITING ? true : (item.status === downloadStatus.RUN && ++downloadCount && false))
|
||||||
console.log(downloadCount, waitList)
|
// console.log(downloadCount, waitList)
|
||||||
return downloadCount < maxDownloadNum && waitList.length > 0 && waitList.shift()
|
return downloadCount < maxDownloadNum && waitList.length > 0 && waitList.shift()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -168,7 +168,9 @@ const actions = {
|
||||||
console.log(err)
|
console.log(err)
|
||||||
_this.dispatch('download/startTask')
|
_this.dispatch('download/startTask')
|
||||||
})
|
})
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
_this.dispatch('download/startTask')
|
||||||
},
|
},
|
||||||
// onStateChanged(state) {
|
// onStateChanged(state) {
|
||||||
// console.log(state)
|
// console.log(state)
|
||||||
|
@ -191,20 +193,22 @@ const actions = {
|
||||||
}
|
}
|
||||||
let p = options.url ? Promise.resolve() : refreshUrl(downloadInfo).then(result => {
|
let p = options.url ? Promise.resolve() : refreshUrl(downloadInfo).then(result => {
|
||||||
commit('updateUrl', { downloadInfo, url: result.url })
|
commit('updateUrl', { downloadInfo, url: result.url })
|
||||||
|
if (!result.url) return Promise.reject(new Error('获取URL失败'))
|
||||||
options.url = result.url
|
options.url = result.url
|
||||||
}).catch(err => {
|
|
||||||
commit('onError', downloadInfo)
|
|
||||||
commit('setStatusText', { downloadInfo, text: err.message })
|
|
||||||
return Promise.reject(err)
|
|
||||||
})
|
})
|
||||||
p.then(() => {
|
p.then(() => {
|
||||||
tryNum[downloadInfo.key] = 0
|
tryNum[downloadInfo.key] = 0
|
||||||
dls[downloadInfo.key] = download(options)
|
dls[downloadInfo.key] = download(options)
|
||||||
|
}).catch(err => {
|
||||||
|
// console.log(err.message)
|
||||||
|
commit('onError', downloadInfo)
|
||||||
|
commit('setStatusText', { downloadInfo, text: err.message })
|
||||||
|
this.dispatch('download/startTask')
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
startTaskMultiple({ state, rootState }, list) {
|
// startTaskMultiple({ state, rootState }, list) {
|
||||||
|
|
||||||
},
|
// },
|
||||||
removeTask({ commit, state }, index) {
|
removeTask({ commit, state }, index) {
|
||||||
let info = state.list[index]
|
let info = state.list[index]
|
||||||
if (state.list[index].status == state.downloadStatus.RUN) {
|
if (state.list[index].status == state.downloadStatus.RUN) {
|
||||||
|
|
|
@ -1,10 +1,14 @@
|
||||||
import kw_api_messoer from './kw/api-messoer'
|
import kw_api_messoer from './kw/api-messoer'
|
||||||
import kw_api_temp from './kw/api-temp'
|
import kw_api_temp from './kw/api-temp'
|
||||||
import tx_api_messoer from './tx/api-messoer'
|
import tx_api_messoer from './tx/api-messoer'
|
||||||
|
import kg_api_messoer from './kg/api-messoer'
|
||||||
|
import wy_api_messoer from './wy/api-messoer'
|
||||||
|
|
||||||
const apis = {
|
const apis = {
|
||||||
kw_api_messoer,
|
kw_api_messoer,
|
||||||
tx_api_messoer,
|
tx_api_messoer,
|
||||||
|
kg_api_messoer,
|
||||||
|
wy_api_messoer,
|
||||||
kw_api_temp,
|
kw_api_temp,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -22,6 +26,10 @@ export default source => {
|
||||||
switch (source) {
|
switch (source) {
|
||||||
case 'tx':
|
case 'tx':
|
||||||
return getAPI('tx')
|
return getAPI('tx')
|
||||||
|
case 'kg':
|
||||||
|
return getAPI('kg')
|
||||||
|
case 'wy':
|
||||||
|
return getAPI('wy')
|
||||||
default:
|
default:
|
||||||
return getAPI('kw')
|
return getAPI('kw')
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,37 @@
|
||||||
|
import { httpFatch } from '../../request'
|
||||||
|
import { requestMsg } from '../../message'
|
||||||
|
|
||||||
|
const api_messoer = {
|
||||||
|
getMusicUrl(songInfo, type) {
|
||||||
|
const requestObj = httpFatch(`https://v1.itooi.cn/kugou/url?id=${songInfo._types[type].hash}&quality=${type.replace(/k$/, '')}&isRedirect=0`, {
|
||||||
|
method: 'get',
|
||||||
|
timeout: 5000,
|
||||||
|
})
|
||||||
|
requestObj.promise = requestObj.promise.then(({ body }) => {
|
||||||
|
return body.code === 200 ? Promise.resolve({ type, url: body.data }) : Promise.reject(new Error(requestMsg.fail))
|
||||||
|
})
|
||||||
|
return requestObj
|
||||||
|
},
|
||||||
|
getPic(songInfo) {
|
||||||
|
const requestObj = httpFatch(`https://v1.itooi.cn/kugou/pic?id=${songInfo.hash}&isRedirect=0`, {
|
||||||
|
method: 'get',
|
||||||
|
timeout: 5000,
|
||||||
|
})
|
||||||
|
requestObj.promise = requestObj.promise.then(({ body }) => {
|
||||||
|
return body.code === 200 ? Promise.resolve(body.data) : Promise.reject(new Error(requestMsg.fail))
|
||||||
|
})
|
||||||
|
return requestObj
|
||||||
|
},
|
||||||
|
getLyric(songInfo) {
|
||||||
|
const requestObj = httpFatch(`https://v1.itooi.cn/kugou/lrc?id=${songInfo.hash}&isRedirect=0`, {
|
||||||
|
method: 'get',
|
||||||
|
timeout: 5000,
|
||||||
|
})
|
||||||
|
requestObj.promise = requestObj.promise.then(({ body }) => {
|
||||||
|
return body ? Promise.resolve(body) : Promise.reject(new Error(requestMsg.fail))
|
||||||
|
})
|
||||||
|
return requestObj
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
export default api_messoer
|
|
@ -1,7 +1,18 @@
|
||||||
import leaderboard from './leaderboard'
|
import leaderboard from './leaderboard'
|
||||||
|
import api_source from '../api-source'
|
||||||
|
|
||||||
|
|
||||||
const kg = {
|
const kg = {
|
||||||
leaderboard,
|
leaderboard,
|
||||||
|
getMusicUrl(songInfo, type) {
|
||||||
|
return api_source('kg').getMusicUrl(songInfo, type)
|
||||||
|
},
|
||||||
|
getLyric(songInfo) {
|
||||||
|
return api_source('kg').getLyric(songInfo)
|
||||||
|
},
|
||||||
|
getPic(songInfo) {
|
||||||
|
return api_source('kg').getPic(songInfo)
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
export default kg
|
export default kg
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { httpGet, cancelHttp } from '../../request'
|
import { httpGet, cancelHttp } from '../../request'
|
||||||
import { formatPlayTime } from '../../index'
|
import { formatPlayTime, sizeFormate } from '../../index'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
list: [
|
list: [
|
||||||
|
@ -89,18 +89,58 @@ export default {
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
filterData(rawList) {
|
filterData(rawList) {
|
||||||
return rawList.map(item => ({
|
// console.log(rawList)
|
||||||
singer: item.singername,
|
return rawList.map(item => {
|
||||||
name: item.songname,
|
const types = []
|
||||||
albumName: item.album_name,
|
const _types = {}
|
||||||
albumId: item.album_id,
|
if (item.filesize !== 0) {
|
||||||
songmid: item.audio_id,
|
let size = sizeFormate(item.filesize)
|
||||||
source: 'kg',
|
types.push({ type: '128k', size, hash: item.hash })
|
||||||
interval: formatPlayTime(item.duration / 1000),
|
_types['128k'] = {
|
||||||
img: null,
|
size,
|
||||||
lrc: null,
|
hash: item.hash,
|
||||||
typeUrl: {},
|
}
|
||||||
}))
|
}
|
||||||
|
if (item.filesize_320 !== 0) {
|
||||||
|
let size = sizeFormate(item.filesize_320)
|
||||||
|
types.push({ type: '320k', size, hash: item.hash_320 })
|
||||||
|
_types['320k'] = {
|
||||||
|
size,
|
||||||
|
hash: item.hash_320,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (item.filesize_ape !== 0) {
|
||||||
|
let size = sizeFormate(item.filesize_ape)
|
||||||
|
types.push({ type: 'ape', size, hash: item.hash_ape })
|
||||||
|
_types.ape = {
|
||||||
|
size,
|
||||||
|
hash: item.hash_ape,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (item.filesize_flac !== 0) {
|
||||||
|
let size = sizeFormate(item.filesize_flac)
|
||||||
|
types.push({ type: 'flac', size, hash: item.hash_flac })
|
||||||
|
_types.flac = {
|
||||||
|
size,
|
||||||
|
hash: item.hash_flac,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
singer: item.singername,
|
||||||
|
name: item.songname,
|
||||||
|
albumName: item.album_name,
|
||||||
|
albumId: item.album_id,
|
||||||
|
songmid: item.audio_id,
|
||||||
|
source: 'kg',
|
||||||
|
interval: formatPlayTime(item.duration / 1000),
|
||||||
|
img: null,
|
||||||
|
lrc: null,
|
||||||
|
hash: item.HASH,
|
||||||
|
types,
|
||||||
|
_types,
|
||||||
|
typeUrl: {},
|
||||||
|
}
|
||||||
|
})
|
||||||
},
|
},
|
||||||
getList(id, page) {
|
getList(id, page) {
|
||||||
let type = this.list.find(s => s.id === id)
|
let type = this.list.find(s => s.id === id)
|
||||||
|
|
|
@ -3,8 +3,14 @@
|
||||||
* @param {*} info
|
* @param {*} info
|
||||||
* @param {*} type
|
* @param {*} type
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const types = ['flac', 'ape', '320k', '192k', '128k']
|
const types = ['flac', 'ape', '320k', '192k', '128k']
|
||||||
export const getMusicType = (info, type) => {
|
export const getMusicType = (info, type) => {
|
||||||
|
switch (window.globalObj.apiSource) {
|
||||||
|
case 'kg':
|
||||||
|
case 'wy':
|
||||||
|
return '128k'
|
||||||
|
}
|
||||||
const rangeType = types.slice(types.indexOf(type))
|
const rangeType = types.slice(types.indexOf(type))
|
||||||
for (const type of rangeType) {
|
for (const type of rangeType) {
|
||||||
if (info._types[type]) return type
|
if (info._types[type]) return type
|
||||||
|
|
|
@ -0,0 +1,37 @@
|
||||||
|
import { httpFatch } from '../../request'
|
||||||
|
import { requestMsg } from '../../message'
|
||||||
|
|
||||||
|
const api_messoer = {
|
||||||
|
getMusicUrl(songInfo, type) {
|
||||||
|
const requestObj = httpFatch(`https://v1.itooi.cn/netease/url?id=${songInfo.songmid}&quality=${type.replace(/k$/, '')}&isRedirect=0`, {
|
||||||
|
method: 'get',
|
||||||
|
timeout: 5000,
|
||||||
|
})
|
||||||
|
requestObj.promise = requestObj.promise.then(({ body }) => {
|
||||||
|
return body.code === 200 ? Promise.resolve({ type, url: body.data }) : Promise.reject(new Error(requestMsg.fail))
|
||||||
|
})
|
||||||
|
return requestObj
|
||||||
|
},
|
||||||
|
getPic(songInfo) {
|
||||||
|
const requestObj = httpFatch(`https://v1.itooi.cn/netease/pic?id=${songInfo.songmid}&isRedirect=0`, {
|
||||||
|
method: 'get',
|
||||||
|
timeout: 5000,
|
||||||
|
})
|
||||||
|
requestObj.promise = requestObj.promise.then(({ body }) => {
|
||||||
|
return body.code === 200 ? Promise.resolve(body.data) : Promise.reject(new Error(requestMsg.fail))
|
||||||
|
})
|
||||||
|
return requestObj
|
||||||
|
},
|
||||||
|
getLyric(songInfo) {
|
||||||
|
const requestObj = httpFatch(`https://v1.itooi.cn/netease/lrc?id=${songInfo.songmid}&isRedirect=0`, {
|
||||||
|
method: 'get',
|
||||||
|
timeout: 5000,
|
||||||
|
})
|
||||||
|
requestObj.promise = requestObj.promise.then(({ body }) => {
|
||||||
|
return body ? Promise.resolve(body) : Promise.reject(new Error(requestMsg.fail))
|
||||||
|
})
|
||||||
|
return requestObj
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
export default api_messoer
|
|
@ -1,7 +1,18 @@
|
||||||
import leaderboard from './leaderboard'
|
import leaderboard from './leaderboard'
|
||||||
|
import api_source from '../api-source'
|
||||||
|
|
||||||
const wy = {
|
const wy = {
|
||||||
leaderboard,
|
leaderboard,
|
||||||
|
getMusicUrl(songInfo, type) {
|
||||||
|
return api_source('wy').getMusicUrl(songInfo, type)
|
||||||
|
},
|
||||||
|
getLyric(songInfo) {
|
||||||
|
console.log(api_source('wy'))
|
||||||
|
return api_source('wy').getLyric(songInfo)
|
||||||
|
},
|
||||||
|
getPic(songInfo) {
|
||||||
|
return api_source('wy').getPic(songInfo)
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
export default wy
|
export default wy
|
||||||
|
|
|
@ -91,6 +91,42 @@ export default {
|
||||||
filterData(rawList) {
|
filterData(rawList) {
|
||||||
// console.log(rawList)
|
// console.log(rawList)
|
||||||
return rawList.map(item => {
|
return rawList.map(item => {
|
||||||
|
const types = []
|
||||||
|
const _types = {}
|
||||||
|
let size
|
||||||
|
switch (item.privilege.maxbr) {
|
||||||
|
case 999000:
|
||||||
|
size = null
|
||||||
|
types.push({ type: 'flac', size })
|
||||||
|
_types['flac'] = {
|
||||||
|
size,
|
||||||
|
}
|
||||||
|
case 320000:
|
||||||
|
size = null
|
||||||
|
types.push({ type: '320k', size })
|
||||||
|
_types['320k'] = {
|
||||||
|
size,
|
||||||
|
}
|
||||||
|
case 192000:
|
||||||
|
case 190000:
|
||||||
|
size = null
|
||||||
|
types.push({ type: '192k', size })
|
||||||
|
_types['192k'] = {
|
||||||
|
size,
|
||||||
|
}
|
||||||
|
// case '160000':
|
||||||
|
|
||||||
|
default:
|
||||||
|
size = null
|
||||||
|
types.push({ type: '128k', size })
|
||||||
|
_types['128k'] = {
|
||||||
|
size,
|
||||||
|
}
|
||||||
|
break
|
||||||
|
}
|
||||||
|
|
||||||
|
types.reverse()
|
||||||
|
|
||||||
return {
|
return {
|
||||||
singer: this.getSinger(item.artists),
|
singer: this.getSinger(item.artists),
|
||||||
name: item.name,
|
name: item.name,
|
||||||
|
@ -101,6 +137,8 @@ export default {
|
||||||
songmid: item.id,
|
songmid: item.id,
|
||||||
img: item.album.picUrl,
|
img: item.album.picUrl,
|
||||||
lrc: null,
|
lrc: null,
|
||||||
|
types,
|
||||||
|
_types,
|
||||||
typeUrl: {},
|
typeUrl: {},
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
td.break(style="width: 20%;") {{item.singer}}
|
td.break(style="width: 20%;") {{item.singer}}
|
||||||
td.break(style="width: 22%;") {{item.albumName}}
|
td.break(style="width: 22%;") {{item.albumName}}
|
||||||
td(style="width: 18%;")
|
td(style="width: 18%;")
|
||||||
material-list-buttons(:index="index" :search-btn="true" :play-btn="item.source == 'kw' || (!isAPITemp && item.source == 'tx')" :download-btn="item.source == 'kw' || (!isAPITemp && item.source == 'tx')" :remove-btn="false" @btn-click="handleListBtnClick")
|
material-list-buttons(:index="index" :search-btn="true" :play-btn="item.source == 'kw' || !isAPITemp" :download-btn="item.source == 'kw' || !isAPITemp" :remove-btn="false" @btn-click="handleListBtnClick")
|
||||||
//- button.btn-info(type='button' v-if="item._types['128k'] || item._types['192k'] || item._types['320k'] || item._types.flac" @click.stop='openDownloadModal(index)') 下载
|
//- button.btn-info(type='button' v-if="item._types['128k'] || item._types['192k'] || item._types['320k'] || item._types.flac" @click.stop='openDownloadModal(index)') 下载
|
||||||
//- button.btn-secondary(type='button' v-if="item._types['128k'] || item._types['192k'] || item._types['320k']" @click.stop='testPlay(index)') 试听
|
//- button.btn-secondary(type='button' v-if="item._types['128k'] || item._types['192k'] || item._types['320k']" @click.stop='testPlay(index)') 试听
|
||||||
//- button.btn-success(type='button' v-if="(item._types['128k'] || item._types['192k'] || item._types['320k']) && userInfo" @click.stop='showListModal(index)') +
|
//- button.btn-success(type='button' v-if="(item._types['128k'] || item._types['192k'] || item._types['320k']) && userInfo" @click.stop='showListModal(index)') +
|
||||||
|
@ -39,7 +39,7 @@
|
||||||
material-pagination(:count="info.total" :limit="info.limit" :page="info.page" @btn-click="handleTogglePage")
|
material-pagination(:count="info.total" :limit="info.limit" :page="info.page" @btn-click="handleTogglePage")
|
||||||
material-download-modal(:show="isShowDownload" :musicInfo="musicInfo" @select="handleAddDownload" @close="isShowDownload = false")
|
material-download-modal(:show="isShowDownload" :musicInfo="musicInfo" @select="handleAddDownload" @close="isShowDownload = false")
|
||||||
material-download-multiple-modal(:show="isShowDownloadMultiple" :list="selectdData" @select="handleAddDownloadMultiple" @close="isShowDownloadMultiple = false")
|
material-download-multiple-modal(:show="isShowDownloadMultiple" :list="selectdData" @select="handleAddDownloadMultiple" @close="isShowDownloadMultiple = false")
|
||||||
material-flow-btn(:show="isShowEditBtn && (source == 'kw' || (!isAPITemp && source == 'tx'))" :remove-btn="false" @btn-click="handleFlowBtnClick")
|
material-flow-btn(:show="isShowEditBtn && (source == 'kw' || !isAPITemp)" :remove-btn="false" @btn-click="handleFlowBtnClick")
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
@ -123,7 +123,7 @@ export default {
|
||||||
this.clickIndex = index
|
this.clickIndex = index
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
(this.source == 'kw' || (!this.isAPITemp && this.source == 'tx')) ? this.testPlay(index) : this.handleSearch(index)
|
(this.source == 'kw' || !this.isAPITemp) ? this.testPlay(index) : this.handleSearch(index)
|
||||||
this.clickTime = 0
|
this.clickTime = 0
|
||||||
this.clickIndex = -1
|
this.clickIndex = -1
|
||||||
},
|
},
|
||||||
|
@ -194,6 +194,11 @@ export default {
|
||||||
this.isShowDownload = false
|
this.isShowDownload = false
|
||||||
},
|
},
|
||||||
handleAddDownloadMultiple(type) {
|
handleAddDownloadMultiple(type) {
|
||||||
|
switch (this.source) {
|
||||||
|
case 'kg':
|
||||||
|
case 'wy':
|
||||||
|
type = '128k'
|
||||||
|
}
|
||||||
this.createDownloadMultiple({ list: [...this.selectdData], type })
|
this.createDownloadMultiple({ list: [...this.selectdData], type })
|
||||||
this.resetSelect()
|
this.resetSelect()
|
||||||
this.isShowDownloadMultiple = false
|
this.isShowDownloadMultiple = false
|
||||||
|
|
Loading…
Reference in New Issue