Browse Source

开通卖家中心loading效果

yangc 8 years ago
parent
commit
3ade8c92f3
1 changed files with 12 additions and 2 deletions
  1. 12 2
      components/register-saler/register/StepThird.vue

+ 12 - 2
components/register-saler/register/StepThird.vue

@@ -265,13 +265,15 @@
       <span @click="sectionChange(2)">上一步</span>
       <span @click="btnDisabled?'':selectFlag == 'open'?submitApply():goProduct()" :class="btnDisabled?'btn-disabled':''">提交申请</span>
     </div>
-    <div class="loading" v-if="showLoading">
+    <div class="loading" v-show="showLoading">
       <img src="/images/all/loading.gif" alt="">
     </div>
+    {{showLoading}}
   </div>
 </template>
 <script>
   import Upload from '~components/common/upload/upload.vue'
+  import Loading from '~components/common/loading/Loading.vue'
   export default {
     data () {
       return {
@@ -319,7 +321,8 @@
       }
     },
     components: {
-      Upload
+      Upload,
+      Loading
     },
     computed: {
       user () {
@@ -413,6 +416,7 @@
         }
       },
       registerSelf: function () {
+        this.showLoading = true
         this.$http.post('/basic/enterprise/register?filePath=' + this.registerData.url, this.registerData.enterprise)
           .then(response => {
             if (response.data.success) {
@@ -426,16 +430,19 @@
                     this.loginData.enterprise.uu = response.data.data.enuu
                     this.storeApply(response.data.data.enuu)
 //                    window.location.reload()
+                    this.showLoading = false
                   })
                 }
               )
             } else {
               this.isSelfRegisterSuccess = false
+              this.showLoading = false
               this.$message.error('个人注册失败,请重新填写信息')
             }
           }, err => {
             console.log(err)
             this.isSelfRegisterSuccess = false
+            this.showLoading = false
             this.$message.error('个人注册失败,请重新填写信息')
           })
       },
@@ -558,6 +565,7 @@
           } else if (!this.checkData.checked) {
             this.$message.error('您还没有勾选相关条款')
           } else {
+            this.showLoading = true
             this.$http.post('/basic/enterprise/register?filePath=' + this.registerData.url, this.registerData.enterprise)
               .then(response => {
                 if (response.data.success) {
@@ -568,9 +576,11 @@
                   this.isSelfRegisterSuccess = false
                   this.$message.error('个人注册失败,请重新填写信息')
                 }
+                this.showLoading = false
               }, err => {
                 console.log(err)
                 this.isSelfRegisterSuccess = false
+                this.showLoading = false
                 this.$message.error('个人注册失败,请重新填写信息')
               })
           }