|
@@ -6,36 +6,43 @@
|
|
|
<span>{{media.duration|useTime}}</span>
|
|
|
</h2>
|
|
|
<el-row style="width: 1100px;">
|
|
|
- <el-col :span="18" style="width: 700px;">
|
|
|
- <video-player id="myVideo" class="video-player-box" ref="videoPlayer" :playsinline="true" @pause="onPlayerPause($event)"
|
|
|
- @play="onPlayerStart($event)" @ready="playerReadied" @timeupdate="onPlayerTimeupdate($event)" @ended="onPlayerEnded($event)"
|
|
|
- :globalOptions="{controls:true}" :options="options">
|
|
|
+ <el-col :span="18" style="width:680px;">
|
|
|
+ <video-player id="myVideo" class="video-player-box" ref="videoPlayer" :playsinline="true"
|
|
|
+ @pause="onPlayerPause($event)" @play="onPlayerStart($event)" @ready="playerReadied"
|
|
|
+ @timeupdate="onPlayerTimeupdate($event)" @ended="onPlayerEnded($event)" :globalOptions="{controls:true}"
|
|
|
+ :options="options">
|
|
|
</video-player>
|
|
|
+
|
|
|
+
|
|
|
</el-col>
|
|
|
|
|
|
- <el-col :span="6" style="width: 400px;float:right;">
|
|
|
- <div class="account-tit" style="align-items: center;width: 360px;margin-left: 30px">
|
|
|
- <a :class="{'current':required===1}" @click="required=1" class="">必修课程</a>
|
|
|
- <a :class="{'current':required===0}" @click="required=0" class="">选修课程</a>
|
|
|
+ <el-col :span="6" style="width: 420px;float:right;">
|
|
|
+ <div class="account-tit2">
|
|
|
+ <a :class="{'current':required===1}" @click="required=1" style="width: 100px;">必修课程</a>
|
|
|
+ <a :class="{'current':required===0}" @click="required=0" style="width: 100px;">选修课程</a>
|
|
|
+ <a :class="{'current':required===2}" @click="required=2" style="width: 100px;">讨论区</a>
|
|
|
</div>
|
|
|
|
|
|
|
|
|
<el-menu v-if="required==1" style="width: 400px;font-size: 10px;">
|
|
|
<ul class="m-chapter-list">
|
|
|
- <li v-for="(item, index) in chapter.required" :key="index" :class="{'current':item.name==activeChapter}">
|
|
|
- <a href="javascript:void(0)" style="text-decoration: none" @click="goState(item)"
|
|
|
- class="ng-binding"> {{parseInt(item.xs/10)}}学时 {{item.name}}</a>
|
|
|
+ <li v-for="(item, index) in chapter.required" :key="index" :class="{'current':item.name==activeChapter}">
|
|
|
+ <a href="javascript:void(0)" style="text-decoration: none" @click="goState(item)" class="ng-binding">
|
|
|
+ {{parseInt(item.xs/10)}}学时 {{item.name}}</a>
|
|
|
|
|
|
- <div class="sub-list" v-if="item.name==activeChapter" >
|
|
|
+ <div class="sub-list" v-if="item.name==activeChapter">
|
|
|
<a v-for="(subItem,index) in list" :key="subItem.id" v-if="subItem.chapterName == activeChapter"
|
|
|
@click="goSubState(subItem, index)" :class="{'current':subItem.name==activeName}">
|
|
|
<span style="width: 8px;height: 8px;">
|
|
|
- <el-progress :percentage="subItem.percent" type="circle" :width="16" :height="16" :format="()=>{return ''}" v-if="subItem.percent>=100" color="green"></el-progress>
|
|
|
- <el-progress :percentage="subItem.percent" type="circle" :width="16" :height="16" :format="()=>{return ''}" v-else-if="subItem.percent>=50" color="cyan"></el-progress>
|
|
|
- <el-progress :percentage="subItem.percent" type="circle" :width="16" :height="16" :format="()=>{return ''}" v-else></el-progress>
|
|
|
+ <el-progress :percentage="subItem.percent" type="circle" :width="16" :height="16"
|
|
|
+ :format="()=>{return ''}" v-if="subItem.percent>=100" color="green"></el-progress>
|
|
|
+ <el-progress :percentage="subItem.percent" type="circle" :width="16" :height="16"
|
|
|
+ :format="()=>{return ''}" v-else-if="subItem.percent>=50" color="cyan"></el-progress>
|
|
|
+ <el-progress :percentage="subItem.percent" type="circle" :width="16" :height="16"
|
|
|
+ :format="()=>{return ''}" v-else></el-progress>
|
|
|
</span>
|
|
|
<span style="margin-left: 16px;"> {{subItem.name}} </span>
|
|
|
- </a>
|
|
|
+ </a>
|
|
|
</div>
|
|
|
</li>
|
|
|
</ul>
|
|
@@ -43,31 +50,40 @@
|
|
|
|
|
|
<el-menu v-if="required==0">
|
|
|
<ul class="m-chapter-list" style="width: 400px;font-size: 10px;">
|
|
|
- <li v-for="(item, index) in chapter.normal" :key="index" :class="{'current':item.name==activeChapter}">
|
|
|
+ <li v-for="(item, index) in chapter.normal" :key="index" :class="{'current':item.name==activeChapter}">
|
|
|
<a href="javascript:void(0)" style="text-decoration: none" @click="goState(item)"
|
|
|
class="ng-binding">{{parseInt(item.xs/10)}}学时 {{item.name}}</a>
|
|
|
|
|
|
- <div class="sub-list pt10" v-if="item.name==activeChapter" >
|
|
|
+ <div class="sub-list pt10" v-if="item.name==activeChapter">
|
|
|
<a v-for="(subItem,index) in list" :key="subItem.id" v-if="subItem.chapterName == activeChapter"
|
|
|
@click="goSubState(subItem, index)" :class="{'current':subItem.name==activeName}">
|
|
|
- <span style="width: 8px;height: 8px;">
|
|
|
- <el-progress :percentage="subItem.percent" type="circle" :width="16" :height="16" :format="()=>{return ''}" v-if="subItem.percent>=100" color="green"></el-progress>
|
|
|
- <el-progress :percentage="subItem.percent" type="circle" :width="16" :height="16" :format="()=>{return ''}" v-else-if="subItem.percent>=50" color="cyan"></el-progress>
|
|
|
- <el-progress :percentage="subItem.percent" type="circle" :width="16" :height="16" :format="()=>{return ''}" v-else></el-progress>
|
|
|
- </span>
|
|
|
- <span style="margin-left: 16px;"> {{subItem.name}} </span>
|
|
|
- </a>
|
|
|
+ <span style="width: 8px;height: 8px;">
|
|
|
+ <el-progress :percentage="subItem.percent" type="circle" :width="16" :height="16"
|
|
|
+ :format="()=>{return ''}" v-if="subItem.percent>=100" color="green"></el-progress>
|
|
|
+ <el-progress :percentage="subItem.percent" type="circle" :width="16" :height="16"
|
|
|
+ :format="()=>{return ''}" v-else-if="subItem.percent>=50" color="cyan"></el-progress>
|
|
|
+ <el-progress :percentage="subItem.percent" type="circle" :width="16" :height="16"
|
|
|
+ :format="()=>{return ''}" v-else></el-progress>
|
|
|
+ </span>
|
|
|
+ <span style="margin-left: 16px;"> {{subItem.name}} </span>
|
|
|
+ </a>
|
|
|
</a>
|
|
|
</div>
|
|
|
</li>
|
|
|
</ul>
|
|
|
- <!-- <el-menu-item v-for="item in chapter.normal" :key="item">{{item}}</el-menu-item> -->
|
|
|
+ <!-- <el-menu-item v-for="item in chapter.normal" :key="item">{{item}}</el-menu-item> -->
|
|
|
</el-menu>
|
|
|
+
|
|
|
+ <div v-if="required==2">
|
|
|
+ <i-message :media-id="media.mediaId"></i-message>
|
|
|
+ </div>
|
|
|
+
|
|
|
</el-col>
|
|
|
+
|
|
|
</el-row>
|
|
|
<div class="left-float" v-if="!closeFace" v-drag>
|
|
|
- <video ref="video" v-show="isnotbtn" width="240" height="180" autoplay></video>
|
|
|
- <canvas ref="canvas" v-show="ontakebtn" width="240" height="180"></canvas>
|
|
|
+ <video ref="video" v-show="isnotbtn" width="240" height="180" autoplay></video>
|
|
|
+ <canvas ref="canvas" v-show="ontakebtn" width="240" height="180"></canvas>
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
@@ -83,6 +99,7 @@
|
|
|
import {
|
|
|
videoPlayer
|
|
|
} from 'vue-video-player';
|
|
|
+ import IMessage from './iMessage.vue'
|
|
|
import 'video.js/dist/video-js.css'
|
|
|
// import html2canvas from "html2canvas";
|
|
|
import {
|
|
@@ -93,14 +110,14 @@
|
|
|
data() {
|
|
|
return {
|
|
|
timer: false,
|
|
|
- required:1,
|
|
|
+ required: 1,
|
|
|
tickNum: 0,
|
|
|
prevTime: 0,
|
|
|
isReady: false,
|
|
|
isnotbtn: false,
|
|
|
ontakebtn: false,
|
|
|
- activeChapter:'',
|
|
|
- activeName:'',
|
|
|
+ activeChapter: '',
|
|
|
+ activeName: '',
|
|
|
curTimes: 0,
|
|
|
errMsg: '',
|
|
|
errCount: 0,
|
|
@@ -108,9 +125,10 @@
|
|
|
}
|
|
|
},
|
|
|
components: {
|
|
|
- videoPlayer
|
|
|
+ videoPlayer,
|
|
|
+ IMessage
|
|
|
},
|
|
|
- props: [ 'media', 'options', 'heartbeat', 'maxErrorCount', 'collectBeat','closeFace', 'chapter', 'list'],
|
|
|
+ props: ['media', 'options', 'heartbeat', 'maxErrorCount', 'collectBeat', 'closeFace', 'chapter', 'list'],
|
|
|
filters: {
|
|
|
useTime(val) {
|
|
|
let timestr = ""
|
|
@@ -132,7 +150,7 @@
|
|
|
el.onmousedown = function(e) {
|
|
|
var disx = e.pageX - el.offsetLeft
|
|
|
var disy = e.pageY - el.offsetTop
|
|
|
- document.onmousemove = function (e) {
|
|
|
+ document.onmousemove = function(e) {
|
|
|
el.style.left = e.pageX - disx + 'px'
|
|
|
el.style.top = e.pageY - disy + 'px'
|
|
|
}
|
|
@@ -157,11 +175,11 @@
|
|
|
this.activeChapter = this.media.chapterName;
|
|
|
this.activeName = this.media.name
|
|
|
},
|
|
|
- watch:{
|
|
|
- "media.name"(){
|
|
|
+ watch: {
|
|
|
+ "media.name"() {
|
|
|
console.log("media.name")
|
|
|
- this.activeChapter = this.media.chapterName;
|
|
|
- this.activeName = this.media.name
|
|
|
+ this.activeChapter = this.media.chapterName;
|
|
|
+ this.activeName = this.media.name
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
@@ -198,19 +216,19 @@
|
|
|
destroyTimer() {
|
|
|
if (this.timer) clearInterval(this.timer);
|
|
|
},
|
|
|
- goState(item){
|
|
|
- if( item.name == this.activeChapter){
|
|
|
+ goState(item) {
|
|
|
+ if (item.name == this.activeChapter) {
|
|
|
this.activeChapter = ""
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
this.activeChapter = item.name;
|
|
|
}
|
|
|
},
|
|
|
- goSubState(item, index){
|
|
|
+ goSubState(item, index) {
|
|
|
this.$emit('loadMedia', item, index)
|
|
|
},
|
|
|
callCamera() {
|
|
|
// H5调用电脑摄像头API
|
|
|
- if( this.closeFace){
|
|
|
+ if (this.closeFace) {
|
|
|
this.isnotbtn = true;
|
|
|
return;
|
|
|
}
|
|
@@ -377,12 +395,12 @@
|
|
|
if (this.tickNum % this.heartbeat != 1) {
|
|
|
return;
|
|
|
}
|
|
|
- let heartBeat = parseInt( this.tickNum / this.heartbeat);
|
|
|
+ let heartBeat = parseInt(this.tickNum / this.heartbeat);
|
|
|
// 异常 10秒检查
|
|
|
- if( !this.closeFace ){
|
|
|
- if (this.errCount > 0 ) {
|
|
|
+ if (!this.closeFace) {
|
|
|
+ if (this.errCount > 0) {
|
|
|
this.photograph()
|
|
|
- } else if ( heartBeat % this.collectBeat == 1) {
|
|
|
+ } else if (heartBeat % this.collectBeat == 1) {
|
|
|
this.photograph()
|
|
|
}
|
|
|
}
|
|
@@ -437,7 +455,8 @@
|
|
|
</script>
|
|
|
|
|
|
<style>
|
|
|
- @import url("./imedia.css");
|
|
|
+ @import url("./imedia.css");
|
|
|
+
|
|
|
.video-js {
|
|
|
.vjs-control-bar {
|
|
|
.vjs-icon-custombutton {
|
|
@@ -453,18 +472,20 @@
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
.left-float {
|
|
|
- width: 240px;
|
|
|
- height: 180px;
|
|
|
- background-color: #8bbdf5;
|
|
|
- position: fixed;
|
|
|
- transition: bottom ease .9s;
|
|
|
- z-index: 0;
|
|
|
- left: 60px;
|
|
|
- top: 120px;
|
|
|
- text-align: center;
|
|
|
- border-radius: 5px;
|
|
|
+ width: 240px;
|
|
|
+ height: 180px;
|
|
|
+ background-color: #8bbdf5;
|
|
|
+ position: fixed;
|
|
|
+ transition: bottom ease .9s;
|
|
|
+ z-index: 0;
|
|
|
+ left: 60px;
|
|
|
+ top: 120px;
|
|
|
+ text-align: center;
|
|
|
+ border-radius: 5px;
|
|
|
}
|
|
|
+
|
|
|
.p-process {
|
|
|
width: 100%;
|
|
|
margin: 20px auto;
|