Commit 70d1debe authored by wxk's avatar wxk

充提币ok

parent 9f9798c1
...@@ -8,6 +8,8 @@ const Api = { ...@@ -8,6 +8,8 @@ const Api = {
GetRobotStatus: "/robotStatus",//机器人预警状态查询 GetRobotStatus: "/robotStatus",//机器人预警状态查询
GetPlatformInfo: "/platform",//交易所及匹配的交易对、目标币信息查询 GetPlatformInfo: "/platform",//交易所及匹配的交易对、目标币信息查询
GetRobotBank: "/accountlist",//查询机器人银行账户 GetRobotBank: "/accountlist",//查询机器人银行账户
GetWalletInfo: "/walletInfo ", //查询某个账号的当前资产信息
Transfer: "/transfer", //充币提币
} }
export default Api; export default Api;
...@@ -70,8 +70,8 @@ ...@@ -70,8 +70,8 @@
<div class="handle-content"> <div class="handle-content">
<div class="handle"> <div class="handle">
<span class="coin-name">{{robotDetailInfo.coin}}</span> <span class="coin-name">{{robotDetailInfo.coin}}</span>
<span class="button">充币</span> <span class="button" @click="clickRecharge(robotDetailInfo.coin)">充币</span>
<span class="button">提币</span> <span class="button" @click="clickWithdraw(robotDetailInfo.coin)">提币</span>
</div> </div>
<p class="item"> <p class="item">
<span class="type-name">可用</span> <span class="type-name">可用</span>
...@@ -89,8 +89,8 @@ ...@@ -89,8 +89,8 @@
<div class="handle-content"> <div class="handle-content">
<div class="handle"> <div class="handle">
<span class="coin-name">{{robotDetailInfo.base}}</span> <span class="coin-name">{{robotDetailInfo.base}}</span>
<span class="button">充币</span> <span class="button" @click="clickRecharge(robotDetailInfo.base)">充币</span>
<span class="button">提币</span> <span class="button" @click="clickWithdraw(robotDetailInfo.base)">提币</span>
</div> </div>
<p class="item"> <p class="item">
<span class="type-name">可用</span> <span class="type-name">可用</span>
...@@ -105,6 +105,130 @@ ...@@ -105,6 +105,130 @@
<span>1234.123456YCC</span> <span>1234.123456YCC</span>
</p> </p>
</div> </div>
<!-- 充币弹框 -->
<el-dialog
title="充币"
:visible.sync="dialogFormVisible"
:before-close="handleClose"
:close-on-click-modal = "false"
center>
<!-- 内层确认弹框 -->
<el-dialog
width="40%"
title="确认充值"
:visible.sync="innerVisible"
:before-close="handleClose"
:close-on-click-modal = "false"
append-to-body
center>
<el-card class="box-card" style="text-align:left;">
<p>充值数量:&nbsp;&nbsp;<span>{{amount_num}}</span></p>
<p>充值币种:&nbsp;&nbsp;<span>{{account_symbol}}</span></p>
<p style="overflow: hidden;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;From:&nbsp;&nbsp;<span>{{recharge_list_value}}</span></p>
<p style="overflow: hidden;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;To:&nbsp;&nbsp;<span>{{robotDetailInfo.account}}</span></p>
<p>&nbsp;&nbsp;&nbsp;操作人:&nbsp;&nbsp;<span>{{username}}</span></p>
</el-card>
<p class="tips">操作前请确认信息</p>
<div slot="footer" class="dialog-footer">
<el-button @click="innerVisible = false">取 消</el-button>
<el-button type="primary" @click="sure_recharge('recharge')" :disabled="transferok">确认充值</el-button>
</div>
</el-dialog>
<el-form>
<el-form-item label="充值数量" label-width="120px">
<el-input v-model="amount_num"></el-input>
</el-form-item>
<el-form-item label="充值币种" label-width="120px">
<el-input v-model="account_symbol" :disabled="true"></el-input>
</el-form-item>
<el-form-item label="From" label-width="120px">
<el-select
v-model="recharge_list_value"
placeholder="请选择账户"
style="width:100%">
<el-option
v-for="item in robotBankList"
:key="item.account"
:value="item.account">
<span style="float: left">{{ item.account }}</span>
<span style="float: right; color: #8492a6; font-size: 13px">{{ item.tag }}</span>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="To" label-width="120px">
<el-input v-model="robotDetailInfo.account" :disabled="true"></el-input>
</el-form-item>
<el-form-item label="操作人" label-width="120px">
<el-input v-model="username" :disabled="true"></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="cancel(),dialogFormVisible = false">取 消</el-button>
<el-button type="primary" @click="amount_num&&recharge_list_value ? innerVisible=true : innerVisible=false">确 定</el-button>
</div>
</el-dialog>
<!-- 提币弹框 -->
<el-dialog
title="提币"
:visible.sync="dialogFormVisible1"
:before-close="handleClose"
:close-on-click-modal = "false"
center>
<!-- 内层确认弹框 -->
<el-dialog
width="40%"
title="确认提币"
:visible.sync="innerVisible1"
:before-close="handleClose"
:close-on-click-modal = "false"
append-to-body
center>
<el-card class="box-card" style="text-align:left;">
<p>提现数量:&nbsp;&nbsp;<span>{{amount_num}}</span></p>
<p>提现币种:&nbsp;&nbsp;<span>{{account_symbol}}</span></p>
<p style="overflow: hidden;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;From:&nbsp;&nbsp;<span>{{robotDetailInfo.account}}</span></p>
<p style="overflow: hidden;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;To:&nbsp;&nbsp;<span>{{recharge_list_value}}</span></p>
<p>&nbsp;&nbsp;&nbsp;操作人:&nbsp;&nbsp;<span>{{username}}</span></p>
</el-card>
<p class="tips">操作前请确认信息</p>
<div slot="footer" class="dialog-footer">
<el-button @click="innerVisible1 = false">取 消</el-button>
<el-button type="primary" @click="sure_recharge('withdraw')" :disabled="transferok">确认提币</el-button>
</div>
</el-dialog>
<el-form>
<el-form-item label="提现数量" label-width="120px">
<el-input v-model="amount_num"></el-input>
</el-form-item>
<el-form-item label="提现币种" label-width="120px">
<el-input v-model="account_symbol" :disabled="true"></el-input>
</el-form-item>
<el-form-item label="From" label-width="120px">
<el-input v-model="robotDetailInfo.account" :disabled="true"></el-input>
</el-form-item>
<el-form-item label="To" label-width="120px">
<el-select
v-model="recharge_list_value"
placeholder="请选择账户"
style="width:100%">
<el-option
v-for="item in robotBankList"
:key="item.account"
:value="item.account">
<span style="float: left">{{ item.account }}</span>
<span style="float: right; color: #8492a6; font-size: 13px">{{ item.tag }}</span>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="操作人" label-width="120px">
<el-input v-model="username" :disabled="true"></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="cancel(),dialogFormVisible1 = false">取 消</el-button>
<el-button type="primary" @click="amount_num&&recharge_list_value ? innerVisible1=true : innerVisible1=false">确 定</el-button>
</div>
</el-dialog>
</div> </div>
</el-col> </el-col>
</el-row> </el-row>
...@@ -118,17 +242,125 @@ ...@@ -118,17 +242,125 @@
export default { export default {
data(){ data(){
return{ return{
username: localStorage.getItem('username'),
value1: true, value1: true,
amount_num:'',//充值数量
dialogFormVisible:false,//充值弹框
transferok:false,
innerVisible: false,//充值确认弹框
dialogFormVisible1:false,//提现弹框
innerVisible1: false,//提现确认弹框
recharge_list_value: '',//充值时候选择的账户
account_symbol: '',//币种
} }
}, },
props: ['robotDetailInfo'], props: ['robotDetailInfo','robotBankList'],
created() { created() {
}, },
methods: { methods: {
//返回上一页(关闭详情)
closeDetails() { closeDetails() {
Bus.$emit('hideDetails') Bus.$emit('hideDetails')
}, },
//查询账户资金信息
getWalletInfo() {
const params = {
uid: this.robotDetailInfo.account,
}
axios.post(ApiConfig.GetWalletInfo,params).then( res=> {
// console.log(res)
})
},
handleClose(done) {
this.$confirm('确认关闭?')
.then(_ => {
done();
this.amount_num = '';
this.recharge_list_value = '';
this.transferok = false;
})
.catch(_ => {});
},
//点击充币
clickRecharge(symbol) {
this.account_symbol = symbol;
this.dialogFormVisible = true;
},
//取消充值
cancel(){
this.amount_num = '';
this.recharge_list_value = '';
this.transferok = false;
},
//弹框确认充值
sure_recharge(key){
const params = {
user: this.username,
fromuid: this.recharge_list_value,
uid: this.robotDetailInfo.account,
coin: this.account_symbol,
amount: this.amount_num,
opt: key
};
if(!Number(this.amount_num) || this.amount_num<0.00000001 || this.amount_num>1800000000){
this.$notify({
title: '提示',
message: "数量错误",
type: 'error',
duration:'2000',
});
return;
}else{
this.transferok = true;
axios.post(ApiConfig.Transfer,params).then(res=>{
if(res.status == 200 && res.data == "transfer success"){
this.$notify({
title: '提示',
message: key=="recharge"?'充值: '+ this.amount_num +" "+ row.symbol + ' 成功' : '提现: ' + this.amount_num +" "+ row.symbol + ' 成功',
type: 'success',
duration:'2000',
});
}else{
this.$notify({
title: '提示',
message: res.data,
type: 'error',
duration:'2000',
});
}
this.dialogFormVisible = false;
this.dialogFormVisible1 = false;
this.innerVisible = false;
this.innerVisible1 = false;
this.amount_num = '';
this.recharge_list_value = '';
this.transferok = false;
})
.catch(err=>{
this.$notify({
title: '提示',
message: "操作失败,请稍后重试!",
type: 'error',
duration:'2000',
});
})
}
},
//点击提币
clickWithdraw(symbol) {
this.account_symbol = symbol;
this.dialogFormVisible1 = true;
}
},
watch: {
robotBankList(val) {
this.robotBankList = val;
// console.log(this.robotBankList);
},
robotDetailInfo() {
this.getWalletInfo();
},
} }
} }
</script> </script>
...@@ -330,4 +562,8 @@ ...@@ -330,4 +562,8 @@
} }
} }
} }
.tips {
color: red;
margin-top: 30px;
}
</style> </style>
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<nav-left :platInfo="platInfo"></nav-left> <nav-left :platInfo="platInfo"></nav-left>
</div> </div>
<div class="main"> <div class="main">
<router-view :platInfo="platInfo"></router-view> <router-view :platInfo="platInfo" :robotBankList="robotBankList"></router-view>
</div> </div>
</div> </div>
</div> </div>
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
data() { data() {
return { return {
platInfo: [], platInfo: [],
robotBankList: '',
// platInfo: [ // platInfo: [
// { // {
// "platform":"找币", // "platform":"找币",
...@@ -73,7 +74,8 @@ ...@@ -73,7 +74,8 @@
} }
axios.post(ApiConfig.GetRobotBank,params).then( res => { axios.post(ApiConfig.GetRobotBank,params).then( res => {
console.log(res.data) // console.log(res.data.data);
this.robotBankList = res.data.data
}) })
}, },
} }
......
...@@ -130,7 +130,7 @@ ...@@ -130,7 +130,7 @@
</ul> </ul>
<p v-if="robotList === null" class="no-data">暂无数据</p> <p v-if="robotList === null" class="no-data">暂无数据</p>
</div> </div>
<robot-details v-show="robotDetails" :robotDetailInfo="robotDetailInfo"></robot-details> <robot-details v-show="robotDetails" :robotDetailInfo="robotDetailInfo" :robotBankList="robotBankList"></robot-details>
</div> </div>
</template> </template>
...@@ -172,7 +172,7 @@ ...@@ -172,7 +172,7 @@
}; };
}, },
components: { RobotDetails }, components: { RobotDetails },
props: ['platInfo'], props: ['platInfo','robotBankList'],
created() { created() {
this.init(); this.init();
Bus.$on('navClick', ()=> { Bus.$on('navClick', ()=> {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment