谢杰标 há 2 anos atrás
pai
commit
dfdeb1e511
4 ficheiros alterados com 67 adições e 216 exclusões
  1. 2 4
      common/methodTool.js
  2. 2 2
      pages2/learn/details.vue
  3. 39 191
      pages2/verify/input.vue
  4. 24 19
      pages3/polyv/detail.vue

+ 2 - 4
common/methodTool.js

@@ -663,14 +663,13 @@ export default {
   imageToBase64(url, quality = 0.8) {
     return new Promise((resolve, reject) => {
       url = this.splitImgHost(url);
-      // #ifdef MP-WEIXI
+      // #ifdef MP-WEIXIN
       let that = this;
       uni.downloadFile({
         url,
         success: (res) => {
           if (res.statusCode === 200) {
             that.fileToBase64(res.tempFilePath).then((res) => {
-              console.log(res);
               resolve(res);
             });
           }
@@ -679,7 +678,6 @@ export default {
       // #endif
       // #ifdef H5
       let image = new Image();
-      console.log(1);
       image.onload = function () {
         let canvas = document.createElement("canvas");
         canvas.width = image.width;
@@ -699,7 +697,7 @@ export default {
   },
   fileToBase64(url) {
     return new Promise((resolve, reject) => {
-      // #ifdef MP-WEIXI
+      // #ifdef MP-WEIXIN
       let fileSystem = uni.getFileSystemManager();
       fileSystem.readFile({
         filePath: url,

+ 2 - 2
pages2/learn/details.vue

@@ -14,7 +14,7 @@
       </view>
       <view class="detailsItem" v-for="(item, index) in listData" :key="index">
         <view class="head">
-          <view class="tap">{{ getTypeName(item.type) }}</view>
+          <view class="tap">{{ getTypeName(item.sectionType) }}</view>
           <view class="title">{{ item.name }}</view>
         </view>
         <!-- <u-line color="#EEEEEE" />
@@ -204,7 +204,7 @@ export default {
     },
     getTypeName(int) {
       if (int === 0) {
-        return "试";
+        return "试";
       }
       if (int === 1) {
         return "视频";

+ 39 - 191
pages2/verify/input.vue

@@ -244,16 +244,6 @@
               >
                 文件大小≤2M
               </text>
-              <!-- :max-size="2097152" -->
-              <!-- @on-list-change="
-                  item.fieldKey === 'recent_photos'
-                    ? changePhotoListHeader1($event)
-                    : item.fieldKey === 'idcard_face_photo'
-                    ? changePhotoListHeader2($event)
-                    : item.fieldKey === 'idcard_national_photo'
-                    ? changePhotoListHeader3($event)
-                    : ''
-                " -->
               <u-upload
                 :show-progress="false"
                 :ref="
@@ -345,7 +335,7 @@
                 label-position="top"
                 :prop="item.required ? item.fieldKey : ''"
               >
-                <div style="width:100%">
+                <div style="width: 100%">
                   <view class="dis_stys">
                     <text style="color: #999999">请在下方签名区进行签名</text>
                     <text @click="retDraw" mode="">清空</text>
@@ -1039,7 +1029,6 @@ export default {
     },
 
     async uploadDatas(data) {
-      console.log("sfsfg---data", data);
       if (this.form.recent_photos && this.form.idcard_face_photo) {
         let base64 = await this.$method.imageToBase64(
           this.form.idcard_face_photo
@@ -1304,31 +1293,37 @@ export default {
         data.working_years =
           this.dictObj["working_years"][Number(data.working_years)];
       }
-      if (data["recent_photos"]) {
-        data.recent_photos = await this.$method.uploadFile(
-          data.recent_photos,
-          0
-        );
-      }
-      if (data["idcard_face_photo"]) {
+      if (
+        data["idcard_face_photo"] &&
+        data["idcard_face_photo"].indexOf("oss/images") == -1
+      ) {
         data.idcard_face_photo = await this.$method.uploadFile(
           data.idcard_face_photo,
           0
         );
       }
-      if (data["idcard_national_photo"]) {
+      if (
+        data["idcard_national_photo"] &&
+        data["idcard_national_photo"].indexOf("oss/images") == -1
+      ) {
         data.idcard_national_photo = await this.$method.uploadFile(
           data.idcard_national_photo,
           0
         );
       }
-      if (data["commitment_electr_signature"]) {
+      if (
+        data["commitment_electr_signature"] &&
+        data["commitment_electr_signature"].indexOf("oss/images") == -1
+      ) {
         data.commitment_electr_signature = await this.$method.uploadFile(
           data.commitment_electr_signature,
           0
         );
       }
-      if (data["commitment_seal"]) {
+      if (
+        data["commitment_seal"] &&
+        data["commitment_seal"].indexOf("oss/images") == -1
+      ) {
         data.commitment_seal = await this.$method.uploadFile(
           data.commitment_seal,
           0
@@ -1399,7 +1394,6 @@ export default {
       };
       const index = map[key];
       if (lists.length) {
-        this["fileList" + index] = lists;
         // #ifdef MP-WEIXIN
         const isJPG =
           lists[0].url.indexOf("//tmp") !== -1 ||
@@ -1411,10 +1405,10 @@ export default {
           lists[0].file.type === "image/png" ||
           lists[0].file.type === "image/jpg";
         // #endif
-
         if (isJPG) {
           let size = lists[0].file.size;
           if (size < 2 * 1024 * 1024) {
+            this["fileList" + index] = lists;
             if (index == 1) {
               let url = lists[0].url;
               // #ifdef MP-WEIXIN
@@ -1439,6 +1433,7 @@ export default {
               this.checkIdCard(index - 1, url, titleMsg, key);
             }
           } else {
+            this.$refs[key][0].remove(0);
             uni.showModal({
               title: "提示",
               content: "上传图片大小不能超过 2MB!",
@@ -1448,158 +1443,8 @@ export default {
           }
         }
       } else {
-        this.fileList3 = [];
-        this.$set(this.form, "idcard_national_photo", "");
-      }
-      this.openVerify = false;
-      this.$nextTick(function () {
-        this.resultForm();
-      });
-    },
-    async changePhotoListHeader1(lists, name) {
-      if (lists.length) {
-        this.fileList1 = lists;
-        // console.log(lists, "lists1");
-        if (
-          lists[0].url.indexOf("//tmp") !== -1 ||
-          lists[0].url.indexOf("//temp") !== -1
-        ) {
-          if (lists[0].file.size < 2 * 1024 * 1024) {
-            // 以前的
-            this.$set(
-              this.form,
-              "recent_photos",
-              await this.$method.imageInfos(lists[0].url)
-            );
-          } else {
-            // 需要压缩
-            let canvasId = "zipCanvas";
-            let imagePath = lists[0].url; //原图的路径
-            let limitSize = 2048; //大小限制2048kb
-            let drawWidth = wx.getSystemInfoSync().windowWidth; //初始绘画区域是画布自身的宽度也就是屏幕宽度
-            getLessLimitSizeImage(
-              canvasId,
-              imagePath,
-              limitSize,
-              drawWidth,
-              async (resPath) => {
-                //resPath就是压缩后图片的路径
-                this.$set(
-                  this.form,
-                  "recent_photos",
-                  await this.$method.imageInfos(resPath)
-                );
-              }
-            );
-          }
-        }
-      } else {
-        this.fileList1 = [];
-        this.$set(this.form, "recent_photos", "");
-      }
-      this.openVerify = false;
-      this.$nextTick(function () {
-        this.resultForm();
-      });
-    },
-    async changePhotoListHeader2(lists, name) {
-      // console.log('身份证照片zhengmian:', lists, this.$refs.idcard_face_photo)
-      if (lists.length) {
-        this.fileList2 = lists;
-        if (
-          lists[0].url.indexOf("//tmp") !== -1 ||
-          lists[0].url.indexOf("//temp") !== -1
-        ) {
-          let url = lists[0].url;
-          let size = lists[0].file.size;
-          this.$refs.idcard_face_photo[0].remove(0);
-
-          // console.log('url', url, size)
-          let titleMsg = "请上传正确清晰的身份证人像面照片";
-          if (size < 2 * 1024 * 1024) {
-            this.checkIdCard(1, url, titleMsg, "idcard_face_photo");
-          } else {
-            // 需要压缩
-            let canvasId = "zipCanvas";
-            let imagePath = url; //原图的路径
-            let limitSize = 2048; //大小限制2048kb
-            let drawWidth = wx.getSystemInfoSync().windowWidth; //初始绘画区域是画布自身的宽度也就是屏幕宽度
-            getLessLimitSizeImage(
-              canvasId,
-              imagePath,
-              limitSize,
-              drawWidth,
-              async (resPath) => {
-                //resPath就是压缩后图片的路径
-                this.checkIdCard(1, resPath, titleMsg, "idcard_face_photo");
-              }
-            );
-          }
-        }
-      } else {
-        this.fileList2 = [];
-        this.$set(this.form, "idcard_face_photo", "");
-      }
-      this.openVerify = false;
-      this.$nextTick(function () {
-        this.resultForm();
-      });
-    },
-    async changePhotoListHeader3(lists, name) {
-      if (lists.length) {
-        this.fileList3 = lists;
-        // #ifdef MP-WEIXIN
-        const isJPG =
-          lists[0].url.indexOf("//tmp") !== -1 ||
-          lists[0].url.indexOf("//temp") !== -1;
-        // #endif
-        // #ifdef H5
-        const isJPG =
-          lists[0].file.type === "image/jpeg" ||
-          lists[0].file.type === "image/png" ||
-          lists[0].file.type === "image/jpg";
-        // #endif
-
-        if (isJPG) {
-          console.log("//tem", lists[0]);
-          // #ifdef MP-WEIXIN
-          let url = lists[0].url;
-          // #endif
-          // #ifdef H5
-          let url = lists[0].file;
-          // #endif
-          let size = lists[0].file.size;
-          this.$refs.idcard_national_photo[0].remove(0);
-          let titleMsg = "请上传正确清晰的身份证国徽面照片";
-          if (size < 2 * 1024 * 1024) {
-            this.checkIdCard(2, url, titleMsg, "idcard_national_photo");
-          } else {
-            uni.showModal({
-              title: "提示",
-              content: "上传图片大小不能超过 2MB!",
-              showCancel: false,
-            });
-            return;
-            // 需要压缩
-            let canvasId = "zipCanvas";
-            let imagePath = url; //原图的路径
-            let limitSize = 2048; //大小限制2048kb
-            let drawWidth = wx.getSystemInfoSync().windowWidth; //初始绘画区域是画布自身的宽度也就是屏幕宽度
-            getLessLimitSizeImage(
-              canvasId,
-              imagePath,
-              limitSize,
-              drawWidth,
-              async (resPath) => {
-                //resPath就是压缩后图片的路径
-                this.checkIdCard(2, resPath, titleMsg, "idcard_national_photo");
-              }
-            );
-          }
-        }
-      } else {
-        this.fileList3 = [];
-        this.$set(this.form, "idcard_national_photo", "");
+        this["fileList" + index] = [];
+        this.$set(this.form, key, "");
       }
       this.openVerify = false;
       this.$nextTick(function () {
@@ -1615,22 +1460,25 @@ export default {
         });
         return;
       }
-      let { IdName, IdNum } = res.data;
-      if (IdName != this.form.name || IdNum != this.form.idcard) {
-        // uni.showModal({
-        //   content:
-        //     IdName != this.form.name
-        //       ? "输入的姓名和身份证人像面照片姓名不匹配,请联系客服"
-        //       : "输入的身份证号和身份证人像面照片身份证号不匹配,请联系客服",
-        //   showCancel: false,
-        //   success: (resultst) => {
-        //     if (resultst.confirm) {
-        //       uni.navigateBack();
-        //     }
-        //   },
-        // });
-        // return;
+      if (cardSide == 1) {
+        let { IdName, IdNum } = res.data;
+        if (IdName != this.form.name || IdNum != this.form.idcard) {
+          uni.showModal({
+            content:
+              IdName != this.form.name
+                ? "输入的姓名和身份证人像面照片姓名不匹配,请联系客服"
+                : "输入的身份证号和身份证人像面照片身份证号不匹配,请联系客服",
+            showCancel: false,
+            success: (resultst) => {
+              if (resultst.confirm) {
+                uni.navigateBack();
+              }
+            },
+          });
+          return;
+        }
       }
+
       this.$refs[paramType][0].lists = [
         {
           url: this.$method.splitImgHost(res.data.IdImgPath),

+ 24 - 19
pages3/polyv/detail.vue

@@ -1657,8 +1657,13 @@ export default {
         })
         .then((res) => {
           let { data } = res.data;
+          console.log(data, 7789);
           if (!data.sectionId) {
             data = this.menuAllList[0];
+          } else {
+            // if(data.learning==1){
+            //   return
+            // }
           }
           this.initPlayVideo(data);
           // if (res.data.data) {
@@ -3275,25 +3280,25 @@ export default {
                 uni.navigateTo({
                   url:
                     "/pages2/class/questionBank?courseId=" +
-                      this.courseId +
-                      "&gradeId=" +
-                      this.gradeId +
-                      "&isFromVideo=1&id=" +
-                      data.id +
-                      "&goodsid=" +
-                      this.goodsId +
-                      "&moduleId=" +
-                      (data.moduleId || 0) +
-                      "&chapterId=" +
-                      (data.chapterId || 0) +
-                      "&orderGoodsId=" +
-                      this.orderGoodsId +
-                      "&type=" +
-                      (data.type == 4 ? 1: 3) +
-                      "&learning=" +
-                      data.studyStatus +
-                      "&isBackVideo=" +
-                      1,
+                    this.courseId +
+                    "&gradeId=" +
+                    this.gradeId +
+                    "&isFromVideo=1&id=" +
+                    data.id +
+                    "&goodsid=" +
+                    this.goodsId +
+                    "&moduleId=" +
+                    (data.moduleId || 0) +
+                    "&chapterId=" +
+                    (data.chapterId || 0) +
+                    "&orderGoodsId=" +
+                    this.orderGoodsId +
+                    "&type=" +
+                    (data.type == 4 ? 1 : 3) +
+                    "&learning=" +
+                    data.studyStatus +
+                    "&isBackVideo=" +
+                    1,
                 });
               }
             },