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
1680c817
Commit
1680c817
authored
Feb 25, 2022
by
chenqikuai
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
1890df05
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
124 additions
and
34 deletions
+124
-34
charts.vue
src/components/charts.vue
+3
-2
index.vue
...components/pc/BlockChainBrowser/AddressOverview/index.vue
+2
-2
LeftBox.vue
...components/pc/BlockChainBrowser/BlockOverview/LeftBox.vue
+6
-6
ChainTxNumberChart.vue
...pc/BlockChainBrowser/ChainOverview/ChainTxNumberChart.vue
+2
-2
index.vue
src/components/pc/BlockChainBrowser/DataFilter/index.vue
+4
-0
blockChainBrowser.ts
src/mixin/blockChainBrowser.ts
+32
-9
AddressOverview.ts
src/mixin/componentsMixin/AddressOverview.ts
+11
-3
api.ts
src/service/api.ts
+59
-0
index.vue
src/views/mobile/blockDetail/index.vue
+2
-2
index.vue
src/views/pc/blockDetail/index.vue
+1
-6
vue.config.js
vue.config.js
+2
-2
No files found.
src/components/charts.vue
View file @
1680c817
...
@@ -117,10 +117,11 @@ export default Vue.extend({
...
@@ -117,10 +117,11 @@ export default Vue.extend({
// 接下来的使用就跟之前一样,初始化图表,设置配置项
// 接下来的使用就跟之前一样,初始化图表,设置配置项
// filters: ['D1', 'W1', 'M1', 'Y1'],
// filters: ['D1', 'W1', 'M1', 'Y1'],
const
times
=
this
.
generate
()
const
times
=
this
.
generate
()
times
&&
statSearch
(
times
).
then
((
ret
)
=>
{
statSearch
(
times
).
then
((
ret
)
=>
{
if
(
ret
.
error
==
null
)
{
if
(
ret
.
error
==
null
)
{
this
.
xData
=
ret
.
result
this
.
xData
=
ret
.
result
var
myChart
=
echarts
.
init
(
this
.
$refs
.
charts
,
null
)
var
myChart
=
echarts
.
init
(
this
.
$refs
.
charts
as
HTMLElement
)
myChart
.
setOption
({
myChart
.
setOption
({
xAxis
:
{
xAxis
:
{
type
:
'category'
,
type
:
'category'
,
...
@@ -137,7 +138,7 @@ export default Vue.extend({
...
@@ -137,7 +138,7 @@ export default Vue.extend({
series
:
[
series
:
[
{
{
data
:
this
.
xData
data
:
this
.
xData
.
map
((
i
)
=>
(
i
&&
i
[
0
]
&&
i
[
0
].
tx_count
)
||
0
)
.
map
((
i
:
any
)
=>
(
i
&&
i
[
0
]
&&
i
[
0
].
tx_count
)
||
0
)
.
reverse
(),
.
reverse
(),
type
:
'line'
,
type
:
'line'
,
areaStyle
:
{},
areaStyle
:
{},
...
...
src/components/pc/BlockChainBrowser/AddressOverview/index.vue
View file @
1680c817
<
template
>
<
template
>
<div
class=
"container"
>
<div
class=
"
_
container"
>
<div
class=
"top flex items-center"
>
<div
class=
"top flex items-center"
>
<div
class=
"address_label mr-2.5 my-title"
>
<div
class=
"address_label mr-2.5 my-title"
>
{{
$t
(
'lang.address.address'
)
}}
{{
$t
(
'lang.address.address'
)
}}
...
@@ -59,7 +59,7 @@ export default VueTypedMixins(AddressOverview).extend({
...
@@ -59,7 +59,7 @@ export default VueTypedMixins(AddressOverview).extend({
</
script
>
</
script
>
<
style
lang=
"scss"
scoped
>
<
style
lang=
"scss"
scoped
>
.container
{
.
_
container
{
width
:
1200px
;
width
:
1200px
;
height
:
440px
;
height
:
440px
;
background
:
#ffffff
;
background
:
#ffffff
;
...
...
src/components/pc/BlockChainBrowser/BlockOverview/LeftBox.vue
View file @
1680c817
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
element-loading-spinner="el-icon-loading"
element-loading-spinner="el-icon-loading"
>
>
<div
class=
"flex"
>
<div
class=
"flex"
>
<div
class=
"flex left overflow-hidden flex-shrink-0"
>
<div
class=
"flex
_
left overflow-hidden flex-shrink-0"
>
<img
<img
src=
"@/assets/images/blockChainBrowser/blockDetail/block.png"
src=
"@/assets/images/blockChainBrowser/blockDetail/block.png"
class=
"blockIcon"
class=
"blockIcon"
...
@@ -22,7 +22,7 @@
...
@@ -22,7 +22,7 @@
</div>
</div>
</div>
</div>
</div>
</div>
<div
class=
"middle flex-shrink-0"
>
<div
class=
"
_
middle flex-shrink-0"
>
<div
class=
"my-title"
>
<div
class=
"my-title"
>
{{
$t
(
'lang.block.blockRevenue'
)
}}
{{
$t
(
'lang.block.blockRevenue'
)
}}
</div>
</div>
...
@@ -30,7 +30,7 @@
...
@@ -30,7 +30,7 @@
{{
$route
.
query
.
height
|
filterBlockReward
}}
{{
$route
.
query
.
height
|
filterBlockReward
}}
</div>
</div>
</div>
</div>
<div
class=
"right flex-shrink-0"
>
<div
class=
"
_
right flex-shrink-0"
>
<div
class=
"my-title"
>
<div
class=
"my-title"
>
{{
$t
(
'lang.block.txCount'
)
}}
{{
$t
(
'lang.block.txCount'
)
}}
</div>
</div>
...
@@ -108,14 +108,14 @@ export default Vue.extend({
...
@@ -108,14 +108,14 @@ export default Vue.extend({
height
:
52px
;
height
:
52px
;
margin-right
:
20px
;
margin-right
:
20px
;
}
}
.left
{
.
_
left
{
width
:
360px
;
width
:
360px
;
}
}
.middle
{
.
_
middle
{
width
:
260px
;
width
:
260px
;
}
}
.right
{
.
_
right
{
width
:
220px
;
width
:
220px
;
}
}
.theTitle
{
.theTitle
{
...
...
src/components/pc/BlockChainBrowser/ChainOverview/ChainTxNumberChart.vue
View file @
1680c817
<
template
>
<
template
>
<div
class=
"container shadow-shadow1 bg-white"
style=
"padding: 30px;"
>
<div
class=
"
_
container shadow-shadow1 bg-white"
style=
"padding: 30px;"
>
<div
class=
"flex justify-between"
>
<div
class=
"flex justify-between"
>
<div
class=
"text-darkBlue text-lg font-bold"
>
<div
class=
"text-darkBlue text-lg font-bold"
>
{{
$t
(
'lang.chainPerf.txNumberOnTheChain'
)
}}
{{
$t
(
'lang.chainPerf.txNumberOnTheChain'
)
}}
...
@@ -37,7 +37,7 @@ export default Vue.extend({
...
@@ -37,7 +37,7 @@ export default Vue.extend({
</
script
>
</
script
>
<
style
scoped
>
<
style
scoped
>
.container
{
.
_
container
{
height
:
280px
;
height
:
280px
;
border-radius
:
4px
;
border-radius
:
4px
;
}
}
...
...
src/components/pc/BlockChainBrowser/DataFilter/index.vue
View file @
1680c817
...
@@ -5,6 +5,7 @@
...
@@ -5,6 +5,7 @@
</div>
</div>
<div>
<div>
<MySelect
<MySelect
v-if=
"!hideSelect"
style=
"width: 310px;"
style=
"width: 310px;"
:selectedValue=
"value"
:selectedValue=
"value"
:optionList=
"optionList"
:optionList=
"optionList"
...
@@ -26,6 +27,9 @@ export default Vue.extend({
...
@@ -26,6 +27,9 @@ export default Vue.extend({
value
:
[
String
,
Number
],
value
:
[
String
,
Number
],
setValue
:
Function
,
setValue
:
Function
,
optionList
:
Array
as
PropType
<
iOptionItem
[]
>
,
optionList
:
Array
as
PropType
<
iOptionItem
[]
>
,
hideSelect
:
{
type
:
Boolean
,
},
},
},
data
()
{
data
()
{
return
{}
return
{}
...
...
src/mixin/blockChainBrowser.ts
View file @
1680c817
...
@@ -3,7 +3,15 @@ import { getLatestBlock } from "ycc-api/dist/cmjs/service/home/index";
...
@@ -3,7 +3,15 @@ import { getLatestBlock } from "ycc-api/dist/cmjs/service/home/index";
import
{
iBlockMsg
}
from
"ycc-api/dist/cmjs/service/home/types"
;
import
{
iBlockMsg
}
from
"ycc-api/dist/cmjs/service/home/types"
;
import
{
getRpc
}
from
"ycc-api/src/service/Rpc"
;
import
{
getRpc
}
from
"ycc-api/src/service/Rpc"
;
import
Base64
from
"@/utils/_base64"
;
import
Base64
from
"@/utils/_base64"
;
import
{
blockStatStatGets
,
getAccountCount
,
getTxList
}
from
"@/service/api"
;
import
moment
from
"moment"
;
import
{
blockStatStatGets
,
getAccountCount
,
getAllPos33TicketCount
,
getTxCountBewteenTimes
,
getTxList
,
}
from
"@/service/api"
;
export
default
Vue
.
extend
({
export
default
Vue
.
extend
({
data
()
{
data
()
{
return
{
return
{
...
@@ -18,9 +26,26 @@ export default Vue.extend({
...
@@ -18,9 +26,26 @@ export default Vue.extend({
tps
:
0
,
tps
:
0
,
addressNumber
:
0
,
addressNumber
:
0
,
latestTxs
:
[],
latestTxs
:
[],
ticketCount
:
0
,
};
};
},
},
mounted
()
{
mounted
()
{
getTxCountBewteenTimes
(
moment
().
unix
(),
moment
()
.
add
(
24
,
"hour"
)
.
unix
()
).
then
((
res
)
=>
{
if
(
res
.
error
===
null
)
{
this
.
tps
=
Number
(((
res
.
result
/
24
)
*
60
*
60
).
toFixed
(
2
));
}
});
getAllPos33TicketCount
().
then
((
ret
)
=>
{
if
(
ret
.
error
===
null
)
{
this
.
ticketCount
=
ret
.
result
;
}
});
getAccountCount
().
then
((
ret
)
=>
{
getAccountCount
().
then
((
ret
)
=>
{
if
(
ret
.
error
===
null
)
{
if
(
ret
.
error
===
null
)
{
this
.
addressNumber
=
ret
.
result
;
this
.
addressNumber
=
ret
.
result
;
...
@@ -39,7 +64,6 @@ export default Vue.extend({
...
@@ -39,7 +64,6 @@ export default Vue.extend({
}));
}));
}
}
});
});
this
.
getSpeed
();
},
},
methods
:
{
methods
:
{
getSpeed
()
{
getSpeed
()
{
...
@@ -49,11 +73,10 @@ export default Vue.extend({
...
@@ -49,11 +73,10 @@ export default Vue.extend({
const
lastBlock
=
res
.
result
[
1
];
const
lastBlock
=
res
.
result
[
1
];
const
perTime
=
const
perTime
=
(
lastBlock
.
time
-
fatherBlock
.
time
)
/
(
this
.
latestHeight
-
725000
);
(
lastBlock
.
time
-
fatherBlock
.
time
)
/
(
this
.
latestHeight
-
725000
);
const
perTxCount
=
// const perTxCount =
(
lastBlock
.
tx_count
-
fatherBlock
.
tx_count
)
/
// (lastBlock.tx_count - fatherBlock.tx_count) /
(
lastBlock
.
time
-
fatherBlock
.
time
);
// (lastBlock.time - fatherBlock.time);
this
.
tps
=
perTime
;
this
.
speed
=
perTime
;
this
.
tps
=
perTxCount
;
}
}
});
});
},
},
...
@@ -104,7 +127,7 @@ export default Vue.extend({
...
@@ -104,7 +127,7 @@ export default Vue.extend({
this
.
latestHeight
=
lastHeaderRet
.
result
.
height
;
this
.
latestHeight
=
lastHeaderRet
.
result
.
height
;
this
.
$store
.
commit
(
"saveMaxHeight"
,
this
.
latestHeight
);
this
.
$store
.
commit
(
"saveMaxHeight"
,
this
.
latestHeight
);
const
str
=
this
.
hexCharCodeToStr
(
lastHeaderRet
.
result
.
hash
);
const
str
=
this
.
hexCharCodeToStr
(
lastHeaderRet
.
result
.
hash
);
this
.
getSpeed
();
fetch
(
"/market"
)
fetch
(
"/market"
)
.
then
((
ret
)
=>
ret
.
json
())
.
then
((
ret
)
=>
ret
.
json
())
.
then
((
ret
)
=>
{
.
then
((
ret
)
=>
{
...
@@ -151,7 +174,7 @@ export default Vue.extend({
...
@@ -151,7 +174,7 @@ export default Vue.extend({
{
{
icon
:
require
(
"@/assets/images/blockChainBrowser/home/pledgeQuantity.png"
),
icon
:
require
(
"@/assets/images/blockChainBrowser/home/pledgeQuantity.png"
),
title
:
this
.
$t
(
"lang.chainMsg.pledgeQuantity"
),
title
:
this
.
$t
(
"lang.chainMsg.pledgeQuantity"
),
number
:
102938
,
number
:
this
.
ticketCount
,
},
},
];
];
},
},
...
...
src/mixin/componentsMixin/AddressOverview.ts
View file @
1680c817
import
Vue
from
"vue"
;
import
Vue
from
"vue"
;
import
QRCode
from
"qrcode"
;
import
QRCode
from
"qrcode"
;
import
{
getAddressTxCount
}
from
"@/service/api"
;
export
default
Vue
.
extend
({
export
default
Vue
.
extend
({
data
()
{
data
()
{
return
{};
return
{
txCount
:
0
,
};
},
},
mounted
()
{
mounted
()
{
this
.
init
();
this
.
init
();
getAddressTxCount
(
this
.
$route
.
query
.
address
as
string
).
then
((
ret
)
=>
{
if
(
ret
.
error
===
null
)
{
this
.
txCount
=
ret
.
result
;
}
});
},
},
activated
()
{
activated
()
{
this
.
init
();
this
.
init
();
},
},
computed
:
{
computed
:
{
tradeInTotalList
()
{
tradeInTotalList
()
:
any
{
return
[
return
[
{
{
name
:
this
.
$t
(
"lang.address.totalReception"
),
name
:
this
.
$t
(
"lang.address.totalReception"
),
...
@@ -23,7 +31,7 @@ export default Vue.extend({
...
@@ -23,7 +31,7 @@ export default Vue.extend({
},
},
{
{
name
:
this
.
$t
(
"lang.block.txCount"
),
name
:
this
.
$t
(
"lang.block.txCount"
),
value
:
"100YCC"
,
value
:
this
.
txCount
,
},
},
{
{
name
:
this
.
$t
(
"lang.address.totalValue"
),
name
:
this
.
$t
(
"lang.address.totalValue"
),
...
...
src/service/api.ts
View file @
1680c817
...
@@ -172,3 +172,62 @@ export function statSearch(times: number[]) {
...
@@ -172,3 +172,62 @@ export function statSearch(times: number[]) {
},
},
});
});
}
}
export
function
getAddressTxCount
(
addr
:
string
)
{
return
axios
(
expandApi
,
{
method
:
"post"
,
params
:
{
id
:
1
,
method
:
"Tx.TxCount"
,
params
:
[
{
match_one
:
[
{
key
:
"from"
,
value
:
addr
,
},
{
key
:
"to"
,
value
:
addr
,
},
],
match
:
[],
},
],
},
});
}
export
function
getAllPos33TicketCount
()
{
return
axios
(
"/yccApi"
,
{
method
:
"post"
,
params
:
{
method
:
"pos33.GetAllPos33TicketCount"
,
params
:
[{}],
},
});
}
export
function
getTxCountBewteenTimes
(
startUnixTime
:
number
,
endUnixTime
:
number
)
{
return
axios
(
expandApi
,
{
method
:
"post"
,
params
:
{
id
:
1
,
method
:
"Tx.TxCount"
,
params
:
[
{
range
:
[
{
start
:
startUnixTime
,
end
:
endUnixTime
,
key
:
"block_time"
,
},
],
},
],
},
});
}
src/views/mobile/blockDetail/index.vue
View file @
1680c817
...
@@ -21,12 +21,12 @@
...
@@ -21,12 +21,12 @@
:setFocusedTab=
"setFocusedTab"
:setFocusedTab=
"setFocusedTab"
></m-tabs>
></m-tabs>
<div
class=
"bg-white px-4"
>
<div
class=
"bg-white px-4"
>
<Select
<
!--
<
Select
v-if=
"focusedTab === 'txRecordTab'"
v-if=
"focusedTab === 'txRecordTab'"
:selectedValue=
"txRecordFilterValue"
:selectedValue=
"txRecordFilterValue"
:optionList=
"txRecordFilterOptionList"
:optionList=
"txRecordFilterOptionList"
@
change=
"(v) => (txRecordFilterValue = v)"
@
change=
"(v) => (txRecordFilterValue = v)"
></Select>
></Select>
-->
</div>
</div>
<div
class=
"bg-white px-4"
>
<div
class=
"bg-white px-4"
>
<Select
<Select
...
...
src/views/pc/blockDetail/index.vue
View file @
1680c817
...
@@ -22,12 +22,7 @@
...
@@ -22,12 +22,7 @@
:setFocusedTab=
"(v) => (focusedTab = v)"
:setFocusedTab=
"(v) => (focusedTab = v)"
:focusedTab=
"focusedTab"
:focusedTab=
"focusedTab"
></TabList>
></TabList>
<DataFilter
<DataFilter
v-if=
"focusedTab === 'txRecordTab'"
:hideSelect=
"true"
>
v-if=
"focusedTab === 'txRecordTab'"
:optionList=
"txRecordFilterOptionList"
:setValue=
"(v) => (txRecordFilterValue = v)"
:value=
"txRecordFilterValue"
>
<template
#
left
>
<template
#
left
>
{{
$t
(
'lang.trade.txTotal'
,
[
pages
.
total
])
}}
{{
$t
(
'lang.trade.txTotal'
,
[
pages
.
total
])
}}
</
template
>
</
template
>
...
...
vue.config.js
View file @
1680c817
...
@@ -22,8 +22,8 @@ module.exports = {
...
@@ -22,8 +22,8 @@ module.exports = {
changeOrigin
:
true
,
changeOrigin
:
true
,
},
},
"/yccApi"
:
{
"/yccApi"
:
{
//
target: "https://mainnet.yuan.org/api",
target
:
"https://mainnet.yuan.org/api"
,
target
:
"http://13.115.171.240:7901/"
,
//
target: "http://13.115.171.240:7901/",
pathRewrite
:
{
pathRewrite
:
{
"^/yccApi"
:
""
,
"^/yccApi"
:
""
,
},
},
...
...
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