11 .transferType input[type=radio] {
16 .transferType input[type="radio"]:checked+label{
18 background-color: #333333;
38 vertical-align: middle;
45 border:1px solid #E0E0E0;
53 <div class="warp-chlid bg-gray">
54 <section class="header bg-header">
55 <i class="iconfont icon-back" @click="close"></i>
56 <p>{{ $t('listVote.vote') }}</p>
59 <section class="form-container">
60 <div class="form bg-white">
61 <div v-if="selectVote !== null" class="form-item">
62 <label class="form-item-label">{{ $t('vote.selectNode') }}</label>
63 <div class="form-item-content" >
64 <div class="vote-title" >
65 <img :src="selectVote.logo" alt="">
73 <div class="form bg-white">
75 <div class="form-item">
76 <label class="form-item-label">
77 {{ $t('transfer.quantity') }}
80 <div class="form-item-content" style=" display: flex;">
81 <input type="number" v-model="transaction.amount" :placeholder="bytomBalance">
82 <span class="color-grey" style="width: 40px; font-size: 15px;position: absolute;right: 0;">{{unit}}</span>
86 <a class="btn btn-primary" @click="send">{{ $t('transfer.confirm') }}</a>
92 import transaction from "@/models/transaction";
93 import getLang from "@/assets/language/sdk";
94 import Confirm from "../sendTransaction/transferConfirm";
95 import { BTM } from "@/utils/constants";
96 import { mapGetters, mapState } from 'vuex'
97 import { Number as Num } from "@/utils/Number"
98 import _ from 'lodash';
100 const currencyInPrice = {
118 accountBalance: 0.00,
120 fee: this.$t("transfer.feeType"),
121 feeTypeOptions: [this.$t("transfer.feeType")],
131 bytomBalance: function () {
133 balances = this.currentAccount.vpBalances
134 if(balances && balances.length >0 ){
135 const balanceObject = balances.filter(b => b.asset === BTM)[0]
136 balance = balanceObject.balance
138 let vote = 0, lock = 0
139 const votes = this.currentAccount.votes
140 if(votes && votes.length >0 ){
141 vote = _.sumBy(votes,'total')
142 lock = _.sumBy(votes,'locked')
145 balance = (balance-vote-lock)/Math.pow(10,balanceObject.decimals)
148 return `${this.$t("vote.amountPlaceHolder")}${(balance != null && balance != 0) ? balance : '0.00'}`
163 account: function (newAccount) {
164 this.guid = newAccount.guid;
170 this.transaction.vote = "";
171 this.transaction.amount = "";
173 formatCurrency: function (num) {
174 return Num.formatCurrency(num, this.currency)
177 if (this.transaction.amount <= 0) {
179 body: this.$t("transfer.noneBTM")
184 let loader = this.$loading.show({
185 // Optional parameters
188 onCancel: this.onCancel
191 const vote = this.selectVote.pub_key
192 this.transaction.to = vote
193 transaction.buildVote(this.currentAccount.guid, vote, Num.convertToNue(this.transaction.amount,8), this.transaction.confirmations).then(result => {
195 if(!this.transaction.fee){
196 this.transaction.fee = Number( _.sumBy(result, 'fee') );
198 this.$router.push({ name: 'vote-confirm', params: { account: this.currentAccount, transaction: this.transaction,assetAlias: 'BTM', rawData: result} })
202 body: getLang(error.message)
208 transaction.asset(BTM).then(ret => {
209 this.selectAsset = ret