17 .balance .token-icon {
22 .balance .token-amount {
23 display: inline-block;
27 .balance .token-amount .asset {
37 .form-item-group .form-item {
52 <transition name="page-transfer"
53 enter-active-class="animated fadeInLeft faster"
54 leave-active-class="animated fadeOutLeft faster">
55 <div v-show="show" class="warp bg-gray">
56 <section class="header bg-green">
57 <i class="iconfont icon-back" @click="close"></i>
59 <img src="../../assets/logo.png" class="token-icon">
60 <div class="token-amount">{{account.balance}}<span class="asset">BTM</span></div>
64 <section class="form">
65 <div class="form-item-group">
66 <div class="form-item">
67 <!-- <label>账户</label> -->
68 <v-select :clearable="false" v-model="guid" style="height: 32px;width: 125px;" label="alias" :options="accounts"></v-select>
70 <div class="form-item" style="margin-left: 20px;">
71 <!-- <label>资产</label> -->
72 <v-select :clearable="false" v-model="selectAsset" style="height: 32px;" label="name" :options="assetOptions"></v-select>
75 <div class="form-item">
76 <label class="form-item-label">{{ $t('transfer.address') }}</label>
77 <div class="form-item-content" style="margin-left: 80px;">
78 <input type="text" v-model="transaction.to">
81 <div class="form-item">
82 <label class="form-item-label">{{ $t('transfer.quantity') }}</label>
83 <div class="form-item-content" style="margin-left: 80px; display: flex;">
84 <input type="number" v-model="transaction.amount" placeholder="0">
85 <span style="width: 40px; font-size: 15px;">{{unit}}</span>
88 <div class="form-item">
89 <label class="form-item-label">≈</label>
90 <div class="form-item-content" style="margin-left: 80px; display: flex;">
91 <input type="number" v-model="transaction.cost" placeholder="0" disabled>
92 <span style="width: 40px; font-size: 15px;">CNY</span>
95 <div class="form-item">
96 <label class="form-item-label">{{ $t('transfer.fee') }}</label>
97 <div class="form-item-content" style="margin-left: 80px;">
98 <v-select :clearable="false" v-model="fee" style="height: 32px;" :options="feeTypeOptions"></v-select>
102 <div style="width: 200px; margin: 0 auto;">
103 <div class="btn bg-green" @click="send">{{ $t('transfer.send') }}</div>
109 <Confirm ref="transferConfirm" @on-success="close"></Confirm>
114 import bytom from "../common/bytom";
115 import getLang from "../../assets/language/sdk";
116 import Confirm from "./confirm";
123 "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff";
127 "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
133 "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
141 ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff: "BTM"
160 return this.$t("transfer.feeType");
166 return [this.$t("transfer.feeType")];
171 selectAsset: function(val) {
172 this.transaction.asset = val.assets;
174 "transaction.amount": function(newAmount) {
175 bytom.Query.asset(this.transaction.asset).then(ret => {
176 this.transaction.cost = Number(ret.result.data.cny_price*newAmount).toFixed(2);
179 guid: function(newGuid) {
180 this.accounts.forEach(account => {
181 if (account.guid == newGuid.guid) {
182 this.account = account;
189 open: function(accountInfo) {
192 bytom.Account.list().then(accounts => {
193 this.accounts = accounts;
195 this.accounts.forEach(function(element) {
196 options.push({ label: element.alias, value: element.guid });
198 this.options = options;
201 this.account = accountInfo;
202 this.guid = accountInfo;
203 this.unit = this.assets[this.transaction.asset];
207 this.transaction.to = "";
208 this.transaction.amount = "";
211 if (this.transaction.to == "") {
213 body: this.$t("transfer.emptyTo")
218 if (this.transaction.amount <= 0) {
220 body: this.$t("transfer.noneBTM")
225 let loader = this.$loading.show({
226 // Optional parameters
229 onCancel: this.onCancel
231 bytom.Transaction.build(
234 this.transaction.asset,
235 this.transaction.amount,
242 this.transaction.fee = Number(ret.result.data.fee / 100000000);
243 this.$refs.transferConfirm.open(
252 body: getLang(error.message)