xiaojincai 4 tahun lalu
induk
melakukan
629aebcfe6
3 mengubah file dengan 32 tambahan dan 2 penghapusan
  1. TEMPAT SAMPAH
      images/zj6.jpg
  2. 25 2
      pages/upload/upload.js
  3. 7 0
      pages/upload/upload.wxml

TEMPAT SAMPAH
images/zj6.jpg


+ 25 - 2
pages/upload/upload.js

@@ -13,8 +13,11 @@ Page({
     halfbody_img: "", //半身照
     education_img: "", //学历照
     oldcard_img:'',
+    health_img:"",//体检报告
     id:'',
     train_type:'',
+    subject_item:"",//报名科目
+    has_healthimg:false,
     img:''
   },
 
@@ -37,7 +40,10 @@ Page({
           halfbody_img: res.data.data.halfbody_img, //半身照
           education_img: res.data.data.education_img, //学历照
           oldcard_img: res.data.data.oldcard_img,
-          train_type: res.data.data.train_type
+          train_type: res.data.data.train_type,
+          health_img: res.data.data.health_img,
+          subject_item: res.data.data.subject_item,
+          has_healthimg:res.data.data.subject_item.split("|")[0].indexOf("特种设备")!=-1
         })
         if (!res.data.data.idnoimg_face){
           wx.request({
@@ -51,7 +57,8 @@ Page({
                 idnoimg_back: res.data.data.idnoimg_back, //反面照
                 halfbody_img: res.data.data.halfbody_img, //半身照
                 education_img: res.data.data.education_img, //学历照
-                oldcard_img: res.data.data.oldcard_img
+                oldcard_img: res.data.data.oldcard_img,
+                health_img: res.data.data.health_img,
               })
             }
           })
@@ -69,6 +76,7 @@ Page({
     formData.halfbody_img = this.data.halfbody_img
     formData.education_img = this.data.education_img
     formData.oldcard_img = this.data.oldcard_img
+    formData.health_img = this.data.health_img
     if (!formData.idnoimg_face) {
       wx.showToast({
         title: '正面照不存在!',
@@ -111,6 +119,16 @@ Page({
         return false
       }     
     }
+    if (this.data.subject_item.split("|")[0].indexOf("特种设备") != -1) {
+      if (!formData.health_img) {
+        wx.showToast({
+          title: '体检证明照片不存在!',
+          icon: 'none',
+          duration: 2000
+        })
+        return false
+      }
+    }
     wx.showLoading({
       title: '',
     })
@@ -204,6 +222,11 @@ Page({
                 oldcard_img: data.data.url
               })
             }
+            if (id == 6) {
+              _this.setData({
+                health_img: data.data.url
+              })
+            }
           },
           fail: res => {
             wx.hideLoading()

+ 7 - 0
pages/upload/upload.wxml

@@ -39,6 +39,13 @@
       <text>注意:拍完整不能斜着拍,和复印效果一样!</text>
       <view data-id='5' bindtap="showImg" class="tips" style="margin:0;">点击查看参考图片</view>
   </view>
+  <view class="item" wx:if="{{has_healthimg}}">
+      <image wx:if='{{health_img}}' data-id='5' bindtap="takePhoto" src="{{health_img}}" mode="scaleToFill"></image>
+      <image wx:else data-id='6' bindtap="takePhoto" src="../../images/upload.png" mode="widthFix"></image>
+      <view class="title">健康体检表照片,务必保持清晰</view>
+      <text>注意:拍完整不能斜着拍,和复印效果一样!</text>
+      <view data-id='6' bindtap="showImg" class="tips" style="margin:0;">点击查看参考图片</view>
+  </view>
 
   <view bindtap="post" class="post">提交资料</view>
 </view>