Преглед изворни кода

资料调整+拍照逻辑调整

Tang пре 2 година
родитељ
комит
e8781807ae
2 измењених фајлова са 54 додато и 34 уклоњено
  1. 48 24
      src/components/dataReview/index.vue
  2. 6 10
      src/components/videoCy/index.vue

+ 48 - 24
src/components/dataReview/index.vue

@@ -209,7 +209,7 @@ export default {
       activeData: {},
       idcard_face_photo_old: "",
       recent_photos_old: "",
-      checkStatus:0,//是否审核通过才允许学习 1是0否
+      checkStatus: 0, //是否审核通过才允许学习 1是0否
       STATUS: false //区分个人中心入口操作
     };
   },
@@ -286,7 +286,7 @@ export default {
             ...JSON.parse(res.data.keyValue2)
           ];
           let Obj = {};
-          this.checkStatus = res.data.checkStatus || 0
+          this.checkStatus = res.data.checkStatus || 0;
           Ary.forEach(i => {
             Obj[i.fieldKey] = [
               {
@@ -409,25 +409,10 @@ export default {
                 JSON.parse(res.data.keyValue)
               ); //历史数据
               resolve();
-            }else if(this.checkStatus == 1 && res.data.status !== 1){
+            } else if (this.checkStatus == 1 && res.data.status !== 1) {
               //后台设置需要审核通过才允许学习
-              this.$confirm(`资料正在审核中,暂无法学习,请耐心等待!如需加急审核,请联系客服人员`, "提示", {
-                confirmButtonText: "确定",
-                cancelButtonText: "返回",
-                closeOnClickModal: false,
-                closeOnPressEscape: false,
-                distinguishCancelAndClose: false,
-                showClose: false
-              })
-                .then(_ => {
-                  //停止执行-退出页面
-                  this.$router.back(-1);
-                })
-                .catch(_ => {
-                  //停止执行-退出页面
-                  this.$router.back(-1);
-                });
-            }else {
+              this.checkFunc();
+            } else {
               this.isShow = false;
               //不需要填写
               this.$emit("callbackDataReview");
@@ -558,6 +543,30 @@ export default {
         }
       }
     },
+    //审核通过才允许学习
+    checkFunc() {
+      //后台设置需要审核通过才允许学习
+      this.$confirm(
+        `资料正在审核中,暂无法学习,请耐心等待!如需加急审核,请联系客服人员`,
+        "提示",
+        {
+          confirmButtonText: "确定",
+          cancelButtonText: "返回",
+          closeOnClickModal: false,
+          closeOnPressEscape: false,
+          distinguishCancelAndClose: false,
+          showClose: false
+        }
+      )
+        .then(_ => {
+          //停止执行-退出页面
+          this.$router.back(-1);
+        })
+        .catch(_ => {
+          //停止执行-退出页面
+          this.$router.back(-1);
+        });
+    },
     //照片处理逻辑
     async uploadImg(e, item) {
       try {
@@ -745,10 +754,15 @@ export default {
     //证件照与身份证匹配
     IdCardCompareFace() {
       return new Promise(async (resolve, reject) => {
-        if (!(
-          this.infoForm["idcard_face_photo"] &&
-          this.infoForm["recent_photos"] && (this.infoForm["idcard_face_photo"] !== this.idcard_face_photo_old || this.infoForm["recent_photos"] !== this.recent_photos_old)
-        )) {
+        if (
+          !(
+            this.infoForm["idcard_face_photo"] &&
+            this.infoForm["recent_photos"] &&
+            (this.infoForm["idcard_face_photo"] !==
+              this.idcard_face_photo_old ||
+              this.infoForm["recent_photos"] !== this.recent_photos_old)
+          )
+        ) {
           resolve();
           return;
         }
@@ -845,6 +859,11 @@ export default {
                 .then(res => {
                   this.$message.success("提交成功");
                   this.isShow = false;
+                  if (this.checkStatus == 1) {
+                    //后台设置需要审核通过才允许学习
+                    this.checkFunc();
+                    return
+                  }
                   this.$emit("callbackDataReview");
                 })
                 .catch(err => {
@@ -865,6 +884,11 @@ export default {
                 .then(res => {
                   this.$message.success("提交成功");
                   this.isShow = false;
+                  if (this.checkStatus == 1) {
+                    //后台设置需要审核通过才允许学习
+                    this.checkFunc();
+                    return
+                  }
                   this.$emit("callbackDataReview");
                 })
                 .catch(err => {

+ 6 - 10
src/components/videoCy/index.vue

@@ -247,22 +247,18 @@ export default {
     //施工继教
     ShiPhotoList(totalVideoTime) {
       //施工继教带年份的订单拍照设置
-      // let time1 = 50 * 60; //拍照间隔多久一张 50分钟
-      // let num = Math.trunc(totalVideoTime / time1) + 1; //拍照数量
-      // let photoList = [];
-      // for (let i = 0; i < num; i++) {
-      //   photoList.push(i * time1);
-      // }
-      // return photoList;
-      //施工继教带年份的订单拍照设置
-      let time1 = 50 * 60 - 1; //拍照间隔多久一张 50分钟
+      if(totalVideoTime < 2760){
+        var time1 = 46 * 60 - 1; //拍照间隔多久一张 46分钟
+      }else{
+        var time1 = 45 * 60 - 1; //拍照间隔多久一张 45分钟
+      }
       let num = Math.ceil(totalVideoTime / time1); //拍照数量
       let photoList = [];
       if (num == 1) {
         photoList.push(parseInt(totalVideoTime / 2));
       } else {
         for (let i = 0; i < num; i++) {
-          photoList.push(parseInt(((totalVideoTime - 3) / num) * (i + 1)));
+          photoList.push(parseInt((totalVideoTime / (num + 1)) * (i + 1)));
         }
       }
       return photoList;