En route 1 年之前
父節點
當前提交
3ec9ce63fb
共有 1 個文件被更改,包括 76 次插入57 次删除
  1. 76 57
      src/pages/course-detail/components/coreContent.vue

+ 76 - 57
src/pages/course-detail/components/coreContent.vue

@@ -19,7 +19,7 @@
           height="100%"
           :src="
             'https://preview.xyyxt.net?src=' +
-              $tools.splitImgHost(SwitchOfficeData.url)
+            $tools.splitImgHost(SwitchOfficeData.url)
           "
         ></iframe>
       </div>
@@ -98,13 +98,13 @@ export default {
     AnswerQuestions,
     CourseTree,
     dataReview,
-    preference
+    preference,
   },
   inject: ["getGoodsData"],
   provide() {
     return {
       getPlayer: () => this.player,
-      getActiveSection: () => this.activeSection
+      getActiveSection: () => this.activeSection,
     };
   },
   data() {
@@ -115,39 +115,39 @@ export default {
       menuTab: [
         {
           name: "1",
-          label: "章节目录"
+          label: "章节目录",
         },
         {
           name: "3",
-          label: "答疑"
+          label: "答疑",
         },
         {
           name: "4",
-          label: "笔记"
+          label: "笔记",
         },
         {
           name: "5",
-          label: "讲义"
-        }
+          label: "讲义",
+        },
       ],
       gradeDetail: {}, //班级详情
       player: null, //视频播放器实例
       SwitchOfficeData: {}, //当前选中讲义数据
-      activeSection: {} //当前选中节数据
+      activeSection: {}, //当前选中节数据
     };
   },
   computed: {
     goodsData() {
       return this.getGoodsData();
-    }
+    },
   },
   watch: {
     //因为刚开始获取不到goodsData的数据 所以需要监听
-    goodsData: function(newVal, oldVal) {
+    goodsData: function (newVal, oldVal) {
       if (newVal) {
         this.getBeforeWork(); //处理前置任务
       }
-    }
+    },
   },
   methods: {
     //切换视图
@@ -170,7 +170,7 @@ export default {
           educationName: this.goodsData.educationName,
           projectName: this.goodsData.projectName,
           businessName: this.goodsData.businessName,
-          categoryName: this.goodsData.categoryName
+          categoryName: this.goodsData.categoryName,
         });
       }
     },
@@ -198,22 +198,22 @@ export default {
       return new Promise((resolve, reject) => {
         this.$request
           .orderstudycheck(this.goodsData.orderGoodsId)
-          .then(res => {
+          .then((res) => {
             resolve();
           })
-          .catch(err => {
+          .catch((err) => {
             this.$confirm(err.msg, "提示", {
               confirmButtonText: "确定",
               closeOnClickModal: false,
               closeOnPressEscape: false,
               showCancelButton: false,
               distinguishCancelAndClose: false,
-              showClose: false
+              showClose: false,
             })
-              .then(_ => {
+              .then((_) => {
                 this.$router.back(-1);
               })
-              .catch(_ => {});
+              .catch((_) => {});
             reject();
           });
       });
@@ -230,9 +230,9 @@ export default {
           this.$request
             .goodsGradeCheckFinishRequiredCourse({
               businessId: this.goodsData.businessId,
-              goodsId: this.goodsData.goodsId
+              goodsId: this.goodsData.goodsId,
             })
-            .then(res => {
+            .then((res) => {
               if (res.data > 0) {
                 this.$confirm(`请先学习必修商品`, "提示", {
                   confirmButtonText: "确定",
@@ -240,30 +240,30 @@ export default {
                   closeOnPressEscape: false,
                   showCancelButton: false,
                   distinguishCancelAndClose: false,
-                  showClose: false
+                  showClose: false,
                 })
-                  .then(_ => {
+                  .then((_) => {
                     this.$router.back(-1);
                   })
-                  .catch(_ => {});
+                  .catch((_) => {});
                 reject();
               } else {
                 resolve();
               }
             })
-            .catch(err => {
+            .catch((err) => {
               this.$confirm(err.msg, "提示", {
-                  confirmButtonText: "确定",
-                  closeOnClickModal: false,
-                  closeOnPressEscape: false,
-                  showCancelButton: false,
-                  distinguishCancelAndClose: false,
-                  showClose: false
+                confirmButtonText: "确定",
+                closeOnClickModal: false,
+                closeOnPressEscape: false,
+                showCancelButton: false,
+                distinguishCancelAndClose: false,
+                showClose: false,
+              })
+                .then((_) => {
+                  this.$router.back(-1);
                 })
-                  .then(_ => {
-                    this.$router.back(-1);
-                  })
-                  .catch(_ => {});
+                .catch((_) => {});
               reject();
             });
         } else {
@@ -274,16 +274,35 @@ export default {
     //提交完资料返回判断是否已开班
     getGradeInfo() {
       return new Promise((resolve, reject) => {
-        this.$request.goodsGradeInfo(this.goodsData.gradeId).then(res => {
+        this.$request.goodsGradeInfo(this.goodsData.gradeId).then((res) => {
           if (res.code == 200) {
             this.gradeDetail = res.data;
+            let nowTime = parseInt(new Date().getTime() / 1000);
+            if (res.data.classEndTime < nowTime) {
+              this.$confirm(
+                `当前课程所属班级有效期已过期,无法继续学习!`,
+                "提示",
+                {
+                  confirmButtonText: "确定",
+                  closeOnClickModal: false,
+                  closeOnPressEscape: false,
+                  showCancelButton: false,
+                  distinguishCancelAndClose: false,
+                  showClose: false,
+                }
+              )
+                .then((_) => {
+                  this.$router.back(-1);
+                })
+                .catch((_) => {});
+            }
             if (res.data.interfaceAccountId > 0 && res.data.learnStatus > 0) {
               const confirmText = [
                 "您的学习账号已经开通,请按照步骤操作,进行学习。",
                 "1.点击【跳转学习网址】按钮",
                 "2.打开学习网址后,选择【个人用户】进行登录",
                 "(1)账号:您个人的身份证号码",
-                "(2)密码:身份证号码,再加111111"
+                "(2)密码:身份证号码,再加111111",
               ];
               const newDatas = [];
               const h = this.$createElement;
@@ -303,7 +322,7 @@ export default {
                 closeOnClickModal: false,
                 closeOnPressEscape: false,
                 distinguishCancelAndClose: false,
-                showClose: false
+                showClose: false,
               });
               return;
             }
@@ -317,13 +336,13 @@ export default {
                   closeOnPressEscape: false,
                   showCancelButton: false,
                   distinguishCancelAndClose: false,
-                  showClose: false
+                  showClose: false,
                 }
               )
-                .then(_ => {
+                .then((_) => {
                   this.$router.back(-1);
                 })
-                .catch(_ => {});
+                .catch((_) => {});
             }
             if (
               res.data.learningStatus == 3 &&
@@ -338,13 +357,13 @@ export default {
                   closeOnPressEscape: false,
                   showCancelButton: false,
                   distinguishCancelAndClose: false,
-                  showClose: false
+                  showClose: false,
                 }
               )
-                .then(_ => {
+                .then((_) => {
                   this.$router.back(-1);
                 })
-                .catch(_ => {});
+                .catch((_) => {});
             }
             if (
               (res.data.interfaceAccountId > 0 && res.data.learnStatus > 0) ||
@@ -365,20 +384,20 @@ export default {
       return new Promise((resolve, reject) => {
         this.$request
           .syncSevenPublicClass({ orderGoodsId: this.goodsData.orderGoodsId })
-          .then(res => {
+          .then((res) => {
             if (res.code == 200) {
               resolve();
             } else {
               reject();
             }
           })
-          .catch(err => {
+          .catch((err) => {
             this.$alert(err.msg, "提示", {
               confirmButtonText: "返回",
               showClose: false,
-              callback: action => {
+              callback: (action) => {
                 this.$router.go(-1);
-              }
+              },
             });
             reject();
           });
@@ -389,7 +408,7 @@ export default {
       return new Promise(async (resolve, reject) => {
         if (this.goodsData.erJianErZao || this.goodsData.jjShiGongYuan) {
           let info = await this.$request.userConfirmInfoDetail({
-            orderGoodsId: this.goodsData.orderGoodsId
+            orderGoodsId: this.goodsData.orderGoodsId,
           });
           if (!info.data || info.data.pushInfo !== 1) {
             this.$confirm(`您的信息正在推送中,请稍后再进入学习!`, "提示", {
@@ -398,13 +417,13 @@ export default {
               closeOnPressEscape: false,
               distinguishCancelAndClose: false,
               showCancelButton: false,
-              showClose: false
+              showClose: false,
             })
-              .then(_ => {
+              .then((_) => {
                 //停止执行-退出页面
                 this.$router.back(-1);
               })
-              .catch(_ => {
+              .catch((_) => {
                 //停止执行-退出页面
                 this.$router.back(-1);
               });
@@ -425,19 +444,19 @@ export default {
             goodsId: this.goodsData.goodsId,
             rebuild: 1,
             gradeId: this.goodsData.gradeId,
-            orderGoodsId: this.goodsData.orderGoodsId
+            orderGoodsId: this.goodsData.orderGoodsId,
           })
-          .then(async res => {
+          .then(async (res) => {
             if (res.data.length > 0) {
               console.log(res.data, "resda");
               this.menuTab.splice(1, 0, {
                 name: "2",
-                label: "重修目录"
+                label: "重修目录",
               });
             }
             resolve();
           })
-          .catch(err => {
+          .catch((err) => {
             this.$message.error(err + "、重修列表获取失败");
             reject();
           });
@@ -452,8 +471,8 @@ export default {
       this.player = player;
       this.video_iframe = "iframe"; //当前缩小视图层
       this.viewStatus = true; //开关隐藏
-    }
-  }
+    },
+  },
 };
 </script>