|
@@ -45,7 +45,7 @@
|
|
|
v-model="dataForm.username"
|
|
v-model="dataForm.username"
|
|
|
type="textarea"
|
|
type="textarea"
|
|
|
placeholder="请输入充值账户."
|
|
placeholder="请输入充值账户."
|
|
|
- :autosize="{ minRows: 15, maxRows: 100 }"
|
|
|
|
|
|
|
+ :autosize="{ minRows: 15, maxRows: 60 }"
|
|
|
@change="setAccountNum"
|
|
@change="setAccountNum"
|
|
|
/>
|
|
/>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
@@ -57,7 +57,7 @@
|
|
|
<el-input
|
|
<el-input
|
|
|
v-model="repeatNumList"
|
|
v-model="repeatNumList"
|
|
|
type="textarea"
|
|
type="textarea"
|
|
|
- :autosize="{ minRows: 15, maxRows: 100 }"
|
|
|
|
|
|
|
+ :autosize="{ minRows: 15, maxRows: 60 }"
|
|
|
/>
|
|
/>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-col>
|
|
</el-col>
|
|
@@ -89,13 +89,14 @@
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
<el-col :span="6">
|
|
<el-col :span="6">
|
|
|
|
|
+ 处理时间:<span>{{ startTime }}</span> -- <span>{{ endTime }}</span>
|
|
|
<el-row :gutter="30">
|
|
<el-row :gutter="30">
|
|
|
<el-col :span="12">
|
|
<el-col :span="12">
|
|
|
<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"
|
|
|
type="textarea"
|
|
type="textarea"
|
|
|
- :autosize="{ minRows: 15, maxRows: 100 }"
|
|
|
|
|
|
|
+ :autosize="{ minRows: 15, maxRows: 60 }"
|
|
|
/>
|
|
/>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
<el-col :span="12">
|
|
@@ -103,7 +104,7 @@
|
|
|
<el-input
|
|
<el-input
|
|
|
v-model="catchAccount"
|
|
v-model="catchAccount"
|
|
|
type="textarea"
|
|
type="textarea"
|
|
|
- :autosize="{ minRows: 15, maxRows: 100 }"
|
|
|
|
|
|
|
+ :autosize="{ minRows: 15, maxRows: 60 }"
|
|
|
/>
|
|
/>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
</el-row>
|
|
</el-row>
|
|
@@ -117,19 +118,16 @@
|
|
|
var LodashArray = require('lodash/array')
|
|
var LodashArray = require('lodash/array')
|
|
|
import { Message, MessageBox, Loading } from 'element-ui'
|
|
import { Message, MessageBox, Loading } from 'element-ui'
|
|
|
import { rechargeChannelPlatformAccount } from '@/api/common'
|
|
import { rechargeChannelPlatformAccount } from '@/api/common'
|
|
|
-// import { validMobile } from '@/utils/validate'
|
|
|
|
|
|
|
|
|
|
export default {
|
|
export default {
|
|
|
name: 'Recharge',
|
|
name: 'Recharge',
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
- // accountHandleSuccess: '', // 处理成功账号
|
|
|
|
|
dataForm: {
|
|
dataForm: {
|
|
|
pid: 'd65aa6d7614589bffe62456b88e98811', // 游戏平台ID;默认魅族平台
|
|
pid: 'd65aa6d7614589bffe62456b88e98811', // 游戏平台ID;默认魅族平台
|
|
|
cid: '', // 渠道账号ID
|
|
cid: '', // 渠道账号ID
|
|
|
gfid: '', // 游戏ID
|
|
gfid: '', // 游戏ID
|
|
|
paypwd: '', // 支付密码
|
|
paypwd: '', // 支付密码
|
|
|
- // username: '13121776520\n13121776521\n13121776522\n\n13121776523\n13121776524\n13121776525', // 充值账户
|
|
|
|
|
username: '', // 充值账户
|
|
username: '', // 充值账户
|
|
|
money: 1, // 充值金额(单位:元)
|
|
money: 1, // 充值金额(单位:元)
|
|
|
recharge: 2, //
|
|
recharge: 2, //
|
|
@@ -166,7 +164,10 @@ export default {
|
|
|
thenAccount: '', // 成功账户
|
|
thenAccount: '', // 成功账户
|
|
|
thenAccountNum: 0, // 成功个数
|
|
thenAccountNum: 0, // 成功个数
|
|
|
catchAccount: '', // 失败账户
|
|
catchAccount: '', // 失败账户
|
|
|
- catchAccountNum: 0 // 失败个数
|
|
|
|
|
|
|
+ catchAccountNum: 0, // 失败个数
|
|
|
|
|
+
|
|
|
|
|
+ startTime: 0, // 开始时间
|
|
|
|
|
+ endTime: 0 // 结束时间
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
@@ -177,7 +178,6 @@ export default {
|
|
|
this.updateUserMoney()
|
|
this.updateUserMoney()
|
|
|
|
|
|
|
|
this.$store.dispatch('user/getF5').then((res) => {
|
|
this.$store.dispatch('user/getF5').then((res) => {
|
|
|
- console.log('# getF5: ', res)
|
|
|
|
|
if (!res) {
|
|
if (!res) {
|
|
|
this.$store.dispatch('user/setF5')
|
|
this.$store.dispatch('user/setF5')
|
|
|
location.reload()
|
|
location.reload()
|
|
@@ -223,13 +223,15 @@ 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')
|
|
|
},
|
|
},
|
|
|
- async onSubmit() {
|
|
|
|
|
|
|
+ onSubmit() {
|
|
|
// this.setAccountNum()
|
|
// this.setAccountNum()
|
|
|
|
|
|
|
|
this.thenAccount = ''
|
|
this.thenAccount = ''
|
|
|
this.catchAccount = ''
|
|
this.catchAccount = ''
|
|
|
this.thenAccountNum = 0
|
|
this.thenAccountNum = 0
|
|
|
this.catchAccountNum = 0
|
|
this.catchAccountNum = 0
|
|
|
|
|
+ this.startTime = ''
|
|
|
|
|
+ this.endTime = ''
|
|
|
|
|
|
|
|
// TODO: 正式服务器未上线,暂时不需要
|
|
// TODO: 正式服务器未上线,暂时不需要
|
|
|
// if ((this.balanceMoney - this.dataForm.money) < 0) {
|
|
// if ((this.balanceMoney - this.dataForm.money) < 0) {
|
|
@@ -242,46 +244,78 @@ export default {
|
|
|
if (valid) {
|
|
if (valid) {
|
|
|
// 截取数据
|
|
// 截取数据
|
|
|
var userLists = this.dataForm.username.split('\n')
|
|
var userLists = this.dataForm.username.split('\n')
|
|
|
|
|
+ // console.log('# userLists: ', userLists)
|
|
|
|
|
|
|
|
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 }
|
|
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.$store.dispatch('common/rechargePlayer', oneData).then((res) => {
|
|
this.$store.dispatch('common/rechargePlayer', oneData).then((res) => {
|
|
|
- const { code, status } = 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 + oneData.username + '\n'
|
|
|
this.thenAccountNum++
|
|
this.thenAccountNum++
|
|
|
|
|
|
|
|
- // 遮屏
|
|
|
|
|
- const loading = Loading.service({
|
|
|
|
|
- lock: true,
|
|
|
|
|
- text: '处理中, 请稍等...',
|
|
|
|
|
- background: 'rgba(0, 0, 0, 0.7)'
|
|
|
|
|
- })
|
|
|
|
|
-
|
|
|
|
|
- // 成功后处理剩下账号数据
|
|
|
|
|
const loadingNum = userLists.length - 2
|
|
const loadingNum = userLists.length - 2
|
|
|
- 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)
|
|
|
|
|
- // console.log('# forEach:', loadingNum, index)
|
|
|
|
|
- if (loadingNum === index) {
|
|
|
|
|
- loading.close()
|
|
|
|
|
- this.updateUserMoney()
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ if (loadingNum > 1) {
|
|
|
|
|
+ // 遮屏
|
|
|
|
|
+ const loading = Loading.service({
|
|
|
|
|
+ lock: true,
|
|
|
|
|
+ text: '处理中, 请稍等...',
|
|
|
|
|
+ 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()
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
} else {
|
|
} else {
|
|
|
this.catchAccount = this.catchAccount + oneData.username + '\n'
|
|
this.catchAccount = this.catchAccount + oneData.username + '\n'
|
|
|
this.catchAccountNum++
|
|
this.catchAccountNum++
|
|
|
|
|
+
|
|
|
|
|
+ return Message({
|
|
|
|
|
+ type: 'warning',
|
|
|
|
|
+ message: message
|
|
|
|
|
+ })
|
|
|
}
|
|
}
|
|
|
- }).catch((res) => {
|
|
|
|
|
|
|
+ }).catch((error) => {
|
|
|
this.catchAccount = this.catchAccount + oneData.username + '\n'
|
|
this.catchAccount = this.catchAccount + oneData.username + '\n'
|
|
|
this.catchAccountNum++
|
|
this.catchAccountNum++
|
|
|
|
|
+ return Message({
|
|
|
|
|
+ type: 'error',
|
|
|
|
|
+ message: error.message
|
|
|
|
|
+ })
|
|
|
})
|
|
})
|
|
|
|
|
+
|
|
|
|
|
+ // 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(() => {
|
|
}).catch(() => {
|
|
|
return Message({
|
|
return Message({
|
|
|
type: 'info',
|
|
type: 'info',
|
|
@@ -301,26 +335,30 @@ export default {
|
|
|
return new Promise((resolve, reject) => {
|
|
return new Promise((resolve, reject) => {
|
|
|
setTimeout((_data) => {
|
|
setTimeout((_data) => {
|
|
|
this.$store.dispatch('common/rechargePlayer', _data).then((res) => {
|
|
this.$store.dispatch('common/rechargePlayer', _data).then((res) => {
|
|
|
- console.log('# then:', data.username)
|
|
|
|
|
- const { code, status } = res
|
|
|
|
|
|
|
+ const { code, status, message } = res
|
|
|
if (code === 200 && status === true) {
|
|
if (code === 200 && status === true) {
|
|
|
this.thenAccount = this.thenAccount + _data.username + '\n'
|
|
this.thenAccount = this.thenAccount + _data.username + '\n'
|
|
|
this.thenAccountNum++
|
|
this.thenAccountNum++
|
|
|
- resolve()
|
|
|
|
|
} else {
|
|
} else {
|
|
|
this.catchAccount = this.catchAccount + _data.username + '\n'
|
|
this.catchAccount = this.catchAccount + _data.username + '\n'
|
|
|
this.catchAccountNum++
|
|
this.catchAccountNum++
|
|
|
- resolve()
|
|
|
|
|
|
|
+ Message({
|
|
|
|
|
+ type: 'warning',
|
|
|
|
|
+ message: message
|
|
|
|
|
+ })
|
|
|
}
|
|
}
|
|
|
- }).catch((res) => {
|
|
|
|
|
- console.log('# catch:', data.username)
|
|
|
|
|
-
|
|
|
|
|
|
|
+ // resolve()
|
|
|
|
|
+ }).catch((error) => {
|
|
|
this.catchAccount = this.catchAccount + _data.username + '\n'
|
|
this.catchAccount = this.catchAccount + _data.username + '\n'
|
|
|
this.catchAccountNum++
|
|
this.catchAccountNum++
|
|
|
- resolve()
|
|
|
|
|
|
|
+ Message({
|
|
|
|
|
+ type: 'error',
|
|
|
|
|
+ message: error.message
|
|
|
|
|
+ })
|
|
|
})
|
|
})
|
|
|
- }, 2000 * (index + 1), data)
|
|
|
|
|
- // 2000 * (index + 1): +1的原因是,这里是从第二条数据开始处理的,异步处理之前单独处理了一个,所以时间久点。
|
|
|
|
|
|
|
+ resolve()
|
|
|
|
|
+ }, 1500 * (index + 1), data)
|
|
|
|
|
+ // 1500 * (index + 1): +1的原因是,这里是从第二条数据开始处理的,异步处理之前单独处理了一个,所以时间久点。
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
|
|
|