Commit 9e5debf9 authored by wxk's avatar wxk

基本ok,等接口完成联调

parent cf2faf5f
......@@ -10,6 +10,8 @@ const Api = {
GetRobotBank: "/accountlist",//查询机器人银行账户
GetWalletInfo: "/walletInfo ", //查询某个账号的当前资产信息
Transfer: "/transfer", //充币提币
Transaction: "/transaction", //交易记录
Records: "/records", //历史记录
}
export default Api;
......@@ -188,57 +188,6 @@ export default {
});
});
},
//找回密码获取验证码
/* getYZM2(){
if(this.forget_email == '' || ! (regEmail.test(this.forget_email) || regEmail2.test(this.forget_email))){
this.$notify({
title: '提示',
message: "请输入正确的邮箱",
type: 'error',
duration:'2000',
});
return;
}
//获取验证码倒计时60s
this.count = TIME_COUNT;
this.show = false;
this.timer = setInterval(() => {
if(this.count > 0 && this.count <= TIME_COUNT){
this.count--;
}else{
this.show = true;
clearInterval(this.timer);
this.timer = null;
}
}, 1000)
axios.post(ApiConfig.SendEmailVcode,{"user":this.forget_email}).then(res => {
console.log(res)
if(res.status == 200&& res.data == "emailsend success"){//发送成功并且注册成功
this.$notify({
title: '提示',
message: "验证码发送成功,请查收",
type: 'success',
duration:'2000',
});
}else{//不存在的33.cn的邮箱
this.$notify({
title: '提示',
message: "验证码发送失败,请检查邮箱后再试",
type: 'error',
duration:'2000',
});
}
})
.catch(err=>{
this.$notify({
title: '提示',
message: "验证码发送失败,请稍后再试",
type: 'error',
duration:'2000',
});
});
},*/
//注册
registered(){
//console.log(this.regist_email)
......
......@@ -267,23 +267,50 @@
stripe
style="width: 100%">
<el-table-column
label="日期"
label="时间"
width="180">
<template slot-scope="scope">
<span style="margin-left: 10px">{{ scope.row.time }}</span>
<span>{{ scope.row.time }}</span>
</template>
</el-table-column>
<el-table-column
label="姓名"
width="180">
label="类型">
<template slot-scope="scope">
<span>{{ scope.row.opt }}</span>
</template>
</el-table-column>
<el-table-column
label="成交价">
<template slot-scope="scope">
<span>{{ scope.row.price }}</span>
</template>
</el-table-column>
<el-table-column
label="成交数量">
<template slot-scope="scope">
<span style="margin-left: 10px">{{ scope.row.fee }}</span>
<span>{{ scope.row.amount }}</span>
</template>
</el-table-column>
<el-table-column
label="地址">
label="成交金额">
<template slot-scope="scope">
<span style="margin-left: 10px">{{ scope.row.sum }}</span>
<span>{{ scope.row.sum }}</span>
</template>
</el-table-column>
<el-table-column
label="手续费">
<template slot-scope="scope">
<span>{{ scope.row.fee }}</span>
</template>
</el-table-column>
<el-table-column
label="状态">
<template slot-scope="scope">
<el-tag
:type="scope.row.status === '完全成交' ? 'success' :
(scope.row.status === '部分成交' ? 'warning' :
(scope.row.status === '挂单中' ? '' : 'danger'))"
disable-transitions>{{scope.row.status}}</el-tag>
</template>
</el-table-column>
</el-table>
......@@ -304,16 +331,16 @@
<div class="select-bar fr clearfix">
<div class="select-bar-content fl">
<span class="title">类型</span>
<el-checkbox-button :indeterminate="isIndeterminate" v-model="checkAll" @change="handleCheckAllChange">全部</el-checkbox-button>
<el-checkbox-group v-model="checkedOptions1" @change="handleCheckedChange">
<el-checkbox-button :indeterminate="isIndeterminate2" v-model="checkAll2" @change="handleCheckAllChange2">全部</el-checkbox-button>
<el-checkbox-group v-model="checkedOptions1" @change="handleCheckedChange2">
<el-checkbox-button v-for="option in options1" :label="option" :key="option">{{option}}</el-checkbox-button>
</el-checkbox-group>
</div>
<div class="select-bar-content status-select fl small">
<span class="title">状态</span>
<el-checkbox-button :indeterminate="isIndeterminate1" v-model="checkAll1" @change="handleCheckAllChange1">全部</el-checkbox-button>
<el-checkbox-group v-model="checkedStates1" @change="handleCheckedChange1">
<el-checkbox-button v-for="state in states1" :label="state" :key="state">{{state}}</el-checkbox-button>
<el-checkbox-button :indeterminate="isIndeterminate3" v-model="checkAll3" @change="handleCheckAllChange3">全部</el-checkbox-button>
<el-checkbox-group v-model="checkedStates1" @change="handleCheckedChange3">
<el-checkbox-button v-for="(state,index) in states1" :label="index" :key="state">{{state}}</el-checkbox-button>
</el-checkbox-group>
</div>
</div>
......@@ -328,27 +355,64 @@
</el-date-picker>
</div>
<el-table
:data="list"
:data="list1"
stripe
style="width: 100%">
<el-table-column
label="日期"
width="180">
<template slot-scope="scope">
<span style="margin-left: 10px">{{ scope.row.time }}</span>
<span>{{ scope.row.time }}</span>
</template>
</el-table-column>
<el-table-column
label="姓名"
width="180">
label="币种">
<template slot-scope="scope">
<span>{{ scope.row.coin }}</span>
</template>
</el-table-column>
<el-table-column
label="类型">
<template slot-scope="scope">
<span>{{ scope.row.opt }}</span>
</template>
</el-table-column>
<el-table-column
label="充提前数量">
<template slot-scope="scope">
<span>{{ scope.row.beforeRecharge }}</span>
</template>
</el-table-column>
<el-table-column
label="充提数量">
<template slot-scope="scope">
<span>{{ scope.row.transfer_amount }}</span>
</template>
</el-table-column>
<el-table-column
label="充提后后数量">
<template slot-scope="scope">
<span>{{ scope.row.afterRecharge }}</span>
</template>
</el-table-column>
<el-table-column
label="手续费">
<template slot-scope="scope">
<span style="margin-left: 10px">{{ scope.row.fee }}</span>
<span>{{ scope.row.fee }}</span>
</template>
</el-table-column>
<el-table-column
label="地址">
label="操作用户">
<template slot-scope="scope">
<span style="margin-left: 10px">{{ scope.row.sum }}</span>
<span>{{ scope.row.user }}</span>
</template>
</el-table-column>
<el-table-column
label="状态">
<template slot-scope="scope">
<el-tag
:type="scope.row.status === '成功' ? 'success' : 'danger'"
disable-transitions>{{scope.row.status}}</el-tag>
</template>
</el-table-column>
</el-table>
......@@ -388,6 +452,8 @@
checkAll: false,
checkedOptions: [],
options: ["买入", "卖出"],
isIndeterminate1: true,
checkAll1: false,
checkedStates: [],
states: ["挂单中", "完全成交", "已撤单", "部分成交"],
list: [{
......@@ -414,7 +480,7 @@
amount: 123.00000000, //数量
fee: 0.10000000, //手续费
sum: 124.00000000, //总价
status: "0", //状态0挂单中 1完全成交2撤单3部分成交
status: "1", //状态0挂单中 1完全成交2撤单3部分成交
time: "2018-06-28 14:12:59"
},{
id: "123", //单号
......@@ -427,20 +493,84 @@
amount: 123.00000000, //数量
fee: 0.10000000, //手续费
sum: 124.00000000, //总价
status: "0", //状态0挂单中 1完全成交2撤单3部分成交
status: "2", //状态0挂单中 1完全成交2撤单3部分成交
time: "2018-06-28 14:12:59"
},{
id: "123", //单号
platform: "zhaobi", //交易所
account: "b15a4f6c5c1163b5f80715c9bd87d5118ec4b5668cb29f148eeceec61ddeadc2",
coin: "DCR", //目标币种
base: "USDT", //基础币种
opt: "0", //操作 0为买入 1为卖出
price: 1.20000000, //单价
amount: 123.00000000, //数量
fee: 0.10000000, //手续费
sum: 124.00000000, //总价
status: "3", //状态0挂单中 1完全成交2撤单3部分成交
time: "2018-06-28 14:12:59"
}],
list1: [{
user: "wkf@33.cn",
coin: "BTC",
transfer_amount: 11.00000123,
time: "2018-06-04 12:52:36",
beforeRecharge: 0.00000123,
afterRecharge: 11.00000123,
status: "0",
fee: 0.10000000,
fromUid: "9c885ce7664ed3c3675df8e49590c141665d94add5bf72a816a8d8a78bd8fbe5",
opt: "1"},{
user: "wkf@33.cn",
coin: "BTC",
transfer_amount: 11.00000123,
time: "2018-06-04 12:52:36",
beforeRecharge: 0.00000123,
afterRecharge: 11.00000123,
status: "0",
fee: 0.10000000,
fromUid: "9c885ce7664ed3c3675df8e49590c141665d94add5bf72a816a8d8a78bd8fbe5",
opt: "1"},{
user: "wkf@33.cn",
coin: "BTC",
transfer_amount: 11.00000123,
time: "2018-06-04 12:52:36",
beforeRecharge: 0.00000123,
afterRecharge: 11.00000123,
status: "1",
fee: 0.10000000,
fromUid: "9c885ce7664ed3c3675df8e49590c141665d94add5bf72a816a8d8a78bd8fbe5",
opt: "0"}],
/*充提记录参数*/
isIndeterminate1: true,
checkAll1: false,
isIndeterminate2: true,
checkAll2: false,
checkedOptions1: [],
options1: ["充币", "提币"],
isIndeterminate3: true,
checkAll3: false,
checkedStates1: [],
states1: ["失败", "成功"],
currentPage4: 1, //分页
}
},
props: ['robotDetailInfo','robotBankList'],
created() {
this.list.map( item => {
const unit = item.opt === "0" ? item.base : item.coin;
item.price = item.price + unit;
item.sum = item.sum + unit;
item.fee = item.fee + unit;
item.opt = item.opt==="0" ? "买入" : "卖出";
item.status = item.status==="0" ? "挂单中" :
(item.status==="1" ? "完全成交" :
(item.status==="2" ? "已撤单" : "部分成交"));
return item;
});
this.list1.map( item => {
item.fee = item.fee + item.coin;
item.opt = item.opt==="0" ? "充币" : "提币";
item.status = item.status==="0" ? "失败" : "成功";
return item;
})
},
methods: {
......@@ -451,7 +581,8 @@
//查询账户资金信息
getWalletInfo() {
const params = {
uid: this.robotDetailInfo.account,
account: this.robotDetailInfo.account,
coin: [this.robotDetailInfo.coin, this.robotDetailInfo.base]
}
axios.post(ApiConfig.GetWalletInfo,params).then( res=> {
// console.log(res)
......@@ -555,8 +686,36 @@
let checkedCount = value.length;
this.checkAll1 = checkedCount === this.states.length;
this.isIndeterminate1 = checkedCount > 0 && checkedCount < this.states.length;
},
//充提记录筛选
handleCheckAllChange2(val) {
this.checkedOptions1 = val ? this.options1 : [];
this.isIndeterminate2 = false;
},
handleCheckedChange2(value) {
let checkedCount = value.length;
this.checkAll2 = checkedCount === this.options1.length;
this.isIndeterminate2 = checkedCount > 0 && checkedCount < this.options1.length;
},
handleCheckAllChange3(val) {
this.checkedStates1 = val ? [0,1] : [];
this.isIndeterminate3 = false;
},
handleCheckedChange3(value) {
let checkedCount = value.length;
this.checkAll3 = checkedCount === [0,1].length;
this.isIndeterminate3 = checkedCount > 0 && checkedCount < this.states1.length;
console.log(value.map( item => {
return item+'';
}))
},
//交易记录分页
handleSizeChange(val) {
console.log(`每页 ${val} 条`);
},
handleCurrentChange(val) {
console.log(`当前页: ${val}`);
}
},
watch: {
robotBankList(val) {
......
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