Browse Source

修复bug

chenxiong 3 years ago
parent
commit
47d04a6ec3

+ 8 - 0
src/apis/course.js

@@ -286,4 +286,12 @@ export default {
 			params:data
 		})
 	},
+
+  courseMajorList(data) {
+		return request({
+			url: '/course/major/list',
+			method: 'get',
+			params:data
+		})
+	},
 }

+ 50 - 34
src/pages/course-detail/index.vue

@@ -1797,6 +1797,7 @@
               :prop="item.required ? item.fieldKey : ''"
             >
               <el-input
+                :disabled="apply_post_disabled"
                 v-model="infoForm.apply_post"
                 :placeholder="`请输入${item.fieldName}`"
               />
@@ -2391,22 +2392,22 @@ export default {
             message: "请输入身份证号",
             trigger: ["change", "blur"],
           },
-          {
-            validator: (rule, value, callback) => {
-              let IDRe18 =
-                /^([1-6][1-9]|50)\d{4}(18|19|20)\d{2}((0[1-9])|10|11|12)(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/;
-              let IDre15 =
-                /^([1-6][1-9]|50)\d{4}\d{2}((0[1-9])|10|11|12)(([0-2][1-9])|10|20|30|31)\d{3}$/;
-
-              if (!IDRe18.test(value) && !IDre15.test(value)) {
-                return callback(new Error("请输入格式正确的身份证号"));
-              } else {
-                return callback();
-              }
-            },
-            message: "请输入格式正确的身份证号",
-            trigger: ["change", "blur"],
-          },
+          // {
+          //   validator: (rule, value, callback) => {
+          //     let IDRe18 =
+          //       /^([1-6][1-9]|50)\d{4}(18|19|20)\d{2}((0[1-9])|10|11|12)(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/;
+          //     let IDre15 =
+          //       /^([1-6][1-9]|50)\d{4}\d{2}((0[1-9])|10|11|12)(([0-2][1-9])|10|20|30|31)\d{3}$/;
+
+          //     if (!IDRe18.test(value) && !IDre15.test(value)) {
+          //       return callback(new Error("请输入格式正确的身份证号"));
+          //     } else {
+          //       return callback();
+          //     }
+          //   },
+          //   message: "请输入格式正确的身份证号",
+          //   trigger: ["change", "blur"],
+          // },
         ],
         telphone: [
           {
@@ -2414,18 +2415,18 @@ export default {
             message: "请输入手机号码",
             trigger: ["change", "blur"],
           },
-          {
-            validator: (rule, value, callback) => {
-              var reg_tel =
-                /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/;
-              if (reg_tel.test(value)) {
-                return callback();
-              } else {
-                return callback(new Error("手机号码不正确"));
-              }
-            },
-            trigger: ["change", "blur"],
-          },
+          // {
+          //   validator: (rule, value, callback) => {
+          //     var reg_tel =
+          //       /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/;
+          //     if (reg_tel.test(value)) {
+          //       return callback();
+          //     } else {
+          //       return callback(new Error("手机号码不正确"));
+          //     }
+          //   },
+          //   trigger: ["change", "blur"],
+          // },
         ],
         education: [
           {
@@ -2571,6 +2572,7 @@ export default {
       menuIndex: [],
       clickLock: false,
       liveLast: null,
+      apply_post_disabled: false,
     };
   },
   computed: {
@@ -3328,17 +3330,26 @@ export default {
     },
 
     async uploadDatas(data) {
+      let self = this;
       if (this.infoForm.recent_photos && this.infoForm.idcard_face_photo) {
         let base = await this.$tools.imageToBase64(
           this.$tools.splitImgHost(this.infoForm.idcard_face_photo)
         );
         console.log(base);
         console.log(this.$tools.splitImgHost(this.infoForm.idcard_face_photo));
-        let resData = await this.$request.faceCertificationIDCardOCR({
-          cardSide: 1, //1人像  2 国徽
-          cardImageBase64: base,
-          gradeId: this.gradeId,
-        });
+
+        let resData = {};
+        try {
+          resData = await this.$request.faceCertificationIDCardOCR({
+            cardSide: 1, //1人像  2 国徽
+            cardImageBase64: base,
+            gradeId: this.gradeId,
+          });
+        } catch (err) {
+          self.$message.warning("身份证人像面照片异常,请重新上传");
+          self.uploading = false;
+          return;
+        }
 
         if (!resData.data) {
           this.$message.warning("身份证人像面照片异常,请重新上传");
@@ -3473,7 +3484,6 @@ export default {
         return;
       }
 
-      var self = this;
       if (self.remarkStatus) {
         var arsty = {};
         for (let k in data) {
@@ -4489,6 +4499,12 @@ export default {
       this.$request.goodsDetail(this.goodsId).then((res) => {
         self.goodsData = res.data;
         self.gradeId = self.goodsData.gradeId;
+        if (this.goodsData.categoryName) {
+          this.infoForm.apply_post = this.goodsData.categoryName;
+          if (this.goodsData.categoryName) {
+            this.apply_post_disabled = true;
+          }
+        }
         if (this.goodsData.buyNote) {
           this.tabList = [
             { name: "1", label: "学员须知" },

+ 1 - 1
src/pages/person-center/free-bank/bank-detail/index.vue

@@ -564,7 +564,7 @@
             <div class="title">
               <div
                 @click="
-                  go('/person-center/my-bank/bank-statistics/' + goodsId, {
+                  go('/person-center/free-bank/bank-statistics/' + goodsId, {
                     orderGoodsId: orderGoodsId,
                   })
                 "

+ 1 - 1
src/pages/person-center/free-bank/bank-statistics/index.vue

@@ -318,7 +318,7 @@ export default {
     },
     goDetail(section) {
       this.$router.push({
-        path: "/person-center/my-bank/bank-explain-detail/" + this.goodsId,
+        path: "/person-center/free-bank/bank-explain-detail/" + this.goodsId,
         query: {
           examId: section.examId || section.majorId,
           orderGoodsId: this.orderGoodsId,

+ 1 - 10
src/pages/person-center/free-bank/index/index.vue

@@ -148,15 +148,6 @@ export default {
         this.total = res.total;
       });
     },
-    studyIn(item, index) {
-      this.itemIndex = index;
-      uni.navigateTo({
-        url: "/pages2/bank/question_detail?id=" + item.goodsId,
-        query: {
-          orderGoodsId: item.orderGoodsId,
-        },
-      });
-    },
 
     pay() {
       this.$router.push({
@@ -165,7 +156,7 @@ export default {
     },
     goStudy(item) {
       this.$router.push({
-        path: "/person-center/my-bank/bank-detail/" + item.goodsId,
+        path: "/person-center/free-bank/bank-detail/" + item.goodsId,
         query: {
           orderGoodsId: item.orderGoodsId,
         },

+ 15 - 2
src/pages/person-center/my-classhour/appointment/index.vue

@@ -42,8 +42,17 @@
 
         <div class="invoice-content__body">
           <el-form-item label="学员类型:">
-            <el-radio v-model="radio" label="1">非补考学员</el-radio>
-            <el-radio v-model="radio" label="2">补考学员</el-radio>
+            <el-radio
+              v-for="(item, index) in radiolist"
+              :key="index"
+              v-model="radio"
+              :label="item.name"
+              v-if="
+                listData.applyStatus &&
+                listData.applyStatus.indexOf(item.name) !== -1
+              "
+              >非补考学员</el-radio
+            >
           </el-form-item>
         </div>
 
@@ -64,6 +73,10 @@ export default {
   name: "appointment",
   data() {
     return {
+      radiolist: [
+        { name: "1", label: "非补考学员" },
+        { name: "2", label: "补考学员" },
+      ],
       form: {},
       radio: "",
       goodsId: 0,

+ 28 - 25
src/pages/person-center/my-course/index.vue

@@ -263,7 +263,6 @@
                   v-if="
                     item.applyStatus === 1 &&
                     !(
-                      (item.interfacePushId > 0 && item.officialStatus != 1) ||
                       sysTime <= item.serviceStartTime ||
                       sysTime >= item.serviceEndTime ||
                       (item.classStartTime && sysTime <= item.classStartTime) ||
@@ -300,7 +299,6 @@
                   v-if="
                     item.beforeStatus === 1 &&
                     !(
-                      (item.interfacePushId > 0 && item.officialStatus != 1) ||
                       sysTime <= item.serviceStartTime ||
                       sysTime >= item.serviceEndTime ||
                       (item.classStartTime && sysTime <= item.classStartTime) ||
@@ -653,29 +651,6 @@ export default {
         }
       }
 
-      var confirmDetail = true;
-      if (item.educationName == "继续教育") {
-        if (
-          item.officialName &&
-          item.businessName == "二级" &&
-          item.projectName == "建造师"
-        ) {
-          confirmDetail = await this.userConfirmInfoDetail();
-        }
-      }
-
-      if (!confirmDetail) {
-        return;
-      }
-
-      //内部系统
-      if (item.interfacePushId > 0 && item.officialStatus != 1) {
-        this.$message({
-          type: "warning",
-          message: "机构正在为您报名中,请耐心等待,有疑问请联系020-87085982!",
-        });
-        return;
-      }
       if (
         this.sysTime <= item.serviceStartTime ||
         this.sysTime >= item.serviceEndTime
@@ -721,6 +696,30 @@ export default {
         return;
       }
 
+      var confirmDetail = true;
+      if (item.educationName == "继续教育") {
+        if (
+          item.officialName &&
+          item.businessName == "二级" &&
+          item.projectName == "建造师"
+        ) {
+          confirmDetail = await this.userConfirmInfoDetail();
+        }
+      }
+
+      //内部系统
+      if (item.interfacePushId > 0 && item.officialStatus != 1) {
+        this.$message({
+          type: "warning",
+          message: "机构正在为您报名中,请耐心等待,有疑问请联系020-87085982!",
+        });
+        return;
+      }
+
+      if (!confirmDetail) {
+        return;
+      }
+
       let rebuildStatus = await this.courseGoodsRebuildStatus(
         item.goodsId,
         item.gradeId
@@ -1175,6 +1174,10 @@ export default {
 
   .appoint-modal {
     &__content {
+      .el-radio {
+        display: block;
+        margin: 10px 30px 10px 0;
+      }
     }
   }
 }

+ 5 - 4
src/pages/person-center/my-mock/index.vue

@@ -776,7 +776,7 @@ export default {
         projectId.projectId;
       }
 
-      await this.subjectList({
+      await this.courseMajorList({
         businessId: this.appointParam.businessId,
         projectId: projectId,
       });
@@ -805,18 +805,19 @@ export default {
         this.$request.mockApplyListApplyBusiness().then(async (res) => {
           this.businesslist = res.rows;
           this.appointParam.businessId = this.businesslist[0].businessId;
-          await this.subjectList({
+          await this.courseMajorList({
             businessId: res.rows[0].businessId,
             projectId: res.rows[0].projectId,
+            status: 1,
           });
           resolve();
         });
       });
     },
-    subjectList(data) {
+    courseMajorList(data) {
       return new Promise((resolve) => {
         let self = this;
-        this.$request.subjectList(data).then((res) => {
+        this.$request.courseMajorList(data).then((res) => {
           if (res.code == 200) {
             self.sList = res.rows;
             let allItem = { id: "", subjectName: "全部" };