Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
zacharyzlj
Yz Music
提交
03e87395
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 搜索 >>
提交
03e87395
编写于
2月 24, 2021
作者:
Z
Zachary
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: playlist add collection func
* remove some debug info * add style
上级
a88a1a49
变更
12
隐藏空白更改
内联
并排
Showing
12 changed file
with
78 addition
and
16 deletion
+78
-16
src/api/base.js
src/api/base.js
+2
-2
src/api/playlist.js
src/api/playlist.js
+6
-0
src/assets/css/fakeqqmusic.scss
src/assets/css/fakeqqmusic.scss
+12
-0
src/components/common/BlackTip.vue
src/components/common/BlackTip.vue
+17
-1
src/components/common/DetailInfoCard.vue
src/components/common/DetailInfoCard.vue
+7
-3
src/components/common/HomeTop.vue
src/components/common/HomeTop.vue
+0
-1
src/views/musicLibrary/MvDetail.vue
src/views/musicLibrary/MvDetail.vue
+1
-1
src/views/musicLibrary/NewDisc.vue
src/views/musicLibrary/NewDisc.vue
+0
-1
src/views/musicLibrary/PlaylistDetail.vue
src/views/musicLibrary/PlaylistDetail.vue
+32
-3
src/views/musicLibrary/SongDetail.vue
src/views/musicLibrary/SongDetail.vue
+1
-1
src/views/musicLibrary/SongerDetail.vue
src/views/musicLibrary/SongerDetail.vue
+0
-2
src/views/musicLibrary/Songers.vue
src/views/musicLibrary/Songers.vue
+0
-1
未找到文件。
src/api/base.js
浏览文件 @
03e87395
import
axios
from
"
axios
"
;
//
const BASIC_URL = "http://zacharyzlj.cn:3000/";
const
BASIC_URL
=
"
http://192.168.31.152:3000/
"
;
const
BASIC_URL
=
"
http://zacharyzlj.cn:3000/
"
;
//
const BASIC_URL = "http://192.168.31.152:3000/";
function
createBaseInstance
()
{
const
instance
=
axios
.
create
({
baseURL
:
BASIC_URL
,
withCredentials
:
true
});
...
...
src/api/playlist.js
浏览文件 @
03e87395
...
...
@@ -24,3 +24,9 @@ export const getCatList = () => requset.get("/playlist/catlist");
/* 登陆后使用 */
export
const
getUserPlaylists
=
id
=>
requset
.
get
(
`/user/playlist?uid=
${
id
}
`
);
/* 收藏/取消收藏歌单
* 登陆后使用
* t : 类型,1:收藏,2:取消收藏 id : 歌单 id */
export
const
toggleLikePlaylist
=
params
=>
requset
.
get
(
"
/playlist/subscribe
"
,
{
params
:
params
});
src/assets/css/fakeqqmusic.scss
浏览文件 @
03e87395
...
...
@@ -118,6 +118,10 @@ $black: #000;
background-position
:
-40px
-100px
;
vertical-align
:
-2px
;
}
.mod_btn__icon_like--like
,
.mod_btn_green__icon_like--like
{
background-position
:
0
-80px
;
}
.mod_btn__icon_add
,
.mod_btn__icon_batch
,
.mod_btn__icon_comment
,
...
...
@@ -1304,6 +1308,14 @@ img .playlist__pic {
background-position
:
0
-150px
;
margin
:
0
auto
16px
;
}
.popup_tips__icon_warn
{
display
:
block
;
width
:
46px
;
height
:
46px
;
margin
:
0
auto
16px
;
background-position
:
0
-220px
;
background-image
:
url(../img/icon_popup.png)
;
}
.popup_tips__tit
{
font-size
:
14px
;
color
:
$white
;
...
...
src/components/common/BlackTip.vue
浏览文件 @
03e87395
...
...
@@ -5,7 +5,7 @@
style=
"z-index: 2147483647; left: 646px; top: 326px"
:style=
"
{ display: ifShow ? '' : 'none' }"
>
<i
class=
"popup_tips__icon
"
></i>
<i
:class=
"processIcon()
"
></i>
<h2
class=
"popup_tips__tit"
>
{{
tip
}}
</h2>
</div>
</
template
>
...
...
@@ -20,6 +20,22 @@ export default {
type
:
String
,
default
:
""
,
},
// 0: tip, 1: warn
iconType
:
{
default
:
0
},
},
methods
:
{
processIcon
()
{
switch
(
this
.
iconType
)
{
case
0
:
return
"
popup_tips__icon
"
;
break
;
case
1
:
return
"
popup_tips__icon_warn
"
;
break
;
default
:
return
""
;
}
},
},
};
</
script
>
src/components/common/DetailInfoCard.vue
浏览文件 @
03e87395
...
...
@@ -35,7 +35,7 @@
<div
class=
"data__desc_txt"
id=
"short_desc"
>
{{
obj
.
desc
}}
</div>
<a
href=
"javascript:;"
class=
"js_desc"
@
click=
"moreClick"
>
[更多]
</a>
<a
class=
"js_desc"
@
click=
"moreClick"
>
[更多]
</a>
</div>
<!-- Info -->
<ul
class=
"data__info"
v-if=
"cardType != 'songer'"
>
...
...
@@ -110,7 +110,11 @@
{{
cardType
==
"
song
"
?
"
播放
"
:
"
播放全部
"
}}
</a>
<a
class=
"mod_btn js_fav_taoge"
@
click=
"btnClick('collection')"
>
<i
class=
"mod_btn__icon_like"
></i>
收藏
<i
class=
"mod_btn__icon_like"
:class=
"obj.subscribed ? 'mod_btn__icon_like--like' : ''"
></i
>
收藏
</a>
<a
class=
"mod_btn js_into_comment"
...
...
@@ -120,9 +124,9 @@
<i
class=
"mod_btn__icon_comment"
></i>
评论(
{{
commentCount
}}
)
</a>
<a
href=
"javascript:;"
class=
"mod_btn js_more"
@
click=
"btnClick('more')"
style=
"display: none"
>
<i
class=
"mod_btn__icon_menu"
></i>
更多
</a>
...
...
src/components/common/HomeTop.vue
浏览文件 @
03e87395
...
...
@@ -79,7 +79,6 @@ export default {
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
);
});
});
...
...
src/views/musicLibrary/MvDetail.vue
浏览文件 @
03e87395
...
...
@@ -81,7 +81,7 @@ export default {
this
.
id
=
this
.
$route
.
query
.
id
;
getMvDetail
(
this
.
id
).
then
((
res
)
=>
{
this
.
mv
=
createMv
(
res
.
data
.
data
);
console
.
log
(
this
.
mv
);
//
console.log(this.mv);
});
this
.
updateMv
();
this
.
getComment
();
...
...
src/views/musicLibrary/NewDisc.vue
浏览文件 @
03e87395
...
...
@@ -147,7 +147,6 @@ export default {
);
}
}
console
.
log
(
this
.
currentAlbums
);
},
selectArea
(
n
)
{
this
.
updateAlbum
();
...
...
src/views/musicLibrary/PlaylistDetail.vue
浏览文件 @
03e87395
...
...
@@ -52,17 +52,20 @@
</div>
</div>
</div>
<black-tip
:ifShow=
"ifShowTip"
:iconType=
"tipType"
:tip=
"tip"
/>
</
template
>
<
script
>
import
DetailInfoCard
from
"
components/common/DetailInfoCard
"
;
import
DetailSonglist
from
"
components/common/DetailSonglist
"
;
import
CommontBox
from
"
components/common/CommontBox
"
;
import
BlackTip
from
"
components/common/BlackTip
"
;
import
{
getPlayList
,
getPlaylistDetial
,
getSongDetail
,
getCommentsNew
,
toggleLikePlaylist
,
}
from
"
api
"
;
import
{
processCount
,
createSong
,
playSonglist
}
from
"
common/utils
"
;
...
...
@@ -76,6 +79,9 @@ export default {
commentPage
:
1
,
commentCount
:
0
,
comments
:
[],
ifShowTip
:
false
,
tip
:
""
,
tipType
:
1
,
};
},
created
()
{
...
...
@@ -84,7 +90,6 @@ export default {
methods
:
{
init
()
{
getPlaylistDetial
(
this
.
id
).
then
((
res
)
=>
{
console
.
log
(
res
);
let
d
=
res
.
data
.
playlist
;
this
.
playlist
=
{
id
:
d
.
id
,
...
...
@@ -97,12 +102,11 @@ export default {
playCount
:
processCount
(
d
.
playCount
),
subscribedCount
:
processCount
(
d
.
subscribedCount
),
shareCount
:
processCount
(
d
.
shareCount
),
subscribed
:
d
.
subscribed
,
};
console
.
log
(
this
.
playlist
);
let
trackIds
=
res
.
data
.
playlist
.
trackIds
.
map
(({
id
})
=>
id
);
let
songDetails
=
getSongDetail
(
trackIds
.
slice
(
0
,
500
)).
then
((
res
)
=>
{
console
.
log
(
res
.
data
.
songs
);
let
songs
=
res
.
data
.
songs
.
map
(({
id
,
name
,
al
,
ar
,
mv
,
dt
})
=>
{
return
createSong
({
id
,
...
...
@@ -122,6 +126,30 @@ export default {
},
cardClick
(
v
)
{
if
(
v
==
"
all
"
)
playSonglist
(
this
.
songs
);
else
if
(
v
==
"
collection
"
)
{
if
(
this
.
$store
.
state
.
user
.
isLogged
)
{
if
(
!
this
.
playlist
.
subscribed
)
{
toggleLikePlaylist
({
t
:
1
,
id
:
this
.
playlist
.
id
}).
then
((
res
)
=>
{
this
.
playlist
.
subscribed
=
true
;
this
.
showTip
(
"
收藏成功,已添加到收藏歌单
"
,
0
);
});
}
else
{
toggleLikePlaylist
({
t
:
2
,
id
:
this
.
playlist
.
id
}).
then
((
res
)
=>
{
this
.
playlist
.
subscribed
=
false
;
this
.
showTip
(
"
取消收藏成功
"
,
0
);
});
}
}
else
this
.
showTip
(
"
请先登陆
"
,
1
);
}
},
showTip
(
tip
,
type
)
{
this
.
tipType
=
type
;
this
.
tip
=
tip
;
this
.
ifShowTip
=
true
;
if
(
this
.
tipTimer
)
clearTimeout
(
this
.
tipTimer
);
setTimeout
(()
=>
{
this
.
ifShowTip
=
false
;
},
1300
);
},
getComment
()
{
let
params
=
{
...
...
@@ -150,6 +178,7 @@ export default {
DetailInfoCard
,
DetailSonglist
,
CommontBox
,
BlackTip
,
},
};
</
script
>
...
...
src/views/musicLibrary/SongDetail.vue
浏览文件 @
03e87395
...
...
@@ -159,7 +159,7 @@ export default {
// 获取歌曲信息
getSongDetail
(
this
.
songId
).
then
((
res
)
=>
{
let
d
=
res
.
data
.
songs
[
0
];
//console.log(
d
);
//console.log(
res
);
this
.
song
=
createSong
({
id
:
d
.
id
,
name
:
d
.
name
,
...
...
src/views/musicLibrary/SongerDetail.vue
浏览文件 @
03e87395
...
...
@@ -228,9 +228,7 @@ export default {
// Get songer album
const
res4
=
await
getSongerAlbums
({
id
:
this
.
id
,
limit
:
5
,
offset
:
0
});
console
.
log
(
res4
);
this
.
albums
=
createAlbums
(
res4
.
data
.
hotAlbums
);
console
.
log
(
this
.
albums
);
// Get songer mv
const
res5
=
await
getSongerMvs
(
this
.
id
);
...
...
src/views/musicLibrary/Songers.vue
浏览文件 @
03e87395
...
...
@@ -68,7 +68,6 @@ export default {
updateArtists
()
{
getSongers
(
this
.
initial
,
this
.
type
,
this
.
area
,
this
.
page
)
.
then
((
res
)
=>
{
console
.
log
(
res
);
this
.
artists
=
res
.
data
.
artists
;
this
.
more
=
res
.
data
.
more
;
this
.
loading
=
false
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录