Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
zacharyzlj
Yz Music
提交
e71084e0
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 搜索 >>
提交
e71084e0
编写于
2月 24, 2021
作者:
Z
Zachary
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: add video detail and play page.
上级
7d2ff2b2
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
254 addition
and
32 deletion
+254
-32
Plan.md
Plan.md
+3
-3
src/api/mv.js
src/api/mv.js
+2
-0
src/common/apiHelper.js
src/common/apiHelper.js
+4
-2
src/common/routerHelper.js
src/common/routerHelper.js
+8
-0
src/components/common/ShowMvs.vue
src/components/common/ShowMvs.vue
+13
-3
src/router/index.js
src/router/index.js
+6
-0
src/views/musicLibrary/MV.vue
src/views/musicLibrary/MV.vue
+38
-24
src/views/musicLibrary/MvDetail.vue
src/views/musicLibrary/MvDetail.vue
+180
-0
未找到文件。
Plan.md
浏览文件 @
e71084e0
...
...
@@ -26,12 +26,12 @@
-
[x] 标题展示
7.
mv 列表页
-
[x] 无限滚动
8.
mv 详情播放页
9
.
功能条
-
[x]
mv 详情播放页
8
.
功能条
-
收藏
-
分享
-
添加
10
.
[x] 懒加载
9
.
[x] 懒加载
-
[ ] 样式调整
-
[ ] 组件抽离
src/api/mv.js
浏览文件 @
e71084e0
...
...
@@ -37,5 +37,7 @@ export const getAllMV = (limit, page, order, area, type) => {
export
const
getMvDetail
=
id
=>
requset
.
get
(
`/mv/detail?mvid=
${
id
}
`
);
export
const
getMvPlayUrl
=
id
=>
requset
.
get
(
`/mv/url?id=
${
id
}
`
);
/* 登陆后使用 */
export
const
getCollectedMvs
=
()
=>
requset
.
get
(
"
/mv/sublist
"
);
src/common/apiHelper.js
浏览文件 @
e71084e0
...
...
@@ -110,7 +110,8 @@ export function createMv(mv) {
coverUrl
,
creator
,
durationms
,
playTime
playTime
,
desc
}
=
mv
;
let
dt
=
duration
?
duration
:
durationms
;
let
times
=
playCount
?
playCount
:
playTime
;
...
...
@@ -126,7 +127,8 @@ export function createMv(mv) {
durationSecond
:
dt
/
1000
,
durationText
:
formatTime
(
dt
/
1000
),
publishTime
,
playCount
:
processCount
(
times
)
playCount
:
processCount
(
times
),
desc
:
desc
};
}
export
function
createMvs
(
mvs
)
{
...
...
src/common/routerHelper.js
浏览文件 @
e71084e0
...
...
@@ -31,3 +31,11 @@ export function gotoAlbumDetail(id) {
query
:
{
id
:
id
}
});
}
export
function
gotoMvDetail
(
id
)
{
if
(
id
&&
id
!=
0
)
Router
.
push
({
path
:
"
/musicLibrary/mvDetail
"
,
query
:
{
id
:
id
}
});
}
src/components/common/ShowMvs.vue
浏览文件 @
e71084e0
...
...
@@ -8,7 +8,11 @@
<ul
class=
"mv_list__list"
>
<li
class=
"mv_list__item"
v-for=
"mv in mvs"
:key=
"mv.id"
>
<div
class=
"mv_list__item_box"
style=
"visibility: visible"
>
<a
class=
"mv_list__cover mod_cover js_mv"
hidefocus=
"true"
>
<a
class=
"mv_list__cover mod_cover js_mv"
hidefocus=
"true"
@
click=
"gotoMvDetail(mv.id)"
>
<img
class=
"mv_list__pic"
style=
"display: block; visibility: visible"
...
...
@@ -20,7 +24,9 @@
<!--div class="mv_list__time">04:10
</div-->
</a>
<h3
class=
"mv_list__title"
>
<a
class=
"js_mv"
:title=
"mv.name"
>
{{
mv
.
name
}}
</a>
<a
class=
"js_mv"
:title=
"mv.name"
@
click=
"gotoMvDetail(mv.id)"
>
{{
mv
.
name
}}
</a>
</h3>
<p
class=
"mv_list__singer"
>
<a
class=
"js_singer"
:title=
"mv.artistsText"
>
{{
...
...
@@ -35,15 +41,19 @@
</
template
>
<
script
>
import
{
gotoMvDetail
}
from
"
common/utils
"
;
export
default
{
props
:
{
mvs
:
{
type
:
Array
,
default
:
[]
},
},
methods
:
{
gotoMvDetail
,
},
};
</
script
>
<
style
scoped
>
h3
,
hr
,
li
,
ol
,
...
...
src/router/index.js
浏览文件 @
e71084e0
...
...
@@ -12,6 +12,7 @@ const SongerDetail = () => import("views/musicLibrary/SongerDetail");
const
SongDetail
=
()
=>
import
(
"
views/musicLibrary/SongDetail
"
);
const
AlbumDetail
=
()
=>
import
(
"
views/musicLibrary/AlbumDetail
"
);
const
PlaylistDetail
=
()
=>
import
(
"
views/musicLibrary/PlaylistDetail
"
);
const
MvDetail
=
()
=>
import
(
"
views/musicLibrary/MvDetail
"
);
const
SearchResultDetail
=
()
=>
import
(
"
views/musicLibrary/SearchResultDetail
"
);
...
...
@@ -93,6 +94,11 @@ const routes = [
component
:
PlaylistDetail
,
meta
:
{
name
:
"
playlistDetail
"
}
},
{
path
:
"
mvDetail
"
,
component
:
MvDetail
,
meta
:
{
name
:
"
mvDetail
"
}
},
{
path
:
"
searchResultDetail
"
,
component
:
SearchResultDetail
,
...
...
src/views/musicLibrary/MV.vue
浏览文件 @
e71084e0
...
...
@@ -49,6 +49,7 @@
class=
"mv_list__cover mod_cover js_mv"
:title=
"item.name"
hidefocus=
"true"
@
click=
"gotoMvDetail(item.id)"
>
<img
style=
"display: block; visibility: visible"
...
...
@@ -60,9 +61,12 @@
<i
class=
"mod_cover__icon_play"
></i>
</a>
<h3
class=
"mv_list__title"
>
<a
href=
"javascript:;"
class=
"js_mv"
:title=
"item.name"
>
{{
item
.
name
}}
</a>
<a
class=
"js_mv"
:title=
"item.name"
@
click=
"gotoMvDetail(item.id)"
>
{{
item
.
name
}}
</a
>
</h3>
<div
class=
"mv_list__singer"
title=
"5AM"
>
<a
class=
"js_singer"
:title=
"item.artistName"
>
{{
...
...
@@ -94,7 +98,7 @@
import
TypeSelectBar
from
"
components/common/TypeSelectBar
"
;
import
TypeSelectSubBar
from
"
components/common/TypeSelectSubBar
"
;
import
{
getAllMV
,
mvArea
,
mvOrder
,
mvType
}
from
"
api
"
;
import
{
processCount
}
from
"
common/utils
"
;
import
{
processCount
,
gotoMvDetail
}
from
"
common/utils
"
;
export
default
{
data
()
{
...
...
@@ -114,41 +118,50 @@ export default {
};
},
mounted
()
{
this
.
update
Mv
();
this
.
init
Mv
();
this
.
$refs
.
mvList
.
addEventListener
(
"
scroll
"
,
this
.
loadMore
);
},
methods
:
{
updateMv
()
{
getAllMV
(
this
.
limit
,
this
.
page
,
this
.
order
,
this
.
selectArea
,
this
.
selectType
)
.
then
((
res
)
=>
{
//console.log(res);
this
.
mvs
.
push
(...
res
.
data
.
data
);
this
.
mvLoading
=
false
;
this
.
allLength
=
res
.
data
.
count
;
this
.
more
=
res
.
data
.
hasMore
;
})
.
catch
((
err
)
=>
console
.
log
(
err
));
async
getMv
()
{
let
res
;
try
{
res
=
await
getAllMV
(
this
.
limit
,
this
.
page
,
this
.
order
,
this
.
selectArea
,
this
.
selectType
);
}
catch
(
e
)
{
console
.
log
(
e
);
}
this
.
mvLoading
=
false
;
this
.
allLength
=
res
.
data
.
count
;
this
.
more
=
res
.
data
.
hasMore
;
return
res
.
data
.
data
;
},
async
initMv
()
{
let
mvs
=
await
this
.
getMv
();
this
.
mvs
=
mvs
;
},
async
updateMv
()
{
let
mvs
=
await
this
.
getMv
();
this
.
mvs
.
push
(...
mvs
);
},
areaSelect
(
id
)
{
this
.
selectArea
=
id
;
this
.
page
=
1
;
this
.
update
Mv
();
this
.
init
Mv
();
},
typeSelect
(
id
)
{
this
.
selectType
=
id
;
this
.
page
=
1
;
this
.
update
Mv
();
this
.
init
Mv
();
},
switchOrder
(
id
)
{
this
.
order
=
id
;
this
.
page
=
1
;
this
.
update
Mv
();
this
.
init
Mv
();
},
loadMore
()
{
const
scrollDom
=
document
.
getElementById
(
"
mv_list_div
"
);
...
...
@@ -163,6 +176,7 @@ export default {
}
},
processCount
,
gotoMvDetail
,
},
components
:
{
TypeSelectBar
,
...
...
src/views/musicLibrary/MvDetail.vue
0 → 100644
浏览文件 @
e71084e0
<
template
>
<div
class=
""
style=
"background-color: #333"
>
<div
class=
"main"
>
<div
class=
"video_player_box"
>
<video
id=
"video_player__source"
class=
"video_player__source"
controls=
"true"
webkit-playsinline=
"true"
isiphoneshowplaysinline=
"true"
playsinline=
"true"
preload=
"metadata"
:src=
"url"
width=
"1000"
height=
"674"
></video>
</div>
<div
class=
"mv__info"
id=
"mv_control"
style=
""
>
<h1
class=
"mv__title"
>
<span
class=
"mv__name"
title=
"Falsetto"
>
{{
mv
.
name
}}
</span>
<span
class=
"mv__line"
>
-
</span>
<a
class=
"mv__singer js_singer"
>
{{
mv
.
artistsText
}}
</a>
</h1>
<span
class=
"mv__listen"
>
播放量:
{{
mv
.
playCount
}}
</span>
</div>
</div>
</div>
<div
class=
"main"
>
<div
class=
"detail_layout"
>
<div
class=
"detail_layout__main"
>
<!-- comment -->
<commont-box
:comments=
"comments"
:limit=
"pageSize"
:currentPage=
"commentPage"
:total=
"commentCount"
@
current-change=
"currentChange"
/>
</div>
<div
class=
"detail_layout__other"
>
<div
class=
"mod_about js_box"
id=
"album_desc"
style=
"margin-top: 10px; display: "
>
<h3
class=
"about__tit"
style=
"height-line: 54px; font-size: 24px"
>
简介
</h3>
<div
class=
"about__cont"
>
<p
v-if=
"mv.desc"
>
{{
mv
.
desc
}}
</p>
<p
style=
"color: #999"
v-else
>
还没有简介哦~
</p>
</div>
<a
class=
"btn_edit js_edit"
style=
"display: none"
>
<i
class=
"icon_txt"
>
编辑
</i>
</a>
</div>
</div>
</div>
</div>
</
template
>
<
script
>
import
CommontBox
from
"
components/common/CommontBox
"
;
import
{
getMvDetail
,
getMvPlayUrl
,
getCommentsNew
}
from
"
api
"
;
import
{
createMv
}
from
"
common/utils
"
;
export
default
{
data
()
{
return
{
id
:
null
,
url
:
""
,
mv
:
{},
pageSize
:
20
,
commentPage
:
1
,
commentCount
:
0
,
comments
:
[],
};
},
mounted
()
{
this
.
id
=
this
.
$route
.
query
.
id
;
getMvDetail
(
this
.
id
).
then
((
res
)
=>
{
this
.
mv
=
createMv
(
res
.
data
.
data
);
console
.
log
(
this
.
mv
);
});
this
.
updateMv
();
this
.
getComment
();
},
methods
:
{
updateMv
()
{
getMvPlayUrl
(
this
.
id
).
then
((
res
)
=>
{
this
.
url
=
res
.
data
.
data
.
url
;
});
},
getComment
()
{
let
params
=
{
type
:
1
,
pageSize
:
this
.
pageSize
,
pageNo
:
this
.
commentPage
,
id
:
this
.
id
,
sortType
:
2
,
};
getCommentsNew
(
params
).
then
((
res
)
=>
{
this
.
commentCount
=
res
.
data
.
data
.
totalCount
>
5000
?
5000
:
res
.
data
.
data
.
totalCount
;
this
.
comments
=
res
.
data
.
data
.
comments
;
});
},
currentChange
(
v
)
{
this
.
commentPage
=
v
;
},
},
watch
:
{
commentPage
()
{
this
.
getComment
();
},
},
components
:
{
CommontBox
,
},
};
</
script
>
<
style
scoped
>
.video_player_box
{
position
:
relative
;
z-index
:
3
;
width
:
1200px
;
height
:
674px
;
padding
:
15px
0
10px
0
;
background-color
:
#000
;
}
.video_player__source
{
/*position: absolute;*/
/*top: 0;*/
/*left: 0;*/
width
:
100%
;
height
:
100%
;
}
.mod_mv
{
background-color
:
#333
;
position
:
relative
;
z-index
:
3
;
}
.mv__info
{
height
:
78px
;
line-height
:
78px
;
position
:
relative
;
}
.mv__name
,
.mv__singer
,
.mv__title
{
color
:
#fff
;
font-size
:
22px
;
}
.mv__title
{
font-weight
:
400
;
float
:
left
;
margin-right
:
10px
;
overflow
:
hidden
;
text-overflow
:
ellipsis
;
white-space
:
nowrap
;
max-width
:
650px
;
}
.mv__name
{
float
:
left
;
overflow
:
hidden
;
text-overflow
:
ellipsis
;
white-space
:
nowrap
;
max-width
:
350px
;
}
.mv__line
{
margin
:
0
8px
;
}
.mv__listen
{
font-size
:
14px
;
color
:
#999
;
}
</
style
>
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录