Files
ClassContent/历届学生/陈一航/项目/baoheapp/src/views/PlayLive.vue
2024-09-27 02:06:13 +08:00

114 lines
2.8 KiB
Vue

<template lang="pug">
.play_live
headerComponents
.content
VideoComponents(:videoUrl="playVideo")
.video_message
h2 {{liveList.title}}
.yy {{liveList.collection_count}}人预约
.item
.left
img(src="/img/icon/give_thumbs-up.png")
span {{liveList.like_count}}
.right(@click="showContent")
span 简介
img(v-if="!isShow" src="/img/icon/open-close.png")
img(v-else src="/img/icon/open-just.png")
.jianjie(v-show="isShow") 测试次卧和减肥贝加尔我逼疯就和我不放假好玩吧放假回
commentComponents(:commentList="CommentList")
OpenCommentomponents
</template>
<script>
import headerComponents from "@/components/header.vue"
import commentComponents from "@/components/comment.vue"
import OpenCommentomponents from "@/components/OpenComment.vue"
import VideoComponents from "@/components/videPlayer.vue"
export default {
components: {
headerComponents,
commentComponents,
OpenCommentomponents,
VideoComponents
},
data() {
return {
id: this.$route.query.id,
CommentList: [], // 保存直播的评论数据
liveList: {},
playVideo: {},
isShow: false
}
},
created() {
this.getInfo()
this.liveComment();
console.log(this.id)
},
methods: {
showContent() {
this.isShow = !this.isShow
},
async liveComment() {
let res = await this.$http.IndexService.liveComment({
object_id: this.id
})
this.CommentList = res.list
},
async getInfo() {
let res = await this.$http.IndexService.liveDetail({
live_id: this.id
});
this.liveList = res.live;
this.playVideo = {
type: "application/x-mpegURL",
src: this.liveList.hls_play_url
}
console.log("详情:",this.liveList)
}
}
}
</script>
<style scoped lang="stylus">
.video_message
padding 0.653rem 0.32rem 0 0.37rem
box-sizing border-box
h2
font-size: 0.48rem;
color: #333333;
margin-bottom 0.24rem
.yy
font-family: PingFangSC-Medium;
font-size: 0.307rem;
color: #999999;
.jianjie
margin-top 0.547rem
margin-bottom 0.52rem
font-size: 0.373rem;
line-height: 0.627rem;
color: #999999;
.item
display flex
justify-content space-between
span
font-size: 0.32rem;
color: #999999;
.left
img
width: 0.347rem;
height: 0.36rem;
vertical-align: middle;
margin-right 0.133rem
.right
img
width: 0.227rem;
height: 0.133rem;
margin-left 0.147rem
vertical-align: middle;
</style>