完善歌单功能

This commit is contained in:
lyswhut
2019-09-03 02:49:48 +08:00
parent 507d495f3f
commit 9e9053c0eb
11 changed files with 373 additions and 102 deletions
+4 -1
View File
@@ -186,7 +186,10 @@ export const updateSetting = setting => {
songList: {
source: 'kw',
sortId: 'hot',
tagId: null,
tagInfo: {
name: '全部',
id: null,
},
},
themeId: 0,
sourceId: 'kw',
+1 -1
View File
@@ -127,7 +127,7 @@ export default {
},
filterTagInfo(rawList) {
return rawList.map(type => ({
type: type.first,
name: type.first,
list: type.second.map(item => ({
parent_id: type.first,
parent_name: type.first,
+2 -2
View File
@@ -5,7 +5,7 @@ export default {
list: [
{
id: 'kgtop500',
name: 'TOP500',
name: '酷狗TOP500',
bangid: '8888',
},
{
@@ -45,7 +45,7 @@ export default {
},
{
id: 'kgdyrgb',
name: '电音热歌榜',
name: '电音榜',
bangid: '33160',
},
{
+7 -7
View File
@@ -41,8 +41,9 @@ export default {
? `http://www2.kugou.kugou.com/yueku/v9/special/getSpecial?is_smarty=1&cdn=cdn&t=5&c=${tagId}`
: `http://www2.kugou.kugou.com/yueku/v9/special/getSpecial?is_smarty=1&`
},
getSongListUrl(sortId, tagId = '', page) {
return `http://www2.kugou.kugou.com/yueku/v9/special/index/getData/getData.html&cdn=cdn&t=${sortId}&c=${tagId}?is_ajax=1&p=${page}`
getSongListUrl(sortId, tagId, page) {
if (tagId == null) tagId = ''
return `http://www2.kugou.kugou.com/yueku/v9/special/getSpecial?is_ajax=1&cdn=cdn&t=${sortId}&c=${tagId}&p=${page}`
},
getSongListDetailUrl(id) {
return `http://www2.kugou.kugou.com/yueku/v9/special/single/${id}-5-9999.html`
@@ -71,10 +72,10 @@ export default {
},
filterTagInfo(rawData) {
const result = []
for (const type of Object.keys(rawData)) {
for (const name of Object.keys(rawData)) {
result.push({
type,
list: rawData[type].data.map(tag => ({
name,
list: rawData[name].data.map(tag => ({
parent_id: tag.parent_id,
parent_name: tag.pname,
id: tag.id,
@@ -196,7 +197,7 @@ export default {
interval: formatPlayTime(item.duration / 1000),
img: null,
lrc: null,
hash: item.HASH,
hash: item.hash,
types,
_types,
typeUrl: {},
@@ -232,7 +233,6 @@ export default {
)
if (!tagId) tasks.push(this.getSongListRecommend()) // 如果是所有类别,则顺便获取推荐列表
return Promise.all(tasks).then(([list, info, recommendList]) => {
console.log(recommendList)
if (recommendList) list.unshift(...recommendList)
return {
list,
+2 -2
View File
@@ -58,7 +58,7 @@ export default {
},
filterTagInfo(rawList) {
return rawList.map(type => ({
type: type.name,
name: type.name,
list: type.data.map(item => ({
parent_id: type.id,
parent_name: type.name,
@@ -115,7 +115,7 @@ export default {
return this._requestObj_listDetail.promise.then(({ body }) => {
if (body.result !== 'ok') return this.getListDetail(id, page)
return {
list: this.filterListDetail(body.data.musiclist),
list: this.filterListDetail(body.musiclist),
page,
limit: body.rn,
total: body.total,