Browse Source

修改个人账户申请开店时,品牌不存在时,不允许开店逻辑

shenjunjie 6 years ago
parent
commit
2cba223f92

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

@@ -446,8 +446,10 @@
             .then(response => {
               item.brandUuid = response.data.uuid
               item.isPdf = item.url.substring(item.url.length - 4, item.url.length) === '.pdf'
+              this.$set(item, 'status', true)
             }, err => {
               console.log(err)
+              this.$set(item, 'status', false)
               this.showBrandNameInvalid = true
             })
         }
@@ -542,6 +544,14 @@
       storeApply: function (enuu) {
         this.showLoading = true
         let validCode = 0
+        let _brandFlg = true
+        let _brandName = ''
+        for (let i = 0; i < this.brands.length; i++) {
+          if (this.brands[i].status !== undefined && !this.brands[i].status) {
+            _brandFlg = false
+            _brandName = this.brands[i].name
+          }
+        }
         if (this.businessLicenseUrl === '') {
           // this.$message.error('请上传营业执照')
           this.collectResult = '请上传营业执照'
@@ -551,6 +561,9 @@
           this.collectResult = '请填写主营产品信息'
           this.timeoutCount++
           this.showLoading = false
+        } else if (!_brandFlg) {
+          this.collectResult = `品牌${_brandName}不存在,请申请此品牌`
+          this.showLoading = false
         } else {
           if (this.brands[0].name === '') {
             validCode = 1

+ 13 - 1
components/register-saler/register/StepThird.vue

@@ -378,8 +378,9 @@
             .then(response => {
               item.brandUuid = response.data.uuid
               item.isPdf = item.url.substring(item.url.length - 4, item.url.length) === '.pdf'
+              this.$set(item, 'status', true)
             }, err => {
-              console.log(err)
+              this.$set(item, 'status', false)
               this.showBrandNameInvalid = true
             })
         }
@@ -467,12 +468,23 @@
       storeApply: function (enuu) {
         this.showLoading = true
         let validCode = 0
+        let _brandFlg = true
+        let _brandName = ''
+        for (let i = 0; i < this.brands.length; i++) {
+          if (this.brands[i].status !== undefined && !this.brands[i].status) {
+            _brandFlg = false
+            _brandName = this.brands[i].name
+          }
+        }
         if (this.businessLicenseUrl === '') {
           this.$message.error('请上传营业执照')
           this.showLoading = false
         } else if (this.description === '') {
             this.$message.error('请填写主营产品信息')
             this.showLoading = false
+        } else if (!_brandFlg) {
+          this.$message.error(`品牌${_brandName}不存在,请申请此品牌`)
+          this.showLoading = false
         } else {
           if (this.brands[0].name === '') {
             validCode = 1