Commit 4d4cfc87 authored by 黄媛媛's avatar 黄媛媛

update

parent 5458c99d
<template> <template>
<div class="Educationvideo"> <div class="Educationvideo" ref="divSrcoll">
<div class="left"> <div class="left">
<ul class="lineUl" style="margin-top:64px"> <ul class="lineUl" style="margin-top:64px">
<li @click="SelectLineId(-1)" :class="msg.LineId ==-1 ? 'Active' : ''"> <li @click="SelectLineId(-1)" :class="msg.LineId ==-1 ? 'Active' : ''">
...@@ -51,14 +51,16 @@ ...@@ -51,14 +51,16 @@
<div v-if="dataList.length==0" style="text-align:center;padding-top:40px"> <div v-if="dataList.length==0" style="text-align:center;padding-top:40px">
<span style="font-size:60px;color:#ccc" class="iconfont icon-wushuju"></span> <span style="font-size:60px;color:#ccc" class="iconfont icon-wushuju"></span>
</div> </div>
<el-pagination background @current-change="handleCurrentChange" <div v-show="nodata && msg.pageIndex>1" class="wryh" style="text-align:center;padding:15px 0;font-size:12px;color:#aaaaaa">无更多数据</div>
<!-- <el-pagination background @current-change="handleCurrentChange"
layout="total,prev, pager, next, jumper" :page-size="msg.pageSize" :total='total'> layout="total,prev, pager, next, jumper" :page-size="msg.pageSize" :total='total'>
</el-pagination> </el-pagination> -->
</div> </div>
<div style="opacity: 0;" ref="bottomDiv">1111</div>
</div> </div>
<div class="videoDiv" v-show="videoDivState"> <div class="videoDiv" v-show="videoDivState">
<div style="text-align:right;padding-right:15px;cursor:pointer"><span @click="videoDivState=false" style="font-size:30px;color:#fff" class="iconfont icon-bumenguanli-shanchu"></span></div> <div style="text-align:right;padding-right:15px;cursor:pointer"><span @click="Setvideo" style="font-size:30px;color:#fff" class="iconfont icon-bumenguanli-shanchu"></span></div>
<video autoplay="autoplay" width="100%" height="90%" :src="thisVideoAddress" controls="controls"></video> <video ref="myVideo" autoplay="autoplay" width="100%" height="90%" :src="thisVideoAddress" controls="controls"></video>
</div> </div>
...@@ -91,34 +93,58 @@ export default { ...@@ -91,34 +93,58 @@ export default {
dataList:[], dataList:[],
total:0, total:0,
loading:false, loading:false,
windowHeight:0,
nodata:false,
} }
}, },
mounted() { mounted() {
this.getLineList(); this.getLineList();
this.getList(); this.getList();
window.addEventListener('scroll',function(){ this.$nextTick(()=>{
console.log("ddocument.documentElement.offsetHeight",document.documentElement.offsetHeight) window.addEventListener('scroll',this.ScrollTop)
console.log("ddocument.documentElement.scrollTop",document.documentElement.scrollTop)
console.log("window.innerHeight",window.innerHeight) })
let bottomOfWindow = document.documentElement.offsetHeight - document.documentElement.scrollTop - window.innerHeight <= 200
console.log("bottomOfWindow",bottomOfWindow) let h = document.documentElement.clientHeight || document.body.clientHeight;
this.windowHeight=h;
if(bottomOfWindow) { },
console.log("滚动到底部") destroyed(){
} window.removeEventListener('scroll',this.ScrollTop)
})
}, },
methods: { methods: {
Setvideo(){
this.videoDivState=false;
let myVideo=this.$refs.myVideo;
myVideo.pause();
},
ScrollTop(){
var that = this;
// that.scroll = (document.documentElement.scrollTop || document.body.scrollTop)+70;
// var divSrcoll = this.$refs.divSrcoll.scrollTop;
if(that.$refs.bottomDiv.getBoundingClientRect()){
var bottomDiv = that.$refs.bottomDiv.getBoundingClientRect().top;
if(this.windowHeight-50 < bottomDiv){
this.handleCurrentChange();
}
}
// console.log("divSrcoll",divSrcoll)
},
SelectLineId(id){ SelectLineId(id){
this.dataList=[];
this.msg.LineId=id; this.msg.LineId=id;
this.getList(); this.getList();
}, },
handleCurrentChange(val) { handleCurrentChange() {
this.msg.pageIndex = val; this.msg.pageIndex = this.msg.pageIndex+1;
this.getList(); this.getList();
}, },
//获取列表 //获取列表
getList() { getList() {
if(this.nodata){
return;
}
this.loading=true; this.loading=true;
this.apipost( this.apipost(
"Video_get_GetPCVideoPageList",this.msg, "Video_get_GetPCVideoPageList",this.msg,
...@@ -126,10 +152,15 @@ export default { ...@@ -126,10 +152,15 @@ export default {
this.loading=false; this.loading=false;
if (res.data.resultCode == 1) { if (res.data.resultCode == 1) {
this.dataList = res.data.data.pageData; let data= res.data.data.pageData;
if(data.length==0 && this.msg.pageIndex>1){
this.nodata=true;
}
else{
this.dataList = this.dataList.concat(data)
}
this.total = res.data.data.count; this.total = res.data.data.count;
console.log("this.dataList",this.dataList)
} }
} }
); );
...@@ -156,8 +187,11 @@ export default { ...@@ -156,8 +187,11 @@ export default {
}, },
goUrl(path,item){ goUrl(path,item){
this.videoDivState=true; this.videoDivState=true;
this.thisVideoAddress=item.VideoAddress; this.thisVideoAddress=item.VideoAddress;
this.AddList(item.Id) this.AddList(item.Id)
let myVideo=this.$refs.myVideo;
myVideo.play();
// let msg=JSON.stringify(item) // let msg=JSON.stringify(item)
// this.$router.push({ // this.$router.push({
// name:path, // name:path,
...@@ -270,6 +304,7 @@ export default { ...@@ -270,6 +304,7 @@ export default {
padding: 5px; padding: 5px;
box-sizing: border-box; box-sizing: border-box;
margin-right: 10px; margin-right: 10px;
margin-bottom:15px;
} }
.Educationvideo .right .Content{ .Educationvideo .right .Content{
padding:15px 15px 10px 15px; padding:15px 15px 10px 15px;
......
...@@ -69,9 +69,12 @@ ...@@ -69,9 +69,12 @@
<div v-if="dataList.length==0" style="text-align:center;padding-top:40px"> <div v-if="dataList.length==0" style="text-align:center;padding-top:40px">
<span style="font-size:60px;color:#ccc" class="iconfont icon-wushuju"></span> <span style="font-size:60px;color:#ccc" class="iconfont icon-wushuju"></span>
</div> </div>
<el-pagination background @current-change="handleCurrentChange" <!-- <el-pagination background @current-change="handleCurrentChange"
layout="total,prev, pager, next, jumper" :page-size="msg.pageSize" :total='total'> layout="total,prev, pager, next, jumper" :page-size="msg.pageSize" :total='total'>
</el-pagination> </el-pagination> -->
<div v-show="nodata && msg.pageIndex>1" class="wryh" style="text-align:center;padding:15px 0;font-size:12px;color:#aaaaaa">无更多数据</div>
<div style="opacity: 0;" ref="bottomDiv">1111</div>
</div> </div>
</div> </div>
<el-dialog <el-dialog
...@@ -136,8 +139,8 @@ ...@@ -136,8 +139,8 @@
</div> </div>
</el-dialog> </el-dialog>
<div class="videoDiv" v-show="videoDivState"> <div class="videoDiv" v-show="videoDivState">
<div style="text-align:right;padding-right:15px;cursor:pointer"><span @click="videoDivState=false" style="font-size:30px;color:#fff" class="iconfont icon-bumenguanli-shanchu"></span></div> <div style="text-align:right;padding-right:15px;cursor:pointer"><span @click="Setvideo" style="font-size:30px;color:#fff" class="iconfont icon-bumenguanli-shanchu"></span></div>
<video autoplay="autoplay" width="100%" height="90%" :src="thisVideoAddress" controls="controls"></video> <video ref="myVideo" autoplay="autoplay" width="100%" height="90%" :src="thisVideoAddress" controls="controls"></video>
</div> </div>
</div> </div>
</template> </template>
...@@ -194,13 +197,40 @@ export default { ...@@ -194,13 +197,40 @@ export default {
}, },
loading:false, loading:false,
baseurl:'http://vt-im-bucket.oss-cn-chengdu.aliyuncs.com', baseurl:'http://vt-im-bucket.oss-cn-chengdu.aliyuncs.com',
windowHeight:0,
nodata:false,
} }
}, },
mounted() { mounted() {
this.getLineList(); this.getLineList();
this.getList(); this.getList();
this.$nextTick(()=>{
window.addEventListener('scroll',this.ScrollTop)
})
let h = document.documentElement.clientHeight || document.body.clientHeight;
this.windowHeight=h;
},
destroyed(){
window.removeEventListener('scroll',this.ScrollTop)
}, },
methods: { methods: {
Setvideo(){
this.videoDivState=false;
let myVideo=this.$refs.myVideo;
myVideo.pause();
},
ScrollTop(){
var that = this;
if(that.$refs.bottomDiv.getBoundingClientRect()){
var bottomDiv = that.$refs.bottomDiv.getBoundingClientRect().top;
if(this.windowHeight-50 < bottomDiv){
this.handleCurrentChange();
}
}
},
DeleteSrc(num){ DeleteSrc(num){
if(num==1){ if(num==1){
this.addMsg.Cover=''; this.addMsg.Cover='';
...@@ -250,20 +280,28 @@ export default { ...@@ -250,20 +280,28 @@ export default {
this.addMsg.Cover=this.addMsg.VideoAddress+lastUrl; this.addMsg.Cover=this.addMsg.VideoAddress+lastUrl;
}); });
}, },
handleCurrentChange(val) { handleCurrentChange() {
this.msg.pageIndex = val; this.msg.pageIndex = this.msg.pageIndex +1;
this.getList(); this.getList();
}, },
//获取列表 //获取列表
getList() { getList() {
if(this.nodata){
return;
}
this.loading=true; this.loading=true;
this.apipost( this.apipost(
"Video_get_GetPCVideoPageList",this.msg, "Video_get_GetPCVideoPageList",this.msg,
res => { res => {
this.loading=false; this.loading=false;
if (res.data.resultCode == 1) { if (res.data.resultCode == 1) {
this.dataList = res.data.data.pageData; let data= res.data.data.pageData;
this.total = res.data.data.count; if(data.length==0 && this.msg.pageIndex>1){
this.nodata=true;
}
else{
this.dataList = this.dataList.concat(data)
}
} }
} }
...@@ -346,6 +384,8 @@ export default { ...@@ -346,6 +384,8 @@ export default {
this.videoDivState=true; this.videoDivState=true;
this.thisVideoAddress=item.VideoAddress; this.thisVideoAddress=item.VideoAddress;
this.AddList(item.Id) this.AddList(item.Id)
let myVideo=this.$refs.myVideo;
myVideo.play();
// let msg=JSON.stringify(item) // let msg=JSON.stringify(item)
// this.$router.push({ // this.$router.push({
// name:path, // name:path,
...@@ -514,6 +554,7 @@ export default { ...@@ -514,6 +554,7 @@ export default {
width: 300px; width: 300px;
padding: 5px; padding: 5px;
box-sizing: border-box; box-sizing: border-box;
margin-bottom:15px;
} }
.EducationvideoList .right .Content{ .EducationvideoList .right .Content{
padding:15px 15px 10px 15px; padding:15px 15px 10px 15px;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment