|
@@ -1,54 +1,53 @@
|
|
|
<template>
|
|
<template>
|
|
|
<div class="login-container">
|
|
<div class="login-container">
|
|
|
- <el-form ref="form" :model="form">
|
|
|
|
|
|
|
+ <el-form ref="dataForm" :model="dataForm" :rules="ruleForm">
|
|
|
<el-row :gutter="30">
|
|
<el-row :gutter="30">
|
|
|
<el-col :span="5">
|
|
<el-col :span="5">
|
|
|
- <el-form-item label="游戏平台">
|
|
|
|
|
- <el-select v-model="rechargePlatformDefault" placeholder="Select">
|
|
|
|
|
|
|
+ <el-form-item label="游戏平台" prop="pid">
|
|
|
|
|
+ <el-select v-model="dataForm.pid" placeholder="Select" class="filter-item">
|
|
|
<el-option
|
|
<el-option
|
|
|
- v-for="(item, index) in rechargePlatform"
|
|
|
|
|
- :key="index"
|
|
|
|
|
|
|
+ v-for="item in rechargePlatform"
|
|
|
|
|
+ :key="item.pid"
|
|
|
:label="item.platform"
|
|
:label="item.platform"
|
|
|
:value="item.pid"
|
|
:value="item.pid"
|
|
|
/>
|
|
/>
|
|
|
</el-select>
|
|
</el-select>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-form-item label="渠道余额" style="width: 300px;">
|
|
<el-form-item label="渠道余额" style="width: 300px;">
|
|
|
- <el-input v-model="balanceMoney" type="number" class="inline-input" disabled style="width: 160px;" /> 元
|
|
|
|
|
|
|
+ <el-input v-model="balanceMoney" type="number" class="inline-input filter-item" disabled style="width: 160px;" /> 元
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
- <el-form-item label="渠道账号">
|
|
|
|
|
- <el-select v-model="rechargeChannelPlatformDefault" placeholder="Select">
|
|
|
|
|
|
|
+ <el-form-item label="渠道账号" prop="cid">
|
|
|
|
|
+ <el-select v-model="dataForm.cid" placeholder="Select" class="filter-item">
|
|
|
<el-option
|
|
<el-option
|
|
|
- v-for="(item, index) in rechargeChannelPlatform"
|
|
|
|
|
- :key="index"
|
|
|
|
|
|
|
+ v-for="item in rechargeChannelPlatform"
|
|
|
|
|
+ :key="item.cid"
|
|
|
:label="item.account"
|
|
:label="item.account"
|
|
|
:value="item.cid"
|
|
:value="item.cid"
|
|
|
- @change="testingCid"
|
|
|
|
|
/>
|
|
/>
|
|
|
</el-select>
|
|
</el-select>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
- <el-form-item label="选择游戏">
|
|
|
|
|
- <el-select v-model="rechargeGameDefault" placeholder="Select">
|
|
|
|
|
|
|
+ <el-form-item label="选择游戏" prop="gfid">
|
|
|
|
|
+ <el-select v-model="dataForm.gfid" placeholder="Select" class="filter-item">
|
|
|
<el-option
|
|
<el-option
|
|
|
- v-for="(item, index) in rechargeGame"
|
|
|
|
|
- :key="index"
|
|
|
|
|
|
|
+ v-for="item in rechargeGame"
|
|
|
|
|
+ :key="item.id"
|
|
|
:label="item.name"
|
|
:label="item.name"
|
|
|
:value="item.id"
|
|
:value="item.id"
|
|
|
- @change="testingGfid"
|
|
|
|
|
/>
|
|
/>
|
|
|
</el-select>
|
|
</el-select>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
|
|
|
|
|
- <el-divider direction="vertical" />
|
|
|
|
|
-
|
|
|
|
|
<el-col :span="3">
|
|
<el-col :span="3">
|
|
|
- <el-input
|
|
|
|
|
- v-model="accountHandle"
|
|
|
|
|
- type="textarea"
|
|
|
|
|
- placeholder="待检测账号."
|
|
|
|
|
- :autosize="{ minRows: 20, maxRows: 50 }"
|
|
|
|
|
- />
|
|
|
|
|
|
|
+ <el-form-item label="充值账户" prop="username" class="filter-item">
|
|
|
|
|
+ <el-input
|
|
|
|
|
+ v-model="dataForm.username"
|
|
|
|
|
+ type="textarea"
|
|
|
|
|
+ placeholder="待检测账号."
|
|
|
|
|
+ :autosize="{ minRows: 15, maxRows: 100 }"
|
|
|
|
|
+ />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+
|
|
|
<!-- <el-row class="row-bg" gutter="10">
|
|
<!-- <el-row class="row-bg" gutter="10">
|
|
|
<el-col :span="9">
|
|
<el-col :span="9">
|
|
|
<span style="font-size: 5px; color: #67C23A;">贴入充值账号,一行一个账号.</span>
|
|
<span style="font-size: 5px; color: #67C23A;">贴入充值账号,一行一个账号.</span>
|
|
@@ -68,11 +67,9 @@
|
|
|
</el-row> -->
|
|
</el-row> -->
|
|
|
</el-col>
|
|
</el-col>
|
|
|
|
|
|
|
|
- <el-divider direction="vertical" />
|
|
|
|
|
-
|
|
|
|
|
- <el-col :span="8">
|
|
|
|
|
- <el-form-item label="充值金额" style="width: 300px;">
|
|
|
|
|
- <el-input v-model="form.payMoney" type="number" class="inline-input" min="0" />
|
|
|
|
|
|
|
+ <el-col :span="3">
|
|
|
|
|
+ <el-form-item label="充值金额" style="width: 160px;" prop="money">
|
|
|
|
|
+ <el-input v-model="dataForm.money" type="number" min="0" class="filter-item" />
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<!-- <el-form-item label="平台折扣">
|
|
<!-- <el-form-item label="平台折扣">
|
|
|
<span>9.8折</span>
|
|
<span>9.8折</span>
|
|
@@ -81,19 +78,40 @@
|
|
|
<span>9.8折</span>
|
|
<span>9.8折</span>
|
|
|
</el-form-item> -->
|
|
</el-form-item> -->
|
|
|
<el-form-item label="支付方式">
|
|
<el-form-item label="支付方式">
|
|
|
- <el-radio-group v-model="form.resource" disabled>
|
|
|
|
|
- <el-radio :label="0">久币支付</el-radio>
|
|
|
|
|
- <el-radio :label="1">商务币支付</el-radio>
|
|
|
|
|
|
|
+ <el-radio-group v-model="dataForm.payway" disabled prop="payway" class="filter-item">
|
|
|
|
|
+ <el-radio :label="1">久币支付</el-radio>
|
|
|
|
|
+ <el-radio :label="2">商务币支付</el-radio>
|
|
|
</el-radio-group>
|
|
</el-radio-group>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-form-item label="支付金额">
|
|
<el-form-item label="支付金额">
|
|
|
- <span>{{ form.payMoney }} 元</span>
|
|
|
|
|
|
|
+ <span>{{ dataForm.money }} 元</span>
|
|
|
</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-row :gutter="30">
|
|
|
|
|
+ <el-col :span="12">
|
|
|
|
|
+ <span style="font-size: 5px; color: #67C23A;">成功账户:</span>
|
|
|
|
|
+ <el-input
|
|
|
|
|
+ v-model="thenAccount"
|
|
|
|
|
+ type="textarea"
|
|
|
|
|
+ :autosize="{ minRows: 15, maxRows: 100 }"
|
|
|
|
|
+ />
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col :span="12">
|
|
|
|
|
+ <span style="font-size: 5px; color: #F56C6C;">失败账户:</span>
|
|
|
|
|
+ <el-input
|
|
|
|
|
+ v-model="catchAccount"
|
|
|
|
|
+ type="textarea"
|
|
|
|
|
+ :autosize="{ minRows: 15, maxRows: 100 }"
|
|
|
|
|
+ />
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ </el-row>
|
|
|
|
|
+ </el-col>
|
|
|
</el-row>
|
|
</el-row>
|
|
|
|
|
+
|
|
|
</el-form>
|
|
</el-form>
|
|
|
|
|
|
|
|
</div>
|
|
</div>
|
|
@@ -107,16 +125,25 @@ export default {
|
|
|
name: 'Recharge',
|
|
name: 'Recharge',
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
- // accountHandle: '13121776520\n13121776521\n13121776522\n13121776523\n13121776524\n13121776525', // 待处理账号
|
|
|
|
|
- accountHandle: '13121776520\n17719118763', // 待处理账号
|
|
|
|
|
accountHandleSuccess: '', // 处理成功账号
|
|
accountHandleSuccess: '', // 处理成功账号
|
|
|
- form: {
|
|
|
|
|
- resource: 0, // 支付方式
|
|
|
|
|
- payMoney: 0, // 支付金额
|
|
|
|
|
- paypwd: '' // 支付密码
|
|
|
|
|
|
|
+ dataForm: {
|
|
|
|
|
+ pid: 'd65aa6d7614589bffe62456b88e98811', // 游戏平台ID;默认魅族平台
|
|
|
|
|
+ cid: '', // 渠道账号ID
|
|
|
|
|
+ gfid: '', // 游戏ID
|
|
|
|
|
+ paypwd: '', // 支付密码
|
|
|
|
|
+ username: '13121776520\n17719118763', // 充值账户
|
|
|
|
|
+ money: 1, // 充值金额(单位:元)
|
|
|
|
|
+ recharge: 2, //
|
|
|
|
|
+ payway: 1, // 充值方式
|
|
|
|
|
+ type: 3 //
|
|
|
|
|
+ },
|
|
|
|
|
+ ruleForm: {
|
|
|
|
|
+ pid: [{ required: true, message: '请选择平台.', trigger: 'change' }],
|
|
|
|
|
+ cid: [{ required: true, message: '请选择渠道账号.', trigger: 'change' }],
|
|
|
|
|
+ gfid: [{ required: true, message: '请选择游戏.', trigger: 'change' }],
|
|
|
|
|
+ username: [{ required: true, message: '缺少充值账户.', trigger: 'blur' }],
|
|
|
|
|
+ money: [{ required: true, message: '请输入充值金额,最低一元.', trigger: 'blur' }]
|
|
|
},
|
|
},
|
|
|
- // 默认魅族平台
|
|
|
|
|
- rechargePlatformDefault: 'd65aa6d7614589bffe62456b88e98811', // 默认账户-pid
|
|
|
|
|
// 游戏平台列表
|
|
// 游戏平台列表
|
|
|
rechargePlatform: [
|
|
rechargePlatform: [
|
|
|
{
|
|
{
|
|
@@ -128,80 +155,85 @@ export default {
|
|
|
'length': 2
|
|
'length': 2
|
|
|
}
|
|
}
|
|
|
],
|
|
],
|
|
|
- // 渠道余额
|
|
|
|
|
- balanceMoney: 0,
|
|
|
|
|
- // 渠道账号
|
|
|
|
|
- rechargeChannelPlatformDefault: '', // cid
|
|
|
|
|
- rechargeChannelPlatform: [],
|
|
|
|
|
- // 游戏列表
|
|
|
|
|
- rechargeGameDefault: '', // gid
|
|
|
|
|
- rechargeGame: []
|
|
|
|
|
|
|
+ balanceMoney: 0, // 渠道余额
|
|
|
|
|
+ rechargeChannelPlatform: [], // 渠道账号
|
|
|
|
|
+ rechargeGame: [], // 游戏列表
|
|
|
|
|
+
|
|
|
|
|
+ thenAccount: '', // 成功账户
|
|
|
|
|
+ catchAccount: '' // 失败账户
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
created() {
|
|
created() {
|
|
|
- this.getBalanceMoney(this.rechargePlatformDefault)
|
|
|
|
|
- this.getRechargePlatform(this.rechargePlatformDefault)
|
|
|
|
|
- this.getRechargeGame(this.rechargePlatformDefault)
|
|
|
|
|
|
|
+ this.getBalanceMoney(this.dataForm.pid)
|
|
|
|
|
+ this.getRechargePlatform(this.dataForm.pid)
|
|
|
|
|
+ this.getRechargeGame(this.dataForm.pid)
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
async onSubmit() {
|
|
async onSubmit() {
|
|
|
- // TODO: form 数据内容判断
|
|
|
|
|
- // TODO: 检测数据页面改为 tree 格式,方便查看某一条数据状态(成功/失败)
|
|
|
|
|
|
|
+ this.thenAccount = ''
|
|
|
|
|
+ this.catchAccount = ''
|
|
|
|
|
|
|
|
- const _this = this
|
|
|
|
|
- // 截取每一条数据
|
|
|
|
|
- var accountHandle = _this.accountHandleSuccess.split('\n')
|
|
|
|
|
- console.log(accountHandle)
|
|
|
|
|
-
|
|
|
|
|
- await MessageBox.prompt('输入支付密码', 'Tip', {
|
|
|
|
|
- confirmButtonText: '确认',
|
|
|
|
|
- cancelButtonText: '取消'
|
|
|
|
|
- }).then(({ value }) => {
|
|
|
|
|
- _this.form.paypwd = value
|
|
|
|
|
- }).catch(() => {
|
|
|
|
|
- Message({
|
|
|
|
|
|
|
+ if ((this.balanceMoney - this.dataForm.money) < 0) {
|
|
|
|
|
+ return Message({
|
|
|
type: 'info',
|
|
type: 'info',
|
|
|
- message: '取消充值.'
|
|
|
|
|
|
|
+ message: '余额不足以充值.'
|
|
|
})
|
|
})
|
|
|
- })
|
|
|
|
|
- console.log('# 支付密码:', this.form.paypwd)
|
|
|
|
|
-
|
|
|
|
|
- var successList = [] // 成功数据
|
|
|
|
|
- var failList = [] // 失败数据
|
|
|
|
|
- for (var i = 0; i < accountHandle.length; i++) {
|
|
|
|
|
- await this.rechargePlayer({ successList, failList }, accountHandle[i])
|
|
|
|
|
}
|
|
}
|
|
|
- // if (successList) {
|
|
|
|
|
- // this.accountHandleSuccess = successList.join('\n')
|
|
|
|
|
- // }
|
|
|
|
|
- console.log('# 成功:', successList)
|
|
|
|
|
- console.log('# 失败:', failList)
|
|
|
|
|
|
|
+ this.$refs['dataForm'].validate((valid) => {
|
|
|
|
|
+ console.log('# form-validate:', valid)
|
|
|
|
|
+ if (valid) {
|
|
|
|
|
+ // 截取数据
|
|
|
|
|
+ var userLists = this.dataForm.username.split('\n')
|
|
|
|
|
+
|
|
|
|
|
+ MessageBox.prompt('输入支付密码', 'Tip', {
|
|
|
|
|
+ confirmButtonText: '确认',
|
|
|
|
|
+ cancelButtonText: '取消'
|
|
|
|
|
+ }).then(({ value }) => {
|
|
|
|
|
+ var successList = [] // 成功数据
|
|
|
|
|
+ var failList = [] // 失败数据
|
|
|
|
|
+
|
|
|
|
|
+ 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({ successList, failList }, _data, index)
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
|
|
+ console.log('# 成功:', successList)
|
|
|
|
|
+ console.log('# 失败:', failList)
|
|
|
|
|
+ }).catch(() => {
|
|
|
|
|
+ return Message({
|
|
|
|
|
+ type: 'info',
|
|
|
|
|
+ message: '取消充值.'
|
|
|
|
|
+ })
|
|
|
|
|
+ })
|
|
|
|
|
+ } else {
|
|
|
|
|
+ return Message({
|
|
|
|
|
+ type: 'error',
|
|
|
|
|
+ message: '请完善提交内容.'
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
},
|
|
},
|
|
|
// 异步进行账户充值
|
|
// 异步进行账户充值
|
|
|
- rechargePlayer(request, mobile) {
|
|
|
|
|
|
|
+ rechargePlayer(request, data, index) {
|
|
|
return new Promise((resolve, reject) => {
|
|
return new Promise((resolve, reject) => {
|
|
|
- const _this = this
|
|
|
|
|
- const _request = request
|
|
|
|
|
- const _data = { pid: this.rechargePlatformDefault, cid: this.rechargeChannelPlatformDefault, gfid: this.rechargeGameDefault, paypwd: this.form.paypwd, username: mobile, money: this.form.payMoney, recharge: 2, payway: 1, type: 3 }
|
|
|
|
|
- setTimeout((_this, _request, _data) => {
|
|
|
|
|
- _this.$store.dispatch('common/rechargePlayer', _data).then((res) => {
|
|
|
|
|
|
|
+ setTimeout((_request, _data) => {
|
|
|
|
|
+ this.$store.dispatch('common/rechargePlayer', _data).then((res) => {
|
|
|
const { code, status } = res
|
|
const { code, status } = res
|
|
|
if (code === 200 && status === true) {
|
|
if (code === 200 && status === true) {
|
|
|
_request.successList.push(_data.username)
|
|
_request.successList.push(_data.username)
|
|
|
|
|
+ this.thenAccount = this.thenAccount + _data.username + '\n'
|
|
|
resolve()
|
|
resolve()
|
|
|
} else {
|
|
} else {
|
|
|
_request.failList.push(_data.username)
|
|
_request.failList.push(_data.username)
|
|
|
|
|
+ this.catchAccount = this.catchAccount + _data.username + '\n'
|
|
|
resolve()
|
|
resolve()
|
|
|
}
|
|
}
|
|
|
}).catch((res) => {
|
|
}).catch((res) => {
|
|
|
- // Message({
|
|
|
|
|
- // message: res,
|
|
|
|
|
- // type: 'error',
|
|
|
|
|
- // duration: 5 * 1000
|
|
|
|
|
- // })
|
|
|
|
|
|
|
+ this.catchAccount = this.catchAccount + _data.username + '\n'
|
|
|
|
|
+
|
|
|
resolve()
|
|
resolve()
|
|
|
})
|
|
})
|
|
|
- }, 1000, _this, _request, _data)
|
|
|
|
|
|
|
+ }, 2000 * index, request, data)
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
|
|
|
|
@@ -222,7 +254,7 @@ export default {
|
|
|
rechargeChannelPlatformAccount(val).then(response => {
|
|
rechargeChannelPlatformAccount(val).then(response => {
|
|
|
// console.log('# getRechargePlatform:', response)
|
|
// console.log('# getRechargePlatform:', response)
|
|
|
this.rechargeChannelPlatform = response.data.data
|
|
this.rechargeChannelPlatform = response.data.data
|
|
|
- this.rechargeChannelPlatformDefault = response.data.data[0]['cid']
|
|
|
|
|
|
|
+ this.dataForm.cid = response.data.data[0]['cid']
|
|
|
}).catch(res => {
|
|
}).catch(res => {
|
|
|
return Message({
|
|
return Message({
|
|
|
message: res,
|
|
message: res,
|
|
@@ -231,14 +263,11 @@ export default {
|
|
|
})
|
|
})
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
- testingCid(val) {
|
|
|
|
|
- console.log(val)
|
|
|
|
|
- },
|
|
|
|
|
// 游戏列表
|
|
// 游戏列表
|
|
|
getRechargeGame(pid) {
|
|
getRechargeGame(pid) {
|
|
|
this.$store.dispatch('common/rechargeGame', pid).then((res) => {
|
|
this.$store.dispatch('common/rechargeGame', pid).then((res) => {
|
|
|
this.rechargeGame = res
|
|
this.rechargeGame = res
|
|
|
- this.rechargeGameDefault = res[0]['id']
|
|
|
|
|
|
|
+ this.dataForm.gfid = res[0]['id']
|
|
|
}).catch((res) => {
|
|
}).catch((res) => {
|
|
|
return Message({
|
|
return Message({
|
|
|
message: res,
|
|
message: res,
|
|
@@ -247,10 +276,7 @@ export default {
|
|
|
})
|
|
})
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
- testingGfid(val) {
|
|
|
|
|
- console.log(val)
|
|
|
|
|
- },
|
|
|
|
|
- // 账号检测
|
|
|
|
|
|
|
+ // 账号检测 -- 弃用
|
|
|
async confirmAccount() {
|
|
async confirmAccount() {
|
|
|
if (this.accountHandle === '') {
|
|
if (this.accountHandle === '') {
|
|
|
return Message({
|
|
return Message({
|