|
@@ -8,6 +8,7 @@ import {apiApplyPermission} from '@/api/user'
|
|
|
|
|
|
import SelfList from '@/components/SelfList.vue'
|
|
|
import VideoComment from '@/components/VideoComment.vue'
|
|
|
+import VideoBox from '@/components/VideoBox.vue'
|
|
|
import { useRoute, useRouter } from 'vue-router'
|
|
|
import { useStore } from 'vuex'
|
|
|
|
|
@@ -261,6 +262,15 @@ const getCommentData=item=>{
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+// 处理弹幕模块数据
|
|
|
+const getDanmuData=item=>{
|
|
|
+ return{
|
|
|
+ id:item.community_video_id,
|
|
|
+ source:1,
|
|
|
+ ...item
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
onMounted(() => {
|
|
|
//向小程序发送消息
|
|
|
let postData = {
|
|
@@ -377,19 +387,15 @@ onActivated(()=>{
|
|
|
<div class="multi-ellipsis title">{{item.title}}</div>
|
|
|
</el-tooltip>
|
|
|
<div class="time">发布时间:{{item.publish_time}}</div>
|
|
|
- <video
|
|
|
- :src="item.video_url"
|
|
|
- controls
|
|
|
- :poster="item.cover_img_url"
|
|
|
- controlslist="nodownload"
|
|
|
- disablePictureInPicture
|
|
|
- autoplay
|
|
|
- v-if="item.community_video_id==curVideoId"
|
|
|
- @ended="curVideoId=0"
|
|
|
- @pause="handleVideoPause"
|
|
|
- ></video>
|
|
|
- <div v-else class="poster-img" :style="'background-image:url('+item.cover_img_url+')'" @click="handelClickPlay(item)"></div>
|
|
|
-
|
|
|
+ <div class="video-content">
|
|
|
+ <VideoBox
|
|
|
+ :videoInfo="getDanmuData(item)"
|
|
|
+ :curVideoId="curVideoId"
|
|
|
+ @clickPlay="handelClickPlay"
|
|
|
+ @ended="curVideoId=0"
|
|
|
+ @pause="handleVideoPause"
|
|
|
+ ></VideoBox>
|
|
|
+ </div>
|
|
|
<VideoComment :videoInfo="getCommentData(item)"></VideoComment>
|
|
|
</div>
|
|
|
<div class="last-add-item"></div>
|
|
@@ -517,34 +523,10 @@ onActivated(()=>{
|
|
|
color: #666;
|
|
|
padding-right: 70px;
|
|
|
}
|
|
|
- video{
|
|
|
+ .video-content{
|
|
|
width: 100%;
|
|
|
- height: 200px;
|
|
|
- object-fit: contain;
|
|
|
+ // height: 200px;
|
|
|
margin: 19px 0;
|
|
|
- display: block;
|
|
|
- box-sizing: border-box;
|
|
|
- }
|
|
|
- .poster-img{
|
|
|
- width: 100%;
|
|
|
- height: 200px;
|
|
|
- margin: 19px 0;
|
|
|
- position: relative;
|
|
|
- background-size: cover;
|
|
|
- background-position: center;
|
|
|
- cursor: pointer;
|
|
|
- &::after{
|
|
|
- content:'';
|
|
|
- display: block;
|
|
|
- position: absolute;
|
|
|
- width: 80px;
|
|
|
- height: 80px;
|
|
|
- top: 50%;
|
|
|
- left: 50%;
|
|
|
- transform: translate(-50%,-50%);
|
|
|
- background-image: url('@/assets/video-play-btn.png');
|
|
|
- background-size: cover;
|
|
|
- }
|
|
|
}
|
|
|
.time{
|
|
|
color: #999;
|