Commit 4cf9927b authored by chenqikuai's avatar chenqikuai

refactor: recode the reward display

parent 5b063011
......@@ -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;">
......
......@@ -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>
......
......@@ -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">
......
......@@ -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>
......
/**
* 初始发行是 100 亿 ycc
区块奖励是每个区块 15 个 ycc
所以当前发行数量= 100 亿+15*区块高度
*注: 高度 725000 之前每个区块的奖励时 30ycc,所以更准确的发行数量为:
100 亿+30*725000 + 15*(当前高度-725000)
*/
export const yccDifferenceBlockRewardHeight = 725000;
......@@ -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 "";
}
},
},
});
......@@ -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)
......
......@@ -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>
......
......@@ -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>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment