Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
robot-monitor
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
汪晓凯
robot-monitor
Commits
70d1debe
Commit
70d1debe
authored
Jul 04, 2018
by
wxk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
充提币ok
parent
9f9798c1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
249 additions
and
9 deletions
+249
-9
api-config.js
src/config/api-config.js
+2
-0
RobotDetails.vue
src/views/RobotDetails.vue
+241
-5
container.vue
src/views/container.vue
+4
-2
overview.vue
src/views/overview.vue
+2
-2
No files found.
src/config/api-config.js
View file @
70d1debe
...
...
@@ -8,6 +8,8 @@ const Api = {
GetRobotStatus
:
"/robotStatus"
,
//机器人预警状态查询
GetPlatformInfo
:
"/platform"
,
//交易所及匹配的交易对、目标币信息查询
GetRobotBank
:
"/accountlist"
,
//查询机器人银行账户
GetWalletInfo
:
"/walletInfo "
,
//查询某个账号的当前资产信息
Transfer
:
"/transfer"
,
//充币提币
}
export
default
Api
;
src/views/RobotDetails.vue
View file @
70d1debe
...
...
@@ -70,8 +70,8 @@
<div
class=
"handle-content"
>
<div
class=
"handle"
>
<span
class=
"coin-name"
>
{{
robotDetailInfo
.
coin
}}
</span>
<span
class=
"button"
>
充币
</span>
<span
class=
"button"
>
提币
</span>
<span
class=
"button"
@
click=
"clickRecharge(robotDetailInfo.coin)"
>
充币
</span>
<span
class=
"button"
@
click=
"clickWithdraw(robotDetailInfo.coin)"
>
提币
</span>
</div>
<p
class=
"item"
>
<span
class=
"type-name"
>
可用
</span>
...
...
@@ -89,8 +89,8 @@
<div
class=
"handle-content"
>
<div
class=
"handle"
>
<span
class=
"coin-name"
>
{{
robotDetailInfo
.
base
}}
</span>
<span
class=
"button"
>
充币
</span>
<span
class=
"button"
>
提币
</span>
<span
class=
"button"
@
click=
"clickRecharge(robotDetailInfo.base)"
>
充币
</span>
<span
class=
"button"
@
click=
"clickWithdraw(robotDetailInfo.base)"
>
提币
</span>
</div>
<p
class=
"item"
>
<span
class=
"type-name"
>
可用
</span>
...
...
@@ -105,6 +105,130 @@
<span>
1234.123456YCC
</span>
</p>
</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>
充值数量:
<span>
{{
amount_num
}}
</span></p>
<p>
充值币种:
<span>
{{
account_symbol
}}
</span></p>
<p
style=
"overflow: hidden;"
>
From:
<span>
{{
recharge_list_value
}}
</span></p>
<p
style=
"overflow: hidden;"
>
To:
<span>
{{
robotDetailInfo
.
account
}}
</span></p>
<p>
操作人:
<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>
提现数量:
<span>
{{
amount_num
}}
</span></p>
<p>
提现币种:
<span>
{{
account_symbol
}}
</span></p>
<p
style=
"overflow: hidden;"
>
From:
<span>
{{
robotDetailInfo
.
account
}}
</span></p>
<p
style=
"overflow: hidden;"
>
To:
<span>
{{
recharge_list_value
}}
</span></p>
<p>
操作人:
<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>
</el-col>
</el-row>
...
...
@@ -118,17 +242,125 @@
export
default
{
data
(){
return
{
username
:
localStorage
.
getItem
(
'username'
),
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
()
{
},
methods
:
{
//返回上一页(关闭详情)
closeDetails
()
{
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
>
...
...
@@ -330,4 +562,8 @@
}
}
}
.tips
{
color
:
red
;
margin-top
:
30px
;
}
</
style
>
src/views/container.vue
View file @
70d1debe
...
...
@@ -6,7 +6,7 @@
<nav-left
:platInfo=
"platInfo"
></nav-left>
</div>
<div
class=
"main"
>
<router-view
:platInfo=
"platInfo"
></router-view>
<router-view
:platInfo=
"platInfo"
:robotBankList=
"robotBankList"
></router-view>
</div>
</div>
</div>
...
...
@@ -21,6 +21,7 @@
data
()
{
return
{
platInfo
:
[],
robotBankList
:
''
,
// platInfo: [
// {
// "platform":"找币",
...
...
@@ -73,7 +74,8 @@
}
axios
.
post
(
ApiConfig
.
GetRobotBank
,
params
).
then
(
res
=>
{
console
.
log
(
res
.
data
)
// console.log(res.data.data);
this
.
robotBankList
=
res
.
data
.
data
})
},
}
...
...
src/views/overview.vue
View file @
70d1debe
...
...
@@ -130,7 +130,7 @@
</ul>
<p
v-if=
"robotList === null"
class=
"no-data"
>
暂无数据
</p>
</div>
<robot-details
v-show=
"robotDetails"
:robotDetailInfo=
"robotDetailInfo"
></robot-details>
<robot-details
v-show=
"robotDetails"
:robotDetailInfo=
"robotDetailInfo"
:robotBankList=
"robotBankList"
></robot-details>
</div>
</
template
>
...
...
@@ -172,7 +172,7 @@
};
},
components
:
{
RobotDetails
},
props
:
[
'platInfo'
],
props
:
[
'platInfo'
,
'robotBankList'
],
created
()
{
this
.
init
();
Bus
.
$on
(
'navClick'
,
()
=>
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment