瀏覽代碼

单个充值成功后,加载中弹框没有关闭成功

wen 3 年之前
父節點
當前提交
14268e1a8b
共有 1 個文件被更改,包括 30 次插入23 次删除
  1. 30 23
      src/views/recharge/index.vue

+ 30 - 23
src/views/recharge/index.vue

@@ -482,19 +482,25 @@ export default {
 
               // 成功后处理剩下账号数据
               accountLists = LodashArray.drop(accountLists) // 删除第一个账户
-              accountLists.forEach(async(item, index) => {
-                await this.rechargePlayer(
-                  { pid: this.dataForm.pid, cid: this.dataForm.cid, gfid: this.dataForm.gfid, paypwd: paypwd, username: item, money: this.dataForm.money, recharge: this.dataForm.recharge, payway: this.dataForm.payway, type: this.dataForm.type },
-                  index, operationType, loadingNum
-                )
-              })
+              console.log('# 充值 -- 账户列表:', accountLists)
+              if (accountLists && accountLists.length > 0) {
+                accountLists.forEach(async(item, index) => {
+                  await this.rechargePlayer(
+                    { pid: this.dataForm.pid, cid: this.dataForm.cid, gfid: this.dataForm.gfid, paypwd: paypwd, username: item, money: this.dataForm.money, recharge: this.dataForm.recharge, payway: this.dataForm.payway, type: this.dataForm.type },
+                    index, operationType, loadingNum
+                  )
+                })
+              } else {
+                this.cloneLoading()
+                this.operation('time_end')
+              }
             } else {
               this.catchAccount = this.catchAccount + oneAccount + '\n'
               this.catchAccountNum++
 
-              // this.cloneLoading()
               // this.formLoading = false
               this.cloneLoading()
+              this.operation('time_end')
               // return Message({
               //   message: '充值 ' + oneAccount + ' : ' + message
               // })
@@ -508,9 +514,9 @@ export default {
             this.catchAccount = this.catchAccount + oneAccount + '\n'
             this.catchAccountNum++
 
-            // this.cloneLoading()
             // this.formLoading = false
             this.cloneLoading()
+            this.operation('time_end')
             // return Message({
             //   type: 'error',
             //   message: '充值失败 ' + oneAccount + ' : ' + error.message
@@ -556,19 +562,24 @@ export default {
 
                   // 成功后处理剩下账号数据
                   accountLists = LodashArray.drop(accountLists) // 删除第一个账户
-                  accountLists.forEach(async(item, index) => {
-                    await this.rechargePlayer(
-                      { pid: this.dataForm.pid, cid: this.dataForm.cid, gfid: this.dataForm.gfid, paypwd: paypwd, username: item, money: this.dataForm.money, recharge: this.dataForm.recharge, payway: this.dataForm.payway, type: this.dataForm.type },
-                      index, operationType, loadingNum
-                    )
-                  })
+                  if (accountLists && accountLists.length > 0) {
+                    accountLists.forEach(async(item, index) => {
+                      await this.rechargePlayer(
+                        { pid: this.dataForm.pid, cid: this.dataForm.cid, gfid: this.dataForm.gfid, paypwd: paypwd, username: item, money: this.dataForm.money, recharge: this.dataForm.recharge, payway: this.dataForm.payway, type: this.dataForm.type },
+                        index, operationType, loadingNum
+                      )
+                    })
+                  } else {
+                    this.cloneLoading()
+                    this.operation('time_end')
+                  }
                 } else {
                   this.catchAccount = this.catchAccount + oneAccount + '\n'
                   this.catchAccountNum++
 
-                  // this.cloneLoading()
                   // this.formLoading = false
                   this.cloneLoading()
+                  this.operation('time_end')
                   // return Message({
                   //   type: 'warning',
                   //   message: '充值 ' + oneAccount + ' : ' + message
@@ -583,9 +594,9 @@ export default {
                 this.catchAccount = this.catchAccount + oneAccount + '\n'
                 this.catchAccountNum++
 
-                // this.cloneLoading(false)
                 // this.formLoading = false
                 this.cloneLoading()
+                this.operation('time_end')
                 // return Message({
                 //   type: 'error',
                 //   message: '充值失败 ' + oneAccount + ' : ' + error.message
@@ -600,9 +611,9 @@ export default {
               this.noExistence = this.noExistence + oneAccount + '\n'
               this.noExistenceNum++
 
-              // this.cloneLoading(false)
               // this.formLoading = false
               this.cloneLoading()
+              this.operation('time_end')
               // return Message({
               //   message: '检测 ' + oneAccount + ' : ' + message
               // })
@@ -616,9 +627,9 @@ export default {
             this.catchAccount = this.catchAccount + oneAccount + '\n'
             this.catchAccountNum++
 
-            // this.cloneLoading(false)
             // this.formLoading = false
             this.cloneLoading()
+            this.operation('time_end')
             // return Message({
             //   type: 'error',
             //   message: '检测失败 ' + oneAccount + ' : ' + error.message
@@ -632,17 +643,13 @@ export default {
 
           break
         default:
-          // Message({
-          //   type: 'error',
-          //   message: '操作有误!!!'
-          // })
           this.$notify({
             title: '操作有误',
             message: '非法操作!',
             type: 'error'
           })
-          // this.formLoading = false
           this.cloneLoading()
+          this.operation('time_end')
           break
       }