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.assetId === BTM)[0]
136 balance = balanceObject.availableBalance
139 return `${this.$t("vote.amountPlaceHolder")}${(balance != null && balance != 0) ? balance : '0.00'}`
154 account: function (newAccount) {
155 this.guid = newAccount.guid;
161 this.transaction.vote = "";
162 this.transaction.amount = "";
164 formatCurrency: function (num) {
165 return Num.formatCurrency(num, this.currency)
168 if (this.transaction.amount <= 0) {
170 body: this.$t("transfer.noneBTM")
175 let loader = this.$loading.show({
176 // Optional parameters
179 onCancel: this.onCancel
182 const vote = this.selectVote.pubKey
183 this.transaction.to = vote
184 transaction.buildVote(this.currentAccount.vpAddress, vote, this.transaction.amount, this.transaction.confirmations).then(result => {
186 if(!this.transaction.fee){
187 this.transaction.fee = Number( _.sumBy(result, 'tx.fee') );
189 this.$router.push({ name: 'vote-confirm', params: { account: this.currentAccount, transaction: this.transaction,assetAlias: 'BTM', rawData: result} })
193 body: getLang(error.message)
199 transaction.asset(BTM).then(ret => {
200 this.selectAsset = ret