Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
html
/
poolin_app
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Wiki
Members
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
772f3082
authored
Jan 31, 2018
by
zhanghui1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
部分细节修改
parent
2a11f561
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
167 additions
and
118 deletions
+167
-118
index.html
+1
-1
package.json
+1
-1
src/assets/less/style.less
+10
-0
src/components/Common/Tabbar.vue
+4
-4
src/components/Common/my.vue
+1
-1
src/components/Dashboard/index.vue
+15
-11
src/components/Dashboard/no.vue
+1
-1
src/components/Dashboard/subaccount.vue
+16
-7
src/components/Jump.vue
+1
-1
src/components/Payments/index.vue
+53
-50
src/components/Users/Create.vue
+28
-5
src/main.js
+1
-1
src/router/index.js
+3
-3
src/utils/function.js
+32
-32
No files found.
index.html
View file @
772f3082
...
...
@@ -7,7 +7,7 @@
<meta
content=
"telephone=no"
name=
"format-detection"
/>
<meta
name=
"apple-mobile-web-app-capable"
content=
"yes"
/>
<meta
http-equiv=
"Cache-Control"
content=
"no-siteapp"
/>
<link
rel=
"stylesheet"
href=
"//at.alicdn.com/t/font_538501_
uluquoo98e12a9k9
.css"
/>
<link
rel=
"stylesheet"
href=
"//at.alicdn.com/t/font_538501_
iihxu81if6r
.css"
/>
<script
src=
"https://cdn.bootcss.com/underscore.js/1.8.3/underscore-min.js"
></script>
<script
src=
"https://cdn.jsdelivr.net/npm/tween.js@16.3.4"
></script>
<title>
poolin_app
</title>
...
...
package.json
View file @
772f3082
...
...
@@ -5,7 +5,7 @@
"author"
:
"xin3w <xin3w@126.com>"
,
"private"
:
true
,
"scripts"
:
{
"dev"
:
"webpack-dev-server --inline --progress --config build/webpack.dev.conf.js"
,
"dev"
:
"webpack-dev-server --inline --progress --config build/webpack.dev.conf.js
--host 192.168.1.57
"
,
"start"
:
"npm run dev"
,
"build"
:
"node build/build.js"
},
...
...
src/assets/less/style.less
View file @
772f3082
...
...
@@ -86,6 +86,16 @@ html,body {-webkit-tap-highlight-color: rgba(0, 0, 0,0); font-size: 0.28rem; bac
.bg-blue{background: #ededf2;}
/*样式修正*/
.bg-coin { .wh(0.5rem); .d-ib; vertical-align: middle; background-size: cover; margin-right: 0.1rem;
&.ltc {background-image:url(../img/index-tab1-active.png);}
&.eth {background-image:url(../img/index-tab2-active.png);}
&.dash {background-image:url(../img/index-tab3-active.png);}
&.xmr {background-image:url(../img/index-tab4-active.png);}
&.btc {background-image:url(../img/index-tab5-active.png);}
&.sc {background-image:url(../img/index-tab6-active.png);}
&.zcash {background-image:url(../img/index-tab7-active.png);}
&.doge {background-image:url(../img/index-tab8-active.png);}
}
.page {width:100%;height:100%; overflow: hidden;.pos(a);
.page-header {background:@blue;color:#fff;.pos(f); left:0; top:0; right:0; height:44px; z-index: 9999;
...
...
src/components/Common/Tabbar.vue
View file @
772f3082
...
...
@@ -42,16 +42,16 @@ export default {
this
.
$store
.
state
.
tab_bar
=
n
;
switch
(
n
)
{
case
0
:
this
.
$router
.
replace
(
'/
frameDashboard
/'
+
this
.
puid
+
'/'
+
this
.
coin_type
+
'/'
+
this
.
region_id
+
'/dashboard'
)
this
.
$router
.
replace
(
'/
my
/'
+
this
.
puid
+
'/'
+
this
.
coin_type
+
'/'
+
this
.
region_id
+
'/dashboard'
)
break
;
case
1
:
this
.
$router
.
replace
(
'/
frameDashboard
/'
+
this
.
puid
+
'/'
+
this
.
coin_type
+
'/'
+
this
.
region_id
+
'/miners'
)
this
.
$router
.
replace
(
'/
my
/'
+
this
.
puid
+
'/'
+
this
.
coin_type
+
'/'
+
this
.
region_id
+
'/miners'
)
break
;
case
2
:
this
.
$router
.
replace
(
'/
frameDashboard
/'
+
this
.
puid
+
'/'
+
this
.
coin_type
+
'/'
+
this
.
region_id
+
'/payments'
)
this
.
$router
.
replace
(
'/
my
/'
+
this
.
puid
+
'/'
+
this
.
coin_type
+
'/'
+
this
.
region_id
+
'/payments'
)
break
;
case
3
:
this
.
$router
.
replace
(
'/
frameDashboard
/settings'
)
this
.
$router
.
replace
(
'/
my
/settings'
)
break
;
}
}
...
...
src/components/Common/
frameDashboard
.vue
→
src/components/Common/
my
.vue
View file @
772f3082
...
...
@@ -7,7 +7,7 @@
<
script
>
import
tabbar
from
'@/components/common/Tabbar'
export
default
{
name
:
'
frameDashboard
'
,
name
:
'
my
'
,
data
()
{
return
{
...
...
src/components/Dashboard/index.vue
View file @
772f3082
...
...
@@ -98,11 +98,6 @@ export default {
},
data
()
{
return
{
puid
:
''
,
coin_type
:
''
,
region_id
:
''
,
language
:
''
,
hasZIndex
:
false
,
//侧栏滑出的zindex调整
showCoin
:
false
,
showRegion
:
false
,
...
...
@@ -127,6 +122,20 @@ export default {
}
};
},
computed
:
{
puid
()
{
return
this
.
$store
.
state
.
puid
||
localStorage
.
getItem
(
'puid'
);
},
coin_type
()
{
return
this
.
$store
.
state
.
coin_type
||
localStorage
.
getItem
(
'coin_type'
);
},
region_id
()
{
return
this
.
$store
.
state
.
region_id
||
localStorage
.
getItem
(
'region_id'
);
},
language
()
{
return
this
.
$store
.
state
.
language
||
localStorage
.
getItem
(
'language'
);
}
},
mounted
()
{
this
.
pageInitInterval
();
},
...
...
@@ -141,16 +150,11 @@ export default {
},
pageInit
()
{
let
self
=
this
;
this
.
puid
=
this
.
$route
.
params
.
puid
||
localStorage
.
getItem
(
'puid'
);
//相关路由参数
this
.
coin_type
=
this
.
$route
.
params
.
coin_type
||
localStorage
.
getItem
(
'coin_type'
);
this
.
region_id
=
this
.
$route
.
params
.
region_id
||
localStorage
.
getItem
(
'region_id'
);
this
.
language
=
localStorage
.
getItem
(
'language'
);
fn
.
getApiBaseUrl
(
this
.
region_id
,
this
.
coin_type
).
then
(
api
=>
{
if
(
api
==
''
)
{
//自动到无节点页面
console
.
log
(
"dashboard/index.vue没有找到apiBaseUrl,所以跳到no.vue"
)
this
.
$router
.
replace
(
'/
frameDashboard
/'
+
this
.
puid
+
'/'
+
this
.
coin_type
)
this
.
$router
.
replace
(
'/
my
/'
+
this
.
puid
+
'/'
+
this
.
coin_type
)
}
else
{
//请求实时算力
fn
.
getWorkerStats
(
api
,
this
.
puid
).
then
(
res
=>
{
...
...
src/components/Dashboard/no.vue
View file @
772f3082
...
...
@@ -66,7 +66,7 @@
<li>
<label
for=
""
>
password
</label>
<input
type=
"text"
value=
"123"
class=
"eq-font"
disabled=
""
/>
<
span
style=
"color: #999;"
>
建议不填
</span
>
<
!--
<span
style=
"color: #999;"
>
建议不填
</span>
--
>
</li>
</ul>
</form>
...
...
src/components/Dashboard/subaccount.vue
View file @
772f3082
...
...
@@ -8,7 +8,7 @@
</div>
<div
class=
"list-item"
>
<div
class=
"list"
v-for=
"subaccount in subaccountList"
:key=
"subaccount.puid"
@
click=
"subaccountActive(subaccount)"
:class=
"subaccount.puid==puid?'active':''"
>
<span>
{{
subaccount
.
name
}}
</span>
<span>
<b
class=
"bg-coin"
:class=
"subaccount.default_coin_type"
></b>
{{
subaccount
.
name
}}
</span>
<i
v-show=
"puid == subaccount.puid"
class=
"iconfont icon-dui"
></i>
</div>
<div
class=
"subAdd"
@
click=
"goCreate"
>
...
...
@@ -24,22 +24,31 @@ export default {
data
()
{
return
{
infoUser
:
'xuzhiyuan@163.com'
,
puid
:
this
.
$route
.
params
.
puid
,
coin_type
:
this
.
$route
.
params
.
coin_type
,
region_id
:
this
.
$route
.
params
.
region_id
,
language
:
localStorage
.
getItem
(
'language'
),
subaccountList
:
[],
cur_account_info
:
{},
}
},
computed
:
{
puid
()
{
return
this
.
$store
.
state
.
puid
||
localStorage
.
getItem
(
'puid'
);
},
coin_type
()
{
return
this
.
$store
.
state
.
coin_type
||
localStorage
.
getItem
(
'coin_type'
);
},
region_id
()
{
return
this
.
$store
.
state
.
region_id
||
localStorage
.
getItem
(
'region_id'
);
},
language
()
{
return
this
.
$store
.
state
.
language
||
localStorage
.
getItem
(
'language'
);
}
},
mounted
()
{
this
.
getSubAccount
();
this
.
getSubAccountById
();
},
methods
:
{
subaccountActive
(
obj
)
{
this
.
puid
=
obj
.
puid
this
.
$store
.
commit
(
'setPuid'
,
obj
.
puid
);
this
.
$emit
(
'childSubAccount'
,
obj
)
},
goCreate
()
{
...
...
src/components/Jump.vue
View file @
772f3082
...
...
@@ -40,7 +40,7 @@ export default {
},
methods
:
{
goDashboard
()
{
this
.
$router
.
replace
(
"/
frameDashboard
/"
+
this
.
puid
+
'/'
+
this
.
coin_type
+
'/'
+
this
.
region_id
+
'/dashboard'
)
this
.
$router
.
replace
(
"/
my
/"
+
this
.
puid
+
'/'
+
this
.
coin_type
+
'/'
+
this
.
region_id
+
'/dashboard'
)
}
}
}
...
...
src/components/Payments/index.vue
View file @
772f3082
...
...
@@ -6,9 +6,9 @@
<div
class=
"page-content bottom"
>
<div
class=
"pay-list pl30 pr30 pt20"
>
<div>
<h3
>
{{
txt
[
language
].
zuorishouyi
}}
<i
@
click=
"promptZuori"
class=
"iconfont icon-gantanhao"
></i>
</h3>
<h3
@
click=
"promptZuori"
>
{{
txt
[
language
].
zuorishouyi
}}
<i
class=
"iconfont icon-gantanhao"
></i>
</h3>
<p>
<span
class=
"v1"
v-if=
"$store.state.coin_type=='xmr'"
><animated-num
:value=
"PaymentStats.yesterday_amount/Math.pow(10,12)"
:fixed=
12
></animated-num></span>
<span
class=
"v1"
v-if=
"$store.state.coin_type=='xmr'"
style=
"font-size:0.76rem"
><animated-num
:value=
"PaymentStats.yesterday_amount/Math.pow(10,12)"
:fixed=
12
></animated-num></span>
<span
class=
"v1"
v-else
><animated-num
:value=
"PaymentStats.yesterday_amount/Math.pow(10,8)"
:fixed=
8
></animated-num></span>
<span
class=
"k1"
>
{{
init_url
.
coins
[
$store
.
state
.
coin_type
][
'symbol'
]
}}
</span>
</p>
...
...
@@ -42,7 +42,7 @@
<span
class=
"k"
>
{{
init_url
.
coins
[
$store
.
state
.
coin_type
][
'symbol'
]
}}
</span>
</div>
</div>
<div
class=
"ments-list p30"
v-for=
"
items
in PaymentHistory.data"
flex=
"dir:left box:mean"
>
<div
class=
"ments-list p30"
v-for=
"
(items,idx)
in PaymentHistory.data"
flex=
"dir:left box:mean"
>
<div>
<span>
{{
items
.
date
|
date422
}}
</span>
<s>
PPS模式
</s>
...
...
@@ -57,8 +57,9 @@
<el-button
type=
"text"
size=
"mini"
style=
"color:#666;cursor:default;"
>
{{
txt
[
language
].
daizhifu
}}
</el-button>
</s>
<s
v-if=
"items.payment_status=='DELAYED'"
>
<el-button
type=
"text"
size=
"mini"
style=
"color:#fa5943;cursor:default;"
>
{{
txt
[
language
].
cunruyue
}}
</el-button><i
style=
"font-family:simsun;color:#ccc; padding-left: 5px; padding-right: 5px;"
>
|
</i>
<el-button
type=
"text"
size=
"mini"
@
:click=
"cunruyue"
>
{{
txt
[
language
].
yuanyin
}}
</el-button>
<el-button
type=
"text"
size=
"mini"
style=
"color:#727272;cursor:default;"
>
{{
txt
[
language
].
cunruyue
}}
</el-button>
<!--
<i
style=
"font-family:simsun;color:#ccc; padding-left: 5px; padding-right: 5px;"
>
|
</i>
<el-button
type=
"text"
size=
"mini"
@
click=
"cunruyue(idx)"
>
{{
txt
[
language
].
yuanyin
}}
</el-button>
-->
</el-tooltip>
</s>
</div>
...
...
@@ -78,9 +79,8 @@ export default {
},
data
()
{
return
{
reason
:
""
,
//
reason: "",
regions
:
[],
language
:
localStorage
.
getItem
(
'language'
),
PaymentStats
:
{
total_paid_amount
:
0
,
balance
:
0
,
...
...
@@ -90,18 +90,29 @@ export default {
PaymentHistory
:
{},
}
},
computed
:
{
...
mapState
([
"txt"
,
"init_url"
,
"cur_coins"
]),
puid
()
{
return
this
.
$store
.
state
.
puid
||
localStorage
.
getItem
(
'puid'
);
},
coin_type
()
{
return
this
.
$store
.
state
.
coin_type
||
localStorage
.
getItem
(
'coin_type'
);
},
region_id
()
{
return
this
.
$store
.
state
.
region_id
||
localStorage
.
getItem
(
'region_id'
);
},
language
()
{
return
this
.
$store
.
state
.
language
||
localStorage
.
getItem
(
'language'
);
}
},
methods
:
{
handleCurrentChange
(
v
)
{
self
=
this
;
let
puid
=
this
.
$route
.
params
.
puid
;
let
coin_type
=
this
.
$route
.
params
.
coin_type
;
let
region_id
=
this
.
$route
.
params
.
region_id
;
//获取支付历史
fn
.
getApiBaseUrl
(
region_id
,
coin_type
)
.
then
(
api
=>
fn
.
getPaymentHistory
(
api
,
puid
,
v
))
.
then
(
res
=>
{
self
.
PaymentHistory
=
res
.
data
.
data
;
//console.log("当前币种所在节点的子帐户支付历史PaymentHistory:", res.data)
self
.
reason
=
fn
.
getPaymentHistoryReason
(
res
.
data
.
data
.
data
);
})
},
...
...
@@ -115,90 +126,79 @@ export default {
},
pageInit
()
{
let
self
=
this
;
let
puid
=
this
.
$route
.
params
.
puid
;
let
coin_type
=
this
.
$route
.
params
.
coin_type
;
let
region_id
=
this
.
$route
.
params
.
region_id
;
this
.
language
=
localStorage
.
getItem
(
'language'
);
//获取stratum_url
fn
.
getStratumUrl
(
region_id
,
coin_type
)
.
then
(
res
=>
{
self
.
stratum_url
=
res
;
})
fn
.
getStratumUrl
(
this
.
region_id
,
this
.
coin_type
).
then
(
res
=>
{
this
.
stratum_url
=
res
;
})
//获取所有节点
fn
.
getAllRegions
().
then
(
res
=>
{
this
.
regions
=
res
;
});
// //获取当前节点信息
fn
.
getRegionInfo
(
region_id
).
then
(
res
=>
{
if
(
self
.
language
==
'zh-cn'
)
{
fn
.
getRegionInfo
(
this
.
region_id
).
then
(
res
=>
{
if
(
this
.
language
==
'zh-cn'
)
{
this
.
region_name
=
res
[
'text_zh-cn'
];
}
if
(
self
.
language
==
'en'
)
{
if
(
this
.
language
==
'en'
)
{
this
.
region_name
=
res
[
'text_en'
];
}
});
//获取支付状态
fn
.
getApiBaseUrl
(
region_id
,
coin_type
)
fn
.
getApiBaseUrl
(
this
.
region_id
,
this
.
coin_type
)
.
then
(
api
=>
{
if
(
api
==
''
)
{
this
.
$toast
(
"当前币种所在的节点不支持!"
);
$router
.
replace
(
"/my/"
+
puid
+
"/"
+
localStorage
.
getItem
(
'coin_type'
))
this
.
$router
.
replace
(
"/my/"
+
puid
+
"/"
+
localStorage
.
getItem
(
'coin_type'
))
}
else
{
fn
.
getPaymentStats
(
api
,
puid
)
fn
.
getPaymentStats
(
api
,
this
.
puid
)
.
then
(
res
=>
{
if
(
res
.
data
.
err_no
==
0
)
{
//console.log("当前币种所在节点的子帐户支付状态PaymentStats:", res.data.data);
this
.
PaymentStats
=
res
.
data
.
data
;
}
else
{
this
.
$toast
(
"当前币种所在节点的子帐户支付状态错误!"
)
$router
.
replace
({
name
:
'
my_puid_cointype
'
,
path
:
'/my/'
+
self
.
$route
.
params
.
puid
+
'/'
+
self
.
$route
.
params
.
coin_type
this
.
$router
.
replace
({
name
:
'
no
'
,
path
:
'/my/'
+
this
.
$route
.
params
.
puid
+
'/'
+
this
.
$route
.
params
.
coin_type
})
}
self
.
loading
=
false
;
// this
.loading = false;
});
}
})
//获取支付历史
fn
.
getApiBaseUrl
(
region_id
,
coin_type
)
fn
.
getApiBaseUrl
(
this
.
region_id
,
this
.
coin_type
)
.
then
(
api
=>
{
if
(
api
==
""
)
{
$router
.
replace
({
name
:
'
my_puid_cointype
'
,
path
:
'/my/'
+
self
.
$route
.
params
.
puid
+
'/'
+
self
.
$route
.
params
.
coin_type
this
.
$router
.
replace
({
name
:
'
no
'
,
path
:
'/my/'
+
this
.
$route
.
params
.
puid
+
'/'
+
this
.
$route
.
params
.
coin_type
})
}
else
{
fn
.
getPaymentHistory
(
api
,
puid
,
1
)
fn
.
getPaymentHistory
(
api
,
this
.
puid
,
1
)
.
then
(
res
=>
{
self
.
PaymentHistory
=
res
.
data
.
data
;
//console.log("当前币种所在节点的子帐户支付历史PaymentHistory:", res.data)
self
.
reason
=
fn
.
getPaymentHistoryReason
(
res
.
data
.
data
.
data
);
self
.
loading
=
false
;
// self.reason = fn.getPaymentHistoryReason(res.data.data.data);
// self.loading = false;
})
}
})
},
promptZuori
()
{
this
.
$toast
(
'昨日收益为国际标准时间昨日0:00-24:00(北京时间昨日8:00到今日8:00)之间的收益。'
);
this
.
$toast
({
message
:
'昨日收益为国际标准时间昨日0:00-24:00(北京时间昨日8:00到今日8:00)之间的收益。'
,
position
:
'middle'
,
className
:
'text-justify'
});
},
cunruyue
(){
this
.
$toast
(
reason
[
items
.
$index
])
}
},
computed
:
{
...
mapState
([
"txt"
,
"init_url"
,
"cur_coins"
]),
refresh
(
v
)
{
return
$store
.
state
.
refresh
;
}
// cunruyue(n) {
// this.$toast(this.reason[n])
// }
},
watch
:
{
'$route'
(
to
,
from
)
{
this
.
pageInitInterval
();
},
refresh
(
v
)
{
this
.
pageInitInterval
()
}
},
mounted
()
{
...
...
@@ -207,3 +207,6 @@ export default {
}
</
script
>
<
style
lang=
"less"
>
.text-justify
.mint-toast-text
{
text-align
:
justify
;}
</
style
>
src/components/Users/Create.vue
View file @
772f3082
...
...
@@ -21,19 +21,21 @@
</el-form-item>
<div
class=
"descript"
>
当切换到该子账户时,将默认显示该币种
</div>
<div
class=
'btn-group full pl30 pr30 mt50'
>
<el-button
type=
"primary"
round
@
click=
"submitForm('createForm')"
:disabled=
"!showBtn"
>
确定
</el-button>
<el-button
type=
"primary"
round
@
click=
"submitForm('createForm')"
:disabled=
"!showBtn"
>
确定
</el-button>
</div>
</el-form>
<div
class=
"p30"
>
<ul
class=
"descript-list"
>
<li>
• 子账户支持多个币种和多个地区挖矿,你可以创建多个子账户管理不同的币种和地区挖矿。
</li>
<li>
• 您最多可设置50个子账户。这一子账户名称加上矿机编号即为矿机设置页的矿机名(worker
name),如: "zizhanghu.001","zizhangh
</li>
<li>
• 您最多可设置50个子账户。这一子账户名称加上矿机编号即为矿机设置页的矿机名(worker
name),如: "zizhanghu.001","zizhanghu.002"。
</li>
</ul>
</div>
</div>
</div>
</
template
>
<
script
>
import
fn
from
'@/utils/function.js'
import
{
MessageBox
}
from
'mint-ui'
;
export
default
{
name
:
"create"
,
data
()
{
...
...
@@ -70,16 +72,37 @@ export default {
submitForm
(
formName
)
{
this
.
$refs
[
formName
].
validate
(
valid
=>
{
if
(
valid
)
{
this
.
$messagebox
.
alert
(
"提交成功!"
,
"温馨提示"
);
this
.
createAccount
({
'name'
:
this
.
createForm
.
username
,
'coin_type'
:
this
.
createForm
.
defaultCoin
})
}
else
{
this
.
$
messagebox
.
alert
(
"提交错误!"
,
"温馨提示"
);
this
.
$
toast
(
'填写错误!'
,
'友情提示'
)
return
false
;
}
});
}
},
createAccount
(
params
)
{
fn
.
createAccount
(
params
).
then
(
res
=>
{
if
(
res
.
data
.
err_no
==
100
)
{
this
.
$toast
(
'该账户已创建过多的子账户!'
)
}
else
{
if
(
res
.
data
.
err_no
==
101
)
{
this
.
$toast
(
"该子账户已存在!"
)
}
else
{
this
.
$toast
({
message
:
'子账号已创建!'
,
iconClass
:
'iconfont icon-caozuochenggong c-green'
});
this
.
$store
.
commit
(
'setPuid'
,
res
.
data
.
data
.
puid
);
this
.
$store
.
commit
(
'setCoinType'
,
res
.
data
.
data
.
default_coin_type
);
this
.
$router
.
push
(
'/my/'
+
this
.
$store
.
state
.
puid
+
'/'
+
this
.
$store
.
state
.
coin_type
);
}
}
})
},
}
};
</
script
>
<
style
>
</
style
>
src/main.js
View file @
772f3082
...
...
@@ -48,7 +48,7 @@ axios.interceptors.request.use(config => {
function
checkToken
()
{
return
new
Promise
((
resolve
,
reject
)
=>
{
resolve
(
'eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6IlEwTTBNRUl4UVRVME5qazJNa0ZFT0RCRk56WkJNVGc0TmtFd09UWkNOakZGTlRFMFEwVTJOdyJ9.eyJpc3MiOiJodHRwczovL2Jsb2NraW4uYXV0aDAuY29tLyIsInN1YiI6ImF1dGgwfDVhMzM4MWE2ZjczMzNjNjdkMzMxOWZiYyIsImF1ZCI6WyJodHRwczovL3d3dy5wb29saW4uY29tL2FwaSIsImh0dHBzOi8vYmxvY2tpbi5hdXRoMC5jb20vdXNlcmluZm8iXSwiaWF0IjoxNTE3Mz
A3OTIzLCJleHAiOjE1MTczMTUxMjMsImF6cCI6IkZhczI5dWJNNW52NElFMlZUQ3ZEWU5iaWtIeTF0bDBkIiwic2NvcGUiOiJvcGVuaWQgcHJvZmlsZSByZWFkIHdyaXRlIn0.B9Ng3zmsPNn9A_pMxnLRAS2JRoG-yX8L15Ik1w8OmLfrxYTObhQ2TtC5V_f_QkXPPduc__BNa1Nz5OkLIxVl_BabiHal0MET-yI_EYiGVse6KLrKl5QiAlHKS_dJwxd0sE4nQDOlPxgNJVkcRaMo0t-M6OZUQpSoZe980OY4ugkqgpmaqzB07UT1HC7gFxZIF2Csf8FZcGylyYkryTPLaUvIMKSH7QIUnYChSKxaP2r-FAUu5C_ThTcjme8KhswQNwIowrcy82gwULlvN0ldUb4UlilwDSXPUlUkDC3LY7SXpiyfxbKrKejjJmDgvl2FSKiFjTbzvA7XIhCu8HuIX
g'
);
resolve
(
'eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6IlEwTTBNRUl4UVRVME5qazJNa0ZFT0RCRk56WkJNVGc0TmtFd09UWkNOakZGTlRFMFEwVTJOdyJ9.eyJpc3MiOiJodHRwczovL2Jsb2NraW4uYXV0aDAuY29tLyIsInN1YiI6ImF1dGgwfDVhMzM4MWE2ZjczMzNjNjdkMzMxOWZiYyIsImF1ZCI6WyJodHRwczovL3d3dy5wb29saW4uY29tL2FwaSIsImh0dHBzOi8vYmxvY2tpbi5hdXRoMC5jb20vdXNlcmluZm8iXSwiaWF0IjoxNTE3Mz
g3NjY0LCJleHAiOjE1MTczOTQ4NjQsImF6cCI6IkZhczI5dWJNNW52NElFMlZUQ3ZEWU5iaWtIeTF0bDBkIiwic2NvcGUiOiJvcGVuaWQgcHJvZmlsZSByZWFkIHdyaXRlIn0.CAjxVLkrBa09VoEhZ_DN_NmTvLK5WqIQEgeTeAl8Rv1CtOi5d5-WuUybTJWIQEfvUpMdmE63p80PLYICsoqQSq3VMpM39eITR2wFlySfDKihXskBuYg0NbTuQkHXbYt2AAfe9DzfFb7eJ0F9YOjP93BOqYMugsSwj8T5tWkpuiHa9OExqlJw0d4M-bpoNtyhQI3nDtPfdg_Q3g0lBp9zC1nbVlBy0lVvV7-1NzBFOvPHaAIg232ggpecOr0escVpwDnOX1otfUl-JoEckw-K4mKC8_CKBaZyF1uPxbNuyv5Q4FfVBKg3CDqXQjudy-FviRLzZFLZsg1IUsabc2u-S
g'
);
})
}
...
...
src/router/index.js
View file @
772f3082
...
...
@@ -59,9 +59,9 @@ const router = new Router({
}
},
{
path
:
'/
frameDashboard
'
,
name
:
'
frameDashboard
'
,
component
:
resolve
=>
require
([
'@/components/Common/
frameDashboard
.vue'
],
resolve
),
path
:
'/
my
'
,
name
:
'
my
'
,
component
:
resolve
=>
require
([
'@/components/Common/
my
.vue'
],
resolve
),
// redirect: 'my/:puid/:coin_type/:region_id/dashboard',
children
:
[{
path
:
':puid/:coin_type/:region_id/dashboard'
,
...
...
src/utils/function.js
View file @
772f3082
...
...
@@ -136,7 +136,7 @@ export default {
* @return {[type]} [description]
*/
getLucky
(
coin_type
)
{
return
$axios
(
Vue
.
$store
.
state
.
common_url
+
"/pool/lucky?coin_type="
+
coin_type
)
return
$axios
(
$store
.
state
.
common_url
+
"/pool/lucky?coin_type="
+
coin_type
)
},
/**
* [getBlocks 获取矿池出块数据]
...
...
@@ -146,7 +146,7 @@ export default {
* @return {[type]} [description]
*/
getBlocks
(
coin_type
)
{
return
$axios
(
Vue
.
$store
.
state
.
common_url
+
"/pool/blocks/merge?coin_type="
+
coin_type
)
return
$axios
(
$store
.
state
.
common_url
+
"/pool/blocks/merge?coin_type="
+
coin_type
)
},
/**
* [getStats 获取矿池实时算力-合并]
...
...
@@ -156,7 +156,7 @@ export default {
* @return {[type]} [description]
*/
getStats
(
coin_type
)
{
return
$axios
(
Vue
.
$store
.
state
.
common_url
+
"/pool/stats/merge?coin_type="
+
coin_type
)
return
$axios
(
$store
.
state
.
common_url
+
"/pool/stats/merge?coin_type="
+
coin_type
)
},
/**
* [getShareHistory 获取矿池算力历史-合并]
...
...
@@ -168,7 +168,7 @@ export default {
* @return {[type]} [description]
*/
getShareHistory
(
count
,
dimension
,
coin_type
)
{
return
$axios
(
Vue
.
$store
.
state
.
common_url
+
"/pool/share-history/merge?count="
+
count
+
"&dimension="
+
dimension
+
"&coin_type="
+
coin_type
)
return
$axios
(
$store
.
state
.
common_url
+
"/pool/share-history/merge?count="
+
count
+
"&dimension="
+
dimension
+
"&coin_type="
+
coin_type
)
},
/**
* [getSubAccount 获取子账户列表]
...
...
@@ -177,7 +177,7 @@ export default {
* @return {[type]} [description]
*/
getSubAccount
()
{
return
$axios
(
Vue
.
$store
.
state
.
common_url
+
"/subaccount"
)
return
$axios
(
$store
.
state
.
common_url
+
"/subaccount"
)
},
/**
* [getSubAccountById 获取子账户详情]
...
...
@@ -188,17 +188,17 @@ export default {
*/
getSubAccountById
(
puid
)
{
// return new Promise(function (relsove, reject) {
// if (!
Vue.$store.state.SubAccount) Vue.
$store.state.SubAccount = {};
// if (
Vue.
$store.state.SubAccount['SubAccount' + puid]) {
// relsove(
Vue.
$store.state.SubAccount['SubAccount' + puid])
// if (!
$store.state.SubAccount)
$store.state.SubAccount = {};
// if ($store.state.SubAccount['SubAccount' + puid]) {
// relsove($store.state.SubAccount['SubAccount' + puid])
// } else {
// $axios(
Vue.
$store.state.common_url + "/subaccount/" + puid).then(function (res) {
//
Vue.
$store.state.SubAccount['SubAccount' + puid] = res;
// relsove(
Vue.
$store.state.SubAccount['SubAccount' + puid])
// $axios($store.state.common_url + "/subaccount/" + puid).then(function (res) {
// $store.state.SubAccount['SubAccount' + puid] = res;
// relsove($store.state.SubAccount['SubAccount' + puid])
// })
// }
// })
return
$axios
(
Vue
.
$store
.
state
.
common_url
+
"/subaccount/"
+
puid
)
return
$axios
(
$store
.
state
.
common_url
+
"/subaccount/"
+
puid
)
},
/**
* [createAccount 创建子账户]
...
...
@@ -208,7 +208,7 @@ export default {
* @return {[type]} [description]
*/
createAccount
(
params
)
{
return
$axios
.
post
(
Vue
.
$store
.
state
.
common_url
+
"/subaccount/create"
,
params
)
return
$axios
.
post
(
$store
.
state
.
common_url
+
"/subaccount/create"
,
params
)
},
/**
* [getUrl 获取初始接口]
...
...
@@ -219,7 +219,7 @@ export default {
*/
getUrl
()
{
//console.log("getUrl")
return
$axios
(
Vue
.
$store
.
state
.
base_url
)
return
$axios
(
$store
.
state
.
base_url
)
// .then(res => { return mock.getUrl })
},
/**
...
...
@@ -232,9 +232,9 @@ export default {
getCoins
()
{
//console.log("getCoins")
new
Promise
((
resolve
,
reject
)
=>
{
resolve
(
Vue
.
$store
.
state
.
init_url
.
coins
)
resolve
(
$store
.
state
.
init_url
.
coins
)
})
// return $axios(
Vue.
$store.state.base_url).then(res => { return res.data.coins })
// return $axios($store.state.base_url).then(res => { return res.data.coins })
},
/**
* [getAllRegions 获取初始接口的所有节点]
...
...
@@ -246,13 +246,13 @@ export default {
getAllRegions
()
{
//console.log("getAllRegions")
// return new Promise((resolve, reject) => {
// resolve(
Vue.
$store.state.init_url.regions)
// resolve($store.state.init_url.regions)
// })
let
coin_type
=
localStorage
.
getItem
(
'coin_type'
);
let
regions
=
[];
let
obj
=
{};
return
new
Promise
((
resolve
,
reject
)
=>
{
_
.
each
(
Vue
.
$store
.
state
.
init_url
.
regions
,
function
(
v
,
k
)
{
_
.
each
(
$store
.
state
.
init_url
.
regions
,
function
(
v
,
k
)
{
_
.
each
(
v
.
supported_coin_types
,
function
(
v1
,
k1
)
{
if
(
v1
.
coin_type
==
coin_type
)
{
obj
=
{
region_id
:
v
.
region_id
,
text_en
:
v
.
text_en
,
'text_zh-cn'
:
v
[
'text_zh-cn'
]
}
...
...
@@ -274,7 +274,7 @@ export default {
//console.log("getRegionInfo")
return
new
Promise
((
resolve
,
reject
)
=>
{
let
cur_region
;
_
.
each
(
Vue
.
$store
.
state
.
init_url
.
regions
,
function
(
v
,
k
)
{
_
.
each
(
$store
.
state
.
init_url
.
regions
,
function
(
v
,
k
)
{
if
(
v
.
region_id
==
region_id
)
{
cur_region
=
v
;
}
...
...
@@ -291,7 +291,7 @@ export default {
*/
getUserList
()
{
//console.log("getUserList")
return
$axios
(
Vue
.
$store
.
state
.
common_url
+
'/subaccount'
);
return
$axios
(
$store
.
state
.
common_url
+
'/subaccount'
);
},
/**
* [getUser 获取当前帐户信息]
...
...
@@ -303,7 +303,7 @@ export default {
*/
getUser
(
puid
)
{
//console.log("getUser")
return
$axios
(
Vue
.
$store
.
state
.
common_url
+
'/subaccount/'
+
puid
)
return
$axios
(
$store
.
state
.
common_url
+
'/subaccount/'
+
puid
)
},
/**
* [getZonglanList 获取单个币种多个节点数据]
...
...
@@ -338,7 +338,7 @@ export default {
// console.log("getApiBaseUrl")
return
new
Promise
((
resolve
,
reject
)
=>
{
let
api_base_url
=
''
;
_
.
each
(
Vue
.
$store
.
state
.
init_url
.
regions
,
function
(
v
,
k
)
{
_
.
each
(
$store
.
state
.
init_url
.
regions
,
function
(
v
,
k
)
{
if
(
v
.
region_id
==
region_id
)
{
_
.
each
(
v
.
supported_coin_types
,
function
(
v1
,
k1
)
{
if
(
v1
.
coin_type
==
cointype
)
{
...
...
@@ -575,7 +575,7 @@ export default {
*/
getRegionCoins
(
region_id
)
{
let
arr_coins
=
[];
_
.
map
(
Vue
.
$store
.
state
.
init_url
.
regions
,
function
(
v
,
i
,
o
)
{
_
.
map
(
$store
.
state
.
init_url
.
regions
,
function
(
v
,
i
,
o
)
{
if
(
v
.
region_id
==
region_id
)
{
_
.
map
(
v
.
supported_coin_types
,
function
(
v1
,
i1
,
o1
)
{
arr_coins
.
push
(
v1
.
coin_type
)
...
...
@@ -607,7 +607,7 @@ export default {
getStratumUrl
(
region_id
,
coin_type
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
let
stratum_url
=
''
;
_
.
each
(
Vue
.
$store
.
state
.
init_url
.
regions
,
function
(
v
,
k
)
{
_
.
each
(
$store
.
state
.
init_url
.
regions
,
function
(
v
,
k
)
{
if
(
v
.
region_id
==
region_id
)
{
_
.
each
(
v
.
supported_coin_types
,
function
(
v1
,
k1
)
{
if
(
v1
.
coin_type
==
coin_type
)
{
...
...
@@ -628,11 +628,11 @@ export default {
*/
getStratumUrls
(
coin_type
)
{
//mock.getUrl.data
//
Vue.
$store.state.init_url
//$store.state.init_url
let
data
=
[];
return
new
Promise
((
resolve
,
reject
)
=>
{
let
stratum_url
=
''
;
_
.
each
(
Vue
.
$store
.
state
.
init_url
.
regions
,
function
(
v
,
k
)
{
_
.
each
(
$store
.
state
.
init_url
.
regions
,
function
(
v
,
k
)
{
_
.
each
(
v
.
supported_coin_types
,
function
(
v1
,
k1
)
{
if
(
v1
.
coin_type
==
coin_type
)
{
data
.
push
({
region_id
:
v
.
region_id
,
text_en
:
v
.
text_en
,
'text_zh-cn'
:
v
[
'text_zh-cn'
],
coin_info
:
v1
})
...
...
@@ -651,7 +651,7 @@ export default {
* @return {[type]} [description]
*/
getSummary
(
puid
,
coin_type
)
{
return
$axios
(
Vue
.
$store
.
state
.
common_url
+
"/subaccount/summary?puid="
+
puid
+
"&coin_type="
+
coin_type
)
return
$axios
(
$store
.
state
.
common_url
+
"/subaccount/summary?puid="
+
puid
+
"&coin_type="
+
coin_type
)
},
/**
* [getAllRegionByCoin 根据币种获取到所有节点所支持的所有节点]
...
...
@@ -664,7 +664,7 @@ export default {
let
regions
=
[];
let
obj
=
{};
return
new
Promise
((
resolve
,
reject
)
=>
{
_
.
each
(
Vue
.
$store
.
state
.
init_url
.
regions
,
function
(
v
,
k
)
{
_
.
each
(
$store
.
state
.
init_url
.
regions
,
function
(
v
,
k
)
{
_
.
each
(
v
.
supported_coin_types
,
function
(
v1
,
k1
)
{
if
(
v1
.
coin_type
==
coin_type
)
{
obj
=
{
region_id
:
v
.
region_id
,
text_en
:
v
.
text_en
,
'text_zh-cn'
:
v
[
'text_zh-cn'
]
}
...
...
@@ -679,25 +679,25 @@ export default {
* 创建 token
*/
createToken
(
puid
,
params
)
{
return
$axios
.
post
(
Vue
.
$store
.
state
.
common_url
+
'/watcher/token/create?puid='
+
puid
,
params
)
return
$axios
.
post
(
$store
.
state
.
common_url
+
'/watcher/token/create?puid='
+
puid
,
params
)
},
/**
* 列出 token
*/
listToken
(
puid
,
coin
)
{
return
$axios
(
Vue
.
$store
.
state
.
common_url
+
'/watcher/token?puid='
+
puid
+
'&coin_type='
+
coin
)
return
$axios
(
$store
.
state
.
common_url
+
'/watcher/token?puid='
+
puid
+
'&coin_type='
+
coin
)
},
/**
* 获取 token 详情
*/
getTokenInfo
(
token
)
{
return
$axios
(
Vue
.
$store
.
state
.
common_url
+
'/watcher/token/info?token='
+
token
)
return
$axios
(
$store
.
state
.
common_url
+
'/watcher/token/info?token='
+
token
)
},
/**
* 移除 token
*/
delToken
(
puid
,
params
)
{
return
$axios
.
post
(
Vue
.
$store
.
state
.
common_url
+
'/watcher/token/delete?puid='
+
puid
,
params
)
return
$axios
.
post
(
$store
.
state
.
common_url
+
'/watcher/token/delete?puid='
+
puid
,
params
)
},
/**
* 获取所支持币种
...
...
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