Commit f89e38d0 authored by 汪晓凯's avatar 汪晓凯

新增充提开关

parent f983ff2f
......@@ -21,6 +21,7 @@ const Api = {
UpdateBankConfig: originUrl + '/updateBankConfig', //修改银行配置
GetRobotConfig: originUrl + '/getRobotConfig', //获取机器人配置
UpdateRobotConfig: originUrl + '/updateRobotConfig', //修改机器人配置接口
transferStatusChange: originUrl + '/updateTransferStatus', //充提状态开关
}
export default Api;
......@@ -79,8 +79,18 @@
<div class="handle-content" v-loading="Loading" element-loading-text="正在刷新数据">
<div class="handle">
<span class="coin-name">{{robotInfo.coin}}</span>
<span class="button" @click="clickRecharge(robotInfo.coin)">充币</span>
<span class="button" @click="clickWithdraw(robotInfo.coin)">提币</span>
<button class="button" :class="robotInfo.transfer_status" :disabled="robotInfo.transfer_status==='close'" @click="clickRecharge(robotInfo.coin)">充币</button>
<button class="button" :class="robotInfo.transfer_status" :disabled="robotInfo.transfer_status==='close'" @click="clickWithdraw(robotInfo.coin)">提币</button>
<div class="switch">
<span v-show="robotInfo.transfer_status==='open'">关闭</span>
<span v-show="robotInfo.transfer_status==='close'">开启</span>
<el-switch
@change="transferStatusChange"
v-model="transfer_status"
active-color="rgba(119,146,167,1)"
inactive-color="rgba(236,239,241,1)">
</el-switch>
</div>
</div>
<p class="item">
<span class="type-name">可用</span>
......@@ -106,8 +116,18 @@
<div class="handle-content" v-loading="Loading" element-loading-text="正在刷新数据">
<div class="handle">
<span class="coin-name">{{robotInfo.base}}</span>
<span class="button" @click="clickRecharge(robotInfo.base)">充币</span>
<span class="button" @click="clickWithdraw(robotInfo.base)">提币</span>
<button class="button" :class="robotInfo.transfer_status" :disabled="robotInfo.transfer_status==='close'" @click="clickRecharge(robotInfo.base)">充币</button>
<button class="button" :class="robotInfo.transfer_status" :disabled="robotInfo.transfer_status==='close'" @click="clickWithdraw(robotInfo.base)">提币</button>
<div class="switch">
<span v-show="robotInfo.transfer_status==='open'">关闭</span>
<span v-show="robotInfo.transfer_status==='close'">开启</span>
<el-switch
@change="transferStatusChange"
v-model="transfer_status"
active-color="rgba(119,146,167,1)"
inactive-color="rgba(236,239,241,1)">
</el-switch>
</div>
</div>
<p class="item">
<span class="type-name">可用</span>
......@@ -581,6 +601,7 @@
ticketInfo: '',//行情
username: localStorage.getItem('username'),
value1: true,
transfer_status: true,
coinInfo: {},//目标币账户信息
baseInfo: {},//基础币账户信息
amount_num: '',//充值数量
......@@ -677,6 +698,7 @@
if (res.data.code === 200) {
// console.log(res.data.data);
this.robotInfo = res.data.data[0];
this.transfer_status = Boolean(res.data.data[0].transfer_status === 'open')
}
}).catch(error => {
this.$notify({
......@@ -1053,6 +1075,42 @@
});
});
},
/*充提开关*/
transferStatusChange() {
const params = {
account: this.robotDetailInfo.account,
symbol: this.robotDetailInfo.coin + '/' + this.robotDetailInfo.base,
transfer_status: !this.transfer_status ? 'close' : 'open',
}
axios.post(ApiConfig.transferStatusChange, params).then( res => {
if(res.data.code === 200){
this.getCurrentRobot();
this.$notify({
title: '成功',
message: "操作成功",
type: 'success',
duration:'2000',
});
}else {
this.transfer_status = !this.transfer_status;
this.$notify({
title: '错误',
message: res.data.msg,
type: 'warning',
duration:'2000',
});
}
}).catch( error => {
this.transfer_status = !this.transfer_status;
this.$notify({
title: '错误',
message: error,
type: 'warning',
duration:'2000',
});
})
}
},
watch: {
$route() {
......@@ -1270,6 +1328,12 @@
height: 25px;
position: relative;
margin-bottom: 4px;
position: relative;
.switch {
position: absolute;
top: 0;
right: 10px;
}
}
.coin-name {
font-size: 18px;
......@@ -1290,7 +1354,11 @@
color: rgba(255, 255, 255, 1);
font-size: 12px;
cursor: pointer;
&:last-child {
&.close {
cursor: not-allowed;
background: rgba(119, 146, 167, 0.5);
}
&:nth-child(2) {
left: 128px;
}
}
......
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