17 .balance .token-icon {
22 .balance .token-amount {
23 display: inline-block;
25 .balance .token-amount .asset {
48 background-image: url("../../assets/img/backgroundHead/transfer.svg");
49 background-size: 320px 80px;
54 background: rgba(255,255,255,0.1);
64 <div class="warp-chlid bg-gray">
65 <section class="header bg-header">
66 <i class="iconfont icon-back" @click="close"></i>
67 <p>{{ $t('main.send') }}</p>
70 <section class="balance transfer-header">
72 <i class="iconfont icon-wallet"></i>
75 <div class="token-amount">
77 <span class="asset">BTM</span>
79 <div class="small color-grey">
85 <section class="form-container">
86 <div class="form bg-white">
87 <div class="form-item">
88 <label class="form-item-label">{{ $t('transfer.address') }}</label>
89 <div class="form-item-content" >
90 <input type="text" v-model="transaction.to">
93 <div class="form-item">
94 <label class="form-item-label">
95 {{ $t('transfer.quantity') }}
97 <small class="float-right" >{{ transaction.cost||0 }} CNY</small>
99 <div class="form-item-content" style=" display: flex;">
100 <input type="number" v-model="transaction.amount" placeholder="0">
101 <span class="color-grey" style="width: 40px; font-size: 15px;position: absolute;right: 0;">{{unit}}</span>
104 <div class="form-item">
105 <label class="form-item-label">{{ $t('transfer.fee') }}</label>
106 <div class="form-item-content" >
107 <!--<v-select :clearable="false" v-model="fee" style="height: 32px;" :options="feeTypeOptions"></v-select>-->
108 <input type="text" v-model="fee" disabled >
112 <a class="btn btn-primary" @click="send">{{ $t('transfer.send') }}</a>
118 import account from "@/models/account";
119 import transaction from "@/models/transaction";
120 import getLang from "@/assets/language/sdk";
121 import Confirm from "./transferConfirm";
128 "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff";
143 ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff: "BTM"
147 accountBalance: 0.00,
148 fee: this.$t("transfer.feeType"),
149 feeTypeOptions: [this.$t("transfer.feeType")],
161 return this.assets[this.transaction.asset];
165 selectAsset: function (val) {
166 this.transaction.asset = val.assets;
168 "transaction.amount": function (newAmount) {
169 transaction.asset(this.transaction.asset).then(ret => {
170 this.transaction.cost = Number(ret.result.data.cny_price * newAmount).toFixed(2);
173 account: function (newAccount) {
174 this.guid = newAccount.guid;
176 guid: function (newGuid) {
177 this.accounts.forEach(account => {
178 if (account.guid == newGuid.guid) {
179 this.account = account;
184 account.balance(newGuid).then(balance => {
185 this.accountBalance = balance;
194 this.transaction.to = "";
195 this.transaction.amount = "";
198 if (this.transaction.to == "") {
200 body: this.$t("transfer.emptyTo")
205 if (this.transaction.amount <= 0) {
207 body: this.$t("transfer.noneBTM")
212 let loader = this.$loading.show({
213 // Optional parameters
216 onCancel: this.onCancel
218 transaction.build(this.account.guid, this.transaction.to, this.transaction.asset, this.transaction.amount, this.transaction.fee).then(ret => {
220 this.transaction.fee = Number(ret.result.data.fee / 100000000);
221 this.$router.push({ name: 'transfer-confirm', params: { account: this.account, transaction: this.transaction, rawData: ret.result.data } })
225 body: getLang(error.message)
230 if (this.$route.params.account != undefined) {
231 this.account = this.$route.params.account;
234 if (this.$route.query.to != undefined) {
235 this.transaction.to = this.$route.query.to
237 if (this.$route.query.amount != undefined) {
238 this.transaction.amount = this.$route.query.amount
241 account.setupNet(localStorage.bytomNet);
242 account.list().then(accounts => {
243 this.accounts = accounts;
244 this.accounts.forEach(function (ele) {
245 ele.label = ele.alias
249 if (Object.keys(this.account).length == 0) {
250 this.account = accounts[0]