hanfucheng 1 рік тому
батько
коміт
9015df63b8
2 змінених файлів з 28 додано та 14 видалено
  1. 12 6
      pages/me/nameAuthentication.vue
  2. 16 8
      pages/me/officialAuthentication.vue

+ 12 - 6
pages/me/nameAuthentication.vue

@@ -83,12 +83,18 @@
             },
             /** 提交按钮 */
             submitForm(e) {
-                this.$refs[e].validate().then(res => {
-                    appletAdd(this.form).then(res => {
-						uni.navigateBack();
-					});
-                }).catch(err => {
-                })
+				this.$refs[e].validate().then(res => {
+					if(this.imageList.length!=2){
+						uni.showToast({
+							title: "身份证正反面照片为两张!",
+							icon: "none"
+						})
+					}else{
+						appletAdd(this.form).then(res => {
+							uni.navigateBack();
+						});
+					}
+				})
             },
 
             updateImg(imgList) {

+ 16 - 8
pages/me/officialAuthentication.vue

@@ -13,7 +13,7 @@
                     <uni-easyinput v-model="form.phone" placeholder="请输入联系电话" maxlength="13"/>
                 </uni-forms-item>
                 <uni-forms-item label="证照信息" required name="path">
-                    <upload :imgArr="imageList" name="path" v-model="form.path" :fileSize="1" :limit="3"
+                    <upload :imgArr="imageList" name="path" v-model="form.path" :fileSize="1" :limit="2"
                             @updateImg="updateImg"></upload>
                 </uni-forms-item>
             </uni-forms>
@@ -79,14 +79,22 @@
             },
             /** 提交按钮 */
             submitForm(e) {
-                this.$refs[e].validate().then(res => {
-					appletAdd(this.form).then(res => {
-						uni.navigateBack();
-					})
-                }).catch(err => {
-                    console.log('err', err);
-                })
+				this.$refs[e].validate().then(res => {
+					if(this.imageList.length!=2){
+						uni.showToast({
+							title: "证照信息照片为两张!",
+							icon: "none"
+						})
+					}else{
+						appletAdd(this.form).then(res => {
+							console.log("1111111111")
+							uni.navigateBack();
+							console.log("2222222222222")
+						});
+					}
+				})
             },
+			
             updateImg(imgList) {
                 this.imageList = imgList;
                 this.form.path = this.imageList.join(',');