|
@@ -1,8 +1,14 @@
|
|
|
<template>
|
|
<template>
|
|
|
- <div class="login-container">
|
|
|
|
|
|
|
+ <div
|
|
|
|
|
+ class="login-container"
|
|
|
|
|
+ >
|
|
|
|
|
+ <!-- v-loading="loading"
|
|
|
|
|
+ element-loading-text="Loading..."
|
|
|
|
|
+ element-loading-svg-view-box="-10, -10, 50, 50"
|
|
|
|
|
+ element-loading-background="rgba(0, 0, 0, 0.8)" -->
|
|
|
<el-form ref="dataForm" :model="dataForm" :rules="ruleForm">
|
|
<el-form ref="dataForm" :model="dataForm" :rules="ruleForm">
|
|
|
<el-row :gutter="30">
|
|
<el-row :gutter="30">
|
|
|
- <el-col :span="5">
|
|
|
|
|
|
|
+ <el-col :span="4">
|
|
|
<el-form-item label="游戏平台" prop="pid">
|
|
<el-form-item label="游戏平台" prop="pid">
|
|
|
<el-select v-model="dataForm.pid" placeholder="Select" class="filter-item">
|
|
<el-select v-model="dataForm.pid" placeholder="Select" class="filter-item">
|
|
|
<el-option
|
|
<el-option
|
|
@@ -62,12 +68,13 @@
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
|
|
|
|
|
- <el-col :span="5">
|
|
|
|
|
|
|
+ <el-col :span="4">
|
|
|
<el-form-item label="账户余额">
|
|
<el-form-item label="账户余额">
|
|
|
<span>{{ user_money }}元</span>
|
|
<span>{{ user_money }}元</span>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-form-item label="充值金额" prop="money">
|
|
<el-form-item label="充值金额" prop="money">
|
|
|
- <el-input v-model="dataForm.money" type="number" min="0" class="filter-item" />
|
|
|
|
|
|
|
+ <el-input v-model="dataForm.money" type="number" min="0" :max="maxMoney" class="filter-item" />
|
|
|
|
|
+ <span style="font-size: var(--el-font-size-extra-small); color: #909399;">最大充值金额:{{ maxMoney }}</span>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<!-- <el-form-item label="平台折扣">
|
|
<!-- <el-form-item label="平台折扣">
|
|
|
<span>9.8折</span>
|
|
<span>9.8折</span>
|
|
@@ -81,17 +88,22 @@
|
|
|
<!-- <el-radio :label="2">商务币支付</el-radio> -->
|
|
<!-- <el-radio :label="2">商务币支付</el-radio> -->
|
|
|
</el-radio-group>
|
|
</el-radio-group>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
- <el-form-item label="支付金额">
|
|
|
|
|
- <span>{{ dataForm.money }} 元</span>
|
|
|
|
|
|
|
+ <el-form-item label="总支付金额">
|
|
|
|
|
+ <span>{{ rechargeMoney }} 元</span>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item label="账号检测">
|
|
|
|
|
+ <el-radio-group v-model="dataForm.payway" prop="payway" class="filter-item">
|
|
|
|
|
+ <el-switch v-model="onCheck" />
|
|
|
|
|
+ </el-radio-group>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
<el-form-item>
|
|
|
- <el-button type="primary" @click="onSubmit">立即支付</el-button>
|
|
|
|
|
|
|
+ <el-button type="primary" @click="onSubmit()">立即支付</el-button>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
- <el-col :span="6">
|
|
|
|
|
|
|
+ <el-col :span="9">
|
|
|
处理时间:<span>{{ startTime }}</span> -- <span>{{ endTime }}</span>
|
|
处理时间:<span>{{ startTime }}</span> -- <span>{{ endTime }}</span>
|
|
|
- <el-row :gutter="30">
|
|
|
|
|
- <el-col :span="12">
|
|
|
|
|
|
|
+ <el-row :gutter="10">
|
|
|
|
|
+ <el-col :span="8">
|
|
|
<span style="font-size: 5px; color: #67C23A;">成功账户:{{ thenAccountNum }}</span>
|
|
<span style="font-size: 5px; color: #67C23A;">成功账户:{{ thenAccountNum }}</span>
|
|
|
<el-input
|
|
<el-input
|
|
|
v-model="thenAccount"
|
|
v-model="thenAccount"
|
|
@@ -99,7 +111,7 @@
|
|
|
:autosize="{ minRows: 15, maxRows: 60 }"
|
|
:autosize="{ minRows: 15, maxRows: 60 }"
|
|
|
/>
|
|
/>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
- <el-col :span="12">
|
|
|
|
|
|
|
+ <el-col :span="8">
|
|
|
<span style="font-size: 5px; color: #F56C6C;">失败账户:{{ catchAccountNum }}</span>
|
|
<span style="font-size: 5px; color: #F56C6C;">失败账户:{{ catchAccountNum }}</span>
|
|
|
<el-input
|
|
<el-input
|
|
|
v-model="catchAccount"
|
|
v-model="catchAccount"
|
|
@@ -107,6 +119,14 @@
|
|
|
:autosize="{ minRows: 15, maxRows: 60 }"
|
|
:autosize="{ minRows: 15, maxRows: 60 }"
|
|
|
/>
|
|
/>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
|
|
+ <el-col :span="8">
|
|
|
|
|
+ <span style="font-size: 5px; color: #F56C6C;">账户不存在:{{ noExistenceNum }}</span>
|
|
|
|
|
+ <el-input
|
|
|
|
|
+ v-model="noExistence"
|
|
|
|
|
+ type="textarea"
|
|
|
|
|
+ :autosize="{ minRows: 15, maxRows: 60 }"
|
|
|
|
|
+ />
|
|
|
|
|
+ </el-col>
|
|
|
</el-row>
|
|
</el-row>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
</el-row>
|
|
</el-row>
|
|
@@ -123,6 +143,7 @@ export default {
|
|
|
name: 'Recharge',
|
|
name: 'Recharge',
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
|
|
+ loading: false,
|
|
|
dataForm: {
|
|
dataForm: {
|
|
|
pid: 'd65aa6d7614589bffe62456b88e98811', // 游戏平台ID;默认魅族平台
|
|
pid: 'd65aa6d7614589bffe62456b88e98811', // 游戏平台ID;默认魅族平台
|
|
|
cid: '', // 渠道账号ID
|
|
cid: '', // 渠道账号ID
|
|
@@ -154,6 +175,7 @@ export default {
|
|
|
],
|
|
],
|
|
|
// balanceMoney: 0, // 渠道余额
|
|
// balanceMoney: 0, // 渠道余额
|
|
|
user_money: 0, // 账户余额
|
|
user_money: 0, // 账户余额
|
|
|
|
|
+ maxMoney: 0, // 最大充值金额
|
|
|
rechargeChannelPlatform: [], // 渠道账号
|
|
rechargeChannelPlatform: [], // 渠道账号
|
|
|
rechargeGame: [], // 游戏列表
|
|
rechargeGame: [], // 游戏列表
|
|
|
|
|
|
|
@@ -166,11 +188,23 @@ export default {
|
|
|
catchAccount: '', // 失败账户
|
|
catchAccount: '', // 失败账户
|
|
|
catchAccountNum: 0, // 失败个数
|
|
catchAccountNum: 0, // 失败个数
|
|
|
|
|
|
|
|
|
|
+ noExistence: '', // 不存在账户
|
|
|
|
|
+ noExistenceNum: 0, // 不存在账户个数
|
|
|
|
|
+
|
|
|
startTime: 0, // 开始时间
|
|
startTime: 0, // 开始时间
|
|
|
- endTime: 0 // 结束时间
|
|
|
|
|
|
|
+ endTime: 0, // 结束时间
|
|
|
|
|
+ onCheck: false, // 是否需要检测账号()
|
|
|
|
|
+ rechargeMoney: 0 // 支付总金额
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
|
|
+ watch: {
|
|
|
|
|
+ 'dataForm.money': {
|
|
|
|
|
+ handler(val, oldVal) {
|
|
|
|
|
+ this.checkMoney(val)
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
created() {
|
|
created() {
|
|
|
// this.getBalanceMoney(this.dataForm.pid)
|
|
// this.getBalanceMoney(this.dataForm.pid)
|
|
|
this.getRechargePlatform(this.dataForm.pid)
|
|
this.getRechargePlatform(this.dataForm.pid)
|
|
@@ -185,14 +219,30 @@ export default {
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
|
|
+ // 判断充值金额
|
|
|
|
|
+ checkMoney(money) {
|
|
|
|
|
+ this.rechargeMoney = this.accountNum * money
|
|
|
|
|
+ if ((this.user_money - this.rechargeMoney) < 0) {
|
|
|
|
|
+ // this.rechargeMoney = this.accountNum * oldVal
|
|
|
|
|
+ return Message({
|
|
|
|
|
+ type: 'warning',
|
|
|
|
|
+ message: '账户余额不足以充值!'
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
// 更新用户余额
|
|
// 更新用户余额
|
|
|
updateUserMoney() {
|
|
updateUserMoney() {
|
|
|
this.$store.dispatch('user/getInfo').then((res) => {
|
|
this.$store.dispatch('user/getInfo').then((res) => {
|
|
|
const { data } = res
|
|
const { data } = res
|
|
|
this.user_money = data.user_money
|
|
this.user_money = data.user_money
|
|
|
|
|
+ if (this.accountNum > 0) {
|
|
|
|
|
+ this.maxMoney = Math.floor(data.user_money / this.accountNum)
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.maxMoney = Math.floor(data.user_money)
|
|
|
|
|
+ }
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
- // 统计充值账户数量并处理行数不是账号的
|
|
|
|
|
|
|
+ // 统计充值账户数量并处理行数是否账号
|
|
|
setAccountNum() {
|
|
setAccountNum() {
|
|
|
if (!this.dataForm.username) {
|
|
if (!this.dataForm.username) {
|
|
|
return false
|
|
return false
|
|
@@ -222,14 +272,24 @@ export default {
|
|
|
}
|
|
}
|
|
|
this.repeatNumList = this.repeatNumList.join().replace(new RegExp(',', 'g'), '\n')
|
|
this.repeatNumList = this.repeatNumList.join().replace(new RegExp(',', 'g'), '\n')
|
|
|
this.dataForm.username = newList.join().replace(new RegExp(',', 'g'), '\n')
|
|
this.dataForm.username = newList.join().replace(new RegExp(',', 'g'), '\n')
|
|
|
|
|
+ this.rechargeMoney = this.accountNum * this.dataForm.money
|
|
|
|
|
+ this.maxMoney = Math.floor(this.user_money / this.accountNum)
|
|
|
},
|
|
},
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 发起提交 游戏账号检测/提交充值 数据
|
|
|
|
|
+ */
|
|
|
onSubmit() {
|
|
onSubmit() {
|
|
|
// this.setAccountNum()
|
|
// this.setAccountNum()
|
|
|
|
|
|
|
|
this.thenAccount = ''
|
|
this.thenAccount = ''
|
|
|
- this.catchAccount = ''
|
|
|
|
|
this.thenAccountNum = 0
|
|
this.thenAccountNum = 0
|
|
|
|
|
+
|
|
|
|
|
+ this.catchAccount = ''
|
|
|
this.catchAccountNum = 0
|
|
this.catchAccountNum = 0
|
|
|
|
|
+
|
|
|
|
|
+ this.noExistence = ''
|
|
|
|
|
+ this.noExistenceNum = 0
|
|
|
|
|
+
|
|
|
this.startTime = ''
|
|
this.startTime = ''
|
|
|
this.endTime = ''
|
|
this.endTime = ''
|
|
|
|
|
|
|
@@ -240,48 +300,80 @@ export default {
|
|
|
// message: '余额不足以充值.'
|
|
// message: '余额不足以充值.'
|
|
|
// })
|
|
// })
|
|
|
// }
|
|
// }
|
|
|
|
|
+ if ((this.user_money - this.rechargeMoney) < 0) {
|
|
|
|
|
+ return Message({
|
|
|
|
|
+ type: 'warning',
|
|
|
|
|
+ message: '账户余额不足以充值!'
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
this.$refs['dataForm'].validate((valid) => {
|
|
this.$refs['dataForm'].validate((valid) => {
|
|
|
if (valid) {
|
|
if (valid) {
|
|
|
- // 截取数据
|
|
|
|
|
- var userLists = this.dataForm.username.split('\n')
|
|
|
|
|
- // console.log('# userLists: ', userLists)
|
|
|
|
|
|
|
+ // 截取账号
|
|
|
|
|
+ var accountLists = this.dataForm.username.split('\n')
|
|
|
|
|
+ // console.log('# accountLists: ', accountLists)
|
|
|
|
|
|
|
|
MessageBox.prompt('输入支付密码', 'Tip', {
|
|
MessageBox.prompt('输入支付密码', 'Tip', {
|
|
|
confirmButtonText: '确认',
|
|
confirmButtonText: '确认',
|
|
|
cancelButtonText: '取消'
|
|
cancelButtonText: '取消'
|
|
|
}).then(({ value }) => {
|
|
}).then(({ value }) => {
|
|
|
- this.startTime = new Date().getHours() + ':' + new Date().getMinutes() + ':' + new Date().getSeconds()
|
|
|
|
|
- // 提取第一条账号数据,针对接口提交判断数据是否有误
|
|
|
|
|
- var oneData = { pid: this.dataForm.pid, cid: this.dataForm.cid, gfid: this.dataForm.gfid, paypwd: value, username: userLists[0], money: this.dataForm.money, recharge: this.dataForm.recharge, payway: this.dataForm.payway, type: this.dataForm.type }
|
|
|
|
|
|
|
+ this.sublmeRecharge(accountLists, value)
|
|
|
|
|
+ }).catch(() => {
|
|
|
|
|
+ return Message({
|
|
|
|
|
+ type: 'info',
|
|
|
|
|
+ message: '取消充值.'
|
|
|
|
|
+ })
|
|
|
|
|
+ })
|
|
|
|
|
+ } else {
|
|
|
|
|
+ return Message({
|
|
|
|
|
+ type: 'error',
|
|
|
|
|
+ message: '请完善提交内容.'
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+ // 提交检测和充值
|
|
|
|
|
+ sublmeRecharge(accountLists, paypwd) {
|
|
|
|
|
+ this.startTime = new Date().getHours() + ':' + new Date().getMinutes() + ':' + new Date().getSeconds()
|
|
|
|
|
+
|
|
|
|
|
+ // 是否需要验证账户
|
|
|
|
|
+ // 提取第一条账号数据,进行提交测试
|
|
|
|
|
+ const oneAccount = accountLists[0]
|
|
|
|
|
+ const oneData = { pid: this.dataForm.pid, cid: this.dataForm.cid, gfid: this.dataForm.gfid, paypwd: paypwd, username: oneAccount, money: this.dataForm.money, recharge: this.dataForm.recharge, payway: this.dataForm.payway, type: this.dataForm.type }
|
|
|
|
|
+ const loadingNum = accountLists.length - 2
|
|
|
|
|
+ if (this.onCheck) {
|
|
|
|
|
+ // 账号检测
|
|
|
|
|
+ this.$store.dispatch('common/rechargePlayerType', { pid: this.dataForm.pid, cid: this.dataForm.cid, gfid: this.dataForm.gfid, username: oneAccount }).then((res) => {
|
|
|
|
|
+ const { code, status, message } = res
|
|
|
|
|
+
|
|
|
|
|
+ if (code === 200 && status === true) {
|
|
|
|
|
+ // 充值
|
|
|
this.$store.dispatch('common/rechargePlayer', oneData).then((res) => {
|
|
this.$store.dispatch('common/rechargePlayer', oneData).then((res) => {
|
|
|
const { code, status, message } = res
|
|
const { code, status, message } = res
|
|
|
if (code === 200 && status === true) {
|
|
if (code === 200 && status === true) {
|
|
|
- this.thenAccount = this.thenAccount + oneData.username + '\n'
|
|
|
|
|
|
|
+ this.thenAccount = this.thenAccount + oneAccount + '\n'
|
|
|
this.thenAccountNum++
|
|
this.thenAccountNum++
|
|
|
|
|
|
|
|
- const loadingNum = userLists.length - 2
|
|
|
|
|
if (loadingNum > 1) {
|
|
if (loadingNum > 1) {
|
|
|
// 遮屏
|
|
// 遮屏
|
|
|
- const loading = Loading.service({
|
|
|
|
|
|
|
+ this.loading = Loading.service({
|
|
|
lock: true,
|
|
lock: true,
|
|
|
text: '处理中, 请稍等...',
|
|
text: '处理中, 请稍等...',
|
|
|
background: 'rgba(0, 0, 0, 0.7)'
|
|
background: 'rgba(0, 0, 0, 0.7)'
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
// 成功后处理剩下账号数据
|
|
// 成功后处理剩下账号数据
|
|
|
- userLists = LodashArray.drop(userLists) // 删除第一个账户
|
|
|
|
|
- userLists.forEach(async(item, index) => {
|
|
|
|
|
- var _data = { pid: this.dataForm.pid, cid: this.dataForm.cid, gfid: this.dataForm.gfid, paypwd: value, username: item, money: this.dataForm.money, recharge: this.dataForm.recharge, payway: this.dataForm.payway, type: this.dataForm.type }
|
|
|
|
|
- await this.rechargePlayer(_data, index)
|
|
|
|
|
- if (loadingNum === index) {
|
|
|
|
|
- loading.close()
|
|
|
|
|
- this.updateUserMoney()
|
|
|
|
|
- this.endTime = new Date().getHours() + ':' + new Date().getMinutes() + ':' + new Date().getSeconds()
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ 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, type: this.dataForm.type },
|
|
|
|
|
+ index,
|
|
|
|
|
+ this.onCheck,
|
|
|
|
|
+ loadingNum
|
|
|
|
|
+ )
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
- this.catchAccount = this.catchAccount + oneData.username + '\n'
|
|
|
|
|
|
|
+ this.catchAccount = this.catchAccount + oneAccount + '\n'
|
|
|
this.catchAccountNum++
|
|
this.catchAccountNum++
|
|
|
|
|
|
|
|
return Message({
|
|
return Message({
|
|
@@ -290,89 +382,204 @@ export default {
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
}).catch((error) => {
|
|
}).catch((error) => {
|
|
|
- this.catchAccount = this.catchAccount + oneData.username + '\n'
|
|
|
|
|
|
|
+ this.catchAccount = this.catchAccount + oneAccount + '\n'
|
|
|
this.catchAccountNum++
|
|
this.catchAccountNum++
|
|
|
|
|
+
|
|
|
return Message({
|
|
return Message({
|
|
|
type: 'error',
|
|
type: 'error',
|
|
|
message: error.message
|
|
message: error.message
|
|
|
})
|
|
})
|
|
|
})
|
|
})
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.noExistence = this.noExistence + oneAccount + '\n'
|
|
|
|
|
+ this.noExistenceNum++
|
|
|
|
|
|
|
|
- // TODO: 跳过第一条数据判断,直接测试
|
|
|
|
|
- // // 遮屏
|
|
|
|
|
- // const loading = Loading.service({
|
|
|
|
|
- // lock: true,
|
|
|
|
|
- // text: '处理中, 请稍等...',
|
|
|
|
|
- // background: 'rgba(0, 0, 0, 0.7)'
|
|
|
|
|
- // })
|
|
|
|
|
- // // 成功后处理剩下账号数据
|
|
|
|
|
- // const loadingNum = userLists.length - 1
|
|
|
|
|
- // userLists.forEach(async(item, index) => {
|
|
|
|
|
- // var _data = { pid: this.dataForm.pid, cid: this.dataForm.cid, gfid: this.dataForm.gfid, paypwd: value, username: item, money: this.dataForm.money, recharge: this.dataForm.recharge, payway: this.dataForm.payway, type: this.dataForm.type }
|
|
|
|
|
- // await this.rechargePlayer(_data, index)
|
|
|
|
|
- // if (loadingNum === index || index > loadingNum) {
|
|
|
|
|
- // loading.close()
|
|
|
|
|
- // this.updateUserMoney()
|
|
|
|
|
- // this.endTime = new Date().getHours() + ':' + new Date().getMinutes() + ': ' + new Date().getSeconds()
|
|
|
|
|
- // }
|
|
|
|
|
- // })
|
|
|
|
|
- }).catch(() => {
|
|
|
|
|
- return Message({
|
|
|
|
|
- type: 'info',
|
|
|
|
|
- message: '取消充值.'
|
|
|
|
|
|
|
+ Message({
|
|
|
|
|
+ type: 'error',
|
|
|
|
|
+ message: '检测:' + message
|
|
|
})
|
|
})
|
|
|
- })
|
|
|
|
|
- } else {
|
|
|
|
|
- return Message({
|
|
|
|
|
|
|
+ }
|
|
|
|
|
+ }).catch((error) => {
|
|
|
|
|
+ console.log('# catch-message:', error.message)
|
|
|
|
|
+ this.catchAccount = this.catchAccount + oneAccount + '\n'
|
|
|
|
|
+ this.catchAccountNum++
|
|
|
|
|
+
|
|
|
|
|
+ Message({
|
|
|
type: 'error',
|
|
type: 'error',
|
|
|
- message: '请完善提交内容.'
|
|
|
|
|
|
|
+ message: '检测:' + error.message
|
|
|
})
|
|
})
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
- },
|
|
|
|
|
- // 异步进行账户充值
|
|
|
|
|
- rechargePlayer(data, index) {
|
|
|
|
|
- return new Promise((resolve, reject) => {
|
|
|
|
|
- setTimeout((_data) => {
|
|
|
|
|
- this.$store.dispatch('common/rechargePlayer', _data).then((res) => {
|
|
|
|
|
- const { code, status, message } = res
|
|
|
|
|
- if (code === 200 && status === true) {
|
|
|
|
|
- this.thenAccount = this.thenAccount + _data.username + '\n'
|
|
|
|
|
- this.thenAccountNum++
|
|
|
|
|
- } else {
|
|
|
|
|
- this.catchAccount = this.catchAccount + _data.username + '\n'
|
|
|
|
|
- this.catchAccountNum++
|
|
|
|
|
- Message({
|
|
|
|
|
- type: 'warning',
|
|
|
|
|
- message: message
|
|
|
|
|
|
|
+ })
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.$store.dispatch('common/rechargePlayer', oneData).then((res) => {
|
|
|
|
|
+ const { code, status, message } = res
|
|
|
|
|
+ if (code === 200 && status === true) {
|
|
|
|
|
+ this.thenAccount = this.thenAccount + oneAccount + '\n'
|
|
|
|
|
+ this.thenAccountNum++
|
|
|
|
|
+
|
|
|
|
|
+ if (loadingNum > 1) {
|
|
|
|
|
+ // 遮屏
|
|
|
|
|
+ this.loading = Loading.service({
|
|
|
|
|
+ lock: true,
|
|
|
|
|
+ text: '处理中, 请稍等...',
|
|
|
|
|
+ background: 'rgba(0, 0, 0, 0.7)'
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
|
|
+ // 成功后处理剩下账号数据
|
|
|
|
|
+ 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, type: this.dataForm.type },
|
|
|
|
|
+ index,
|
|
|
|
|
+ this.onCheck,
|
|
|
|
|
+ loadingNum
|
|
|
|
|
+ )
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
- // resolve()
|
|
|
|
|
- }).catch((error) => {
|
|
|
|
|
- this.catchAccount = this.catchAccount + _data.username + '\n'
|
|
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.catchAccount = this.catchAccount + oneAccount + '\n'
|
|
|
this.catchAccountNum++
|
|
this.catchAccountNum++
|
|
|
- Message({
|
|
|
|
|
- type: 'error',
|
|
|
|
|
- message: error.message
|
|
|
|
|
|
|
+
|
|
|
|
|
+ return Message({
|
|
|
|
|
+ type: 'warning',
|
|
|
|
|
+ message: message
|
|
|
})
|
|
})
|
|
|
|
|
+ }
|
|
|
|
|
+ }).catch((error) => {
|
|
|
|
|
+ this.catchAccount = this.catchAccount + oneAccount + '\n'
|
|
|
|
|
+ this.catchAccountNum++
|
|
|
|
|
+
|
|
|
|
|
+ return Message({
|
|
|
|
|
+ type: 'error',
|
|
|
|
|
+ message: error.message
|
|
|
})
|
|
})
|
|
|
- resolve()
|
|
|
|
|
- }, 1500 * (index + 1), data)
|
|
|
|
|
- // 1500 * (index + 1): +1的原因是,这里是从第二条数据开始处理的,异步处理之前单独处理了一个,所以时间久点。
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // // ## 测试(去除第一个账户单独测试)
|
|
|
|
|
+ // // 是否需要验证账户
|
|
|
|
|
+ // const loadingNum = accountLists.length - 1
|
|
|
|
|
+ // // 遮屏
|
|
|
|
|
+ // this.loading = Loading.service({
|
|
|
|
|
+ // lock: true,
|
|
|
|
|
+ // text: '处理中, 请稍等...',
|
|
|
|
|
+ // background: 'rgba(0, 0, 0, 0.7)'
|
|
|
|
|
+ // })
|
|
|
|
|
+ // // 成功后处理剩下账号数据
|
|
|
|
|
+ // 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, type: this.dataForm.type },
|
|
|
|
|
+ // index,
|
|
|
|
|
+ // this.onCheck,
|
|
|
|
|
+ // loadingNum
|
|
|
|
|
+ // )
|
|
|
|
|
+ // })
|
|
|
},
|
|
},
|
|
|
|
|
+ // 关闭加载页面
|
|
|
|
|
+ cloneLoading() {
|
|
|
|
|
+ // this.loading = false
|
|
|
|
|
+ this.loading.close()
|
|
|
|
|
+ this.updateUserMoney()
|
|
|
|
|
+ this.endTime = new Date().getHours() + ':' + new Date().getMinutes() + ':' + new Date().getSeconds()
|
|
|
|
|
+ },
|
|
|
|
|
+ // 异步进行账户充值
|
|
|
|
|
+ rechargePlayer(data, index, onCheck, count) {
|
|
|
|
|
+ // 延迟一秒处理
|
|
|
|
|
+ setTimeout((data, index, onCheck, count) => {
|
|
|
|
|
+ return new Promise((resolve, reject) => {
|
|
|
|
|
+ // 继续延迟
|
|
|
|
|
+ setTimeout((_data, onCheck, { index, count }) => {
|
|
|
|
|
+ if (index === count || index > count) {
|
|
|
|
|
+ this.cloneLoading()
|
|
|
|
|
+ }
|
|
|
|
|
+ // 是否需要账号检测
|
|
|
|
|
+ if (onCheck === true) {
|
|
|
|
|
+ // 账号检测
|
|
|
|
|
+ this.$store.dispatch('common/rechargePlayerType', { pid: _data.pid, cid: _data.cid, gfid: _data.gfid, username: _data.username }).then((res) => {
|
|
|
|
|
+ const { code, status, message } = res
|
|
|
|
|
+ if (code === 200 && status !== true) {
|
|
|
|
|
+ // this.thenAccount = this.thenAccount + _data.username + '\n'
|
|
|
|
|
+ // this.thenAccountNum++
|
|
|
|
|
|
|
|
- // 账户余额 -- 弃用
|
|
|
|
|
- getBalanceMoney(val) {
|
|
|
|
|
- this.$store.dispatch('common/getMainChannelMoney', val).then((res) => {
|
|
|
|
|
- this.balanceMoney = res
|
|
|
|
|
- }).catch((res) => {
|
|
|
|
|
- return Message({
|
|
|
|
|
- message: res,
|
|
|
|
|
- type: 'error',
|
|
|
|
|
- duration: 5 * 1000
|
|
|
|
|
|
|
+ // 充值
|
|
|
|
|
+ this.$store.dispatch('common/rechargePlayer', _data).then((res) => {
|
|
|
|
|
+ const { code, status, message } = res
|
|
|
|
|
+ if (code === 200 && status === true) {
|
|
|
|
|
+ this.thenAccount = this.thenAccount + _data.username + '\n'
|
|
|
|
|
+ this.thenAccountNum++
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.catchAccount = this.catchAccount + _data.username + '\n'
|
|
|
|
|
+ this.catchAccountNum++
|
|
|
|
|
+
|
|
|
|
|
+ Message({
|
|
|
|
|
+ type: 'warning',
|
|
|
|
|
+ message: 'Player:' + message
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ }).catch((error) => {
|
|
|
|
|
+ this.catchAccount = this.catchAccount + _data.username + '\n'
|
|
|
|
|
+ this.catchAccountNum++
|
|
|
|
|
+
|
|
|
|
|
+ Message({
|
|
|
|
|
+ type: 'error',
|
|
|
|
|
+ message: 'Player:' + error.message
|
|
|
|
|
+ })
|
|
|
|
|
+ })
|
|
|
|
|
+ } else {
|
|
|
|
|
+ if (code === 10001) {
|
|
|
|
|
+ this.catchAccount = this.catchAccount + _data.username + '\n'
|
|
|
|
|
+ this.catchAccountNum++
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.noExistence = this.noExistence + _data.username + '\n'
|
|
|
|
|
+ this.noExistenceNum++
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ Message({
|
|
|
|
|
+ type: 'error',
|
|
|
|
|
+ message: '检测:' + message
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ }).catch((error) => {
|
|
|
|
|
+ this.catchAccount = this.catchAccount + _data.username + '\n'
|
|
|
|
|
+ this.catchAccountNum++
|
|
|
|
|
+
|
|
|
|
|
+ Message({
|
|
|
|
|
+ type: 'error',
|
|
|
|
|
+ message: '检测:' + error.message
|
|
|
|
|
+ })
|
|
|
|
|
+ resolve()
|
|
|
|
|
+ })
|
|
|
|
|
+ } else {
|
|
|
|
|
+ // 充值
|
|
|
|
|
+ this.$store.dispatch('common/rechargePlayer', _data).then((res) => {
|
|
|
|
|
+ const { code, status, message } = res
|
|
|
|
|
+ if (code === 200 && status === true) {
|
|
|
|
|
+ this.thenAccount = this.thenAccount + _data.username + '\n'
|
|
|
|
|
+ this.thenAccountNum++
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.catchAccount = this.catchAccount + _data.username + '\n'
|
|
|
|
|
+ this.catchAccountNum++
|
|
|
|
|
+
|
|
|
|
|
+ Message({
|
|
|
|
|
+ type: 'warning',
|
|
|
|
|
+ message: '充值:' + message
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ }).catch((error) => {
|
|
|
|
|
+ this.catchAccount = this.catchAccount + _data.username + '\n'
|
|
|
|
|
+ this.catchAccountNum++
|
|
|
|
|
+
|
|
|
|
|
+ Message({
|
|
|
|
|
+ type: 'error',
|
|
|
|
|
+ message: '充值:' + error.message
|
|
|
|
|
+ })
|
|
|
|
|
+ resolve()
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ }, 1800 * (index + 1), data, onCheck, { index, count })
|
|
|
|
|
+ // }, (1600 + Math.round(Math.random() * 300)) * (index + 1), data, onCheck)
|
|
|
|
|
+ // 1500 * (index + 1): +1的原因是,这里是从第二条数据开始处理的,异步处理之前单独处理了一个,所以时间久点。
|
|
|
})
|
|
})
|
|
|
- })
|
|
|
|
|
|
|
+ }, 1000, data, index, onCheck, count)
|
|
|
},
|
|
},
|
|
|
// 渠道账号列表
|
|
// 渠道账号列表
|
|
|
getRechargePlatform(val) {
|
|
getRechargePlatform(val) {
|