Browse Source

新账号中心企业认证

hangb 7 years ago
parent
commit
cc3156da0f

+ 154 - 1
assets/scss/common.scss

@@ -489,8 +489,161 @@ form .el-form-item .el-form-item__content div.correct .el-input__inner{
 
 //企业认证
 form .el-form-item.padding55 .el-form-item__content .el-input__inner{
-  padding-left: 55px;
+  //padding-left: 55px;
 }
 form .el-form-item.padding45 .el-form-item__content .el-input__inner{
   padding-left: 45px;
+  border: 1px solid #dcdfe6;
+}
+
+//上传图片
+
+.x-btn-blank{
+  position: relative;
+  display: inline-block;
+  width: 360px;
+  height: 44px;
+  text-align: left;
+  border: 1px solid #dcdcdc;
+  overflow: hidden;
+  cursor: pointer;
+}
+.x-btn-blank span.upload {
+  margin-left: 50px;
+  line-height: 44px;
+  font-size: 14px;
+  color: #c9c9c9;
+}
+.x-btn-blank input[type='file']{
+  position: absolute;
+  top: 0;
+  left: 0;
+  width: 360px;
+  height: 44px;
+  opacity: 0;
+  border: none;
+}
+.x-btn-blank:hover, .x-btn-blank[disabled] {
+  border-color: #c0c4cc;
+  background: #e6e6e6;
+  color: #333;
+}
+.x-btn-blank:hover span.upload{
+  color: #000;
+}
+form .el-form-item.padding55 .el-form-item__content{
+  text-align: left;
+  line-height: 1;
+}
+form .el-form-item.padding55 a.thumbnail {
+  margin-bottom: 0;
+  width: 120px;
+  line-height: 70px;
+  border-radius: 0;
+}
+form .el-form-item.padding55 a.thumbnail:hover{
+  border: 1px solid #ddd;
+}
+form .el-form-item.padding55 img.previewImg {
+  max-width: 120px;
+  max-height: 70px;
+}
+
+
+//地址选择
+.form-control[disabled], .form-control[readonly], fieldset[disabled] .form-control {
+  background-color: transparent;
+}
+.x-union-menu {
+  width: 600px;
+}
+.x-form .dropdown-menu {
+  left: 15px;
+  margin-top: -1px;
+  border-color: #e4ecf3;
+  border-radius: 0;
+  padding: 0;
+}
+.x-union-header>div {
+  background: #f5f8fa;
+  font-weight: 700;
+  border-bottom: 1px solid #e4ecf3;
+}
+.x-union-header{
+  overflow: hidden;
+  height: 28px;
+  line-height: 28px;
+  background: #f5f8fa;
+}
+.x-union-header>div:last-child {
+  border-right-width: 0;
+}
+.x-union-menu .x-item-ext {
+  float: left;
+  width: 235px;
+}
+.x-union-header>div, .x-union-list>ul {
+  float: left;
+  width: 121px;
+  border-right: 1px solid #e4ecf3;
+}
+.x-union-list>ul {
+  height: 200px;
+  margin: 0;
+  overflow-y: auto;
+}
+.x-union-list .x-item-ext {
+  padding: 10px;
+}
+.x-union-header>div, .x-union-list>ul>li {
+  padding: 2px 10px;
+  cursor: pointer;
+  font-size: 14px;
+  color: #505050;
+  height: 28px;
+  line-height: 28px;
+}
+.x-union-list>ul>li:hover, .x-union-list>ul>li.active {
+  background: #fee9c7;
+}
+.x-input, .x-input-blank {
+  border-color: #ccc;
+  border-radius: 0;
+  box-shadow: none;
+}
+.text-right a.register-btn {
+  display: inline-block;
+  border-radius: 0;
+  width: 45px;
+  height: 30px;
+  line-height: 30px;
+  text-align: center;
+  font-size: 14px;
+}
+.text-right a.register-btn:first-child{
+  margin-right: 10px;
+  background: #5078cb;
+  color: #fff;
+}
+.text-right a.register-btn:last-child{
+  background: #e6e6e6;
+  color: #333;
+}
+#street {
+  width: 200px !important;
+  height: 94px !important;
+  font-size: 14px;
+  color: #555;
+}
+form .el-form-item.padding45 .el-form-item__content input.active{
+  border-color: #f56c6c !important;
+}
+form .el-form-item.padding45 .el-form-item__content input.correct{
+  border-color: #67c23a !important;
+}
+form .el-form-item.padding55 .el-form-item__content a.active{
+  border-color: #f56c6c !important;
+}
+form .el-form-item.padding55 .el-form-item__content a.correct {
+  border-color: #67c23a !important;
 }

+ 0 - 1
components/appeal/AccountAppeal.vue

@@ -320,7 +320,6 @@
 </script>
 <style lang="scss" scoped>
   .certification {
-    padding-bottom: 145px;
     margin: 0 auto;
     width: 100%;
     background: #eee;

+ 0 - 1
components/appeal/PasswordRestAppeal.vue

@@ -399,7 +399,6 @@
 </script>
 <style lang="scss" scoped>
   .certification {
-    padding-bottom: 145px;
     margin: 0 auto;
     width: 100%;
     background: #eee;

+ 209 - 43
components/certification/EnterpriseCertification.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="certification">
     <div class="container">
-      <div class="content" v-if="enterpriseRegister">
+      <div class="content" v-show="enterpriseRegister">
         <div class="content-top">
           <h3>企业认证</h3>
           <div class="step">
@@ -14,34 +14,91 @@
             <el-form-item prop="spaceName">
               <el-input type="text"
                         v-model="enterprise.spaceName"
-                        v-bind:class="{ active: isSpaceNameExist }"
+                        v-bind:class="{ active: isSpaceNameValid }"
                         auto-complete="off"
                         placeholder="企业名称"
               ></el-input>
-              <span class="tip exist" v-show="isSpaceNameExist">该企业已被注册,请确认。<a href="">仍有问题?</a></span>
+              <span class="tip exist" v-show="isSpaceNameValid">该企业已被认证,请确认。<a href="https://www.ubtob.com/contact">仍有问题?</a></span>
             </el-form-item>
             <el-form-item prop="businessCode">
               <el-input type="text"
                         v-model="enterprise.businessCode"
-                        v-bind:class="{ active: isBusinessCodeExist }"
+                        v-bind:class="{ active: isBusinessCodeValid }"
                         auto-complete="off"
                         placeholder="营业执照号"></el-input>
-              <span class="tip exist" v-show="isBusinessCodeExist">该企业已被注册,请确认。<a href="">仍有问题?</a></span>
+              <span class="tip exist" v-show="isBusinessCodeValid">该企业已被认证,请确认。<a href="https://www.ubtob.com/contact">仍有问题?</a></span>
             </el-form-item>
             <el-form-item prop="businessImage" class="padding55">
-              <el-input v-model="enterprise.businessImage" placeholder="上传营业执照扫描件"></el-input>
-              <i class="fa fa-photo"></i>
+              <a class="x-btn-blank" title="上传营业执照扫描件" v-bind:class="{ correct: uploadFileChecked }">
+                <i class="fa fa-picture-o"></i>
+                <span class="upload">上传营业执照扫描件</span>
+                <input type="file"
+                       class="form-control file-input"
+                       name="name"
+                       accept="image/jpeg,image/jpg,image/gif,image/bmp,image/png,.pdf"
+                       @change="upload"/>
+              </a>
+              <a class="thumbnail" v-if="enterprise.businessCodeImage !== ''"><img class="previewImg" alt="" :src="enterprise.businessCodeImage"></a>
             </el-form-item>
             <el-form-item prop="corporation">
               <el-input v-model="enterprise.corporation" placeholder="法定代表人"></el-input>
             </el-form-item>
             <el-form-item prop="regAddress" class="padding45">
-              <el-input v-model="enterprise.regAddress" placeholder="注册地址"></el-input>
+              <input type="text" readonly aria-haspopup="true" aria-expanded="false"
+                     @click="onShowAddress"
+                     v-model="enterprise.regAddress"
+                     v-bind:class="{ correct: addressCheck }"
+                     class="form-control"
+                     name="name"
+                     placeholder="注册地址"/>
               <i class="fa fa-map-marker"></i>
+              <div v-show="showAddressBox"
+                   @mouseenter="isShowAddressBox = true"
+                   @mouseleave="isShowAddressBox = false"
+                   style="display: block;" class="dropdown-menu x-union-menu" aria-labelledby="address">
+                <div class="x-union-header">
+                  <div>省份</div>
+                  <div>城市</div>
+                  <div>县区</div>
+                  <div class="x-item-ext">详细地址</div>
+                </div>
+                <div class="x-union-list">
+                  <ul class="list-unstyled">
+                    <li v-for="province in cityData.province"
+                        :class="province == address.regProvince ? 'active' : ''"
+                        v-text="province"
+                        @click="getCity(province)"></li>
+                  </ul>
+                  <ul class="list-unstyled">
+                    <li v-for="city in cityData.city"
+                        :class="city == address.regCity ? 'active' : ''"
+                        v-text="city"
+                        @click="getDistrict(city)"></li>
+                  </ul>
+                  <ul class="list-unstyled">
+                    <li v-for="district in cityData.district"
+                        v-text="district"
+                        :class="district == address.regDistrict ? 'active' : ''"
+                        @click="chooseDistrict(district)"></li>
+                  </ul>
+                  <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>
+                      </div>
+                    </div>
+                    <div class="text-right">
+                      <a class="register-btn btn-submit" @click="submitAddress">确定</a>
+                      <a @click="showAddressBox = false" class="register-btn btn-console">取消</a>
+                    </div>
+                  </div>
+                </div>
+              </div>
             </el-form-item>
             <el-form-item>
               <a class="btn finish"
-                 :disabled="!checked" @click="isLogin">提交</a>
+                 :disabled="!checked || !spaceNameChecked || !businessCodeChecked || !corporationChecked || !uploadFileChecked || !addressCheck"
+                 @click="submitForm">提交</a>
             </el-form-item>
             <el-form-item>
               <el-checkbox name="type" v-model="checked" @click="checkboxIsChecked"></el-checkbox>
@@ -50,7 +107,7 @@
           </el-form>
         </div>
       </div>
-      <div class="content" v-if="!enterpriseRegister">
+      <div class="content" v-show="!enterpriseRegister">
         <div class="content-top">
           <h3>企业认证</h3>
           <div class="step">
@@ -105,24 +162,25 @@
         if (value === '') {
           callback(new Error('请填写正确的企业名称'))
           this.spaceNameChecked = false
+          this.isSpaceNameValid = false
         } else {
           if (this.enterprise.spaceName !== '') {
             if (value.length > 20) {
               callback(new Error('输入长度过长,20个字符以内'))
             } else {
-              this.$http.get(`/api/userspace/checkSpaceName`, {params: {spaceName: this.enterprise.spaceName}})
+              this.$http.get(`/api/userspace/name/valid`, {params: {spaceName: this.enterprise.spaceName}})
                 .then(response => {
-                  if (response.data.success) {
+                  if (!response.data.content.isValid) {
                     this.spaceNameChecked = true
-                    this.isSpaceNameExist = false
+                    this.isSpaceNameValid = false
                   } else {
                     this.spaceNameChecked = false
-                    this.isSpaceNameExist = true
+                    this.isSpaceNameValid = true
                     return Promise.reject(response.data)
                   }
                 }).catch(err => {
-                  console.log(err)
-//                  this.$message.error(err.errMsg)
+//                  console.log(err)
+                  this.$message.error(err.errMsg)
                 })
             }
           }
@@ -133,24 +191,25 @@
         if (value === '') {
           callback(new Error('请填写正确的营业执照号'))
           this.businessCodeChecked = false
+          this.isBusinessCodeValid = false
         } else {
           if (this.enterprise.businessCode !== '') {
             if (value.length > 20) {
               callback(new Error('输入长度过长,20个字符以内'))
             } else {
-              this.$http.get(`/api/userspace/checkBusinessCode`, {params: {businessCode: this.enterprise.businessCode}})
+              this.$http.get(`/api/userspace/businessCode/valid`, {params: {businessCode: this.enterprise.businessCode}})
                 .then(response => {
-                  if (response.data.success) {
+                  if (!response.data.content.isValid) {
                     this.businessCodeChecked = true
-                    this.isBusinessCodeExist = false
+                    this.isBusinessCodeValid = false
                   } else {
                     this.businessCodeChecked = false
-                    this.isBusinessCodeExist = true
+                    this.isBusinessCodeValid = true
                     return Promise.reject(response.data)
                   }
                 }).catch(err => {
-                  console.log(err)
-//                  this.$message.error(err.errMsg)
+//                  console.log(err)
+                  this.$message.error(err.errMsg)
                 })
             }
           }
@@ -172,15 +231,6 @@
           callback()
         }
       }
-      var validateRegAddress = (rule, value, callback) => {
-        if (value === '') {
-          callback(new Error('请填写正确的注册地址'))
-          this.corporationChecked = false
-        } else {
-          this.corporationChecked = true
-          callback()
-        }
-      }
       return {
         enterpriseRegister: true,
         enterprise: {
@@ -188,18 +238,30 @@
           businessCode: '',
           corporation: '',
           regAddress: '',
-          province: '',
-          city: '',
-          district: '',
-          street: '',
-          businessImage: ''
+          businessCodeImage: ''
         },
         checked: true,
-        isSpaceNameExist: false,
-        isBusinessCodeExist: false,
+        showAddressBox: false,
+        isShowAddressBox: false,
+        isSpaceNameValid: false,
+        isBusinessCodeValid: false,
         spaceNameChecked: false,
         businessCodeChecked: false,
         corporationChecked: false,
+        uploadFileChecked: false,
+        addressCheck: false,
+        allCityData: {},
+        cityData: {
+          province: [],
+          city: [],
+          district: []
+        },
+        address: {
+          regProvince: '',
+          regCity: '',
+          regDistrict: '',
+          regStreet: ''
+        },
 //        企业认证第一步
         rules: {
           spaceName: [
@@ -210,9 +272,6 @@
           ],
           corporation: [
             {validator: validateCorporation, trigger: 'blur'}
-          ],
-          regAddress: [
-            {validator: validateRegAddress, trigger: 'blur'}
           ]
         }
       }
@@ -223,6 +282,7 @@
       }
     },
     mounted () {
+//      验证是否登录
       this.$nextTick(() => {
         this.isLogin()
         // 刷新统计信息
@@ -230,6 +290,13 @@
           this.isLogin()
         }, 10000)
       })
+//      获取城市地址
+      this.$http.get('/data/city.json').then(response => {
+        this.allCityData = response.data
+        for (let province in response.data) {
+          this.cityData.province.push(province)
+        }
+      })
     },
     methods: {
 //      我同意是否被选中
@@ -239,17 +306,116 @@
 //      判断用户是否登录
       isLogin () {
         if (!this.logged) {
-          console.log(this.logged)
+//          console.log(this.logged)
 //          未登录跳到登录页面
 //          window.location.href = '/'
         }
+      },
+//      上传营业执照扫描件
+      upload (e) {
+        let file = e.target.files[0]
+        if (file.size > 5 * 1024 * 1024) {
+          this.uploadFileChecked = false
+        } else {
+          let param = new FormData()
+          param.append('image', file, file.name)
+          let config = {
+            headers: {'Content-Type': 'multipart/form-data'}
+          }
+//          图片上传接口
+          this.$http.post('/api/userspace/upload', param, config)
+            .then(response => {
+              this.enterprise.businessCodeImage = response.data.content
+              this.uploadFileChecked = true
+            }, err => {
+              console.log(err)
+              this.uploadFileChecked = false
+            })
+        }
+      },
+//      地址选择
+      onHideAddress () {
+//        if (!this.isShowAddressBox && !this.isClickInputAddress) {
+//          this.showAddressBox = false
+//        }
+//        this.isClickInputAddress = false
+      },
+      onShowAddress () {
+        this.showAddressBox = !this.showAddressBox
+//        if (this.showAddressBox) {
+//          this.onHideAddress()
+//        } else {
+//          this.showAddressBox = true
+//          this.isClickInputAddress = true
+//        }
+      },
+      getCity (province) {
+        this.cityData.city = []
+        this.address.regCity = ''
+        this.cityData.district = []
+        this.address.regDistrict = ''
+        this.address.regProvince = province
+        for (let item in this.allCityData[province]) {
+          this.cityData.city.push(item)
+        }
+      },
+      getDistrict (city) {
+        this.address.regCity = city
+        this.address.regDistrict = ''
+        this.cityData.district = this.allCityData[this.address.regProvince][city]
+      },
+      chooseDistrict (district) {
+        this.address.regDistrict = district
+      },
+      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
+          } else {
+            this.$message.error('请输入详细地址')
+            this.addressCheck = false
+          }
+        } else {
+          this.$message.error('请输入省、市、区')
+          this.addressCheck = false
+        }
+      },
+//      提交表单
+      submitForm () {
+        if (this.checked && this.spaceNameChecked && this.businessCodeChecked && this.corporationChecked && this.uploadFileChecked && this.addressCheck) {
+          let param = new FormData()
+          param.append('spaceName', this.enterprise.spaceName)
+          param.append('businessCode', this.enterprise.businessCode)
+          param.append('corporation', this.enterprise.corporation)
+          param.append('regAddress', this.enterprise.regAddress)
+          param.append('regProvince', this.address.regProvince)
+          param.append('regCity', this.address.regCity)
+          param.append('regDistrict', this.address.regDistrict)
+          param.append('regStreet', this.address.regStreet)
+          param.append('businessCodeImage', this.enterprise.businessCodeImage)
+          let config = {
+            headers: {'Content-Type': 'multipart/form-data'}
+          }
+          this.$http.post('/valid/userspace/submit', param, config)
+            .then(response => {
+              if (response.data.success) {
+                this.enterpriseRegister = false
+              } else {
+                this.enterpriseRegister = true
+                return Promise.reject(response.data)
+              }
+            }).catch(err => {
+              this.$message.error(err.errMsg)
+            })
+        }
       }
     }
   }
 </script>
 <style lang="scss" scoped>
   .certification {
-    padding-bottom: 145px;
     margin: 0 auto;
     width: 100%;
     background: #eee;

+ 0 - 1
components/certification/RealNameCertification.vue

@@ -82,7 +82,6 @@
 </script>
 <style lang="scss" scoped>
   .certification {
-    padding-bottom: 145px;
     margin: 0 auto;
     width: 100%;
     background: #eee;

+ 0 - 1
components/change/ChangeManager.vue

@@ -141,7 +141,6 @@
 </script>
 <style lang="scss" scoped>
   .validation {
-    padding-bottom: 145px;
     margin: 0 auto;
     width: 100%;
     background: #eee;

+ 2 - 1
components/default/CommonFooter.vue

@@ -27,7 +27,8 @@
 </script>
 <style lang="scss" scoped>
 .navbar{
-  padding: 30px 0;
+  padding: 50px 0;
+  margin-bottom: 0;
   background: #eee;
   .container{
     position: relative;

+ 0 - 1
components/encrypted-setting/EncryptedSetting.vue

@@ -113,7 +113,6 @@
 </script>
 <style lang="scss" scoped>
   .encrypted {
-    padding-bottom: 145px;
     margin: 0 auto;
     width: 100%;
     background: #eee;

+ 1 - 1
components/login/Footer.vue

@@ -27,7 +27,7 @@
 </script>
 <style lang="scss" scoped>
 .navbar{
-  padding: 30px 0;
+  padding: 50px 0;
   .container{
     position: relative;
     width: 990px!important;

+ 1 - 2
components/register/EnterpriseRegistration.vue

@@ -70,7 +70,7 @@
                         auto-complete="off"
                         placeholder="密码确认"
                         v-bind:class="{ correct: this.passwordChecked }"></el-input>
-              <span class="sure" v-if="isHasRegister" v-show="phoneIsRegisterTip">手机号已注册过优软云,请输入原密码</span>
+              <span class="sure" v-if="isHasRegister" v-show="phoneIsRegisterTip">手机号已注册,请输入原密码 <a>忘记密码?</a></span>
             </el-form-item>
             <el-form-item prop="confirm" v-if="!isHasRegister">
               <el-input type="password"
@@ -581,7 +581,6 @@
 </script>
 <style lang="scss" scoped>
   .register {
-    padding-bottom: 145px;
     margin: 0 auto;
     width: 100%;
     background: #eee;

+ 8 - 4
components/register/PersonalRegistration.vue

@@ -35,7 +35,7 @@
                          @click="getCheckCode"
                          :disabled="this.checkMobile">获取验证码</el-button>
               <el-button type="primary"  v-show="!sendPersonalCode" class="code code-send">已发送({{personal_time}}s)</el-button>
-              <!--<span v-show="codeErrorChecked" class="codeError-tip">验证码输入错误</span>-->
+              <span v-show="codeErrorChecked" class="codeError-tip">{{codeErrorMsg}}</span>
             </el-form-item>
             <el-form-item>
               <!--<el-button type="primary" @click="submitForm('item')" :disabled="!this.item.vipName || !this.item.password || !this.item.confirm  || !this.item.code || !this.checked" class="finish">完成注册</el-button>-->
@@ -211,7 +211,9 @@
                     return Promise.reject(response.data)
                   }
                 }).catch(err => {
-                  this.$message.error(err.errMsg)
+                  this.codeErrorMsg = err.errMsg
+//                  console.log(err)
+//                  this.$message.error(err.errMsg)
                 })
             }
           } else {}
@@ -242,6 +244,7 @@
         token: '',
         mobileRegister: false,
         sendPersonalCode: true,
+        codeErrorMsg: '',
         personal_time: 0,
         rules2: {
           vipName: [
@@ -338,7 +341,6 @@
 </script>
 <style lang="scss" scoped>
   .register {
-    padding-bottom: 145px;
     margin: 0 auto;
     width: 100%;
     background: #eee;
@@ -463,7 +465,9 @@
             span.codeError-tip{
               position: absolute;
               top: 3px;
-              right: -105px;
+              left: 378px;
+              width: 200px;
+              text-align: left;
               color: #ff4949;
               font-size: 12px;
             }

+ 0 - 1
components/reset/ResetPassword.vue

@@ -166,7 +166,6 @@
 </script>
 <style lang="scss" scoped>
   .validation {
-    padding-bottom: 145px;
     margin: 0 auto;
     width: 100%;
     background: #eee;

+ 0 - 1
components/validation/EmailValidation.vue

@@ -128,7 +128,6 @@
 </script>
 <style lang="scss" scoped>
   .validation {
-    padding-bottom: 145px;
     margin: 0 auto;
     width: 100%;
     background: #eee;

+ 0 - 1
components/validation/PhoneValidation.vue

@@ -134,7 +134,6 @@
 </script>
 <style lang="scss" scoped>
   .validation {
-    padding-bottom: 145px;
     margin: 0 auto;
     width: 100%;
     background: #eee;

+ 1 - 1
nuxt.config.js

@@ -98,5 +98,5 @@ module.exports = {
     ssr: true
   }],
   /* TODO 暂时代理到商城测试版,之后再做出调整 */
-  proxyTable: ['/api/**', '/login/**', '/user**', '/logout**', '/sso/**', '/appeal/**', '/update/user/**']
+  proxyTable: ['/api/**', '/login/**', '/user**', '/logout**', '/sso/**', '/appeal/**', '/update/user/**', '/valid/**']
 }

File diff suppressed because it is too large
+ 0 - 0
static/data/city.json


+ 1 - 1
store/index.js

@@ -28,7 +28,7 @@ export const actions = {
     commit('option/REQUEST_IS_LOGIN')
     return axios.get('/sso/login/isLogin')
     .then(response => {
-      console.log(JSON.stringify(response.data))
+      // console.log(JSON.stringify(response.data.content))
       commit('option/REQUEST_IS_LOGIN_SUCCESS', response.data.data)
     }, err => {
       commit('option/REQUEST_IS_LOGIN_FAILURE', err)

Some files were not shown because too many files changed in this diff