Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
zacharyzlj
Yz Music
提交
0a38dd10
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 搜索 >>
提交
0a38dd10
编写于
2月 19, 2021
作者:
Z
Zachary
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update: some page add play func
上级
2206d2b8
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
37 addition
and
17 deletion
+37
-17
src/common/storeHelper.js
src/common/storeHelper.js
+13
-0
src/common/utils.js
src/common/utils.js
+2
-0
src/components/content/RecommendedBar.vue
src/components/content/RecommendedBar.vue
+2
-3
src/views/musicLibrary/AlbumDetail.vue
src/views/musicLibrary/AlbumDetail.vue
+11
-4
src/views/musicLibrary/Ranking.vue
src/views/musicLibrary/Ranking.vue
+9
-10
未找到文件。
src/common/storeHelper.js
0 → 100644
浏览文件 @
0a38dd10
import
Store
from
"
@/store
"
;
// 替换播放列表,并播放
export
function
playSonglist
(
list
)
{
Store
.
commit
(
"
music/setPlaylist
"
,
list
);
Store
.
dispatch
(
"
music/startSong
"
,
list
[
0
]);
}
// 将歌曲添加到列表尾部,并播放该歌曲
export
function
playTheSong
(
song
)
{
Store
.
dispatch
(
"
music/addToPlaylist
"
,
song
);
Store
.
dispatch
(
"
music/startSong
"
,
song
);
}
src/common/utils.js
浏览文件 @
0a38dd10
export
*
from
"
./storeHelper
"
;
export
function
processCount
(
count
)
{
if
(
count
>
10000000
)
{
return
(
count
/
10000000
).
toFixed
(
2
)
+
"
亿
"
;
...
...
src/components/content/RecommendedBar.vue
浏览文件 @
0a38dd10
...
...
@@ -65,7 +65,7 @@
<
script
>
import
{
getPlayList
,
getPlaylistDetial
,
getSongDetail
}
from
"
api
"
;
import
{
processCount
,
createSong
}
from
"
common/utils
"
;
import
{
processCount
,
createSong
,
playSonglist
}
from
"
common/utils
"
;
export
default
{
data
()
{
...
...
@@ -122,8 +122,7 @@ export default {
});
});
console
.
log
(
songs
);
this
.
$store
.
commit
(
"
music/setPlaylist
"
,
songs
);
this
.
$store
.
dispatch
(
"
music/startSong
"
,
songs
[
0
]);
playSonglist
(
songs
);
});
});
},
...
...
src/views/musicLibrary/AlbumDetail.vue
浏览文件 @
0a38dd10
...
...
@@ -43,9 +43,9 @@
</ul>
<div
class=
"data__actions"
role=
"toolbar"
>
<a
class=
"mod_btn_green js_all_play"
><i
class=
"mod_btn_green__icon_play"
></i>
播放全部
</a
>
<a
class=
"mod_btn_green js_all_play"
@
click=
"playAll"
>
<i
class=
"mod_btn_green__icon_play"
></i>
播放全部
</a
>
<a
href=
"javascript:;"
...
...
@@ -106,6 +106,7 @@
<a
class=
"list_menu__item list_menu__play js_play"
title=
"播放"
@
click=
"playOne(idx)"
>
<i
class=
"list_menu__icon_play"
></i>
<span
class=
"icon_txt"
>
播放
</span>
...
...
@@ -308,7 +309,7 @@
<
script
>
import
{
getAlbum
}
from
"
api
"
;
import
{
createSong
}
from
"
common/utils
"
;
import
{
createSong
,
playSonglist
,
playTheSong
}
from
"
common/utils
"
;
export
default
{
data
()
{
...
...
@@ -355,6 +356,12 @@ export default {
console
.
log
(
this
.
songs
);
});
},
playAll
()
{
playSonglist
(
this
.
songs
);
},
playOne
(
id
)
{
playTheSong
(
this
.
songs
[
id
]);
},
},
};
</
script
>
...
...
src/views/musicLibrary/Ranking.vue
浏览文件 @
0a38dd10
...
...
@@ -81,7 +81,7 @@
><i
class=
"toplist_switch__arrow_prev sprite"
></i
><i
class=
"icon_txt"
>
上一期
</i></a
>
<
span
class=
"toplist_switch__data js_chosed_week"
>
2021-02-13
</span
>
<
!--
<span
class=
"toplist_switch__data js_chosed_week"
>
2021-02-13
</span>
--
>
<a
href=
"javascript:;"
class=
"toplist_switch__btn js_next_week"
...
...
@@ -161,6 +161,7 @@
class=
"songlist__icon songlist__icon_mv sprite"
rel=
"noopener"
title=
"MV"
:style=
"
{ display: song.mvId == 0 ? 'none' : '' }"
>
<span
class=
"icon_txt"
>
MV
</span></a
>
...
...
@@ -168,11 +169,7 @@
class=
"songlist__songname_txt"
style=
"visibility: visible"
>
<a
class=
"songlist__cover album_name"
data-albummid=
"002pDbf73FEsT9"
data-albumid=
"1080467"
>
<a
class=
"songlist__cover album_name"
>
<img
class=
"songlist__pic"
style=
"display: block; visibility: visible"
...
...
@@ -189,6 +186,7 @@
href=
"javascript:;"
class=
"list_menu__item list_menu__play js_play"
title=
"播放"
@
click=
"playOne(idx)"
>
<i
class=
"list_menu__icon_play"
></i>
<span
class=
"icon_txt"
>
播放
</span>
...
...
@@ -247,7 +245,7 @@
<
script
>
import
{
getPlaylistDetial
,
getSongDetail
}
from
"
api
"
;
import
{
isDef
,
createSong
}
from
"
common/utils
"
;
import
{
isDef
,
createSong
,
playSonglist
,
playTheSong
}
from
"
common/utils
"
;
export
default
{
data
()
{
...
...
@@ -332,9 +330,10 @@ export default {
else
return
"
icon_rank_down
"
;
},
playAll
()
{
this
.
$store
.
commit
(
"
music/setPlaylist
"
,
this
.
listDatas
);
this
.
$store
.
dispatch
(
"
music/startSong
"
,
this
.
listDatas
[
0
]);
//this.$store.commit("music/setCurrentSong", songs[0]);
playSonglist
(
this
.
listDatas
);
},
playOne
(
id
)
{
playTheSong
(
this
.
listDatas
[
id
]);
},
},
watch
:
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录