|
@@ -45,6 +45,9 @@
|
|
|
<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="当前渠道余额">
|
|
|
|
|
+ <span>{{ balanceMoney }}元</span>
|
|
|
|
|
+ </el-form-item>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
|
|
|
|
|
<el-col :span="3">
|
|
<el-col :span="3">
|
|
@@ -179,7 +182,7 @@ export default {
|
|
|
'length': 2
|
|
'length': 2
|
|
|
}
|
|
}
|
|
|
],
|
|
],
|
|
|
- // balanceMoney: 0, // 渠道余额
|
|
|
|
|
|
|
+ balanceMoney: 0, // 渠道余额
|
|
|
user_money: 0, // 账户余额
|
|
user_money: 0, // 账户余额
|
|
|
maxMoney: 0, // 最大充值金额
|
|
maxMoney: 0, // 最大充值金额
|
|
|
rechargeChannelPlatform: [], // 渠道账号
|
|
rechargeChannelPlatform: [], // 渠道账号
|
|
@@ -213,7 +216,7 @@ export default {
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
created() {
|
|
created() {
|
|
|
- // this.getBalanceMoney(this.dataForm.pid)
|
|
|
|
|
|
|
+ this.getBalanceMoney()
|
|
|
this.getRechargePlatform(this.dataForm.pid)
|
|
this.getRechargePlatform(this.dataForm.pid)
|
|
|
this.getRechargeGame(this.dataForm.pid)
|
|
this.getRechargeGame(this.dataForm.pid)
|
|
|
this.updateUserMoney()
|
|
this.updateUserMoney()
|
|
@@ -229,11 +232,11 @@ export default {
|
|
|
// 判断充值金额
|
|
// 判断充值金额
|
|
|
checkMoney(money) {
|
|
checkMoney(money) {
|
|
|
this.rechargeMoney = this.accountNum * money
|
|
this.rechargeMoney = this.accountNum * money
|
|
|
- if ((this.user_money - this.rechargeMoney) < 0) {
|
|
|
|
|
|
|
+ if ((this.balanceMoney - this.rechargeMoney) < 0) {
|
|
|
// this.rechargeMoney = this.accountNum * oldVal
|
|
// this.rechargeMoney = this.accountNum * oldVal
|
|
|
return Message({
|
|
return Message({
|
|
|
type: 'warning',
|
|
type: 'warning',
|
|
|
- message: '账户余额不足以充值!'
|
|
|
|
|
|
|
+ message: '渠道余额不足以充值!'
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
@@ -242,11 +245,7 @@ export default {
|
|
|
this.$store.dispatch('user/getInfo').then((res) => {
|
|
this.$store.dispatch('user/getInfo').then((res) => {
|
|
|
const { data } = res
|
|
const { data } = res
|
|
|
this.user_money = Math.floor(data.user_money)
|
|
this.user_money = Math.floor(data.user_money)
|
|
|
- if (this.accountNum > 0) {
|
|
|
|
|
- this.maxMoney = Math.floor(data.user_money / this.accountNum)
|
|
|
|
|
- } else {
|
|
|
|
|
- this.maxMoney = Math.floor(data.user_money)
|
|
|
|
|
- }
|
|
|
|
|
|
|
+
|
|
|
return Message({
|
|
return Message({
|
|
|
type: 'success',
|
|
type: 'success',
|
|
|
message: '账户余额已更新'
|
|
message: '账户余额已更新'
|
|
@@ -284,7 +283,7 @@ 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.rechargeMoney = this.accountNum * this.dataForm.money
|
|
|
- this.maxMoney = Math.floor(this.user_money / this.accountNum)
|
|
|
|
|
|
|
+ this.maxMoney = Math.floor(this.balanceMoney / this.accountNum)
|
|
|
},
|
|
},
|
|
|
/**
|
|
/**
|
|
|
* 发起提交 游戏账号检测/提交充值 数据
|
|
* 发起提交 游戏账号检测/提交充值 数据
|
|
@@ -329,7 +328,7 @@ export default {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 需要充值则检测余额
|
|
// 需要充值则检测余额
|
|
|
- if ((this.user_money - this.rechargeMoney) < 0) {
|
|
|
|
|
|
|
+ if ((this.balanceMoney - this.rechargeMoney) < 0) {
|
|
|
return Message({
|
|
return Message({
|
|
|
type: 'warning',
|
|
type: 'warning',
|
|
|
message: '账户余额不足以充值!'
|
|
message: '账户余额不足以充值!'
|
|
@@ -559,6 +558,7 @@ export default {
|
|
|
this.loading.close()
|
|
this.loading.close()
|
|
|
if (onMoney) {
|
|
if (onMoney) {
|
|
|
this.updateUserMoney()
|
|
this.updateUserMoney()
|
|
|
|
|
+ this.getBalanceMoney()
|
|
|
}
|
|
}
|
|
|
this.endTime = new Date().getHours() + ':' + new Date().getMinutes() + ':' + new Date().getSeconds()
|
|
this.endTime = new Date().getHours() + ':' + new Date().getMinutes() + ':' + new Date().getSeconds()
|
|
|
},
|
|
},
|
|
@@ -742,6 +742,27 @@ export default {
|
|
|
duration: 5 * 1000
|
|
duration: 5 * 1000
|
|
|
})
|
|
})
|
|
|
})
|
|
})
|
|
|
|
|
+ },
|
|
|
|
|
+ // 账户余额 -- 弃用
|
|
|
|
|
+ getBalanceMoney() {
|
|
|
|
|
+ this.$store.dispatch('common/getMainChannelMoney', this.dataForm.pid).then((res) => {
|
|
|
|
|
+ this.balanceMoney = res
|
|
|
|
|
+ if (this.accountNum > 0) {
|
|
|
|
|
+ this.maxMoney = Math.floor(res / this.accountNum)
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.maxMoney = Math.floor(res)
|
|
|
|
|
+ }
|
|
|
|
|
+ return Message({
|
|
|
|
|
+ type: 'success',
|
|
|
|
|
+ message: '渠道余额已更新'
|
|
|
|
|
+ })
|
|
|
|
|
+ }).catch((res) => {
|
|
|
|
|
+ return Message({
|
|
|
|
|
+ message: res,
|
|
|
|
|
+ type: 'error',
|
|
|
|
|
+ duration: 5 * 1000
|
|
|
|
|
+ })
|
|
|
|
|
+ })
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|