Browse Source

更换管理员申诉、企业认证选择地址时输入详细地址不能输入空格键就提交

hangb 7 years ago
parent
commit
15a4c35e95

+ 10 - 4
components/appeal/ChangeManagerAppeal.vue

@@ -553,10 +553,16 @@
       },
       submitAddress () {
         if (this.address.regDistrict !== '' && this.address.regCity !== '' && this.address.regProvince !== '') {
-          if (this.address.regStreet !== '') {
-            this.changeManager.regAddress = this.address.regProvince + this.address.regCity + this.address.regDistrict + this.address.regStreet
-            this.showAddressBox = false
-            this.addressCheck = true
+          if (this.address.regStreet) {
+            let reg = /^(?=.*([\w\u4e00-\u9fa5]+)).*$/
+            if (!reg.test(this.address.regStreet)) {
+              this.addressCheck = false
+              this.$message.error('请输入详细地址')
+            } else {
+              this.changeManager.regAddress = this.address.regProvince + this.address.regCity + this.address.regDistrict + this.address.regStreet
+              this.showAddressBox = false
+              this.addressCheck = true
+            }
           } else {
             this.$message.error('请输入详细地址')
             this.addressCheck = false

+ 16 - 5
components/certification/EnterpriseCertification.vue

@@ -84,7 +84,12 @@
                   <div class="x-item-ext">
                     <div class="form-group">
                       <div class="col-sm-12">
-                        <textarea id="street" name="street" rows="4" v-model="address.regStreet" class="form-control x-input" placeholder="xx路xx大厦xx栋xx楼xx室"></textarea>
+                        <textarea id="street"
+                                  name="street"
+                                  rows="4"
+                                  v-model="address.regStreet"
+                                  class="form-control x-input"
+                                  placeholder="xx路xx大厦xx栋xx楼xx室"></textarea>
                       </div>
                     </div>
                     <div class="text-right">
@@ -398,10 +403,16 @@
       },
       submitAddress () {
         if (this.address.regDistrict !== '' && this.address.regCity !== '' && this.address.regProvince !== '') {
-          if (this.address.regStreet !== '') {
-            this.enterprise.regAddress = this.address.regProvince + this.address.regCity + this.address.regDistrict + this.address.regStreet
-            this.showAddressBox = false
-            this.addressCheck = true
+          if (this.address.regStreet) {
+            let reg = /^(?=.*([\w\u4e00-\u9fa5]+)).*$/
+            if (!reg.test(this.address.regStreet)) {
+              this.addressCheck = false
+              this.$message.error('请输入详细地址')
+            } else {
+              this.enterprise.regAddress = this.address.regProvince + this.address.regCity + this.address.regDistrict + this.address.regStreet
+              this.showAddressBox = false
+              this.addressCheck = true
+            }
           } else {
             this.$message.error('请输入详细地址')
             this.addressCheck = false