Commit fa026470 authored by wxk's avatar wxk

详情优化

parent df998225
// const originUrl = ""//本地开发 const originUrl = ""//本地开发
const originUrl = "/asset_monitor"//测试 // const originUrl = "/asset_monitor"//测试
const Api = { const Api = {
Login: originUrl + "/login",//登录 Login: originUrl + "/login",//登录
Register: originUrl + "/register",//注册 Register: originUrl + "/register",//注册
......
...@@ -6,20 +6,20 @@ ...@@ -6,20 +6,20 @@
</div> </div>
<el-row :gutter="20" class="operation-area"> <el-row :gutter="20" class="operation-area">
<el-col :span="16"> <el-col :span="16">
<div class="dashboard" :class="[robotDetailInfo.status || 'normal']"> <div class="dashboard" :class="[robotInfo.status || 'normal']">
<div class="chart-box"> <div class="chart-box">
<p class="title">今日盈亏</p> <p class="title">今日盈亏</p>
<p v-show="robotDetailInfo.today_profit>0" class="data gain">+{{(robotDetailInfo.today_profit*100).toFixed(2)}}%</p> <p v-show="robotInfo.today_profit>0" class="data gain">+{{(robotInfo.today_profit*100).toFixed(2)}}%</p>
<p v-show="robotDetailInfo.today_profit<0" class="data lose">-{{(robotDetailInfo.today_profit*100).toFixed(2)}}%</p> <p v-show="robotInfo.today_profit<0" class="data lose">-{{(robotInfo.today_profit*100).toFixed(2)}}%</p>
<p v-show="robotDetailInfo.today_profit==0" class="data none">- -</p> <p v-show="robotInfo.today_profit==0" class="data none">- -</p>
<div class="type-box"> <div class="type-box">
<p v-show="robotDetailInfo.status==='normal'" class="type">正在运行</p> <p v-show="robotInfo.status==='normal'" class="type">正在运行</p>
<p v-show="robotDetailInfo.status==='stop'" class="type">停止运行</p> <p v-show="robotInfo.status==='stop'" class="type">停止运行</p>
<p> <p>
<span class="result">总盈亏</span> <span class="result">总盈亏</span>
<span v-show="robotDetailInfo.all_profit>0" class="data gain">+{{(robotDetailInfo.all_profit*100).toFixed(2)}}%</span> <span v-show="robotInfo.all_profit>0" class="data gain">+{{(robotInfo.all_profit*100).toFixed(2)}}%</span>
<span v-show="robotDetailInfo.all_profit<0" class="data lose">-{{(robotDetailInfo.all_profit*100).toFixed(2)}}%</span> <span v-show="robotInfo.all_profit<0" class="data lose">-{{(robotInfo.all_profit*100).toFixed(2)}}%</span>
<span v-show="robotDetailInfo.all_profit==0" class="data none">- -</span> <span v-show="robotInfo.all_profit==0" class="data none">- -</span>
</p> </p>
</div> </div>
<div class="switch"> <div class="switch">
...@@ -36,24 +36,24 @@ ...@@ -36,24 +36,24 @@
<div class="dashboard-details"> <div class="dashboard-details">
<p> <p>
<span>机器人名称</span> <span>机器人名称</span>
<span>{{robotDetailInfo.tag}}</span> <span>{{robotInfo.tag}}</span>
</p> </p>
<p> <p>
<span>交易对</span> <span>交易对</span>
<span>{{robotDetailInfo.coin}}/{{robotDetailInfo.base}}</span> <span>{{robotInfo.coin}}/{{robotInfo.base}}</span>
</p> </p>
<p> <p>
<span>账户地址</span> <span>账户地址</span>
<span>{{robotDetailInfo.account}}</span> <span>{{robotInfo.account}}</span>
</p> </p>
<p> <p>
<span>运行状态</span> <span>运行状态</span>
<span v-show="robotDetailInfo.status==='normal'" class="green">正在运行</span> <span v-show="robotInfo.status==='normal'" class="green">正在运行</span>
<span v-show="robotDetailInfo.status==='stop'" class="red">停止运行</span> <span v-show="robotInfo.status==='stop'" class="red">停止运行</span>
</p> </p>
<p> <p>
<span>交易所</span> <span>交易所</span>
<span>{{robotDetailInfo.platform}}</span> <span>{{robotInfo.platform}}</span>
</p> </p>
<p> <p>
<span>行情</span> <span>行情</span>
...@@ -70,9 +70,9 @@ ...@@ -70,9 +70,9 @@
<div class="handle-box"> <div class="handle-box">
<div class="handle-content" v-loading="Loading" element-loading-text="正在刷新数据"> <div class="handle-content" v-loading="Loading" element-loading-text="正在刷新数据">
<div class="handle"> <div class="handle">
<span class="coin-name">{{robotDetailInfo.coin}}</span> <span class="coin-name">{{robotInfo.coin}}</span>
<span class="button" @click="clickRecharge(robotDetailInfo.coin)">充币</span> <span class="button" @click="clickRecharge(robotInfo.coin)">充币</span>
<span class="button" @click="clickWithdraw(robotDetailInfo.coin)">提币</span> <span class="button" @click="clickWithdraw(robotInfo.coin)">提币</span>
</div> </div>
<p class="item"> <p class="item">
<span class="type-name">可用</span> <span class="type-name">可用</span>
...@@ -88,18 +88,18 @@ ...@@ -88,18 +88,18 @@
</p> </p>
<p class="item"> <p class="item">
<span class="type-name">标准</span> <span class="type-name">标准</span>
<span>{{robotDetailInfo.coin_normal}}</span> <span>{{robotInfo.coin_normal}}</span>
</p> </p>
<p class="item"> <p class="item">
<span class="type-name">比例</span> <span class="type-name">比例</span>
<span>{{robotDetailInfo.coin_percent*100+'%'}}(总量/标准)</span> <span>{{robotInfo.coin_percent*100+'%'}}(总量/标准)</span>
</p> </p>
</div> </div>
<div class="handle-content" v-loading="Loading" element-loading-text="正在刷新数据"> <div class="handle-content" v-loading="Loading" element-loading-text="正在刷新数据">
<div class="handle"> <div class="handle">
<span class="coin-name">{{robotDetailInfo.base}}</span> <span class="coin-name">{{robotInfo.base}}</span>
<span class="button" @click="clickRecharge(robotDetailInfo.base)">充币</span> <span class="button" @click="clickRecharge(robotInfo.base)">充币</span>
<span class="button" @click="clickWithdraw(robotDetailInfo.base)">提币</span> <span class="button" @click="clickWithdraw(robotInfo.base)">提币</span>
</div> </div>
<p class="item"> <p class="item">
<span class="type-name">可用</span> <span class="type-name">可用</span>
...@@ -115,11 +115,11 @@ ...@@ -115,11 +115,11 @@
</p> </p>
<p class="item"> <p class="item">
<span class="type-name">标准</span> <span class="type-name">标准</span>
<span>{{robotDetailInfo.base_normal}}</span> <span>{{robotInfo.base_normal}}</span>
</p> </p>
<p class="item"> <p class="item">
<span class="type-name">比例</span> <span class="type-name">比例</span>
<span>{{robotDetailInfo.base_percent*100+'%'}}(总量/标准)</span> <span>{{robotInfo.base_percent*100+'%'}}(总量/标准)</span>
</p> </p>
</div> </div>
<!-- 充币弹框 --> <!-- 充币弹框 -->
...@@ -221,7 +221,7 @@ ...@@ -221,7 +221,7 @@
<el-input v-model="account_symbol" :disabled="true"></el-input> <el-input v-model="account_symbol" :disabled="true"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="From" label-width="120px"> <el-form-item label="From" label-width="120px">
<el-input v-model="robotDetailInfo.account" :disabled="true"></el-input> <el-input v-model="robotInfo.account" :disabled="true"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="To" label-width="120px"> <el-form-item label="To" label-width="120px">
<el-select <el-select
...@@ -457,6 +457,7 @@ ...@@ -457,6 +457,7 @@
export default { export default {
data(){ data(){
return{ return{
robotInfo: {},
username: localStorage.getItem('username'), username: localStorage.getItem('username'),
value1: true, value1: true,
coinInfo: {},//目标币账户信息 coinInfo: {},//目标币账户信息
...@@ -512,11 +513,34 @@ ...@@ -512,11 +513,34 @@
this.getWalletInfo(); this.getWalletInfo();
this.getTransaction(); this.getTransaction();
this.getRecords(); this.getRecords();
this.getCurrentRobot();
}, },
//返回上一页(关闭详情) //返回上一页(关闭详情)
closeDetails() { closeDetails() {
Bus.$emit('hideDetails') Bus.$emit('hideDetails')
}, },
//查询当前机器人信息
getCurrentRobot() {
const symbol = this.robotDetailInfo.coin+'/'+this.robotDetailInfo.base;
const params = {
class: 'robot',
account: this.robotDetailInfo.account,
symbol: [symbol]
}
axios.post(ApiConfig.GetMatchRobots,params).then( res => {
if (res.data.code === 200) {
// console.log(res.data.data);
this.robotInfo = res.data.data[0];
}
}).catch( error => {
this.$notify({
title: '错误',
message: "服务器崩溃啦,请稍后再试",
type: 'error',
duration:'2000',
});
})
},
//查询账户资金信息 //查询账户资金信息
getWalletInfo() { getWalletInfo() {
const params = { const params = {
...@@ -588,12 +612,13 @@ ...@@ -588,12 +612,13 @@
this.Loading = false; this.Loading = false;
this.init(); this.init();
}else{ }else{
this.Loading = false;
this.$notify({ this.$notify({
title: '提示', title: '提示',
message: res.data.msg, message: res.data.msg,
type: 'error', type: 'error',
duration:'2000', duration:'2000',
}); })
} }
this.dialogFormVisible = false; this.dialogFormVisible = false;
this.dialogFormVisible1 = false; this.dialogFormVisible1 = false;
...@@ -602,15 +627,22 @@ ...@@ -602,15 +627,22 @@
this.amount_num = ''; this.amount_num = '';
this.recharge_list_value = ''; this.recharge_list_value = '';
this.transferok = false; this.transferok = false;
}).catch(err=>{ }).catch( error => {
// console.log(err) this.Loading = false;
this.dialogFormVisible = false;
this.dialogFormVisible1 = false;
this.innerVisible = false;
this.innerVisible1 = false;
this.amount_num = '';
this.recharge_list_value = '';
this.transferok = false;
this.$notify({ this.$notify({
title: '提示', title: '错误',
message: "操作失败,请稍后重试!", message: "服务器崩溃啦,请稍后再试",
type: 'error', type: 'error',
duration:'2000', duration:'2000',
}); });
}) });
} }
}, },
//点击提币 //点击提币
......
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