y595705120 vor 3 Jahren
Ursprung
Commit
7cea515a1e
1 geänderte Dateien mit 33 neuen und 6 gelöschten Zeilen
  1. 33 6
      src/containers/center/play/index.vue

+ 33 - 6
src/containers/center/play/index.vue

@@ -16,7 +16,7 @@
       </el-col>
 
       <el-col :lg="6"  :md="6" :span="6">
-        <el-progress
+        <el-progress v-if="tpl.examGroupId>0"
            class="mprocess"
            type="circle"
            :width="150"
@@ -25,10 +25,20 @@
            :percentage="info.score"
            >
         </el-progress>
+
+        <el-progress v-else
+           class="mprocess"
+           type="circle"
+           :width="150"
+           :format="formatString('--')"
+           :stroke-width="18"
+           :percentage="0"
+           >
+        </el-progress>
       </el-col>
 
       <el-col :lg="6" :md="6" :span="6">
-        <el-progress
+        <el-progress v-if="tpl.examGroupId>0"
            class="mprocess"
            type="circle"
            :width="150"
@@ -37,15 +47,27 @@
            :percentage="info.score>=60?100:info.score"
            >
         </el-progress>
+        <el-progress v-else
+           class="mprocess"
+           type="circle"
+           :width="150"
+           :format="formatString('--')"
+           :stroke-width="18"
+           :percentage="0"
+           >
+        </el-progress>
       </el-col>
 
       <el-col :lg="6" :md="6" :span="6">
         <div>
           <p style="font-size: 24px;"> 说明 </p>
-          <p class="mt10">1、所有课程学完可以参加考试</p>
-          <p class="mt10">2、考试不限次数,获得60分即可合格</p>
+          <p class="mt10" >岗位名称:{{tpl.name}} </p>
+          <p class="mt10" v-if="tpl.examGroupId>0" >考试不限次数,获得60分即合格</p>
+
+          <p class="mt10" v-if="tpl.examGroupId==0" >学完所有课程,即可打印学时证明</p>
+
           <div>
-              <el-button type="primary" class="mt10" style="font-size: 14px;" @click="startExam">
+              <el-button type="primary" class="mt10" style="font-size: 14px;" @click="startExam" v-if="tpl.examGroupId>0">
                 参加考试
               </el-button>
 
@@ -64,7 +86,7 @@
         <div class="account-tit" style="height:30px">
           <a :class="{'current':show===1}"  @click="show=1" class="">正在学习</a>
           <a :class="{'current':show===2}"  @click="show=2" class="">已经完成</a>
-          <a :class="{'current':show===3}"  @click="show=3" class="">考试记录</a>
+          <a :class="{'current':show===3}"  @click="show=3" class="" v-if="tpl.examGroupId>0">考试记录</a>
         </div>
 
         <div v-if="show <3" class="lwh-ul-form mt20">
@@ -171,6 +193,7 @@
         mediaDialog: false,
         editRzcode: false,
         info: {score:0, percent:0},
+        tpl:{},
         media:{},
         options:{
           autoplay: true, // 如果true,浏览器准备好时开始回放。
@@ -270,12 +293,16 @@
         if( score == -1 ) return `未参加`;
         return `${score||0}分,${score>=60?'通过':'未通过'}`;
       },
+      formatString(val){
+        return ()=> val;
+      },
       getData() {
         let param = { courseId: this.courseId }
         httpServer("course.getCourse", param).then(res => {
           if (res.code == 200) {
             this.info = res.data.info;
             let list = res.data.list;
+            this.tpl = res.data.tpl||{};
             this.list = list.map( (item)=>{
               item.percent = getPercent(item)||0;
               return item;