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
4cf9927b
Commit
4cf9927b
authored
Feb 17, 2022
by
chenqikuai
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor: recode the reward display
parent
5b063011
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
81 additions
and
33 deletions
+81
-33
m-block-desc-card.vue
src/components/mobile/m-block-desc-card.vue
+2
-4
m-blockItem.vue
src/components/mobile/m-blockItem.vue
+2
-4
LeftBox.vue
...components/pc/BlockChainBrowser/BlockOverview/LeftBox.vue
+2
-4
index.vue
src/components/pc/BlockChainBrowser/LatestBlock/index.vue
+2
-4
index.ts
src/constant/index.ts
+8
-0
address.ts
src/mixin/address.ts
+24
-0
filters.ts
src/utils/filters.ts
+10
-7
index.vue
src/views/pc/address/index.vue
+29
-9
block.vue
src/views/pc/block.vue
+2
-1
No files found.
src/components/mobile/m-block-desc-card.vue
View file @
4cf9927b
...
...
@@ -13,7 +13,7 @@
{{
$t
(
'lang.block.blockReward'
)
}}
</span>
<span
class=
"text-footer-color text-sm font-bold"
>
15 YCC
{{
height
|
filterBlockReward
}}
</span>
</div>
</div>
...
...
@@ -22,9 +22,7 @@
{{
$t
(
'lang.txDetail.height'
)
}}
</div>
<div
class=
"text-text-color text-xs"
>
{{
$t
(
'lang.block.votingNode'
)
}}
5+
{{
$t
(
'lang.block.packingNode'
)
}}
10
{{
height
|
filterVotePackReward
}}
</div>
</div>
<div
class=
"flex justify-between items-end mb-6"
style=
"margin-top: 3px;"
>
...
...
src/components/mobile/m-blockItem.vue
View file @
4cf9927b
...
...
@@ -51,12 +51,10 @@
{{
$t
(
'lang.block.blockReward'
)
}}
</span>
<span
class=
"text-black text-xs"
>
15 YCC
{{
height
|
filterBlockReward
}}
</span>
<span
class=
"text-text-color text-xs"
>
{{
$t
(
'lang.block.votingNode'
)
}}
5+
{{
$t
(
'lang.block.packingNode'
)
}}
10
{{
height
|
filterVotePackReward
}}
</span>
</div>
</div>
...
...
src/components/pc/BlockChainBrowser/BlockOverview/LeftBox.vue
View file @
4cf9927b
...
...
@@ -27,12 +27,10 @@
{{
$t
(
'lang.block.blockRevenue'
)
}}
</div>
<div
class=
"my-benifit"
>
15YCC
{{
$route
.
query
.
height
|
filterBlockReward
}}
</div>
<div
class=
"my-title"
>
{{
$t
(
'lang.block.votingNode'
)
}}
5+
{{
$t
(
'lang.block.packingNode'
)
}}
10
{{
$route
.
query
.
height
|
filterVotePackReward
}}
</div>
</div>
<div
class=
"right flex-shrink-0"
>
...
...
src/components/pc/BlockChainBrowser/LatestBlock/index.vue
View file @
4cf9927b
...
...
@@ -34,7 +34,7 @@
<div>
<span
class=
"graytxt"
>
{{
$t
(
'lang.block.blockReward'
)
}}
:
</span>
<span>
15 ycc
{{
item
.
height
|
filterBlockReward
}}
</span>
</div>
</div>
...
...
@@ -57,9 +57,7 @@
</router-link>
</div>
<div
class=
"graytxt"
>
{{
$t
(
'lang.block.votingNode'
)
}}
5+
{{
$t
(
'lang.block.packingNode'
)
}}
10
{{
item
.
height
|
filterVotePackReward
}}
</div>
</div>
</div>
...
...
src/constant/index.ts
View file @
4cf9927b
/**
* 初始发行是 100 亿 ycc
区块奖励是每个区块 15 个 ycc
所以当前发行数量= 100 亿+15*区块高度
*注: 高度 725000 之前每个区块的奖励时 30ycc,所以更准确的发行数量为:
100 亿+30*725000 + 15*(当前高度-725000)
*/
export
const
yccDifferenceBlockRewardHeight
=
725000
;
src/mixin/address.ts
View file @
4cf9927b
...
...
@@ -5,6 +5,10 @@ export default Vue.extend({
return
{
value
:
""
,
focusedTab
:
"1"
,
pages
:
{
total
:
0
,
},
selectedOption
:
"1"
,
};
},
computed
:
{
...
...
@@ -24,10 +28,30 @@ export default Vue.extend({
},
];
},
optionList
()
{
return
[
{
name
:
this
.
$t
(
"lang.trade.txRecord"
),
value
:
"1"
},
{
name
:
this
.
$t
(
"lang.trade.consensusNode"
),
value
:
"2"
},
];
},
},
methods
:
{
setValue
(
v
:
string
)
{
this
.
value
=
v
;
},
groupCellName
(
val
:
any
)
{
switch
(
val
.
row
.
tradeG
)
{
case
0
:
return
""
;
case
1
:
return
"tx-middle"
;
case
2
:
return
"tx-start"
;
case
3
:
return
"tx-end"
;
default
:
return
""
;
}
},
},
});
src/utils/filters.ts
View file @
4cf9927b
...
...
@@ -2,6 +2,7 @@ import { i18n } from "@/assets/lang";
import
{
iAsset
}
from
"@/types/trade"
;
import
{
deCode
}
from
"./prototype"
;
import
{
parseTransferNote
}
from
"@33cn/chain33-transaction-parser"
;
import
{
yccDifferenceBlockRewardHeight
}
from
"@/constant"
;
/**
* 格式化时间
...
...
@@ -170,15 +171,17 @@ export default {
return
result
;
}
},
branchIncome
:
(
num
:
string
,
token
:
string
)
=>
{
const
differHeight
=
725000
return
Number
(
num
)
>
differHeight
?
`15 YCC(
${
i18n
.
t
(
"lang.block.votingNode"
)}
5 +
${
i18n
.
t
(
filterBlockReward
(
num
:
string
):
string
{
return
Number
(
num
)
>
yccDifferenceBlockRewardHeight
?
`15 YCC`
:
`30 YCC`
;
},
filterVotePackReward
(
num
:
string
):
string
{
return
Number
(
num
)
>
yccDifferenceBlockRewardHeight
?
`
${
i18n
.
t
(
"lang.block.votingNode"
)}
5 +
${
i18n
.
t
(
"lang.block.packingNode"
)}
3
)
`
:
`
30 YCC(
${
i18n
.
t
(
"lang.block.votingNode"
)}
5 +
${
i18n
.
t
(
)}
3`
:
`
${
i18n
.
t
(
"lang.block.votingNode"
)}
5 +
${
i18n
.
t
(
"lang.block.packingNode"
)}
3
)
`
;
)}
3`
;
},
TradeValue
:
(
tradeInfo
:
any
)
=>
{
if
(
!
tradeInfo
.
amount
&&
!
tradeInfo
.
assets
)
...
...
src/views/pc/address/index.vue
View file @
4cf9927b
...
...
@@ -3,11 +3,32 @@
style=
"margin-top: 70px;"
class=
"min-w-1200 md:w-bodySet mx-auto flow-root"
>
<chain-search
:value=
"value"
:setValue=
"setValue"
></chain-search>
<chain-search
:value=
"value"
:setValue=
"setValue"
></chain-search>
<address-overview
class=
"mt-7"
></address-overview>
<TabList
:setFocusedTab=
"(v) => (focusedTab = v)"
:tabList=
"tabList"
:focusedTab=
"focusedTab"
></TabList>
<DataFilter
v-if=
"focusedTab === '1'"
:optionList=
"optionList"
:setValue=
"(v) => (selectedOption = v)"
:value=
"selectedOption"
>
<template
#
left
>
{{
$t
(
'lang.trade.txTotal'
,
[
pages
.
total
])
}}
</
template
>
</DataFilter>
<TradeTable
v-if=
"focusedTab === '1'"
:groupCellName=
"groupCellName"
:Loading=
"loadingTable"
:Trades=
"Trades"
:pages=
"pages"
:sizeChange=
"sizeChange"
:pageChange=
"pageChange"
></TradeTable>
</div>
</template>
...
...
@@ -16,12 +37,11 @@ import ChainSearch from '@/components/pc/BlockChainBrowser/ChainSearch.vue'
import
AddressOverview
from
'@/components/pc/BlockChainBrowser/AddressOverview/index.vue'
import
VueTypedMixins
from
'vue-typed-mixins'
import
address
from
'@/mixin/address'
import
TabList
from
'@/components/pc/BlockChainBrowser/TabList/index.vue'
import
DataFilter
from
'@/components/pc/BlockChainBrowser/DataFilter/index.vue'
export
default
VueTypedMixins
(
address
).
extend
({
components
:
{
ChainSearch
,
AddressOverview
},
computed
:
{
},
components
:
{
ChainSearch
,
AddressOverview
,
TabList
,
DataFilter
},
computed
:
{},
})
</
script
>
...
...
src/views/pc/block.vue
View file @
4cf9927b
...
...
@@ -69,7 +69,8 @@
<el-table-column
:label=
"$t('lang.block.blockReward')"
>
<
template
slot-scope=
"block"
>
<div
class=
"light2"
>
{{
block
.
row
.
height
|
branchIncome
(
'BTY'
)
}}
{{
block
.
row
.
height
|
filterBlockReward
}}
(
{{
block
.
row
.
height
|
filterVotePackReward
}}
)
</div>
</
template
>
</el-table-column>
...
...
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