Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
zacharyzlj
Yz Music
提交
a59a71b5
Y
Yz Music
项目概览
zacharyzlj
/
Yz Music
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Y
Yz Music
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
a59a71b5
编写于
2月 22, 2021
作者:
Z
Zachary
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: finish home top func
* add router helper file * imporve code
上级
ac8461b6
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
86 addition
and
68 deletion
+86
-68
src/assets/css/fakeqqmusic.css
src/assets/css/fakeqqmusic.css
+1
-0
src/common/routerHelper.js
src/common/routerHelper.js
+33
-0
src/common/utils.js
src/common/utils.js
+1
-0
src/components/common/DetailSonglist.vue
src/components/common/DetailSonglist.vue
+9
-22
src/components/common/HomeTop.vue
src/components/common/HomeTop.vue
+30
-28
src/components/common/RecommendedBar.vue
src/components/common/RecommendedBar.vue
+7
-7
src/views/musicLibrary/NewDisc.vue
src/views/musicLibrary/NewDisc.vue
+2
-7
src/views/musicLibrary/Songers.vue
src/views/musicLibrary/Songers.vue
+3
-4
未找到文件。
src/assets/css/fakeqqmusic.css
浏览文件 @
a59a71b5
...
...
@@ -748,6 +748,7 @@
transition
:
transform
0.75s
cubic-bezier
(
0
,
1
,
0.75
,
1
);
}
.mod_cover__icon_play
{
cursor
:
pointer
;
position
:
absolute
;
left
:
50%
;
top
:
50%
;
...
...
src/common/routerHelper.js
0 → 100644
浏览文件 @
a59a71b5
import
Router
from
"
@/router
"
;
export
function
gotoSongDetail
(
id
)
{
if
(
id
&&
id
!=
0
)
Router
.
push
({
path
:
"
/musicLibrary/songDetail
"
,
query
:
{
id
:
id
}
});
}
export
function
gotoSongerDetail
(
id
)
{
if
(
id
&&
id
!=
0
)
Router
.
push
({
path
:
"
/musicLibrary/songerDetail
"
,
query
:
{
id
:
id
}
});
}
export
function
gotoPlaylistDetail
(
id
)
{
if
(
id
&&
id
!=
0
)
Router
.
push
({
path
:
"
/musicLibrary/playlistDetail
"
,
query
:
{
id
:
id
}
});
}
export
function
gotoAlbumDetail
(
id
)
{
if
(
id
&&
id
!=
0
)
Router
.
push
({
path
:
"
/musicLibrary/albumDetail
"
,
query
:
{
id
:
id
}
});
}
src/common/utils.js
浏览文件 @
a59a71b5
export
*
from
"
./storeHelper
"
;
export
*
from
"
./apiHelper
"
;
export
*
from
"
./routerHelper
"
;
export
function
isDef
(
v
)
{
return
v
!==
undefined
&&
v
!==
null
;
...
...
src/components/common/DetailSonglist.vue
浏览文件 @
a59a71b5
...
...
@@ -22,7 +22,7 @@
<div
class=
"songlist__number"
>
{{
idx
+
1
}}
</div>
<div
class=
"songlist__songname"
>
<span
class=
"songlist__songname_txt"
>
<a
:title=
"song.name"
@
click=
"gotoSongDeail(song.id)"
>
<a
:title=
"song.name"
@
click=
"gotoSongDe
t
ail(song.id)"
>
{{
song
.
name
}}
<span
class=
"songlist__song_txt"
></span>
</a>
</span>
...
...
@@ -59,6 +59,11 @@
<
script
>
import
ModListMenu
from
"
components/common/ModListMenu
"
;
import
{
gotoSongDetail
,
gotoSongerDetail
,
gotoAlbumDetail
,
}
from
"
common/utils
"
;
export
default
{
props
:
{
songs
:
{
...
...
@@ -71,27 +76,9 @@ export default {
},
},
methods
:
{
gotoSongDeail
(
id
)
{
if
(
id
&&
id
!=
0
)
this
.
$router
.
push
({
path
:
"
/musicLibrary/songDetail
"
,
query
:
{
id
:
id
},
});
},
gotoSongerDetail
(
id
)
{
if
(
id
&&
id
!=
0
)
this
.
$router
.
push
({
path
:
"
/musicLibrary/songerDetail
"
,
query
:
{
id
:
id
},
});
},
gotoAlbumDetail
(
id
)
{
if
(
id
&&
id
!=
0
)
this
.
$router
.
push
({
path
:
"
/musicLibrary/albumDetail
"
,
query
:
{
id
:
id
},
});
},
gotoSongDetail
,
gotoSongerDetail
,
gotoAlbumDetail
,
},
components
:
{
ModListMenu
,
...
...
src/components/common/HomeTop.vue
浏览文件 @
a59a71b5
...
...
@@ -11,7 +11,10 @@
>
<div
class=
"toplist__box"
>
<div
id=
"toplist__bg"
:class=
"'toplist__bg' + idx"
></div>
<i
class=
"mod_cover__icon_play js_play_toplist"
></i>
<i
class=
"mod_cover__icon_play js_play_toplist"
@
click=
"playSonglist(toplist)"
></i>
<i
class=
"toplist__line"
></i>
<h3
class=
"toplist__hd"
>
<a
href=
"javascript:;"
class=
"toplist__tit"
...
...
@@ -26,16 +29,19 @@
<a
href=
"javascript:;"
class=
"js_song"
:data-id=
"toplist
.tracks
[songIdx - 1].id"
@
click=
"gotoSongDetail(toplist
.tracks
[songIdx - 1].id)"
:data-id=
"toplist[songIdx - 1].id"
@
click=
"gotoSongDetail(toplist[songIdx - 1].id)"
>
{{
parseSongName
(
toplist
.
tracks
[
songIdx
-
1
].
name
)
}}
{{
toplist
[
songIdx
-
1
].
name
}}
</a>
</div>
<div
class=
"toplist__artist"
>
<a
href=
"javascript:;"
>
{{
parseArtistsName
(
toplist
.
tracks
[
songIdx
-
1
].
ar
)
}}
</a>
<a
@
click=
"
gotoSongerDetail(toplist[songIdx - 1].artists[0].id)
"
>
{{
toplist
[
songIdx
-
1
].
artistsText
}}
</a
>
</div>
</li>
</ul>
...
...
@@ -47,7 +53,13 @@
</
template
>
<
script
>
import
{
getTopList
,
toplistTypes
}
from
"
api
"
;
import
{
getPlaylistDetial
,
getSongDetail
,
toplistTypes
}
from
"
api
"
;
import
{
createSongs
,
gotoSongDetail
,
gotoSongerDetail
,
playSonglist
,
}
from
"
common/utils
"
;
export
default
{
data
()
{
...
...
@@ -62,28 +74,18 @@ export default {
},
methods
:
{
updateTopList
(
toplistType
)
{
getTopList
(
toplistType
).
then
((
res
)
=>
{
//console.log(res);
this
.
toplists
.
push
(
res
.
data
.
playlist
);
});
},
parseSongName
(
name
)
{
return
name
;
},
parseArtistsName
(
nameList
)
{
let
l
=
[];
for
(
let
i
of
nameList
)
{
l
.
push
(
i
.
name
);
}
let
name
=
l
.
join
(
"
/
"
);
return
name
;
},
gotoSongDetail
(
id
)
{
this
.
$router
.
push
({
path
:
"
/musicLibrary/songDetail
"
,
query
:
{
id
:
id
},
getPlaylistDetial
(
toplistType
).
then
((
res
)
=>
{
let
trackIds
=
res
.
data
.
playlist
.
trackIds
.
map
(({
id
})
=>
id
);
getSongDetail
(
trackIds
).
then
((
res
)
=>
{
let
songs
=
createSongs
(
res
.
data
.
songs
);
console
.
log
(
songs
);
this
.
toplists
.
push
(
songs
);
});
});
},
gotoSongDetail
,
gotoSongerDetail
,
playSonglist
,
},
};
</
script
>
...
...
src/components/common/RecommendedBar.vue
浏览文件 @
a59a71b5
...
...
@@ -65,7 +65,12 @@
<
script
>
import
{
getPlayList
,
getPlaylistDetial
,
getSongDetail
}
from
"
api
"
;
import
{
processCount
,
createSong
,
playSonglist
}
from
"
common/utils
"
;
import
{
processCount
,
createSong
,
playSonglist
,
gotoPlaylistDetail
,
}
from
"
common/utils
"
;
export
default
{
data
()
{
...
...
@@ -126,12 +131,7 @@ export default {
});
});
},
gotoPlaylistDetail
(
id
)
{
this
.
$router
.
push
({
path
:
"
/musicLibrary/playlistDetail
"
,
query
:
{
id
:
id
},
});
},
gotoPlaylistDetail
,
},
};
</
script
>
...
...
src/views/musicLibrary/NewDisc.vue
浏览文件 @
a59a71b5
...
...
@@ -80,7 +80,7 @@
<
script
>
import
TypeSelectSubBar
from
"
components/common/TypeSelectSubBar
"
;
import
{
albumAreas
,
getTopAlbum
}
from
"
api
"
;
import
{
createAlbums
}
from
"
common/utils
"
;
import
{
createAlbums
,
gotoAlbumDetail
}
from
"
common/utils
"
;
export
default
{
data
()
{
...
...
@@ -121,12 +121,7 @@ export default {
console
.
log
(
v
);
this
.
page
=
v
;
},
gotoAlbumDetail
(
id
)
{
this
.
$router
.
push
({
path
:
"
/musicLibrary/albumDetail
"
,
query
:
{
id
:
id
},
});
},
gotoAlbumDetail
,
},
watch
:
{
page
(
newPage
)
{
...
...
src/views/musicLibrary/Songers.vue
浏览文件 @
a59a71b5
...
...
@@ -29,7 +29,7 @@
href=
"javascript:;"
class=
"singer_list_txt__link js_singer"
:title=
"item.name"
@
click=
"gotoSongerDetail(
{ id: item.id }
)"
@
click=
"gotoSongerDetail(
item.id
)"
>
{{
item
.
name
}}
</a
>
</li>
...
...
@@ -67,6 +67,7 @@
<
script
>
import
{
getSongers
,
songerInitials
,
songerTypes
,
songerAreas
}
from
"
api
"
;
import
{
gotoSongerDetail
}
from
"
common/utils
"
;
import
TypeSelectBar
from
"
components/common/TypeSelectBar
"
;
import
TypeSelectSubBar
from
"
components/common/TypeSelectSubBar
"
;
...
...
@@ -131,9 +132,7 @@ export default {
this
.
updateArtists
();
}
},
gotoSongerDetail
(
query
)
{
this
.
$router
.
push
({
path
:
"
/musicLibrary/songerDetail
"
,
query
:
query
});
},
gotoSongerDetail
,
},
components
:
{
TypeSelectBar
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录