فهرست منبع

Merge branch 'dev' of http://120.79.166.78:19005/zhongzheng-edu/saas_pc into dev

xiexaing 1 سال پیش
والد
کامیت
a15b9ee71c

+ 2 - 2
src/components/dataReview/index.vue

@@ -670,7 +670,7 @@ export default {
         if (
           this.infoForm["name"] &&
           this.cacheIdCardData["IdName"] &&
-          this.infoForm["name"].trim() !== this.cacheIdCardData["IdName"]
+          this.infoForm["name"].replace(/\s/g, "") !== this.cacheIdCardData["IdName"]
         ) {
           var str = "输入的姓名和身份证人像面照片姓名不匹配,请联系客服";
           this.$message.warning(str);
@@ -678,7 +678,7 @@ export default {
         } else if (
           this.infoForm["idcard"] &&
           this.cacheIdCardData["IdNum"] &&
-          this.infoForm["idcard"] !== this.cacheIdCardData["IdNum"]
+          this.infoForm["idcard"].replace(/\s/g, "") !== this.cacheIdCardData["IdNum"]
         ) {
           var str = "输入的身份证号和身份证人像面照片身份证号不匹配,请联系客服";
           this.$message.warning(str);

+ 63 - 38
src/components/videoCy/index.vue

@@ -5,7 +5,7 @@
       backgroundImage: `url(${$tools.splitImgHost(goodsData.coverUrl, false)})`
     }"
   >
-    <div id="player" v-show="!HideVideo || activeSection.playSource == 1"></div>
+    <div id="player" v-show="!HideVideo || viewSign == 1"></div>
 
     <div class="recordStyle" v-if="showRecordStatus">
       您上次看{{
@@ -55,7 +55,8 @@ export default {
       failToRegister: false, //报名推送不通过
       videoPauseSetTimeStatus: false,
       player_tencent: null,
-      firstPlay: true //是否初次播放
+      firstPlay: true, //是否初次播放
+      viewSign: null
     };
   },
   computed: {
@@ -90,8 +91,8 @@ export default {
   },
   mounted() {
     this.$bus.$on("toPlay", async item => {
+      this.viewSign = this.goodsData.viewSign;
       if (this.player) {
-        console.log("1");
         this.player.HTML5 &&
           this.player.HTML5.video.removeEventListener(
             "timeupdate",
@@ -100,39 +101,38 @@ export default {
         this.player.destroy(); //初始化播放器
       }
       if (this.player_tencent) {
-        console.log("2");
         this.player_tencent.dispose(); //初始化播放器
       }
       this.initData(); //初始化参数
       await this.getRecordHistoryPhoto(); //获取拍照历史记录
       await this.getRecordLast(); //获取播放记录
-      let playSource = this.activeSection.playSource || 1;
-      if (playSource == 2) {
+      let viewSign = this.viewSign || 1;
+      if (viewSign == 2) {
         await this.loadPlayer_tencent(); //加载播放内容
       } else {
         await this.loadPlayer(); //加载播放内容
       }
-      this[playSource == 2 ? "player_tencent" : "player"].on(
-        playSource == 2 ? "loadstart" : "s2j_onPlayerInitOver",
+      this[viewSign == 2 ? "player_tencent" : "player"].on(
+        viewSign == 2 ? "loadstart" : "s2j_onPlayerInitOver",
         () => {
-          this[playSource == 2 ? "player_tencent" : "player"].on(
-            playSource == 2 ? "pause" : "s2j_onVideoPause",
+          this[viewSign == 2 ? "player_tencent" : "player"].on(
+            viewSign == 2 ? "pause" : "s2j_onVideoPause",
             this.onVideoPause
           ); //视频暂停时触发
-          this[playSource == 2 ? "player_tencent" : "player"].on(
-            playSource == 2 ? "playing" : "s2j_onVideoPlay",
+          this[viewSign == 2 ? "player_tencent" : "player"].on(
+            viewSign == 2 ? "playing" : "s2j_onVideoPlay",
             this.onVideoPlay
           ); //视频播放或由暂停恢复播放时触发
-          this[playSource == 2 ? "player_tencent" : "player"].on(
-            playSource == 2 ? "ended" : "s2j_onPlayOver",
+          this[viewSign == 2 ? "player_tencent" : "player"].on(
+            viewSign == 2 ? "ended" : "s2j_onPlayOver",
             this.onPlayOver
           ); //当前视频播放完毕时触发
 
-          // this[playSource == 2 ? "player_tencent" : "player"].on(
-          //   playSource == 2 ? "error" : "s2j_onPlayerError",
+          // this[viewSign == 2 ? "player_tencent" : "player"].on(
+          //   viewSign == 2 ? "error" : "s2j_onPlayerError",
           //   this.onPlayerError
           // ); //播放出现错误时触发
-          if (playSource != 2) {
+          if (viewSign != 2) {
             this.player.on("serverError", this.serverError); //发生业务逻辑错误时触发,比如授权验证失败、域名黑白名单验证不通过等错误。参数返回事件名称和错误代码。
           }
         }
@@ -180,7 +180,7 @@ export default {
     },
     //从头播放
     seekVideo0() {
-      if (this.activeSection.playSource == 2) {
+      if (this.viewSign == 2) {
         this.player_tencent.currentTime(0);
       } else {
         this.player.j2s_seekVideo(0);
@@ -219,10 +219,10 @@ export default {
     //计算拍照逻辑
     photoLogic() {
       if (this.photoList.length > 0 || this.activeSection.learning == 1) return; //已从历史拍照数据获得
-      if (this.activeSection.playSource == 2) {
+      if (this.viewSign == 2) {
         var polyvPlayerContext = this.player_tencent;
         var totalVideoTime = polyvPlayerContext.duration();
-        var duration = polyvPlayerContext.currentTime();
+        var duration = Number(this.activeSection.videoCurrentTime) || polyvPlayerContext.currentTime() || 0;
       } else {
         var polyvPlayerContext = this.player;
         var totalVideoTime = polyvPlayerContext.j2s_getDuration();
@@ -332,7 +332,7 @@ export default {
     //postTime = true 只提交随机时间 false 提交拍照
     postCoursePhotoRecord(postTime = false, photoUrl) {
       return new Promise((resolve, reject) => {
-        if (this.activeSection.playSource == 2) {
+        if (this.viewSign == 2) {
           var currentTime = this.player_tencent.currentTime();
         } else {
           var currentTime = this.player.j2s_getCurrentTime();
@@ -428,26 +428,50 @@ export default {
     },
     //播放视频-腾讯
     loadPlayer_tencent() {
-      return new Promise(async(resolve) => {
+      return new Promise(async resolve => {
         try {
           let player_tencent_demo = document.createElement("video");
           player_tencent_demo.id = "player-tencent";
           document
             .getElementById("player")
             .insertAdjacentElement("afterend", player_tencent_demo);
-            const {data} = await this.$request.vodvidesignid(this.activeSection.recordingUrl)
-            console.log(data,'sign')
+          const { data } = await this.$request.vodvidesignid(
+            this.activeSection.recordingUrl
+          );
+
+          const autoPlay = this.goodsData.goodsPlayConfig
+            ? this.goodsData.goodsPlayConfig.autoPlay
+            : true;
+          const isAllowSeek =
+            this.activeSection.learning == 1
+              ? true
+              : this.goodsData.goodsPlayConfig
+              ? this.goodsData.goodsPlayConfig.isAllowSeek == "off"
+                ? true
+                : false
+              : false;
+          const playbackRate =
+            this.activeSection.learning == 1
+              ? true
+              : this.goodsData.goodsPlayConfig
+              ? this.goodsData.goodsPlayConfig.playbackRate
+              : false;
+
           this.player_tencent = TCPlayer("player-tencent", {
             width: 810,
             height: 455,
             preload: "auto",
-            autoplay: false,
+            autoplay: autoPlay,
+            controlBar: {
+              progressControl: isAllowSeek,
+              playbackRateMenuButton: playbackRate
+            },
             // player-tencent 为播放器容器 ID,必须与 html 中一致
             fileID: this.activeSection.recordingUrl, // 请传入需要播放的视频 fileID(必须)
             appID: data.appID, // 请传入点播账号的 appID(必须)
             licenseUrl: data.licenseUrl, // 请传入点播账号的 appID(必须)
             //私有加密播放需填写 psign, psign 即播放器签名,签名介绍和生成方式参见链接:https://cloud.tencent.com/document/product/266/42436
-            psign:data.psign
+            psign: data.psign
           });
           this.$emit("videoScript", this.player_tencent); //抛出播放实例
           resolve();
@@ -458,7 +482,7 @@ export default {
     },
     //监听器
     timeEvent() {
-      console.log("监听器");
+      console.log("监听器执行中~");
       this.timeEventStatus = true; //双重保障
       // 定时提交学习记录
       this.submitStudyRecords();
@@ -478,7 +502,7 @@ export default {
         this.failToRegister
       )
         return;
-      if (this.activeSection.playSource == 2) {
+      if (this.viewSign == 2) {
         var videoTime = this.player_tencent.currentTime();
       } else {
         var videoTime = this.player.j2s_getCurrentTime();
@@ -493,7 +517,7 @@ export default {
             this.activeSection.learning != 1
           ) {
             //不存在拍照历史,没有重修过,没有学过,则拍照
-            if (this.activeSection.playSource == 2) {
+            if (this.viewSign == 2) {
               this.player_tencent.pause(); //暂停
             } else {
               this.player.j2s_pauseVideo(); //暂停
@@ -508,7 +532,7 @@ export default {
     submitStudyRecords() {
       let time = new Date().getTime();
       if (time >= this.commitTime) {
-        this.postStudyRecord(0,null,null);
+        this.postStudyRecord(0, null, null);
         this.commitTime = time + 15000;
       }
     },
@@ -550,15 +574,16 @@ export default {
       if (this.firstPlay) {
         this.firstPlay = false;
         //计算拍照逻辑
-        // this.photoLogic();
+        this.photoLogic();
         //开启上次播放位置提示
         if (this.activeSection.videoCurrentTime) {
           this.showRecordStatus = true;
+          this.player_tencent.currentTime(Number(this.activeSection.videoCurrentTime) || 0);
           this.showRecordSetTimeOut = setTimeout(() => {
             this.showRecordStatus = false;
           }, 5000);
         }
-        if (this.activeSection.playSource == 2) {
+        if (this.viewSign == 2) {
           this.player_tencent.on("timeupdate", this.timeEvent); //当前视频播放中触发
         } else {
           this.player.HTML5.video.addEventListener(
@@ -568,7 +593,7 @@ export default {
         }
         this.timeEventStatusTimeout = setTimeout(() => {
           if (!this.timeEventStatus) {
-            if (this.activeSection.playSource == 2) {
+            if (this.viewSign == 2) {
               this.player_tencent.pause();
             } else {
               this.player.j2s_pauseVideo();
@@ -648,7 +673,7 @@ export default {
         this.exitFullscreen();
       }
       setTimeout(() => {
-        if (this.activeSection.playSource == 2) {
+        if (this.viewSign == 2) {
           this.player_tencent.pause(); //暂停
         } else {
           this.player.j2s_pauseVideo(); //暂停
@@ -688,7 +713,7 @@ export default {
             ); //提交记录
             //恢复播放
             if (STATUS) {
-              if (this.activeSection.playSource == 2) {
+              if (this.viewSign == 2) {
                 var polyvPlayerContext = this.player_tencent;
                 if (polyvPlayerContext && this.openPhotoStatus !== 1) {
                   polyvPlayerContext.play();
@@ -730,7 +755,7 @@ export default {
       return new Promise((resolve, reject) => {
         let currentTime = 0;
         let PlayDuration = 0;
-        if (this.activeSection.playSource == 2) {
+        if (this.viewSign == 2) {
           var polyvPlayerContext = this.player_tencent;
           if (polyvPlayerContext) {
             currentTime = polyvPlayerContext.currentTime(); //当前视频播放时刻
@@ -783,7 +808,7 @@ export default {
           })
           .catch(err => {
             if (err.code === 600) {
-              if (this.activeSection.playSource == 2) {
+              if (this.viewSign == 2) {
                 polyvPlayerContext.pause();
               } else {
                 polyvPlayerContext.j2s_pauseVideo();
@@ -827,7 +852,7 @@ export default {
       return new Promise(resolve => {
         this.$request
           .faceCertificationCompareFace({
-            urlA:url,
+            urlA: url,
             // imageA: url,
             orderGoodsId: this.goodsData.orderGoodsId,
             gradeId: this.goodsData.gradeId

+ 2 - 2
src/pages/bank-exam-wrong-explain/index.vue

@@ -852,14 +852,14 @@ export default {
     goodsQuestionList() {
       if (this.courseType == 2) {
         this.$request.bankReportData(this.recordId).then(async (res) => {
-          let questionList = JSON.parse(res.data.historyExamJson);
+          let questionList = JSON.parse(res.data.historyExamJson) || [];
 
           this.listForEach(questionList)
         });
         
       } else {
         this.$request.examReport(this.recordId).then(async (res) => {
-          let questionList = JSON.parse(res.data.historyExamJson);
+          let questionList = JSON.parse(res.data.historyExamJson) || [];
 
           this.listForEach(questionList)
         });

+ 1 - 9
src/pages/course-detail/components/CourseTree.vue

@@ -361,7 +361,6 @@ export default {
         }
         if (item.sectionType == 2) {
           if (item.liveStartTime > this.nowTime) {
-            console.log("asdasdasd");
             return {
               name: "待开播",
               style: "warning"
@@ -386,7 +385,6 @@ export default {
     },
     BackExamStatus: function() {
       return function(item) {
-        console.log(item, "item");
         if (item.rebuild > 0) {
           return {
             name: "待重测",
@@ -493,7 +491,6 @@ export default {
           goodsType: this.goodsData.goodsType // 商品类型 1视频2题库 3补考 4前培 5虚拟赠送题库 6直播
         }
       }).then(res => {
-        console.log("直播的用户学习日志:", res);
       });
     },
     //是否显示直播时间范围
@@ -790,7 +787,7 @@ export default {
             this.doExam(item);
           }
         } catch (error) {
-          console.log(error, "error");
+          console.error("菜单展开逻辑报错:",error);
         }
       }
     },
@@ -833,11 +830,6 @@ export default {
     //播放视频节
     watchSection(item) {
       if (this.isActive(item)) return;
-      if(item.sectionId == 7969){
-        item.playSource = 1
-      }else{
-        item.playSource = 2
-      }
       this.$emit("update:activeSection", item);
       setTimeout(() => {
         this.$bus.$emit("toPlay", item);

+ 32 - 14
src/pages/course-exam/index.vue

@@ -1148,15 +1148,29 @@ export default {
     };
   },
   async mounted() {
-    this.goodsId = this.$route.params.goodsId;
-    this.examId = this.$route.query.examId;
-    this.type = this.$route.query.type;
-    this.courseId = this.$route.query.courseId;
-    this.gradeId = this.$route.query.gradeId;
-    this.moduleId = this.$route.query.moduleId;
-    this.sectionId = this.$route.query.sectionId;
-    this.chapterId = this.$route.query.chapterId;
-    this.orderGoodsId = this.$route.query.orderGoodsId;
+    this.goodsId = Number(this.$route.params.goodsId);
+    this.examId = Number(this.$route.query.examId);
+    this.type = Number(this.$route.query.type);
+    this.courseId = Number(this.$route.query.courseId);
+    this.gradeId = Number(this.$route.query.gradeId);
+    this.moduleId = Number(this.$route.query.moduleId);
+    this.sectionId = Number(this.$route.query.sectionId);
+    this.chapterId = Number(this.$route.query.chapterId);
+    this.orderGoodsId = Number(this.$route.query.orderGoodsId);
+    if (
+      (this.type == 1 && (!this.chapterId || this.chapterId === 0)) ||
+      (this.type == 3 && (!this.moduleId || this.moduleId === 0))
+    ) {
+      this.$alert("数据出现未知异常,请重进或向教务人员反馈", "提示", {
+        confirmButtonText: "返回上一页",
+        showClose: false,
+        callback: action => {
+          this.mustBack = true;
+          this.$router.go(-1);
+        }
+      });
+      return;
+    }
     await this.getGoodsDetail();
     await this.bankExam();
     this.needPhoto && (await this.getExamLearnStatus());
@@ -1980,9 +1994,9 @@ export default {
       //交卷 /bank/record/edit
       this.$request
         .bankRecordEdit({
-          moduleId: this.moduleId || 0,
-          chapterId: this.chapterId || 0,
-          sectionId: this.sectionId || 0,
+          moduleId: this.moduleId,
+          chapterId: this.chapterId,
+          sectionId: this.sectionId,
           gradeId: this.gradeId,
           courseId: this.courseId,
           orderGoodsId: this.orderGoodsId,
@@ -2098,10 +2112,14 @@ export default {
         .bankRecordEdit({
           examId: this.examId,
           goodsId: this.goodsId,
+          gradeId: this.gradeId,
           recordId: this.recordId,
           orderGoodsId: this.orderGoodsId,
-          moduleExamId: this.moduleId || 0,
-          chapterExamId: this.chapterId || 0,
+          courseId: this.courseId,
+          type: this.type,
+          moduleId: this.moduleId,
+          chapterId: this.chapterId,
+          sectionId: this.sectionId,
           status: 0,
           ...form
         })

+ 2 - 2
src/pages/person-center/bank-record/index.vue

@@ -266,8 +266,8 @@ export default {
         cancelButtonText: "查看上次",
         closeOnClickModal: false,
         closeOnPressEscape: false,
-        distinguishCancelAndClose: false,
-        showClose: false,
+        distinguishCancelAndClose: true,
+        showClose: true,
       })
         .then((_) => {
           if (section.courseType == 2) {

+ 2 - 2
src/pages/person-center/bank-record/record-list/index.vue

@@ -235,8 +235,8 @@ export default {
         cancelButtonText: "查看上次",
         closeOnClickModal: false,
         closeOnPressEscape: false,
-        distinguishCancelAndClose: false,
-        showClose: false,
+        distinguishCancelAndClose: true,
+        showClose: true,
       })
         .then((_) => {
           if (this.courseType == 2) {

+ 0 - 12
src/router/index.js

@@ -770,7 +770,6 @@ Router.prototype.replace = function replace(location) {
   return originalReplace.call(this, location).catch(err => err)
 }
 router.beforeEach(async (to, from, next) => {
-  console.error("页面进入")
   if (!store.state.TENANT_NANE) {
     await store.dispatch('findTenantId')
   }
@@ -782,7 +781,6 @@ router.beforeEach(async (to, from, next) => {
   }
   if (!store.state.isDesktop) {
     request.getWeAppLink().then(res => {
-      console.log("isDesktop")
       res.msg && (window.location.href = res.msg);
     });
   }
@@ -931,11 +929,9 @@ router.beforeEach(async (to, from, next) => {
       let isCourseLock = courseAdmin.some(item => {
         return to.path.indexOf(item) != -1
       })
-      console.log(3, isCourseLock, canToCourse)
       if (isCourseLock) {
         //没有执行定时器,开启锁定
         if (!canToCourse) {
-          console.log("x1")
           request.goodsDetail(to.params.goodsId).then(res => {
             //继续教育锁定
             // if(res.data.educationName == '继续教育') {
@@ -968,7 +964,6 @@ router.beforeEach(async (to, from, next) => {
 
                         })
                       }, 10000);
-                      console.log("学习")
                       next()
                     });
                   })
@@ -995,20 +990,16 @@ router.beforeEach(async (to, from, next) => {
 
                   })
                 }, 10000);
-                console.log("学习")
                 next()
               })
           })
           return;
-          console.log("继续跑")
         } else {
-          console.log("x2")
           //正在执行定时器,可以直接进入
           next()
         }
         return;
       } else {
-        console.log("x5")
         //非题库页面删除锁定
         let isLeaveCouese = courseAdmin.some(item => {
           return from.path.indexOf(item) != -1
@@ -1026,14 +1017,11 @@ router.beforeEach(async (to, from, next) => {
           })
         }
       }
-      console.log(4)
       if (!to.path.includes('/person-center/my-info')) {
         checkFunc()
       }
-      console.log(11123)
       next()
     } else {
-      console.log(8)
       next()
     }