Bläddra i källkod

学习页条件限制

En route 1 år sedan
förälder
incheckning
f1f22eeb6b

+ 21 - 0
src/pages/course-detail/components/CourseTree.vue

@@ -1070,6 +1070,27 @@ export default {
           })
           .then(res => {
             let data = res.data;
+            if (data && data.endTime > parseInt(new Date().getTime() / 1000)) {
+              this.$confirm(
+                "当前无法学习," +
+                  this.$tools.timestampToTime(data.endTime, false) +
+                  "过后可继续学习",
+                "提示",
+                {
+                  confirmButtonText: "确定",
+                  closeOnClickModal: false,
+                  closeOnPressEscape: false,
+                  showCancelButton: false,
+                  distinguishCancelAndClose: false,
+                  showClose: false
+                }
+              )
+                .then(_ => {
+                  this.$router.back(-1);
+                })
+                .catch(_ => {});
+              return;
+            }
             if (!data.sectionId) {
               data = this.allSectionList[0];
             } else {

+ 80 - 0
src/pages/course-detail/components/coreContent.vue

@@ -176,6 +176,8 @@ export default {
     },
     //资料填写回调
     async callbackDataReview() {
+      await this.RequiredCourse(); //检测必修
+      await this.orderstudycheckFunc(); //七大员是否允许学习
       await this.confirmInfoDetail(); //判断开通信息推送是否成功
       if (this.goodsData.gradeId > 0) {
         await this.getGradeInfo(); //提交完资料返回判断是否已开班
@@ -191,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) => {

+ 2 - 0
src/pages/person-center/my-message/index.vue

@@ -261,6 +261,8 @@ export default {
     getreceiptStatus() {
       this.$request
         .getappinformUserlist({
+          pageNum:1,
+          pageSize:10,
           systemStatusList: this.formData.systemStatusList,
           receiptStatus: 0
         })