Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
ycc-website
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
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Website
ycc-website
Commits
9352a5db
Commit
9352a5db
authored
Feb 24, 2022
by
chenqikuai
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
ee01be77
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
84 additions
and
27 deletions
+84
-27
m-chain-perf.vue
src/components/mobile/m-chain-perf.vue
+4
-5
m-chain-price.vue
src/components/mobile/m-chain-price.vue
+10
-3
ChainCardShowPerf.vue
.../pc/BlockChainBrowser/ChainOverview/ChainCardShowPerf.vue
+4
-5
index.vue
src/components/pc/BlockChainBrowser/ChainOverview/index.vue
+9
-1
blockChainBrowser.ts
src/mixin/blockChainBrowser.ts
+26
-11
api.ts
src/service/api.ts
+15
-0
blockChainBrowser.vue
src/views/mobile/blockChainBrowser.vue
+13
-2
blockChainBrowser.vue
src/views/pc/blockChainBrowser.vue
+3
-0
No files found.
src/components/mobile/m-chain-perf.vue
View file @
9352a5db
...
...
@@ -19,7 +19,7 @@
import
Vue
from
'vue'
export
default
Vue
.
extend
({
props
:
{
speed
:
String
,
speed
:
Number
,
tps
:
Number
,
txNumber
:
Number
,
addressNumber
:
Number
,
...
...
@@ -29,11 +29,11 @@ export default Vue.extend({
return
[
{
name
:
this
.
$t
(
'lang.chainPerf.speed'
)
as
string
,
value
:
'2s'
+
this
.
speed
,
value
:
this
.
speed
+
's'
,
},
{
name
:
this
.
$t
(
'lang.chainPerf.tps'
)
as
string
,
value
:
'13.3'
+
this
.
tps
,
value
:
this
.
tps
,
},
{
name
:
this
.
$t
(
'lang.chainPerf.txNumber'
)
as
string
,
...
...
@@ -41,8 +41,7 @@ export default Vue.extend({
},
{
name
:
this
.
$t
(
'lang.chainPerf.addressNumber'
)
as
string
,
// value: '120391820' + this.addressNumber,
value
:
'23842'
,
value
:
this
.
addressNumber
,
},
]
},
...
...
src/components/mobile/m-chain-price.vue
View file @
9352a5db
...
...
@@ -7,11 +7,13 @@
}"
>
<img
:src=
"yccIcon"
alt=
""
class=
"yccIcon"
/>
<div
class=
"text-white font-bold text-xl mt-1"
>
0.004538 美元
</div>
<div
class=
"text-white font-bold text-xl mt-1"
>
{{
price
}}{{
$t
(
'lang.price.dollar'
)
}}
</div>
<div
class=
"updown text-my-red font-bold text-xs flex items-center justify-center"
>
+9%
{{
quoteChange
}}
</div>
<div
class=
"font-bold text-xs text-white mt-4"
>
{{
$t
(
'lang.price.realTimeQuotes'
)
}}
...
...
@@ -25,7 +27,7 @@
{{
$t
(
'lang.price.marketValueInDollars'
)
}}
</div>
<div
class=
"text-footer-color font-bold"
>
1029381023
{{
marketValue
}}
</div>
</div>
</div>
...
...
@@ -35,6 +37,11 @@ import Vue from 'vue'
import
bg
from
'@/assets/images/blockChainBrowser/home/beautiful-rect.png'
import
yccIcon
from
'@/assets/images/blockChainBrowser/home/ycc-icon.png'
export
default
Vue
.
extend
({
props
:
{
price
:
String
,
quoteChange
:
String
,
marketValue
:
Number
,
},
data
()
{
return
{
bg
,
...
...
src/components/pc/BlockChainBrowser/ChainOverview/ChainCardShowPerf.vue
View file @
9352a5db
...
...
@@ -15,7 +15,7 @@
import
Vue
from
'vue'
export
default
Vue
.
extend
({
props
:
{
speed
:
String
,
speed
:
Number
,
tps
:
Number
,
txNumber
:
Number
,
addressNumber
:
Number
,
...
...
@@ -25,11 +25,11 @@ export default Vue.extend({
return
[
{
name
:
this
.
$t
(
'lang.chainPerf.speed'
)
as
string
,
value
:
'2s'
+
this
.
speed
,
value
:
this
.
speed
+
's'
,
},
{
name
:
this
.
$t
(
'lang.chainPerf.tps'
)
as
string
,
value
:
'13.3'
+
this
.
tps
,
value
:
this
.
tps
,
},
{
name
:
this
.
$t
(
'lang.chainPerf.txNumber'
)
as
string
,
...
...
@@ -37,8 +37,7 @@ export default Vue.extend({
},
{
name
:
this
.
$t
(
'lang.chainPerf.addressNumber'
)
as
string
,
// value: '120391820' + this.addressNumber,
value
:
'0asdf0980q9238409812304980932'
,
value
:
this
.
addressNumber
,
},
]
},
...
...
src/components/pc/BlockChainBrowser/ChainOverview/index.vue
View file @
9352a5db
...
...
@@ -6,7 +6,12 @@
:marketValue=
"marketValue"
></chain-card-show-price>
<div>
<chain-card-show-perf
:txNumber=
"totalTx"
></chain-card-show-perf>
<chain-card-show-perf
:txNumber=
"totalTx"
:speed=
"speed"
:tps=
"tps"
:addressNumber=
"addressNumber"
></chain-card-show-perf>
<chain-tx-number-chart
style=
"margin-top: 30px;"
></chain-tx-number-chart>
</div>
</div>
...
...
@@ -28,6 +33,9 @@ export default Vue.extend({
quoteChange
:
String
,
price
:
String
,
marketValue
:
Number
,
speed
:
Number
,
tps
:
Number
,
addressNumber
:
Number
,
},
})
</
script
>
src/mixin/blockChainBrowser.ts
View file @
9352a5db
...
...
@@ -3,7 +3,7 @@ import { getLatestBlock } from "ycc-api/dist/cmjs/service/home/index";
import
{
iBlockMsg
}
from
"ycc-api/dist/cmjs/service/home/types"
;
import
{
getRpc
}
from
"ycc-api/src/service/Rpc"
;
import
Base64
from
"@/utils/_base64"
;
import
{
getTxList
}
from
"@/service/api"
;
import
{
blockStatStatGets
,
getTxList
}
from
"@/service/api"
;
export
default
Vue
.
extend
({
data
()
{
return
{
...
...
@@ -14,15 +14,10 @@ export default Vue.extend({
quoteChange
:
""
,
price
:
""
,
marketValue
:
0
,
latestTxs
:
[
{
hash
:
"lkajskfdkasdf"
,
from
:
"laksjdflas"
,
to
:
"lakdjflkasdf"
,
time_block
:
1643167975993
,
amount
:
30000000
,
},
],
speed
:
0
,
tps
:
0
,
addressNumber
:
0
,
latestTxs
:
[],
};
},
mounted
()
{
...
...
@@ -39,8 +34,24 @@ export default Vue.extend({
}));
}
});
this
.
getSpeed
();
},
methods
:
{
getSpeed
()
{
blockStatStatGets
(
725000
,
this
.
latestHeight
).
then
((
res
)
=>
{
if
(
res
.
error
===
null
)
{
const
fatherBlock
=
res
.
result
[
0
];
const
lastBlock
=
res
.
result
[
1
];
const
perTime
=
(
lastBlock
.
time
-
fatherBlock
.
time
)
/
(
this
.
latestHeight
-
725000
);
const
perTxCount
=
(
lastBlock
.
tx_count
-
fatherBlock
.
tx_count
)
/
(
lastBlock
.
time
-
fatherBlock
.
time
);
this
.
tps
=
perTime
;
this
.
tps
=
perTxCount
;
}
});
},
setValue
(
v
:
string
)
{
this
.
value
=
v
;
},
...
...
@@ -111,6 +122,10 @@ export default Vue.extend({
},
},
computed
:
{
nodeNum
():
number
{
// 100 亿+30*725000 + 15*(当前高度-725000)
return
100
*
1
e8
+
30
*
725000
+
15
*
(
this
.
latestHeight
-
725000
);
},
msgList
():
any
[]
{
return
[
{
...
...
@@ -126,7 +141,7 @@ export default Vue.extend({
{
icon
:
require
(
"@/assets/images/blockChainBrowser/home/circulateNumber.png"
),
title
:
this
.
$t
(
"lang.chainMsg.circulation"
),
number
:
102938
,
number
:
this
.
nodeNum
,
},
{
icon
:
require
(
"@/assets/images/blockChainBrowser/home/pledgeQuantity.png"
),
...
...
src/service/api.ts
View file @
9352a5db
...
...
@@ -110,3 +110,18 @@ export function getTxList(number: number, size: number) {
},
});
}
export
function
blockStatStatGets
(
startHeight
:
number
,
endHeight
:
number
)
{
return
axios
(
expandApi
,
{
method
:
"post"
,
params
:
{
id
:
1
,
method
:
"BlockStat.StatGets"
,
params
:
[
{
height
:
[
startHeight
,
endHeight
],
},
],
},
});
}
src/views/mobile/blockChainBrowser.vue
View file @
9352a5db
...
...
@@ -13,9 +13,20 @@
</div>
<m-num-of-on-chain-tx
class=
"mx-4 mt-3.5"
></m-num-of-on-chain-tx>
<div
class=
"flex justify-between mx-4 mt-3.5"
>
<m-chain-price
class=
"flex-shrink-0"
></m-chain-price>
<m-chain-price
class=
"flex-shrink-0"
:marketValue=
"marketValue"
:price=
"price"
:quoteChange=
"quoteChange"
></m-chain-price>
<div
style=
"width: 15px;"
></div>
<m-chain-perf
class=
"flex-grow"
></m-chain-perf>
<m-chain-perf
class=
"flex-grow"
:speed=
"speed"
:addressNumber=
"addressNumber"
:tps=
"tps"
:txNumber=
"totalTx"
></m-chain-perf>
</div>
<m-latest-blocks
class=
"mx-4 mt-3.5 shadow-shadow1 rounded-twoPx overflow-hidden"
...
...
src/views/pc/blockChainBrowser.vue
View file @
9352a5db
...
...
@@ -28,6 +28,9 @@
:quoteChange=
"quoteChange"
:price=
"price"
:marketValue=
"marketValue"
:speed=
"speed"
:tps=
"tps"
:addressNumber=
"addressNumber"
/>
<div
class=
"flex justify-between mt-14"
style=
"margin-bottom: 60px;"
>
<latest-block
:latestBlocks=
"latestBlocks"
></latest-block>
...
...
chenqikuai
@chenqikuai
mentioned in commit
748f7ae1
·
Mar 03, 2022
mentioned in commit
748f7ae1
mentioned in commit 748f7ae18ac2f8eb14ee7c2865eaea786342a520
Toggle commit list
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