chenxiong 3 tahun lalu
induk
melakukan
6426061cd1

+ 7 - 1
src/pages/course-detail/index.vue

@@ -2446,6 +2446,7 @@ export default {
       veryIdName: "",
       isPlayRebuild: false,
       showRecordStatus: false,
+      hasStart: false,
     };
   },
   computed: {
@@ -2509,7 +2510,7 @@ export default {
     try {
       this.$msgbox.close();
     } catch (err) {}
-    if (this.playSectionId) {
+    if (this.playSectionId && this.hasStart) {
       this.postStudyRecord();
     }
     // if (this.lockTimer) {
@@ -4506,7 +4507,9 @@ export default {
         this.recordObj = await this.getRecordLast();
         this.getNoteList();
         await this.clears();
+
         this.vid = option.recordingUrl;
+        this.hasStart = true;
         this.loadPlayerScript(this.loadPlayer);
         // uni.$emit("levelId", this.levelId);
         // uni.$emit("getSection", this.menuItem);
@@ -4539,6 +4542,7 @@ export default {
         this.getNoteList();
         //设置播放的节ID
         await this.clears();
+        this.hasStart = true;
         this.vidzb = option.liveUrl;
         this.loadPlayerScriptzb(this.loadPlayerzb);
         // uni.$emit("levelId", this.levelId);
@@ -4608,6 +4612,7 @@ export default {
       this.playerzb.on("s2j_onOver", () => {
         console.log("s2j_onOver");
         clearInterval(this.livingTimer);
+        this.hasStart = false;
         this.$message({
           type: "success",
           message: "播放完毕",
@@ -4679,6 +4684,7 @@ export default {
         });
 
         this.player.on("s2j_onPlayOver", () => {
+          this.hasStart = false;
           clearInterval(this.postTimer);
           this.$message({
             type: "success",

+ 51 - 31
src/pages/goods-detail/course-detail.vue

@@ -268,7 +268,10 @@
                   </el-tab-pane>
                   <el-tab-pane label="学员须知" name="3">
                     <div
-                      v-html="goodsDetail.buyNote.replace(/\n|\r\n/g, '<br>')"
+                      v-html="
+                        goodsDetail.buyNote &&
+                        goodsDetail.buyNote.replace(/\n|\r\n/g, '<br>')
+                      "
                     ></div>
                   </el-tab-pane>
                 </el-tabs>
@@ -375,6 +378,9 @@
             <el-option
               v-for="item in gradeList"
               :key="item.gradeId"
+              :disabled="
+                item.studentNum > 0 && item.studentNum == item.studentUpper
+              "
               :label="
                 item.classEndTime
                   ? `${item.className} 有效期至:${$tools.timestampToTime(
@@ -846,34 +852,34 @@ export default {
         }
       }).auditionMinute;
 
-      self.$request.obtainpolyvvideosign(self.vid).then((res) => {
-        self.player = polyvPlayer({
-          wrap: "#player",
-          width: 800,
-          height: 450,
-          vid: self.vid,
-          start: 0,
-          end: auditionMinute,
-          teaser_show: 0,
-          ts: res.data.ts,
-          sign: res.data.sign,
-          playsafe: function (vid, next) {
-            next();
-          },
-        });
+      // self.$request.obtainpolyvvideosign(self.vid).then((res) => {
+      self.player = polyvPlayer({
+        wrap: "#player",
+        width: 800,
+        height: 450,
+        vid: self.vid,
+        start: 0,
+        end: auditionMinute,
+        teaser_show: 0,
+        // ts: res.data.ts,
+        // sign: res.data.sign,
+        playsafe: function (vid, next) {
+          next();
+        },
+      });
 
-        self.player.on("s2j_onPlayOver", () => {
-          this.$confirm("试看结束,购买课程可学习全部", "提示", {
-            closeOnClickModal: false,
-            showCancelButton: false,
-            closeOnPressEscape: false,
-            distinguishCancelAndClose: false,
-            showClose: false,
-          }).then((res) => {
-            this.videoModalShow = false;
-          });
+      self.player.on("s2j_onPlayOver", () => {
+        this.$confirm("试看结束,购买课程可学习全部", "提示", {
+          closeOnClickModal: false,
+          showCancelButton: false,
+          closeOnPressEscape: false,
+          distinguishCancelAndClose: false,
+          showClose: false,
+        }).then((res) => {
+          this.videoModalShow = false;
         });
       });
+      // });
     },
     /**
      * @param {String} 直播预览
@@ -1163,8 +1169,20 @@ export default {
                   className: "系统分班",
                   gradeId: 0,
                 };
-
                 this.gradeList.push(item);
+              } else {
+                let isGradeFull = this.gradeList.every(
+                  (item) =>
+                    item.studentNum > 0 && item.studentNum == item.studentUpper
+                );
+                //所有班级都满了
+                if (isGradeFull) {
+                  let item = {
+                    className: "系统分班",
+                    gradeId: 0,
+                  };
+                  this.gradeList.unshift(item);
+                }
               }
             });
         }
@@ -1350,10 +1368,12 @@ export default {
     getGoodsDetail() {
       this.$request.commonGoodsDetail(this.goodsId).then((res) => {
         if (res.data.pcDetailHtml) {
-          res.data.pcDetailHtml = res.data.pcDetailHtml.replace(
-            /<img/gi,
-            '<img style="max-width:100%;height:100%;display:block;margin:0px auto;"'
-          );
+          res.data.pcDetailHtml =
+            res.data.pcDetailHtml &&
+            res.data.pcDetailHtml.replace(
+              /<img/gi,
+              '<img style="max-width:100%;height:100%;display:block;margin:0px auto;"'
+            );
         }
         this.goodsDetail = res.data;
         this.goodsExamConfig = JSON.parse(res.data.goodsExamConfig);

+ 11 - 3
src/pages/subject/wrong-bank.vue

@@ -1060,9 +1060,11 @@ export default {
         this.$request
           .wrongRecordDelete({
             examId: this.questionList[questionIndex].examId,
-            orderGoodsId: this.$route.query.orderGoodsId,
+            orderGoodsId: this.questionList[questionIndex].orderGoodsId || "",
             questionId: this.questionList[questionIndex].questionId,
-            goodsId: this.questionList[questionIndex].goodsId,
+            goodsId: this.questionList[questionIndex].orderGoodsId
+              ? ""
+              : this.questionList[questionIndex].goodsId,
           })
           .then((res) => {});
       }
@@ -1116,6 +1118,9 @@ export default {
             .wrongRecordDelete({
               examId: question.examId,
               orderGoodsId: question.orderGoodsId,
+              goodsId: this.questionList[questionIndex].orderGoodsId
+                ? ""
+                : this.questionList[questionIndex].goodsId,
               questionId: question.questionId,
             })
             .then((res) => {});
@@ -1163,7 +1168,10 @@ export default {
         this.$request
           .wrongRecordDelete({
             examId: this.questionList[questionIndex].examId,
-            orderGoodsId: this.questionList[questionIndex].orderGoodsId,
+            orderGoodsId: this.questionList[questionIndex].orderGoodsId || "",
+            goodsId: this.questionList[questionIndex].orderGoodsId
+              ? ""
+              : this.questionList[questionIndex].goodsId,
             questionId: this.questionList[questionIndex].questionId,
           })
           .then((res) => {});

+ 12 - 6
src/pages/subject/wrong-type-bank.vue

@@ -1058,9 +1058,11 @@ export default {
         this.$request
           .wrongRecordDelete({
             examId: this.questionList[questionIndex].examId,
-            orderGoodsId: this.$route.query.orderGoodsId,
+            orderGoodsId: this.questionList[questionIndex].orderGoodsId,
             questionId: this.questionList[questionIndex].questionId,
-            goodsId: this.questionList[questionIndex].goodsId,
+            goodsId: this.questionList[questionIndex].orderGoodsId
+              ? ""
+              : this.questionList[questionIndex].goodsId,
           })
           .then((res) => {});
       }
@@ -1113,9 +1115,11 @@ export default {
           this.$request
             .wrongRecordDelete({
               examId: question.examId,
-              orderGoodsId: this.$route.query.orderGoodsId,
+              orderGoodsId: this.questionList[questionIndex].orderGoodsId || "",
               questionId: question.questionId,
-              goodsId: question.goodsId,
+              goodsId: this.questionList[questionIndex].orderGoodsId
+                ? ""
+                : this.questionList[questionIndex].goodsId,
             })
             .then((res) => {});
         }
@@ -1162,9 +1166,11 @@ export default {
         this.$request
           .wrongRecordDelete({
             examId: this.questionList[questionIndex].examId,
-            orderGoodsId: this.$route.query.orderGoodsId,
+            orderGoodsId: this.questionList[questionIndex].orderGoodsId,
             questionId: this.questionList[questionIndex].questionId,
-            goodsId: this.questionList[questionIndex].goodsId,
+            goodsId: this.questionList[questionIndex].orderGoodsId
+              ? ""
+              : this.questionList[questionIndex].goodsId,
           })
           .then((res) => {});
       }