|
@@ -6,7 +6,7 @@
|
|
<el-row>
|
|
<el-row>
|
|
<el-col :span="14" :push="2">
|
|
<el-col :span="14" :push="2">
|
|
<el-card class="video-player">
|
|
<el-card class="video-player">
|
|
- <div id="J_prismPlayer" class="player">
|
|
|
|
|
|
+ <div id="J_prismPlayer" :style="{ height: height + 'px' }">
|
|
<img src="../assets/pc/img/video-img.jpg" alt />
|
|
<img src="../assets/pc/img/video-img.jpg" alt />
|
|
</div>
|
|
</div>
|
|
<div class="title">
|
|
<div class="title">
|
|
@@ -113,10 +113,15 @@
|
|
</el-card>
|
|
</el-card>
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :span="6" :push="2">
|
|
<el-col :span="6" :push="2">
|
|
- <el-card class="comments">
|
|
|
|
|
|
+ <el-card class="comments" :style="{ height: commentsHeight + 'px' }">
|
|
<div class="cose-title">聊天互动</div>
|
|
<div class="cose-title">聊天互动</div>
|
|
- <div class="messages-content">
|
|
|
|
- <div class="item">
|
|
|
|
|
|
+ <div
|
|
|
|
+ class="messages-content"
|
|
|
|
+ id="commentsList"
|
|
|
|
+ :style="{ height: minHeight + 'px' }"
|
|
|
|
+ @scroll="getNewComments"
|
|
|
|
+ >
|
|
|
|
+ <div class="item" v-for="(item, i) in list" :key="i">
|
|
<div class="time">2021-01-01 22:22</div>
|
|
<div class="time">2021-01-01 22:22</div>
|
|
<div class="message">
|
|
<div class="message">
|
|
<div class="head-img">
|
|
<div class="head-img">
|
|
@@ -127,22 +132,7 @@
|
|
</div>
|
|
</div>
|
|
<div class="word">
|
|
<div class="word">
|
|
<div class="user">上海市网友</div>
|
|
<div class="user">上海市网友</div>
|
|
- <div class="tidings">111</div>
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
- <div class="item">
|
|
|
|
- <!-- <div class="time">2021-01-01 22:22</div> -->
|
|
|
|
- <div class="message">
|
|
|
|
- <div class="head-img">
|
|
|
|
- <img
|
|
|
|
- src="https://ss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=1429871452,4246708244&fm=26&gp=0.jpg"
|
|
|
|
- alt=""
|
|
|
|
- />
|
|
|
|
- </div>
|
|
|
|
- <div class="word">
|
|
|
|
- <div class="user">上海市网友</div>
|
|
|
|
- <div class="tidings">111</div>
|
|
|
|
|
|
+ <div class="tidings">{{i }}</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -150,9 +140,14 @@
|
|
|
|
|
|
<div class="send">
|
|
<div class="send">
|
|
<div class="textbox">
|
|
<div class="textbox">
|
|
- <el-input v-model="tidings" placeholder="我也来说几句"></el-input>
|
|
|
|
|
|
+ <el-input
|
|
|
|
+ v-model="tidings"
|
|
|
|
+ placeholder="我也来说几句"
|
|
|
|
+ ></el-input>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="send-btn">
|
|
|
|
+ <el-button type="primary">发送</el-button>
|
|
</div>
|
|
</div>
|
|
- <div class="send-btn"><el-button type="primary">发送</el-button></div>
|
|
|
|
</div>
|
|
</div>
|
|
</el-card>
|
|
</el-card>
|
|
</el-col>
|
|
</el-col>
|
|
@@ -166,13 +161,21 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
-import { strToObject, initMudu, initPlayer } from "../util/video.js";
|
|
|
|
|
|
+import {
|
|
|
|
+ strToObject,
|
|
|
|
+ initMudu,
|
|
|
|
+ getMsgList,
|
|
|
|
+ initPlayer,
|
|
|
|
+} from "../util/video.js";
|
|
import "../assets/pc/css/video.scss";
|
|
import "../assets/pc/css/video.scss";
|
|
export default {
|
|
export default {
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
- width: 1024,
|
|
|
|
- height: 500,
|
|
|
|
|
|
+ windowWidth: document.documentElement.clientWidth, //实时屏幕宽度
|
|
|
|
+ width: 876,
|
|
|
|
+ height: 492,
|
|
|
|
+ commentsHeight: 629,
|
|
|
|
+ minHeight: 528,
|
|
presentNum: 1,
|
|
presentNum: 1,
|
|
barrageFlag: true,
|
|
barrageFlag: true,
|
|
presentList: [
|
|
presentList: [
|
|
@@ -202,24 +205,62 @@ export default {
|
|
price: "免费",
|
|
price: "免费",
|
|
},
|
|
},
|
|
],
|
|
],
|
|
- tidings:''
|
|
|
|
|
|
+ tidings: "",
|
|
|
|
+ commentApi: {},
|
|
|
|
+ scrollTop: 0,
|
|
|
|
+ list: [1, 2, 3, 4, 5, 6, 7, 8, 9],
|
|
|
|
+ page: 3,
|
|
};
|
|
};
|
|
},
|
|
},
|
|
|
|
|
|
- created() {},
|
|
|
|
- mounted() {
|
|
|
|
- // 初始化播放器
|
|
|
|
- /* initMudu({
|
|
|
|
- id:'J_prismPlayer',
|
|
|
|
- width:this.width,
|
|
|
|
- height:this.height
|
|
|
|
- }); */
|
|
|
|
|
|
+ async created() {
|
|
|
|
+ console.log("--------------------------");
|
|
|
|
+ let scale = this.windowWidth / 1536;
|
|
|
|
+ this.height = parseInt(scale * 492);
|
|
|
|
+ this.width = parseInt(scale * 876);
|
|
|
|
+ this.commentsHeight = this.height + 139;
|
|
|
|
+ this.minHeight = this.commentsHeight - 41 - 33 - 27;
|
|
|
|
+ // 初始化播放器+
|
|
|
|
+ this.commentApi = await initMudu({
|
|
|
|
+ id: "J_prismPlayer",
|
|
|
|
+ width: this.width,
|
|
|
|
+ height: this.height,
|
|
|
|
+ });
|
|
|
|
+ console.log("-----------22222222---------");
|
|
|
|
+ let c = await getMsgList(this.commentApi, 0);
|
|
|
|
+ console.log(c);
|
|
|
|
+ this.scrollToBottom();
|
|
},
|
|
},
|
|
|
|
+ async mounted() {},
|
|
methods: {
|
|
methods: {
|
|
handleChange(value) {
|
|
handleChange(value) {
|
|
this.$data.presentNum = value;
|
|
this.$data.presentNum = value;
|
|
console.log(this.$data.presentNum);
|
|
console.log(this.$data.presentNum);
|
|
},
|
|
},
|
|
|
|
+ getComments(page) {
|
|
|
|
+ getMsgList(1);
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ //评论显示从下到上
|
|
|
|
+ scrollToBottom() {
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
+ var container = this.$el.querySelector("#commentsList");
|
|
|
|
+ container.scrollTop = container.scrollHeight;
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ getNewComments(e) {
|
|
|
|
+ let top = e.target.scrollTop;
|
|
|
|
+ if (e.target.scrollTop == 0) {
|
|
|
|
+ console.log("到顶了");
|
|
|
|
+ console.log(this.page);
|
|
|
|
+ if (this.page > 0) {
|
|
|
|
+ this.list.unshift(10, 11, 12, 13, 14, 15, 16, 17, 18, 19, '间隔');
|
|
|
|
+ console.log(this.page);
|
|
|
|
+ console.log(this.list)
|
|
|
|
+ this.page -= this.page;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ },
|
|
},
|
|
},
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|