|
@@ -1,149 +1,273 @@
|
|
|
<template>
|
|
<template>
|
|
|
<div class="login-container">
|
|
<div class="login-container">
|
|
|
- <el-container>
|
|
|
|
|
- <el-aside width="500px">
|
|
|
|
|
- <el-row class="row-bg" gutter="10">
|
|
|
|
|
- <el-col :span="8">
|
|
|
|
|
- <span style="font-size: 5px;">贴入充值账号,一行一个账号.</span>
|
|
|
|
|
- <el-input
|
|
|
|
|
- v-model="accountHandle"
|
|
|
|
|
- :rows="25"
|
|
|
|
|
- type="textarea"
|
|
|
|
|
- placeholder="待检测账号."
|
|
|
|
|
- />
|
|
|
|
|
- </el-col>
|
|
|
|
|
- <el-col :span="6">
|
|
|
|
|
- <el-button type="success" @click="confirmAccount">确认账号</el-button>
|
|
|
|
|
- </el-col>
|
|
|
|
|
- <el-col :span="8">
|
|
|
|
|
- <span style="font-size: 5px;">账号确认成功后会显示到这里.</span>
|
|
|
|
|
- <el-input
|
|
|
|
|
- v-model="accountHandleSuccess"
|
|
|
|
|
- :rows="25"
|
|
|
|
|
- type="textarea"
|
|
|
|
|
- placeholder="账号检测成功."
|
|
|
|
|
- />
|
|
|
|
|
- </el-col>
|
|
|
|
|
- </el-row>
|
|
|
|
|
- </el-aside>
|
|
|
|
|
- <el-main>
|
|
|
|
|
- <el-form ref="form" :model="form" label-width="100px">
|
|
|
|
|
|
|
+ <el-form ref="form" :model="form">
|
|
|
|
|
+ <el-row :gutter="30">
|
|
|
|
|
+ <el-col :span="5">
|
|
|
<el-form-item label="游戏平台">
|
|
<el-form-item label="游戏平台">
|
|
|
- <el-select v-model="value" placeholder="Select">
|
|
|
|
|
|
|
+ <el-select v-model="rechargePlatformDefault" placeholder="Select">
|
|
|
<el-option
|
|
<el-option
|
|
|
- v-for="item in options"
|
|
|
|
|
- :key="item.value"
|
|
|
|
|
- :label="item.label"
|
|
|
|
|
- :value="item.value"
|
|
|
|
|
|
|
+ v-for="(item, index) in rechargePlatform"
|
|
|
|
|
+ :key="index"
|
|
|
|
|
+ :label="item.platform"
|
|
|
|
|
+ :value="item.pid"
|
|
|
/>
|
|
/>
|
|
|
</el-select>
|
|
</el-select>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
|
|
+ <el-form-item label="渠道余额" style="width: 300px;">
|
|
|
|
|
+ <el-input v-model="balanceMoney" type="number" class="inline-input" disabled style="width: 160px;" /> 元
|
|
|
|
|
+ </el-form-item>
|
|
|
<el-form-item label="渠道账号">
|
|
<el-form-item label="渠道账号">
|
|
|
- <el-select v-model="value" placeholder="Select">
|
|
|
|
|
|
|
+ <el-select v-model="rechargeChannelPlatformDefault" placeholder="Select">
|
|
|
<el-option
|
|
<el-option
|
|
|
- v-for="item in options"
|
|
|
|
|
- :key="item.value"
|
|
|
|
|
- :label="item.label"
|
|
|
|
|
- :value="item.value"
|
|
|
|
|
|
|
+ v-for="(item, index) in rechargeChannelPlatform"
|
|
|
|
|
+ :key="index"
|
|
|
|
|
+ :label="item.account"
|
|
|
|
|
+ :value="item.cid"
|
|
|
|
|
+ @change="testingCid"
|
|
|
/>
|
|
/>
|
|
|
</el-select>
|
|
</el-select>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-form-item label="选择游戏">
|
|
<el-form-item label="选择游戏">
|
|
|
- <el-select v-model="value" placeholder="Select">
|
|
|
|
|
|
|
+ <el-select v-model="rechargeGameDefault" placeholder="Select">
|
|
|
<el-option
|
|
<el-option
|
|
|
- v-for="item in options"
|
|
|
|
|
- :key="item.value"
|
|
|
|
|
- :label="item.label"
|
|
|
|
|
- :value="item.value"
|
|
|
|
|
|
|
+ v-for="(item, index) in rechargeGame"
|
|
|
|
|
+ :key="index"
|
|
|
|
|
+ :label="item.name"
|
|
|
|
|
+ :value="item.id"
|
|
|
|
|
+ @change="testingGfid"
|
|
|
/>
|
|
/>
|
|
|
</el-select>
|
|
</el-select>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
- <el-form-item label="充值金额">
|
|
|
|
|
- <el-input v-model="form.name" type="number" class="inline-input" />
|
|
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+
|
|
|
|
|
+ <el-divider direction="vertical" />
|
|
|
|
|
+
|
|
|
|
|
+ <el-col :span="8">
|
|
|
|
|
+ <el-row class="row-bg" gutter="10">
|
|
|
|
|
+ <el-col :span="9">
|
|
|
|
|
+ <span style="font-size: 5px; color: #67C23A;">贴入充值账号,一行一个账号.</span>
|
|
|
|
|
+ <!-- :rows="25" -->
|
|
|
|
|
+ <el-input
|
|
|
|
|
+ v-model="accountHandle"
|
|
|
|
|
+ type="textarea"
|
|
|
|
|
+ placeholder="待检测账号."
|
|
|
|
|
+ :autosize="{ minRows: 10, maxRows: 30 }"
|
|
|
|
|
+ />
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col :span="6" style="margin-top: 150px;">
|
|
|
|
|
+ <el-button type="success" @click="confirmAccount">确认账号</el-button>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col :span="9">
|
|
|
|
|
+ <span style="font-size: 5px; color: #67C23A;">账号确认成功后会显示到这里.</span>
|
|
|
|
|
+ <el-input
|
|
|
|
|
+ v-model="accountHandleSuccess"
|
|
|
|
|
+ type="textarea"
|
|
|
|
|
+ placeholder="账号检测成功."
|
|
|
|
|
+ :autosize="{ minRows: 10, maxRows: 30 }"
|
|
|
|
|
+ />
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ </el-row>
|
|
|
|
|
+ </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-form-item>
|
|
</el-form-item>
|
|
|
- <el-form-item label="平台折扣">
|
|
|
|
|
|
|
+ <!-- <el-form-item label="平台折扣">
|
|
|
<span>9.8折</span>
|
|
<span>9.8折</span>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-form-item label="游戏折扣">
|
|
<el-form-item label="游戏折扣">
|
|
|
<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">
|
|
|
|
|
- <el-radio label="久币支付" />
|
|
|
|
|
- <el-radio label="商务币支付" />
|
|
|
|
|
|
|
+ <el-radio-group v-model="form.resource" disabled>
|
|
|
|
|
+ <el-radio :label="0">久币支付</el-radio>
|
|
|
|
|
+ <el-radio :label="1">商务币支付</el-radio>
|
|
|
</el-radio-group>
|
|
</el-radio-group>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-form-item label="支付金额">
|
|
<el-form-item label="支付金额">
|
|
|
- <span>99.999元</span>
|
|
|
|
|
|
|
+ <span>{{ form.payMoney }} 元</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-form>
|
|
|
|
|
- </el-main>
|
|
|
|
|
- </el-container>
|
|
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ </el-row>
|
|
|
|
|
+ </el-form>
|
|
|
|
|
+
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
-// import { validMobile } from '@/utils/validate'
|
|
|
|
|
|
|
+import { Message, MessageBox } from 'element-ui'
|
|
|
|
|
+import { rechargeChannelPlatformAccount } from '@/api/common'
|
|
|
|
|
|
|
|
export default {
|
|
export default {
|
|
|
name: 'Recharge',
|
|
name: 'Recharge',
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
// accountHandle: '13121776520\n13121776521\n13121776522\n13121776523\n13121776524\n13121776525', // 待处理账号
|
|
// accountHandle: '13121776520\n13121776521\n13121776522\n13121776523\n13121776524\n13121776525', // 待处理账号
|
|
|
- accountHandle: '', // 待处理账号
|
|
|
|
|
|
|
+ accountHandle: '13121776520\n17719118763', // 待处理账号
|
|
|
accountHandleSuccess: '', // 处理成功账号
|
|
accountHandleSuccess: '', // 处理成功账号
|
|
|
form: {
|
|
form: {
|
|
|
- name: '',
|
|
|
|
|
- region: '',
|
|
|
|
|
- date1: '',
|
|
|
|
|
- date2: '',
|
|
|
|
|
- delivery: false,
|
|
|
|
|
- type: [],
|
|
|
|
|
- resource: '',
|
|
|
|
|
- desc: ''
|
|
|
|
|
|
|
+ resource: 0, // 支付方式
|
|
|
|
|
+ payMoney: 0, // 支付金额
|
|
|
|
|
+ paypwd: '' // 支付密码
|
|
|
},
|
|
},
|
|
|
- value: [],
|
|
|
|
|
- options: [
|
|
|
|
|
|
|
+ // 默认魅族平台
|
|
|
|
|
+ rechargePlatformDefault: 'd65aa6d7614589bffe62456b88e98811', // 默认账户-pid
|
|
|
|
|
+ // 游戏平台列表
|
|
|
|
|
+ rechargePlatform: [
|
|
|
{
|
|
{
|
|
|
- value: 'aaaa',
|
|
|
|
|
- label: 'aaaa'
|
|
|
|
|
- }, {
|
|
|
|
|
- value: 'xxx',
|
|
|
|
|
- label: 'bbb'
|
|
|
|
|
- }, {
|
|
|
|
|
- value: 'ccc',
|
|
|
|
|
- label: 'ccc'
|
|
|
|
|
- }, {
|
|
|
|
|
- value: 'ddd',
|
|
|
|
|
- label: 'ddd'
|
|
|
|
|
|
|
+ 'pid': 'd65aa6d7614589bffe62456b88e98811',
|
|
|
|
|
+ 'platform': 'MM',
|
|
|
|
|
+ 'disRate': 9.8,
|
|
|
|
|
+ 'rate': 9.7,
|
|
|
|
|
+ 'type': 0,
|
|
|
|
|
+ 'length': 2
|
|
|
}
|
|
}
|
|
|
- ]
|
|
|
|
|
|
|
+ ],
|
|
|
|
|
+ // 渠道余额
|
|
|
|
|
+ balanceMoney: 0,
|
|
|
|
|
+ // 渠道账号
|
|
|
|
|
+ rechargeChannelPlatformDefault: '', // cid
|
|
|
|
|
+ rechargeChannelPlatform: [],
|
|
|
|
|
+ // 游戏列表
|
|
|
|
|
+ rechargeGameDefault: '', // gid
|
|
|
|
|
+ rechargeGame: []
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
created() {
|
|
created() {
|
|
|
|
|
+ this.getBalanceMoney(this.rechargePlatformDefault)
|
|
|
|
|
+ this.getRechargePlatform(this.rechargePlatformDefault)
|
|
|
|
|
+ this.getRechargeGame(this.rechargePlatformDefault)
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
- onSubmit() {
|
|
|
|
|
- console.log('submit!')
|
|
|
|
|
|
|
+ async onSubmit() {
|
|
|
|
|
+ // TODO: form 数据内容判断
|
|
|
|
|
+ // TODO: 检测数据页面改为 tree 格式,方便查看某一条数据状态(成功/失败)
|
|
|
|
|
+
|
|
|
|
|
+ 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({
|
|
|
|
|
+ type: 'info',
|
|
|
|
|
+ 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)
|
|
|
|
|
+ },
|
|
|
|
|
+ // 异步进行账户充值
|
|
|
|
|
+ rechargePlayer(request, mobile) {
|
|
|
|
|
+ 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) => {
|
|
|
|
|
+ const { code, status } = res
|
|
|
|
|
+ if (code === 200 && status === true) {
|
|
|
|
|
+ _request.successList.push(_data.username)
|
|
|
|
|
+ resolve()
|
|
|
|
|
+ } else {
|
|
|
|
|
+ _request.failList.push(_data.username)
|
|
|
|
|
+ resolve()
|
|
|
|
|
+ }
|
|
|
|
|
+ }).catch((res) => {
|
|
|
|
|
+ // Message({
|
|
|
|
|
+ // message: res,
|
|
|
|
|
+ // type: 'error',
|
|
|
|
|
+ // duration: 5 * 1000
|
|
|
|
|
+ // })
|
|
|
|
|
+ resolve()
|
|
|
|
|
+ })
|
|
|
|
|
+ }, 1000, _this, _request, _data)
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ // 账户余额
|
|
|
|
|
+ getBalanceMoney(val) {
|
|
|
|
|
+ this.$store.dispatch('common/getMainChannelMoney', val).then((res) => {
|
|
|
|
|
+ this.balanceMoney = res
|
|
|
|
|
+ }).catch((res) => {
|
|
|
|
|
+ return Message({
|
|
|
|
|
+ message: res,
|
|
|
|
|
+ type: 'error',
|
|
|
|
|
+ duration: 5 * 1000
|
|
|
|
|
+ })
|
|
|
|
|
+ })
|
|
|
},
|
|
},
|
|
|
- handleChange1(value) {
|
|
|
|
|
- console.log(value)
|
|
|
|
|
|
|
+ // 渠道账号列表
|
|
|
|
|
+ getRechargePlatform(val) {
|
|
|
|
|
+ rechargeChannelPlatformAccount(val).then(response => {
|
|
|
|
|
+ // console.log('# getRechargePlatform:', response)
|
|
|
|
|
+ this.rechargeChannelPlatform = response.data.data
|
|
|
|
|
+ this.rechargeChannelPlatformDefault = response.data.data[0]['cid']
|
|
|
|
|
+ }).catch(res => {
|
|
|
|
|
+ return Message({
|
|
|
|
|
+ message: res,
|
|
|
|
|
+ type: 'error',
|
|
|
|
|
+ duration: 5 * 1000
|
|
|
|
|
+ })
|
|
|
|
|
+ })
|
|
|
},
|
|
},
|
|
|
- handleChange2(value) {
|
|
|
|
|
- console.log(value)
|
|
|
|
|
|
|
+ testingCid(val) {
|
|
|
|
|
+ console.log(val)
|
|
|
|
|
+ },
|
|
|
|
|
+ // 游戏列表
|
|
|
|
|
+ getRechargeGame(pid) {
|
|
|
|
|
+ this.$store.dispatch('common/rechargeGame', pid).then((res) => {
|
|
|
|
|
+ this.rechargeGame = res
|
|
|
|
|
+ this.rechargeGameDefault = res[0]['id']
|
|
|
|
|
+ }).catch((res) => {
|
|
|
|
|
+ return Message({
|
|
|
|
|
+ message: res,
|
|
|
|
|
+ type: 'error',
|
|
|
|
|
+ duration: 5 * 1000
|
|
|
|
|
+ })
|
|
|
|
|
+ })
|
|
|
},
|
|
},
|
|
|
- handleChange3(value) {
|
|
|
|
|
- console.log(value)
|
|
|
|
|
|
|
+ testingGfid(val) {
|
|
|
|
|
+ console.log(val)
|
|
|
},
|
|
},
|
|
|
|
|
+ // 账号检测
|
|
|
async confirmAccount() {
|
|
async confirmAccount() {
|
|
|
|
|
+ if (this.accountHandle === '') {
|
|
|
|
|
+ return Message({
|
|
|
|
|
+ message: '请输入检测账号!',
|
|
|
|
|
+ type: 'error',
|
|
|
|
|
+ duration: 5 * 1000
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
// 截取每一条数据
|
|
// 截取每一条数据
|
|
|
var accountHandle = this.accountHandle.split('\n')
|
|
var accountHandle = this.accountHandle.split('\n')
|
|
|
- // console.log(list)
|
|
|
|
|
- var successList = []
|
|
|
|
|
- var failList = []
|
|
|
|
|
|
|
+
|
|
|
|
|
+ // TODO: 检测账号数据去重
|
|
|
|
|
+
|
|
|
|
|
+ var successList = [] // 成功数据
|
|
|
|
|
+ var failList = [] // 失败数据
|
|
|
for (var i = 0; i < accountHandle.length; i++) {
|
|
for (var i = 0; i < accountHandle.length; i++) {
|
|
|
await this.requestFunc({ successList, failList }, accountHandle[i])
|
|
await this.requestFunc({ successList, failList }, accountHandle[i])
|
|
|
}
|
|
}
|
|
@@ -153,27 +277,33 @@ export default {
|
|
|
console.log('# 成功:', successList)
|
|
console.log('# 成功:', successList)
|
|
|
console.log('# 失败:', failList)
|
|
console.log('# 失败:', failList)
|
|
|
},
|
|
},
|
|
|
- requestFunc(request, data) {
|
|
|
|
|
|
|
+ // 异步进行账户检测处理
|
|
|
|
|
+ requestFunc(request, mobile) {
|
|
|
return new Promise((resolve, reject) => {
|
|
return new Promise((resolve, reject) => {
|
|
|
- this.$store.dispatch('common/rechargePlayerType', data).then((res) => {
|
|
|
|
|
- // console.log('# then:', res)
|
|
|
|
|
- if (res.status === true) {
|
|
|
|
|
- request.successList.push(data)
|
|
|
|
|
- } else {
|
|
|
|
|
- request.failList.push(data)
|
|
|
|
|
- }
|
|
|
|
|
- resolve()
|
|
|
|
|
- }).catch((res) => {
|
|
|
|
|
- resolve()
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ const _this = this
|
|
|
|
|
+ const _request = request
|
|
|
|
|
+ const _mobile = mobile
|
|
|
|
|
+ setTimeout((_this, _request, _mobile, { pid, cid, gfid }) => {
|
|
|
|
|
+ _this.$store.dispatch('common/rechargePlayerType', { pid: pid, cid: cid, gfid: gfid, username: _mobile }).then((res) => {
|
|
|
|
|
+ if (res.status === true) {
|
|
|
|
|
+ _request.successList.push(_mobile)
|
|
|
|
|
+ } else {
|
|
|
|
|
+ _request.failList.push(_mobile)
|
|
|
|
|
+ }
|
|
|
|
|
+ resolve()
|
|
|
|
|
+ }).catch(() => {
|
|
|
|
|
+ resolve()
|
|
|
|
|
+ })
|
|
|
|
|
+ }, 1000, _this, _request, _mobile, { pid: this.rechargePlatformDefault, cid: this.rechargeChannelPlatformDefault, gfid: this.rechargeGameDefault })
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss">
|
|
<style lang="scss">
|
|
|
-.login-container{
|
|
|
|
|
- margin: 10px;
|
|
|
|
|
-}
|
|
|
|
|
|
|
+ .login-container{
|
|
|
|
|
+ margin: 20px;
|
|
|
|
|
+ }
|
|
|
</style>
|
|
</style>
|