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
f89e38d0
Commit
f89e38d0
authored
Aug 30, 2018
by
汪晓凯
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增充提开关
parent
f983ff2f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
74 additions
and
5 deletions
+74
-5
api-config.js
src/config/api-config.js
+1
-0
RobotDetails.vue
src/views/RobotDetails.vue
+73
-5
No files found.
src/config/api-config.js
View file @
f89e38d0
...
@@ -21,6 +21,7 @@ const Api = {
...
@@ -21,6 +21,7 @@ const Api = {
UpdateBankConfig
:
originUrl
+
'/updateBankConfig'
,
//修改银行配置
UpdateBankConfig
:
originUrl
+
'/updateBankConfig'
,
//修改银行配置
GetRobotConfig
:
originUrl
+
'/getRobotConfig'
,
//获取机器人配置
GetRobotConfig
:
originUrl
+
'/getRobotConfig'
,
//获取机器人配置
UpdateRobotConfig
:
originUrl
+
'/updateRobotConfig'
,
//修改机器人配置接口
UpdateRobotConfig
:
originUrl
+
'/updateRobotConfig'
,
//修改机器人配置接口
transferStatusChange
:
originUrl
+
'/updateTransferStatus'
,
//充提状态开关
}
}
export
default
Api
;
export
default
Api
;
src/views/RobotDetails.vue
View file @
f89e38d0
...
@@ -79,8 +79,18 @@
...
@@ -79,8 +79,18 @@
<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"
>
{{
robotInfo
.
coin
}}
</span>
<span
class=
"coin-name"
>
{{
robotInfo
.
coin
}}
</span>
<span
class=
"button"
@
click=
"clickRecharge(robotInfo.coin)"
>
充币
</span>
<button
class=
"button"
:class=
"robotInfo.transfer_status"
:disabled=
"robotInfo.transfer_status==='close'"
@
click=
"clickRecharge(robotInfo.coin)"
>
充币
</button>
<span
class=
"button"
@
click=
"clickWithdraw(robotInfo.coin)"
>
提币
</span>
<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>
</div>
<p
class=
"item"
>
<p
class=
"item"
>
<span
class=
"type-name"
>
可用
</span>
<span
class=
"type-name"
>
可用
</span>
...
@@ -106,8 +116,18 @@
...
@@ -106,8 +116,18 @@
<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"
>
{{
robotInfo
.
base
}}
</span>
<span
class=
"coin-name"
>
{{
robotInfo
.
base
}}
</span>
<span
class=
"button"
@
click=
"clickRecharge(robotInfo.base)"
>
充币
</span>
<button
class=
"button"
:class=
"robotInfo.transfer_status"
:disabled=
"robotInfo.transfer_status==='close'"
@
click=
"clickRecharge(robotInfo.base)"
>
充币
</button>
<span
class=
"button"
@
click=
"clickWithdraw(robotInfo.base)"
>
提币
</span>
<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>
</div>
<p
class=
"item"
>
<p
class=
"item"
>
<span
class=
"type-name"
>
可用
</span>
<span
class=
"type-name"
>
可用
</span>
...
@@ -581,6 +601,7 @@
...
@@ -581,6 +601,7 @@
ticketInfo
:
''
,
//行情
ticketInfo
:
''
,
//行情
username
:
localStorage
.
getItem
(
'username'
),
username
:
localStorage
.
getItem
(
'username'
),
value1
:
true
,
value1
:
true
,
transfer_status
:
true
,
coinInfo
:
{},
//目标币账户信息
coinInfo
:
{},
//目标币账户信息
baseInfo
:
{},
//基础币账户信息
baseInfo
:
{},
//基础币账户信息
amount_num
:
''
,
//充值数量
amount_num
:
''
,
//充值数量
...
@@ -677,6 +698,7 @@
...
@@ -677,6 +698,7 @@
if
(
res
.
data
.
code
===
200
)
{
if
(
res
.
data
.
code
===
200
)
{
// console.log(res.data.data);
// console.log(res.data.data);
this
.
robotInfo
=
res
.
data
.
data
[
0
];
this
.
robotInfo
=
res
.
data
.
data
[
0
];
this
.
transfer_status
=
Boolean
(
res
.
data
.
data
[
0
].
transfer_status
===
'open'
)
}
}
}).
catch
(
error
=>
{
}).
catch
(
error
=>
{
this
.
$notify
({
this
.
$notify
({
...
@@ -1053,6 +1075,42 @@
...
@@ -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
:
{
watch
:
{
$route
()
{
$route
()
{
...
@@ -1270,6 +1328,12 @@
...
@@ -1270,6 +1328,12 @@
height
:
25px
;
height
:
25px
;
position
:
relative
;
position
:
relative
;
margin-bottom
:
4px
;
margin-bottom
:
4px
;
position
:
relative
;
.switch
{
position
:
absolute
;
top
:
0
;
right
:
10px
;
}
}
}
.coin-name
{
.coin-name
{
font-size
:
18px
;
font-size
:
18px
;
...
@@ -1290,7 +1354,11 @@
...
@@ -1290,7 +1354,11 @@
color
:
rgba
(
255
,
255
,
255
,
1
);
color
:
rgba
(
255
,
255
,
255
,
1
);
font-size
:
12px
;
font-size
:
12px
;
cursor
:
pointer
;
cursor
:
pointer
;
&:last-child
{
&.close
{
cursor
:
not-allowed
;
background
:
rgba
(
119
,
146
,
167
,
0.5
);
}
&
:nth-child
(
2
)
{
left
:
128px
;
left
:
128px
;
}
}
}
}
...
...
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