Files
ClassContent/历届学生/逯帅帅/项目开发/上课项目/uniapp在包河/pages/watchtv/watchtv.vue
2024-09-27 02:06:13 +08:00

82 lines
1.5 KiB
Vue
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<div>
<top></top>
<videoes :src='videoUrl.src'></videoes>
<view class="end-title">
  <view @tap="change(0)" :class="{ btna: btnnum == 0 }">频道</view>
 <view @tap="change(1)" :class="{ btna: btnnum == 1 }">评论</view>
</view>
<view class="end-cont" :class="{ dis: btnnum == 0 }">
<tvlist></tvlist>
</view>
<view class="end-cont" :class="{ dis: btnnum == 1 }">
<comment :comment-list="CommentArr"></comment>
</view>
</div>
</template>
<script>
export default {
//此页面需要调包河TV评论接口,拿到值保存,然后传到comment组件中去
data() {
return {
btnnum: 0,
videoUrl: [],
CommentArr: [],
dataList: [],
};
},
onLoad(el) {
this.dataList = el;
},
created() {
console.log(this.dataList.id);
console.log(this.dataList.url);
console.log(this.videoUrl.src);
this.videoUrl.push({
type: "audio/x-mpegurl",
src: this.dataList.url,
});
this.getTvComment();
},
methods: {
change(e) {
this.btnnum = e;
},
async getTvComment() {
let res = await this.$http.index.channelComment({
object_id: this.dataList.id,
});
this.CommentArr = res.list;
},
},
};
</script>
<style scoped>
.end-title {
display: flex;
height: 120rpx;
line-height: 120rpx;
}
.end-title view {
flex-grow: 1;
text-align: center;
}
.end-cont {
display: none;
}
.btna {
color: #ffffff;
color: red;
}
.dis {
display: block;
}
uni-video {
width: 100%;
}
</style>