Procházet zdrojové kódy

关闭学习 的加以提示

y595705120 před 3 roky
rodič
revize
57a4a0f3bb

+ 10 - 5
src/containers/center/play/components/media.vue

@@ -12,7 +12,7 @@
       :globalOptions="{controls:true}"
       :options="options">
     </video-player>
-    <div class="dialog-footer">
+    <div class="dialog-footer pt30">
       <el-row class="media-footer">
         <el-col :span="8" class="media-time">
           <span>{{curTimes|useTime}}</span>
@@ -63,9 +63,9 @@
     },
     watch:{
       mediaType( ){
-        console.log("change mediaType", this.mediaType)
         this.selectMediaType = this.mediaType;
         if( !this.mediaType ) return;
+
       },
       dialog( showDilog ){
         if( !showDilog){
@@ -242,10 +242,15 @@
         let param ={id: media.id, position:curTimes ,isFinish};
         httpServer("course.tick", param, true).then( res => {
           if (res.code == 200) {
-            let {skip, position, pause} = res.data
-            if( pause ) {
+            let {skip, position, pause, closed} = res.data
+            if( pause || closed ) {
               this.doPause();
               this.$emit("close")
+              if( closed ) {
+                this.$message.errorMsg("课程关闭学习", 5);
+              }else if( pause ){
+                this.$message.errorMsg("多处同时播放视频", 5);
+              }
               return
              }
             if( !skip ) this.setposition( position );
@@ -291,7 +296,7 @@
     padding: 0px;
   }
   .media-time{
-    font-size: 21px;
+    font-size: 16px;
     vertical-align: center;
   }
   .media-select{

+ 2 - 1
src/containers/center/play/index.vue

@@ -129,7 +129,7 @@
      :visible.sync="mediaDialog"
      top="50px"
      :title="media.name"
-     width="640px"
+     :width="mediaType=='hls'?'640px':'480px'"
      >
         <Media
           :options="options"
@@ -249,6 +249,7 @@
         }else{
           mediaUrl = mediaUrl.replace('/ld/', '/hls/');
         }
+        this.mediaType = val;
         this.options.sources = [{src:mediaUrl,type: "application/x-mpegURL"}];
         this.options.playtimes = this.media.position||0;
         this.options.autoplay = this.options.playtimes>0;