diff --git a/src/common/lang/en.js b/src/common/lang/en.js index 09f4b40..5aab708 100644 --- a/src/common/lang/en.js +++ b/src/common/lang/en.js @@ -621,7 +621,12 @@ Within their 50% share each consensus node will receive their share according to profitONG: 'This is the transaction fee profit you have made. This will update at the beginning of each new consensus round.', getProfitPart: 'Already receiving profit portion', newStakePart: 'New stake portion', - claimableONT: 'Claimable ONT' + claimableONT: 'Claimable ONT', + redeemInitPos: 'Redeem Init Pos', + initPosInLock: "Locked", + initPosRedeemable: 'Claimable', + noClaimbleInitPos: 'No claimble ONT.', + redeemInitPosOk: 'Redeem' }, exchange: { exchange: 'Exchange', diff --git a/src/common/lang/zh.js b/src/common/lang/zh.js index 10be3f2..da53f65 100644 --- a/src/common/lang/zh.js +++ b/src/common/lang/zh.js @@ -616,7 +616,12 @@ export default { profitONG: '这是您已获得的交易费收益。该收益会在每轮共识周期开始时更新。', getProfitPart: '产生收益中', newStakePart: '新的质押', - claimableONT: '可提取ONT' + claimableONT: '可提取ONT', + redeemInitPos: '提取初始质押', + initPosInLock: "锁定中", + initPosRedeemable: '可提取', + noClaimbleInitPos: '没有可提取的初始质押。', + redeemInitPosOk: '确认提取' }, exchange: { exchange: 'Exchange', diff --git a/src/renderer/components/Node/NodeStake/NodeStakeInfo.vue b/src/renderer/components/Node/NodeStake/NodeStakeInfo.vue index 28bae15..8b58b56 100644 --- a/src/renderer/components/Node/NodeStake/NodeStakeInfo.vue +++ b/src/renderer/components/Node/NodeStake/NodeStakeInfo.vue @@ -46,7 +46,7 @@ } .initPos-btns { margin:10px auto; - width:540px; + width:640px; } .initPos-btns button { margin-right: 20px; @@ -119,7 +119,8 @@ {{$t('nodeMgmt.addInitPos')}} {{$t('nodeMgmt.reduceInitPos')}} + >{{$t('nodeMgmt.reduceInitPos')}} + {{$t('nodeMgmt.redeemInitPos')}} + +
+

{{$t('nodeMgmt.initPosInLock')}}: {{authorizationInfo.locked}} ONT

+

{{$t('nodeMgmt.initPosRedeemable')}}: {{authorizationInfo.claimable}} ONT

+
+
+ { this.$store.dispatch("fetchStakeDetail", this.stakeIdentity.ontid); this.$store.dispatch('fetchPeerItem', this.detail.publickey); this.$store.dispatch('fetchPosLimit') + this.$store.dispatch('fetchAuthorizationInfo', + {pk: this.detail.publickey, address: this.stakeWallet.address} + ) }, this.interval); this.intervalId = intervalId }, @@ -259,7 +281,8 @@ export default { status3: state => state.NodeStake.status3, current: state => state.NodeStake.current, statusTip: state => state.NodeStake.statusTip, - btnText: state => state.NodeStake.btnText + btnText: state => state.NodeStake.btnText, + authorizationInfo: state => state.NodeAuthorization.authorizationInfo }) }, methods: { @@ -512,6 +535,24 @@ export default { }, handleReducePosCancel() { this.reducePosVisible = false; + }, + handleRedeemPosOk() { + if(this.authorizationInfo && this.authorizationInfo.claimableVal === 0) { + this.$message.warning(this.$t('nodeMgmt.noClaimbleInitPos')) + return; + } + this.redeemPosVisible = false; + const userAddr = new Crypto.Address(this.stakeWallet.address); + const peerPubkeys = [this.detail.publickey] + const withdrawList = [this.authorizationInfo.claimableVal] + const payer = userAddr + const tx = GovernanceTxBuilder.makeWithdrawTx(userAddr, peerPubkeys, withdrawList, payer, GAS_PRICE, GAS_LIMIT) + this.tx = tx; + this.walletPassModal = true; + this.isDelegateSendTx = false; + }, + handleRedeemPosCancel() { + this.redeemPosVisible = false; } } }; diff --git a/src/renderer/store/modules/NodeStake.js b/src/renderer/store/modules/NodeStake.js index ed552ab..02d3b58 100644 --- a/src/renderer/store/modules/NodeStake.js +++ b/src/renderer/store/modules/NodeStake.js @@ -3,9 +3,16 @@ import en from '../../../common/lang/en' import zh from '../../../common/lang/zh' import {ONT_PASS_NODE, ONT_PASS_NODE_PRD, ONT_PASS_URL} from '../../../core/consts' const state = { - detail: '', - stakeWallet: '', - stakeIdentity:'', + detail: { + publickey: '' + }, + stakeWallet: { + address: '', + key: '' + }, + stakeIdentity: { + ontid: '' + }, status1: '', status2: '', status3: '',