En route 1 éve
szülő
commit
82b2a98ca2
1 módosított fájl, 85 hozzáadás és 2 törlés
  1. 85 2
      src/pages/course-detail/components/coreContent.vue

+ 85 - 2
src/pages/course-detail/components/coreContent.vue

@@ -61,7 +61,10 @@
             </course-tree>
           </template>
           <template v-if="tab.name == '3'">
-            <answer-questions ref="answerQuestions"></answer-questions>
+            <answer-questions
+              ref="answerQuestions"
+              :activeSection.sync="activeSection"
+            ></answer-questions>
           </template>
           <template v-if="tab.name == '4'">
             <Notes ref="notes"></Notes>
@@ -173,6 +176,8 @@ export default {
     },
     //资料填写回调
     async callbackDataReview() {
+      await this.RequiredCourse(); //检测必修
+      await this.orderstudycheckFunc(); //七大员是否允许学习
       await this.confirmInfoDetail(); //判断开通信息推送是否成功
       if (this.goodsData.gradeId > 0) {
         await this.getGradeInfo(); //提交完资料返回判断是否已开班
@@ -188,6 +193,84 @@ export default {
       await this.getRebuildCourse(); //获取重修列表
       this.courseTabIndex = "1";
     },
+    //七大员是否允许学习
+    orderstudycheckFunc() {
+      return new Promise((resolve, reject) => {
+        this.$request
+          .orderstudycheck(this.goodsData.orderGoodsId)
+          .then(res => {
+            resolve();
+          })
+          .catch(err => {
+            this.$confirm(err.msg, "提示", {
+              confirmButtonText: "确定",
+              closeOnClickModal: false,
+              closeOnPressEscape: false,
+              showCancelButton: false,
+              distinguishCancelAndClose: false,
+              showClose: false
+            })
+              .then(_ => {
+                this.$router.back(-1);
+              })
+              .catch(_ => {});
+            reject();
+          });
+      });
+    },
+    //检测必修
+    RequiredCourse() {
+      return new Promise((resolve, reject) => {
+        if (
+          this.goodsData.educationName == "继续教育" &&
+          this.goodsData.businessName == "二级" &&
+          (this.goodsData.projectName == "建造师" ||
+            this.goodsData.projectName == "造价师")
+        ) {
+          this.$request
+            .goodsGradeCheckFinishRequiredCourse({
+              businessId: this.goodsData.businessId,
+              goodsId: this.goodsData.goodsId
+            })
+            .then(res => {
+              if (res.data > 0) {
+                this.$confirm(`请先学习必修商品`, "提示", {
+                  confirmButtonText: "确定",
+                  closeOnClickModal: false,
+                  closeOnPressEscape: false,
+                  showCancelButton: false,
+                  distinguishCancelAndClose: false,
+                  showClose: false
+                })
+                  .then(_ => {
+                    this.$router.back(-1);
+                  })
+                  .catch(_ => {});
+                reject();
+              } else {
+                resolve();
+              }
+            })
+            .catch(err => {
+              this.$confirm(err.msg, "提示", {
+                  confirmButtonText: "确定",
+                  closeOnClickModal: false,
+                  closeOnPressEscape: false,
+                  showCancelButton: false,
+                  distinguishCancelAndClose: false,
+                  showClose: false
+                })
+                  .then(_ => {
+                    this.$router.back(-1);
+                  })
+                  .catch(_ => {});
+              reject();
+            });
+        } else {
+          resolve();
+        }
+      });
+    },
     //提交完资料返回判断是否已开班
     getGradeInfo() {
       return new Promise((resolve, reject) => {
@@ -309,7 +392,7 @@ export default {
             orderGoodsId: this.goodsData.orderGoodsId
           });
           if (!info.data || info.data.pushInfo !== 1) {
-            this.$confirm(`开通信息推送不成功,无法进入学习!`, "提示", {
+            this.$confirm(`您的信息正在推送中,请稍后再进入学习!`, "提示", {
               confirmButtonText: "确定",
               closeOnClickModal: false,
               closeOnPressEscape: false,