ソースを参照

个人注册与开店流程处理

yangc 8 年 前
コミット
79f567d178

+ 1 - 1
assets/scss/common.scss

@@ -612,7 +612,7 @@ div.el-tree-node__content{
   z-index: 10;
 }
 .select-adder {
-  background:url("/images/all/xiala.png") right no-repeat #fff !important;
+  background:url("../../static/images/all/xiala.png") right no-repeat #fff !important;
   background-position-x: 100% !important;
 }
 .componentDetail .el-dialog--tiny{

+ 2 - 2
assets/scss/help.css

@@ -47,7 +47,7 @@
   padding-left: 15px;
   text-decoration: none;
   color: #333;
-  background:url("/images/help/openblack.png") no-repeat left;
+  background:url("../../static/images/help/openblack.png") no-repeat left;
 }
 
 .help-list li a:hover{
@@ -84,7 +84,7 @@
 .help-list ul.list-body li a.cur,.help-list ul li a.cur{
   text-decoration: none;
   font-size: 14px;
-  background:url("/images/help/openblackR.png") no-repeat left;
+  background:url("../../static/images/help/openblackR.png") no-repeat left;
 }
 
 /*

+ 9 - 1
components/common/upload/upload.vue

@@ -21,7 +21,7 @@
 </template>
 <script>
   export default {
-    props: ['typeData'],
+    props: ['typeData', 'url'],
     data () {
       return {
         qualifications: {
@@ -32,6 +32,13 @@
         isPdf: false
       }
     },
+    watch: {
+      url: function (val, oldVal) {
+        if (val && val !== '') {
+          this.qualifications.url = val
+        }
+      }
+    },
     methods: {
       update (e) {
         let file = e.target.files[0]
@@ -74,6 +81,7 @@
       },
       deleteImg () {
         this.qualifications.url = ''
+        this.qualifications.type = this.typeData
         this.$emit('uploadAction', this.qualifications)
       }
     }

+ 18 - 6
components/default/Header.vue

@@ -16,7 +16,7 @@
               </div>
               <ul class="dropdown-menu">
                 <li class="menu-item-first">
-                  <span>{{ enterprise.enName }}</span>
+                  <span><i class="fa fa-map-marker"></i>&nbsp;{{ enterprise.enName }}</span>
                   <a class="pull-right" @click="toggleEnterprises()" v-if="user.data.enterprises && user.data.enterprises.length > 1">
                     {{ showEnterprises ? '取消' : '切换' }}
                   </a>
@@ -27,7 +27,7 @@
                   <a @click="switchEnterprise(en)">{{ en.enName }}</a>
                 </li>
                 <li class="menu-item"  v-if="showEnterprises">
-                  <a @click="switchEnterprise({uu: 0})">(<span v-text="user.data.userName"></span>)个人</a>
+                  <a @click="switchEnterprise({uu: 0})">(<span v-text="user.data.userName"></span>)个人账户</a>
                 </li>
               </ul>
             </div>
@@ -66,9 +66,9 @@
       enterprise () {
         let ens = this.user.data.enterprises
         if (ens && ens.length) {
-          return ens.find(item => item.current) || {enName: '(' + this.user.data.userName + ')' + '个人'}
+          return ens.find(item => item.current) || {enName: '(' + this.user.data.userName + ')' + '个人账户'}
         } else {
-          return {enName: '(' + this.user.data.userName + ')' + '个人'}
+          return {enName: '(' + this.user.data.userName + ')' + '个人账户'}
         }
       },
       url () {
@@ -104,16 +104,24 @@
         this.toggleEnterprises()
         this.$http.get(`/user/authentication/${en.uu}`).then(() => {
           this.$store.dispatch('loadUserInfo')
-          window.location.reload()
+          let href = window.location.href
+          let hrefPath = href.slice(href.length - 14, href.length)
+          if (hrefPath === 'register-saler' && en.uu !== 0 && en.isVendor === 313) {
+            window.location.href = '/vendor#/index'
+          } else {
+            window.location.reload()
+          }
         })
       },
       toVendor: function () {
         let isSelf = true
+        let tempEnterprise = {}
         let ens = this.user.data.enterprises
         if (ens && ens.length) {
           ens.forEach(function (item) {
             if (item.current) {
               isSelf = false
+              tempEnterprise = item
             }
           })
         } else {
@@ -122,7 +130,11 @@
         if (isSelf) {
           window.location.href = '/register-saler'
         } else {
-          window.location.href = '/vendor#/index'
+          if (tempEnterprise.isVendor === 313) {
+            window.location.href = '/vendor#/index'
+          } else {
+            window.location.href = '/register-saler'
+          }
         }
       }
     },

+ 101 - 9
components/register-saler/Register.vue

@@ -2,15 +2,33 @@
   <div>
     <div class="step-menu">
       <ul>
-        <li :class="section == 1?'active':''"  @click="sectionChange(1)">第一步:完善企业信息</li>
-        <li :class="section == 2?'active':''"  @click="sectionChange(2)">第二步:阅读相关条例</li>
-        <li :class="section == 3?'active':''"  @click="sectionChange(3)">第三步:提交申请</li>
+        <li :class="section == 1?'active':''" >第一步:完善企业信息</li>
+        <li :class="section == 2?'active':''" >第二步:阅读相关条例</li>
+        <li :class="section == 3?'active':''" >第三步:提交申请</li>
       </ul>
     </div>
     <div class="tab-list">
-      <step-first v-if="section == 1" @sectionEvent="sectionChange" @registerAction="onRegister"></step-first>
-      <step-second v-if="section == 2" @sectionEvent="sectionChange" :checkData="checkData"></step-second>
-      <step-third v-if="section == 3" @sectionEvent="sectionChange" :registerData="registerData" :checkData="checkData"></step-third>
+      <step-first v-show="section == 1"
+                  @sectionEvent="sectionChange"
+                  @registerAction="onRegister"
+                  :loginData="loginData"
+                  :enterpriseData="enterpriseData"
+                  :businessImgUrl="businessImgUrl"
+                  @businessImgUrlAction="onBusinessImgUrl"
+                  @isSelfCacheDataAction="onCacheData"></step-first>
+      <step-second v-show="section == 2"
+                   @sectionEvent="sectionChange"
+                   :checkData="checkData"
+                   :loginData="loginData"
+                   :cacheData="cacheData"></step-second>
+      <step-third v-show="section == 3"
+                  @sectionEvent="sectionChange"
+                  :registerData="registerData"
+                  :enterpriseData="enterpriseData"
+                  :checkData="checkData"
+                  :businessImgUrl="businessImgUrl"
+                  @businessImgUrlAction="onBusinessImgUrl"
+                  :loginData="loginData"></step-third>
     </div>
     </div>
 </template>
@@ -27,9 +45,25 @@
         },
         registerData: {
           enterprise: {},
-          isValidRegister: false,
+          c: false,
           url: ''
-        }
+        },
+        loginData: {
+          isSelf: true,
+          section: 1,
+          enterprise: {}
+        },
+        cacheData: {
+          enName: '',
+          enShortName: '',
+          enBussinessCode: '',
+          enAddress: '',
+          enUrl: '',
+          enIsRead: false,
+          enBussinessCodeImage: ''
+        },
+        enterpriseData: {},
+        businessImgUrl: ''
       }
     },
     components: {
@@ -37,14 +71,72 @@
       StepSecond,
       StepThird
     },
+    computed: {
+      user () {
+        return this.$store.state.option.user
+      }
+    },
+    created () {
+      let ens = this.user.data.enterprises
+      let isSelf = true
+      let tempEnterprise = {}
+      if (ens && ens.length) {
+        ens.forEach(function (item) {
+          if (item.current) {
+            isSelf = false
+            tempEnterprise = item
+          }
+        })
+      } else {
+        isSelf = true
+      }
+      if (!isSelf) {
+        this.$http.get('/basic/enterprise/' + tempEnterprise.uu + '/info')
+          .then(response => {
+            this.enterpriseData = response.data
+          })
+        if (tempEnterprise.isVendor === 1690) { // 是企业
+          this.section = 3
+          this.checkData.checked = true
+        } else if (typeof tempEnterprise.isVendor === 'undefined' || tempEnterprise.isVendor === '') {
+          this.section = 2
+          this.checkData.checked = false
+        }
+      } else { // 是个人
+        this.$http.get('/basic/user/userCacheEnterprise')
+          .then(response => {
+            if (!response.data) {
+              this.section = 1
+              this.checkData.checked = false
+            } else if (!response.data.enIsRead) {
+              this.section = 2
+              this.checkData.checked = false
+              this.enterpriseData = response.data
+            } else if (response.data.enIsRead) {
+              this.section = 3
+              this.checkData.checked = true
+              this.enterpriseData = response.data
+            }
+          })
+      }
+      this.loginData.isSelf = isSelf
+      this.loginData.section = this.section
+      this.loginData.enterprise = tempEnterprise
+    },
     methods: {
       sectionChange: function (num) {
         this.section = num
       },
       onRegister: function (data) {
-        this.registerData.isValidRegister = data.isValid
+        this.registerData.isValidRegister = data.isValidRegister
         this.registerData.enterprise = data.enterprise
         this.registerData.url = data.url
+      },
+      onCacheData: function (cache) {
+        this.cacheData = cache
+      },
+      onBusinessImgUrl: function (url) {
+        this.businessImgUrl = url
       }
     }
   }

+ 258 - 25
components/register-saler/register/StepFirst.vue

@@ -1,6 +1,6 @@
 <template>
   <!--填写注册信息-->
-  <div class="section">
+  <div class="section" @click="onHideAddress">
     <div class="register">
       <div class="x-form-set-header">
         <h4>企业注册信息</h4>
@@ -8,7 +8,7 @@
       <div class="row">
         <label class="col-sm-2 x-required">企业名称:</label>
         <div class="col-sm-5">
-          <input type="text" @change="nameCheck" v-model="data.name" class="form-control" name="name" required="" placeholder="填写营业执照上的企业名称">
+          <input type="text" @change="nameCheck" :disabled="!loginData.isSelf" v-model="data.name" class="form-control" name="name" required="" placeholder="填写营业执照上的企业名称">
         </div>
         <div class="col-sm-5" v-show="!validName.isValidTypeName && !validName.init">
           <p>
@@ -24,7 +24,7 @@
       <div class="row">
         <label class="col-sm-2 x-required">企业简称:</label>
         <div class="col-sm-5">
-          <input type="text" @change="simpleNameCheck" v-model="data.simpleName" class="form-control" name="name" required="" placeholder="请填写正确的企业名称,2~40个字符">
+          <input type="text" :disabled="!loginData.isSelf" @change="simpleNameCheck" v-model="data.simpleName" class="form-control" name="name" required="" placeholder="请填写正确的企业名称,2~40个字符">
         </div>
         <div class="col-sm-5" v-show="!validSimpleName.isValidSimpleName && !validSimpleName.init">
           <p>
@@ -35,7 +35,7 @@
       <div class="row">
         <label class="col-sm-2 x-required">营业执照:</label>
         <div class="col-sm-5">
-          <a class="x-btn-blank">
+          <a class="x-btn-blank" v-if="loginData.isSelf">
             <i class="fa fa-picture-o"></i>
             请上传营业执照扫描件(≤5M的图片或PDF)
             <input type="file" @change="upload" class="form-control file-input" name="name" required="" placeholder="请上传营业执照扫描件(≤5M的图片或PDF)" accept="image/jpeg,image/jpg,image/gif,image/bmp,image/png,.pdf">
@@ -47,27 +47,68 @@
       <div class="row">
         <label class="col-sm-2 x-required">营业执照号:</label>
         <div class="col-sm-5">
-          <input type="text" @change="licenceCheck" v-model="data.licenceId" class="form-control" name="name" required="" placeholder="请填写营业执照上的注册号">
+          <input type="text" :disabled="!loginData.isSelf" @change="licenceCheck" v-model="data.licenceId" class="form-control" name="name" required="" placeholder="请填写营业执照上的注册号">
         </div>
         <div class="col-sm-5" v-show="!validLicence.isValidLicence && !validLicence.init"><p><i class="fa fa-info-circle"></i>请填写营业执照上的注册号</p></div>
       </div>
       <div class="row">
-        <label class="col-sm-2">企业地址:</label>
+        <label class="col-sm-2 x-required">企业地址:</label>
         <div class="col-sm-5">
-          <input type="text" @change="addressCheck" v-model="data.address" class="form-control" name="name" required="" placeholder="填写总部所在地详细地址" style="padding-left:20px;">
+          <input type="text" readonly aria-haspopup="true" aria-expanded="false" @focus="onShowAddress" :style="!loginData.isSelf?'background-color: #eee;':''" :disabled="!loginData.isSelf" v-model="data.address" class="form-control" name="name" required="" placeholder="填写总部所在地详细地址" style="padding-left:20px;background-color: transparent;">
           <span class="fa fa-map-marker"></span>
+          <div v-show="showAddressBox"
+               @mouseenter="isInAddressBox = true"
+               @mouseleave="isInAddressBox = false"
+               style="display: block; left: 14px;" 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.currentProvince ? 'active' : ''"
+                    v-text="province"
+                    @click="getCity(province)"></li>
+              </ul>
+              <ul class="list-unstyled">
+                <li v-for="city in cityData.city"
+                    :class="city == address.currentCity ? '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.currentDistrict ? '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.detail" 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>
         </div>
         <div class="col-sm-5" v-show="!validAddress.isValidAddress && !validAddress.init"><p><i class="fa fa-info-circle"></i>填写总部所在地详细地址</p></div>
       </div>
       <div class="row">
         <label class="col-sm-2">官网地址:</label>
         <div class="col-sm-5">
-          <input type="url" @change="websiteCheck" v-model="data.website" class="form-control" name="name" required="" placeholder="www.example.com" style="padding-left:55px;">
+          <input type="url" :disabled="!loginData.isSelf" @change="websiteCheck" v-model="data.website" class="form-control" name="name" required="" placeholder="www.example.com" style="padding-left:55px;">
           <span class="web">http://</span>
         </div>
         <div class="col-sm-5"></div>
       </div>
-      <div class="row next-btn"><button class="btn" @click="sectionChange(2)">下一步</button></div>
+      <div class="row next-btn"><button class="btn" :style="loginData.isSelf && !isValid ? 'opacity: .65;':''" @click="sectionChange(2)">下一步</button></div>
     </div>
   </div>
 </template>
@@ -105,24 +146,85 @@
           init: true
         },
         isValid: false,
-        isPdf: false
+        isPdf: false,
+        showAddressBox: false,
+        isInAddressBox: false,
+        temCityData: {},
+        cityData: {
+          province: [],
+          city: [],
+          district: []
+        },
+        address: {
+          currentProvince: '',
+          currentCity: '',
+          currentDistrict: '',
+          detail: ''
+        }
       }
     },
+    props: ['loginData', 'enterpriseData', 'businessImgUrl'],
+    watch: {
+      enterpriseData: function (val, oldVal) {
+        if (val !== {}) {
+          this.data.name = val.enName || ''
+          this.data.simpleName = val.enShortname || ''
+          this.data.licenceId = val.enBussinessCode || ''
+          this.data.address = val.enAddress || ''
+          this.data.website = val.enUrl || ''
+          this.data.url = val.enBussinessCodeImage || ''
+          if (this.loginData.isSelf) {
+            this.nameCheck()
+            this.simpleNameCheck()
+            this.licenceCheck()
+            this.addressCheck()
+            this.websiteCheck()
+            this.imgUrlCheck()
+            this.checkFullData()
+            this.submitRegisterData()
+          }
+        }
+      },
+      businessImgUrl: function (val, oldVal) {
+        this.data.url = val
+        this.checkFullData()
+        this.submitRegisterData()
+      }
+    },
+    mounted () {
+      this.$http.get('/data/city.json').then(response => {
+        this.temCityData = response.data
+        for (let province in response.data) {
+          this.cityData.province.push(province)
+        }
+      })
+    },
     methods: {
       sectionChange: function (type) {
-        let enterprise = {
-          enName: this.data.name,
-          enShortName: this.data.simpleName,
-          enBussinessCode: this.data.licenceId,
-          enAddress: this.data.address,
-          enUrl: this.data.website
+        if (this.loginData.isSelf && !this.isValid) {
+          this.$message.error('请填写正确的注册信息')
+        } else {
+          this.checkFullData()
+          let enterprise = {
+            enName: this.data.name,
+            enShortName: this.data.simpleName,
+            enBussinessCode: this.data.licenceId,
+            enAddress: this.data.address,
+            enUrl: this.data.website
+          }
+          let data = {}
+          data.enterprise = enterprise
+          data.isValidRegister = this.isValid
+          data.url = this.data.url
+          enterprise.enIsRead = false
+          enterprise.enBussinessCodeImage = this.data.url
+          if (this.loginData.isSelf) {
+            this.$http.post('/basic/user/userCacheEnterprise', enterprise)
+            this.$emit('isSelfCacheDataAction', enterprise)
+          }
+          this.$emit('registerAction', data)
+          this.$emit('sectionEvent', type)
         }
-        let data = {}
-        data.enterprise = enterprise
-        data.isValid = this.isValid
-        data.url = this.data.url
-        this.$emit('registerAction', data)
-        this.$emit('sectionEvent', type)
       },
       upload: function (e) {
         let file = e.target.files[0]
@@ -142,6 +244,7 @@
             this.$http.post('/api/images', param, config)
               .then(response => {
                 this.data.url = response.data[0].path
+                this.$emit('businessImgUrlAction', this.data.url)
               }, err => {
                 console.log(err)
                 this.validUpload.isValidUpload = false
@@ -156,6 +259,7 @@
               .then(response => {
                 this.isPdf = true
                 this.data.url = response.data[0].path
+                this.$emit('businessImgUrlAction', this.data.url)
               }, err => {
                 console.log(err)
                 this.validUpload.isValidUpload = false
@@ -169,7 +273,16 @@
           this.validUpload.isValidUpload && !this.validUpload.init &&
           this.validName.isValidTypeName && !this.validName.init && this.validName.isValidName &&
           this.validLicence.isValidLicence && !this.validLicence.init &&
-          this.validSimpleName.isValidSimpleName && !this.validSimpleName.init
+          this.validSimpleName.isValidSimpleName && !this.validSimpleName.init &&
+            this.validAddress.isValidAddress && !this.validAddress.init
+      },
+      checkFullData: function () {
+        this.isValid =
+          this.validUpload.isValidUpload &&
+          this.validName.isValidTypeName && this.validName.isValidName &&
+          this.validLicence.isValidLicence &&
+          this.validSimpleName.isValidSimpleName &&
+          this.validAddress.isValidAddress
       },
       nameCheck: function () {
         this.validName.init = false
@@ -185,22 +298,75 @@
         this.validSimpleName.isValidSimpleName = this.data.simpleName !== '' && this.data.simpleName.length >= 2 && this.data.simpleName.length <= 40 && this.commonValid(this.data.simpleName)
         this.validCheck()
       },
+      imgUrlCheck: function () {
+        this.validUpload.init = false
+        this.validUpload.isValidUpload = this.data.url !== ''
+      },
       licenceCheck: function () {
         this.validLicence.init = false
         this.$http.post('/basic/enterprise/register/valid/businessCode?businessCode=' + this.data.licenceId)
           .then(response => {
-            this.validLicence.isValidLicence = response.data.success
+            this.validLicence.isValidLicence = response.data.success && this.data.licenceId
           })
         this.validCheck()
       },
       addressCheck: function () {
-        //
+        this.validAddress.init = false
+        this.validAddress.isValidAddress = this.data.address !== ''
+        this.validCheck()
       },
       websiteCheck: function () {
      // (/^([\w-]+\.)+[\w-]+(/[\w-./?%&=])?$/).test(this.messageBoard.userTel)
       },
       commonValid: function (str) {
         return str.indexOf(' ') === -1
+      },
+      submitRegisterData: function () {
+        let enterprise = {
+          enName: this.data.name,
+          enShortName: this.data.simpleName,
+          enBussinessCode: this.data.licenceId,
+          enAddress: this.data.address,
+          enUrl: this.data.website
+        }
+        let data = {}
+        data.enterprise = enterprise
+        data.isValidRegister = this.isValid
+        data.url = this.data.url
+        this.$emit('registerAction', data)
+      },
+      onShowAddress: function () {
+        this.showAddressBox = true
+        this.isClickInputAddress = true
+      },
+      onHideAddress: function () {
+        if (!this.isInAddressBox && !this.isClickInputAddress) {
+          this.showAddressBox = false
+        }
+        this.isClickInputAddress = false
+      },
+      getCity: function (province) {
+        this.cityData.city = []
+        this.address.currentProvince = province
+        for (let item in this.temCityData[province]) {
+          this.cityData.city.push(item)
+        }
+      },
+      getDistrict: function (city) {
+        this.address.currentCity = city
+        this.cityData.district = this.temCityData[this.address.currentProvince][city]
+      },
+      chooseDistrict: function (district) {
+        this.address.currentDistrict = district
+      },
+      submitAddress: function () {
+        if (this.address.detail !== '') {
+          this.data.address = this.address.currentProvince + this.address.currentCity + this.address.currentDistrict + this.address.detail
+          this.showAddressBox = false
+          this.addressCheck()
+        } else {
+          this.$message.error('请输入详细地址')
+        }
       }
     }
   }
@@ -215,4 +381,71 @@
     max-width: 200px;
     margin-top: 5px;
   }
+  .x-union-menu {
+    width: 600px
+  }
+  .x-union-header>div{
+    background: #f5f8fa;
+    font-weight: 700;
+    border-bottom: 1px solid #e4ecf3;
+  }
+  .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-menu .x-item-ext {
+    float: left;
+    width: 235px;
+  }
+  .x-union-list .x-item-ext {
+    padding: 10px
+  }
+  .x-union-header>div:last-child {
+    border-right-width: 0
+  }
+  .x-union-header>div,.x-union-list>ul>li {
+    padding: 2px 10px;
+    cursor: pointer;
+  }
+  .x-union-list>ul>li:hover,.x-union-list>ul>li.active {
+    background: #fee9c7;
+  }
+  .x-input {
+    border-color: #ccc;
+    border-radius: 0;
+    box-shadow: none;
+  }
+  textarea.form-control {
+    height: auto;
+  }
+  .text-right {
+    text-align: right;
+  }
+  .register-btn {
+    padding: 5px 10px;
+    font-size: 12px;
+    line-height: 1.5;
+  }
+  .btn-submit {
+    background: #5078cb;
+    color: #fff;
+  }
+  .btn-console {
+    border: 1px solid #ccc;
+    background: #fff;
+    color: #888;
+    margin-left: 5px;
+    transition: all .2s ease-in-out;
+  }
+  .btn-console:hover {
+    border: 1px solid #adadad;
+    background: #e6e6e6;
+    color: #333;
+  }
 </style>

+ 22 - 5
components/register-saler/register/StepSecond.vue

@@ -21,23 +21,40 @@
     <div class="row" style="margin-left: 30px; text-align: center;">
       <label class="checkbox-inline">
         <input type="checkbox" id="agree" name="agree" value="1" :checked="checkData.checked" @click="checkData.checked = !checkData.checked" >
-        我已阅读并同意<a href="" target="_blank">
-        《优软商城服务条款》</a>、<a href="" target="_blank">
+        我已阅读并同意<a href="http://www.usoftmall.com/help#/issue/50" target="_blank">
+        《优软商城服务条款》</a>、<a href="http://www.usoftmall.com/help#/issue/16" target="_blank">
         《优软商城买卖条例》</a>
       </label>
     </div>
     <div class="row next-btn" style="margin-top: 20px">
       <button @click="sectionChange(1)" class="btn">上一步</button>
-      <button @click="sectionChange(3)" class="btn">下一步</button>
+      <button @click="sectionChange(3)" class="btn" :style="!checkData.checked ? 'opacity: .65;':''">下一步</button>
     </div>
   </div>
 </template>
 <script>
   export default {
-    props: ['checkData'],
+    props: ['checkData', 'loginData', 'cacheData'],
     methods: {
       sectionChange: function (type) {
-        this.$emit('sectionEvent', type)
+        if (type === 3) {
+          if (this.checkData.checked) {
+            if (this.loginData.isSelf) {
+              this.cacheData.enIsRead = this.checkData.checked
+              this.$http.post('/basic/user/userCacheEnterprise', this.cacheData)
+            } else {
+              this.$http.post('/basic/enterprise/openVendorSetRead/' + this.loginData.enterprise.uu)
+                .then(() => {
+                  this.$store.dispatch('loadUserInfo')
+                })
+            }
+            this.$emit('sectionEvent', type)
+          } else {
+            this.$message.error('请阅读并勾选服务条款')
+          }
+        } else {
+          this.$emit('sectionEvent', type)
+        }
       }
     }
   }

+ 113 - 29
components/register-saler/register/StepThird.vue

@@ -29,7 +29,7 @@
                 <div class="col-md-4 custom_col">
                   <div class="row" style="margin: 0;">
                     <div class="col-md-5 col-md-offset-1 show_image_area show_image">
-                      <upload :typeData="'BUSINESS_LICENSE'" @uploadAction="onUpload"></upload>
+                      <upload :typeData="'BUSINESS_LICENSE'" :url="businessLicenseUrl" @uploadAction="onUpload"></upload>
                     </div>
                     <div class="col-md-5" style="padding: 0;">
                       <span style="margin-top: 50%;padding-right: 20px;">营业执照<em style="color: #FF0000;">*</em></span>
@@ -64,8 +64,7 @@
                 <div class="col-md-7">
                   <input type="text" v-model="brand.name"
                          @input="onBrandInput(brand, index)"
-                         @change="onBrandChanged(brand, index)"
-                         @blur.stop.prevent="showSimilarKey.flag = showFlag"
+                         @blur.stop.prevent="onBrandChanged(brand, index)"
                          class="form-control" name="brandName"  autocomplete="off" placeholder="请输入英文品牌或中文品牌,如:松下; panasonic等"/>
                   <ul class="dropdown-menu"
                       v-show="showSimilarKey.flag && showSimilarKey.index == index"
@@ -73,8 +72,9 @@
                       @mouseleave="showFlag = false">
                     <li @mouseenter="setKeyActive"
                         @mouseleave="setKeyDefault"
+                        @click.stop.prevent="changedName(brand, index, key_index)"
                         v-for="(key, key_index) in similarKeys[index]">
-                      <a v-text="key.nameCn"  @click.stop.prevent="changedName(brand, index, key_index)">
+                      <a v-text="key.nameCn">
                         <!--<strong>C</strong>apital Advan<strong>c</strong>ed-->
                       </a>
                     </li>
@@ -103,7 +103,7 @@
                 <div class="col-md-4 custom_col">
                   <div class="row" style="margin: 0;">
                     <div class="col-md-5 col-md-offset-1 show_image_area show_image">
-                      <upload :typeData="'BUSINESS_LICENSE'" @uploadAction="onUpload"></upload>
+                      <upload :typeData="'BUSINESS_LICENSE'" :url="businessLicenseUrl" @uploadAction="onUpload"></upload>
                     </div>
                     <div class="col-md-5" style="padding: 0;">
                       <span style="margin-top: 50%;padding-right: 20px;">营业执照<em style="color: #FF0000;">*</em></span>
@@ -138,8 +138,7 @@
                 <div class="col-md-7">
                   <input type="text" v-model="brand.name"
                          @input="onBrandInput(brand, index)"
-                         @change="onBrandChanged(brand, index)"
-                         @blur.stop.prevent="showSimilarKey.flag = showFlag"
+                         @blur.stop.prevent="onBrandChanged(brand, index)"
                          class="form-control" name="brandName"  autocomplete="off" placeholder="请输入英文品牌或中文品牌,如:松下; panasonic等"/>
                   <ul class="dropdown-menu"
                       v-show="showSimilarKey.flag && showSimilarKey.index == index"
@@ -177,7 +176,7 @@
                 <div class="col-md-4 custom_col">
                   <div class="row" style="margin: 0;">
                     <div class="col-md-5 col-md-offset-1 show_image_area show_image">
-                      <upload :typeData="'BUSINESS_LICENSE'" @uploadAction="onUpload"></upload>
+                      <upload :typeData="'BUSINESS_LICENSE'" :url="businessLicenseUrl" @uploadAction="onUpload"></upload>
                     </div>
                     <div class="col-md-5" style="padding: 0;">
                       <span style="margin-top: 50%;padding-right: 20px;">营业执照<em style="color: #FF0000;">*</em></span>
@@ -269,22 +268,44 @@
         businessLicenseUrl: '',
         taxPayerUrl: '',
         taxRegistrationUrl: '',
+//        defaultBusinessUrl: '',
         showBrandNameInvalid: false,
         similarKeys: [[]],
         showSimilarKey: {
           flag: false,
           index: 0
         },
-        showFlag: false
+        showFlag: false,
+        isSelfRegisterSuccess: true
       }
     },
     props: [
       'checkData',
-      'registerData'
+      'registerData',
+      'loginData',
+      'enterpriseData',
+      'businessImgUrl'
     ],
+    watch: {
+      enterpriseData: function (val, oldVal) {
+        if (val !== {}) {
+          this.businessLicenseUrl = val.enBussinessCodeImage || ''
+//          this.defaultBusinessUrl = val.enBussinessCodeImage || ''
+        }
+      },
+      businessImgUrl: function (val, oldVal) {
+        console.log(1)
+        this.businessLicenseUrl = val
+      }
+    },
     components: {
       Upload
     },
+    computed: {
+      user () {
+        return this.$store.state.option.user
+      }
+    },
     methods: {
       sectionChange: function (type) {
         this.$emit('sectionEvent', type)
@@ -301,7 +322,9 @@
       },
       onUpload: function (obj) {
         if (obj.type === 'BUSINESS_LICENSE') {
+    //      this.businessLicenseUrl = obj.url
           this.businessLicenseUrl = obj.url
+          this.$emit('businessImgUrlAction', this.businessLicenseUrl)
         } else if (obj.type === 'TAX_PAYER') {
           this.taxPayerUrl = obj.url
         } else if (obj.type === 'TAX_REGISTRATION') {
@@ -311,7 +334,12 @@
         }
       },
       onBrandChanged: function (item, index) {
-//        this.showSimilarKey = false
+        this.showSimilarKey.flag = this.showFlag
+        if (!this.showFlag) {
+          this.onCheck(item)
+        }
+      },
+      onCheck: function (item, index) {
         this.$http.get('/api/product/brand', {params: {name: item.name, op: 'by_name'}})
           .then(response => {
             item.brandUuid = response.data.uuid
@@ -335,6 +363,7 @@
       changedName: function (brand, index, keyIndex) {
         brand.name = this.similarKeys[index][keyIndex].nameCn
         this.showSimilarKey.flag = false
+        this.onCheck(brand)
       },
       setKeyActive: function (e) {
         e.target.setAttribute('class', 'active')
@@ -343,13 +372,18 @@
         e.target.setAttribute('class', '')
       },
       submitApply: function () {
-        if (!this.registerData.isValidRegister) {
-          this.$message.error('请输入正确的注册信息')
-        } else if (!this.checkData.checked) {
-          this.$message.error('您还没有勾选相关条款')
+        if (this.loginData.isSelf) {
+          if (!this.registerData.isValidRegister) {
+            this.$message.error('请输入正确的注册信息')
+          } else if (!this.checkData.checked) {
+            this.$message.error('您还没有勾选相关条款')
+          } else {
+            this.registerSelf()
+          }
         } else {
-          let isValidRegisterSelf = this.registerSelf()
-          if (isValidRegisterSelf) {
+          if (!this.checkData.checked) {
+            this.$message.error('您还没有勾选相关条款')
+          } else {
             this.storeApply()
           }
         }
@@ -358,26 +392,29 @@
         this.$http.post('/basic/enterprise/register?filePath=' + this.registerData.url, this.registerData.enterprise)
           .then(response => {
             if (response.data.success) {
+              this.isSelfRegisterSuccess = true
+              this.$http.delete('basic/user/userCacheEnterprise')
               this.$http.get('/user/authentication/reflash')
                 .then(() => {
                   this.$http.get(`/user/authentication/` + response.data.data.enuu).then(() => {
                     this.$store.dispatch('loadUserInfo')
+                    this.loginData.isSelf = false
+                    this.storeApply(response.data.data.enuu)
                     //       window.location.reload()
                   })
                 }
               )
-              return true
             } else {
+              this.isSelfRegisterSuccess = false
               this.$message.error('个人注册失败,请重新填写信息')
-              return false
             }
           }, err => {
             console.log(err)
+            this.isSelfRegisterSuccess = false
             this.$message.error('个人注册失败,请重新填写信息')
-            return false
           })
       },
-      storeApply: function () {
+      storeApply: function (enuu) {
         let validCode = 0
         if (this.businessLicenseUrl === '') {
           this.$message.error('请上传营业执照')
@@ -418,12 +455,27 @@
             }).then(response => {
               if (response.data.success) {
                 this.$message.success('感谢您对优软商城的支持,我们会尽快对您提交的信息进行审核,预计审核时间为3个工作日,审核结果将以站内消息及邮件形式通知您!')
+                this.$http.post('/basic/enterprise/openVendor/' + enuu)
+                  .then(() => {
+                    this.$http.get('/user/authentication/reflash')
+                      .then(() => {
+                        this.$http.get(`/user/authentication/` + enuu).then(() => {
+                          this.$store.dispatch('loadUserInfo')
+                        })
+                      }
+                      )
+                  })
                 window.setTimeout(function () {
                   window.location.href = '/vendor#/store-apply/'
                 }, 1000)
               } else {
-                this.$message.error('注册失败')
+                this.$http.post('/basic/enterprise/openVendorSetRead/' + enuu)
+                this.$message.error('开通店铺失败')
               }
+            }, err => {
+              console.log(err)
+              this.$http.post('/basic/enterprise/openVendorSetRead/' + enuu)
+              this.$message.error('开通店铺失败')
             })
           } else {
             if (validCode === 1) {
@@ -451,15 +503,47 @@
       isPdf: function (url) {
         return url.substring(url.length - 4, url.length) === '.pdf'
       },
+      reflashEnterprise: function (enuu, url) {
+        this.$http.post('/basic/enterprise/openVendor/' + enuu)
+          .then(() => {
+            this.$http.get('/user/authentication/reflash')
+              .then(() => {
+                this.$http.get(`/user/authentication/` + enuu).then(() => {
+                  this.$store.dispatch('loadUserInfo')
+                  window.location.href = url
+                })
+              }
+              )
+          })
+      },
       goProduct: function () {
-        if (!this.registerData.isValidRegister) {
-          this.$message.error('请输入正确的注册信息')
-        } else if (!this.checkData.checked) {
-          this.$message.error('您还没有勾选相关条款')
+        if (this.loginData.isSelf) {
+          if (!this.registerData.isValidRegister) {
+            this.$message.error('请输入正确的注册信息')
+          } else if (!this.checkData.checked) {
+            this.$message.error('您还没有勾选相关条款')
+          } else {
+            this.$http.post('/basic/enterprise/register?filePath=' + this.registerData.url, this.registerData.enterprise)
+              .then(response => {
+                if (response.data.success) {
+                  this.isSelfRegisterSuccess = true
+                  this.$http.delete('basic/user/userCacheEnterprise')
+                  this.reflashEnterprise(response.data.data.enuu, '/vendor#/vendor_productOn')
+                } else {
+                  this.isSelfRegisterSuccess = false
+                  this.$message.error('个人注册失败,请重新填写信息')
+                }
+              }, err => {
+                console.log(err)
+                this.isSelfRegisterSuccess = false
+                this.$message.error('个人注册失败,请重新填写信息')
+              })
+          }
         } else {
-          let isValidRegisterSelf = this.registerSelf()
-          if (isValidRegisterSelf) {
-            window.location.href = '/vendor#/vendor_productOn'
+          if (!this.checkData.checked) {
+            this.$message.error('您还没有勾选相关条款')
+          } else {
+            this.reflashEnterprise(this.loginData.enterprise.uu, '/vendor#/vendor_productOn')
           }
         }
       }

+ 3 - 3
pages/register-saler/index.vue

@@ -79,8 +79,8 @@
   }
   .step-menu ul li:hover{
     cursor: pointer;
-    background: #0099ff;
-    color: #fff;
+    /*background: #0099ff;
+    color: #fff;*/
   }
   .step-menu ul li.active{
     background: #0099ff;
@@ -175,7 +175,7 @@
     float: right;
     border-radius: 3px;
   }
-  .next-btn button:hover{
+  .next-btn button:hover, .next-btn button:focus {
     background: #3765cb;
     color: #fff;
   }

ファイルの差分が大きいため隠しています
+ 0 - 0
static/data/city.json


この差分においてかなりの量のファイルが変更されているため、一部のファイルを表示していません