Browse Source

移动端开店

shenjj 7 years ago
parent
commit
6a85219c46

+ 15 - 4
components/mobile/register-saler/Register.vue

@@ -23,7 +23,12 @@
                    :checkData="checkData"
                    :loginData="loginData"
                    :cacheData="cacheData"></step-second>
-      <step-third v-show="section == 3"
+      <choose-storetype v-show="section == 3"
+                  @sectionEvent="sectionChange"
+      >
+
+      </choose-storetype>
+      <step-third v-show="section == 4"
                   @sectionEvent="sectionChange"
                   :registerData="registerData"
                   :enterpriseData="enterpriseData"
@@ -31,7 +36,7 @@
                   :businessImgUrl="businessImgUrl"
                   @businessImgUrlAction="onBusinessImgUrl"
                   :loginData="loginData"
-                  :tab="'ORIGINAL_FACTORY'"></step-third>
+                  :tab="tab"></step-third>
     </div>
     </div>
 </template>
@@ -39,9 +44,11 @@
   import StepFirst from '~components/mobile/register-saler/register/StepFirst.vue'
   import StepSecond from '~components/mobile/register-saler/register/StepSecond.vue'
   import StepThird from '~components/mobile/register-saler/register/StepThird.vue'
+  import chooseStoretype from '~components/mobile/register-saler/register/chooseStoretype.vue'
   export default {
     data () {
       return {
+        tab: 'ORIGINAL_FACTORY',
         section: 1,
         checkData: {
           checked: false
@@ -64,7 +71,8 @@
     components: {
       StepFirst,
       StepSecond,
-      StepThird
+      StepThird,
+      chooseStoretype
     },
     computed: {
       user () {
@@ -114,8 +122,11 @@
       this.loginData.enterprise = tempEnterprise
     },
     methods: {
-      sectionChange: function (num) {
+      sectionChange: function (num, tab) {
         this.section = num
+        if (tab) {
+          this.tab = tab
+        }
       },
       onRegister: function (data) {
         this.registerData.isValidRegister = data.isValidRegister

+ 42 - 38
components/mobile/register-saler/register/StepFirst.vue

@@ -9,7 +9,7 @@
       <div class="">
         <label class="col-sm-2 mobile-x-required">企业名称:</label>
         <div class="col-sm-5 mobile-x-input-kuang">
-          <input :class="!validName.isValidTypeName || !validName.isValidName?'form-control error-box-border':'form-control'" type="text" @change="nameCheck(3)" @input="nameTypeCheck()" :disabled="!loginData.isSelf" v-model="data.name" name="name" required="" placeholder="填写营业执照上的企业名称">
+          <input :class="!validName.isValidTypeName || !validName.isValidName?'form-control error-box-border':'form-control'" type="text" @input="nameTypeCheck()" :disabled="!loginData.isSelf" v-model="data.name" name="name" required="" placeholder="填写营业执照上的企业名称">
           <div class="mobile-x-text-help" v-show="validName.isValidTypeName && validName.isValidName && !validName.init">
             <i class="glyphicon glyphicon-ok x-icon-left"></i>
           </div>
@@ -266,43 +266,46 @@
         this.data.address = val.address || val.enAddress || ''
       },
       sectionChange: function (type) {
-        if (!this.isValid) {
-          if (!this.validName.isValidName) {
-            this.showBangdingPage = true
-          } else {
-            this.timeoutCount++
-            this.collectResult = '请填写正确的注册信息'
-          }
-          // this.$message.error('请填写正确的注册信息')
-        } else {
-          if (this.enterpriseData.uu) {
-            this.enCheckFullData()
+        this.nameCheck(3, () => {
+          if (!this.isValid) {
+            // this.nameCheck(3)
+            if (!this.validName.isValidName) {
+              this.showBangdingPage = true
+            } else {
+              this.timeoutCount++
+              this.collectResult = '请填写正确的注册信息'
+            }
+            // this.$message.error('请填写正确的注册信息')
           } else {
-            this.checkFullData()
-          }
-          let enterprise = this.data
-//          enterprise.tagsData = enterprise.tagsData.toString()
-//          if (typeof this.data.tagsData === 'string') {
-//            this.data.tagsData = this.data.tagsData.split(',')
-//          }
-          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)
-          } else { // 企业用户,更新当前企业信息,主要是更新企业地址
-            this.enterpriseData.enAddress = this.data.address
-            this.$http.post('/basic/enterprise/' + this.enterpriseData.uu + '/updateInfo', this.enterpriseData)
+            if (this.enterpriseData.uu) {
+              this.enCheckFullData()
+            } else {
+              this.checkFullData()
+            }
+            let enterprise = this.data
+  //          enterprise.tagsData = enterprise.tagsData.toString()
+  //          if (typeof this.data.tagsData === 'string') {
+  //            this.data.tagsData = this.data.tagsData.split(',')
+  //          }
+            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)
+            } else { // 企业用户,更新当前企业信息,主要是更新企业地址
+              this.enterpriseData.enAddress = this.data.address
+              this.$http.post('/basic/enterprise/' + this.enterpriseData.uu + '/updateInfo', this.enterpriseData)
+            }
+            this.$emit('registerAction', data)
+            this.$emit('sectionEvent', type)
+  //          this.$emit('businessImgUrlAction', this.data.url)
           }
-          this.$emit('registerAction', data)
-          this.$emit('sectionEvent', type)
-//          this.$emit('businessImgUrlAction', this.data.url)
-        }
+        })
       },
 //      upload: function (e) {
 //        let file = e.target.files[0]
@@ -399,7 +402,7 @@
         this.validName.init = false
       },
       // 企业名称是否已存在验证
-      nameCheck: function (num) {
+      nameCheck: function (num, cb) {
         if (num > 0) {
           this.$http.post('/basic/enterprise/register/valid/name?name=' + this.data.name)
             .then(response => {
@@ -407,6 +410,7 @@
                 this.validName.init = false
                 this.validName.isValidName = response.data.success
                 this.validCheck()
+                cb && cb()
               } else {
                 this.nameCheck(num - 1)
               }
@@ -717,7 +721,7 @@
   .mobile-fiexd-modal {
     .dropdown-menu{
       width: 100%;
-      top:0.98rem;
+      top: auto;
       bottom: 0.98rem;
       padding: 0;
       border-radius: 0;

+ 5 - 0
components/mobile/register-saler/register/StepThird.vue

@@ -289,10 +289,15 @@
       <h4 class="h4">库存寄售</h4>
       <p class="title">无需开店,即可发布贵司仓库里的滞销产品,优软商城代为销售,匿名清仓无压力<button class="no-apply" @click="goProduct">暂不开店,直接寄售</button></p>
     </div>-->
+    <div class="btn-area">
+      <span @click="sectionChange(3)" style="background: #c1c1c1;border:#c1c1c1">上一步</span>
+      <!--<span @click="btnDisabled?'':selectFlag == 'open'?submitApply():goProduct()" :class="btnDisabled?'btn-disabled':''">提交申请</span>-->
+    </div>
     <div class="btn-area">
       <!--<span @click="sectionChange(2)">上一步</span>-->
       <span @click="btnDisabled?'':selectFlag == 'open'?submitApply():goProduct()" :class="btnDisabled?'btn-disabled':''">提交申请</span>
     </div>
+
     <div class="loading" v-show="showLoading">
       <img src="/images/all/loading.gif" alt="">
     </div>

+ 113 - 0
components/mobile/register-saler/register/chooseStoretype.vue

@@ -0,0 +1,113 @@
+<template>
+  <div class="mobile-user mobile-fix-content">
+    <div class="line" @click="go(4, 'ORIGINAL_FACTORY')">
+      <div class="img-wrap">
+        <img src="/images/mobile/user/icon_02.png" alt="">
+      </div>
+      <span>原厂</span>
+      <i class="iconfont icon-xiangyou"></i>
+    </div>
+    <div class="line block-line" @click="go(4, 'AGENCY')">
+      <div class="img-wrap">
+        <img src="/images/mobile/user/apply-store.png" alt="">
+      </div>
+      <span>代理商</span>
+      <i class="iconfont icon-xiangyou"></i>
+      <div class="border-line"></div>
+    </div>
+    <div @click="go(4, 'DISTRIBUTION')" class="line block-line">
+      <div class="img-wrap">
+        <img src="/images/mobile/user/icon_05.png" alt="">
+      </div>
+      <span>经销商</span>
+      <i class="iconfont icon-xiangyou"></i>
+      <div class="border-line"></div>
+    </div>
+  </div>
+</template>
+
+<script>
+  export default {
+     name: 'choose-store-type',
+     methods: {
+       go(type, tab) {
+         this.$emit('sectionEvent', type, tab)
+       }
+     }
+  }
+</script>
+
+<style lang="scss" scoped>
+  .mobile-user {
+    background: #f1f3f6;
+    .line {
+      height: 1.17rem;
+      background: #fff;
+      line-height: 1.17rem;
+      font-size: .28rem;
+      padding: 0 .24rem 0 .26rem;
+      width: 7.1rem;
+      margin: .3rem auto 0;
+      .img-wrap {
+        width: .8rem;
+        margin: 0 .26rem 0 0;
+        display: inline-block;
+        img {
+          max-width: .8rem;
+          max-height: .8rem;
+        }
+        img.photo {
+          width: 1.27rem;
+          height: 1.27rem;
+        }
+      }
+      span.edit img{
+        float: right;
+        margin-top: .43rem;
+        width: .3rem;
+        height: .3rem;
+      }
+      span.tel{
+        margin-left: .2rem;
+      }
+      .l-right {
+        color: #666;
+        margin-right: .35rem;
+        max-width: 4.8rem;
+        text-align: right;
+        overflow: hidden;
+        text-overflow: ellipsis;
+        white-space: nowrap;
+      }
+      i {
+        float: right;
+        color: #c1c1c6;
+        font-size: .28rem;
+      }
+      &.img-line {
+        padding-left: .16rem;
+        .img-wrap {
+          width: .9rem;
+          margin: 0 .16rem 0 0;
+          img {
+            max-width: .9rem;
+            max-height: .9rem;
+            border-radius: 100%;
+            border: 1px solid #acc;
+          }
+        }
+      }
+      &.block-line {
+        margin-top: 0;
+        position: relative;
+        .border-line {
+          width: 6.62rem;
+          position: absolute;
+          top: 0;
+          height: 1px;
+          background: #d9d9d9;
+        }
+      }
+    }
+  }
+</style>

+ 2 - 1
pages/mobile/user/index.vue

@@ -151,7 +151,8 @@
           if (this.storeStatus.uuid) {
             this.$router.push(url)
           } else {
-            this.setRemindText('请先前往pc端申请开店')
+            this.$router.push('/mobile/store')
+            // this.setRemindText('请先前往pc端申请开店')
           }
         } else if (!this.user.data.enterprise.uu || this.user.data.enterprise.isVendor !== 313) {
           this.setRemindText('请先前往pc端完善企业信息')