<template>
- <div>aaa{{transfer}}</div>
+ <div>{{transfer}}</div>
</template>
<script>
beforeCreate() {
chrome.extension.onMessage.addListener((request, sender, sendResponse) => {
this.transfer = request.cmd;
- console.log(request, 222);
- // alert("前端/后端/Popup收到");
+ console.log("transfer", request);
sendResponse("popup返回值");
});
}
this.$emit("on-exit", "creation");
},
create: function() {
+ if (this.formItem.accAlias == "") {
+ this.$dialog.show({
+ body: this.$t("createAccount.inputAlias")
+ });
+ return;
+ }
+ if (this.formItem.keyAlias == "") {
+ this.$dialog.show({
+ body: this.$t("createAccount.inputKey")
+ });
+ return;
+ }
+ if (this.formItem.passwd1 == "") {
+ this.$dialog.show({
+ body: this.$t("createAccount.inputPass")
+ });
+ return;
+ }
if (this.formItem.passwd1 != this.formItem.passwd2) {
- this.tips = "两次密码不一致,请检查后再试";
+ this.tips = this.$t('createAccount.passwordAgain');
return;
}
this.formItem.passwd1
)
.then(res => {
- console.log(res);
+ console.log("bytom.Account.create", res);
this.formItem = {};
loader.hide();
this.back();
.restore(this.fileTxt)
.then(res => {
this.close();
- console.log(res);
+ console.log("recovery", res);
})
.catch(error => {
this.$dialog.show({
},
methods: {
open: function(account, transaction, data) {
- console.log(transaction);
this.account = account;
this.transaction = transaction;
this.transaction.toShort = utils.shortAddress(transaction.to, 4);
bytom.Transaction.transfer(this.account.guid, this.rawData, passwd)
.then(ret => {
loader.hide();
- console.log(ret);
-
this.close();
this.$emit("on-success");
this.$dialog.show({
methods: {
open: function(transaction, selfAddress) {
this.show = true;
-
- console.log(transaction);
this.transaction = transaction;
this.selfAddress = selfAddress;
},
this.transaction.fee
)
.then(ret => {
- console.log(ret);
loader.hide();
this.transaction.fee = Number(ret.result.data.fee / 100000000);
return {
nets: [],
selected: mainNet,
- formItem: {}
+ formItem: {
+ accAlias: "",
+ keyAlias: "",
+ passwd1: "",
+ passwd2: ""
+ }
};
},
computed : {
},
methods: {
create: function() {
+ if (this.formItem.accAlias == "") {
+ this.$dialog.show({
+ body: this.$t("createAccount.inputAlias")
+ });
+ return;
+ }
+ if (this.formItem.keyAlias == "") {
+ this.$dialog.show({
+ body: this.$t("createAccount.inputKey")
+ });
+ return;
+ }
+ if (this.formItem.passwd1 == "") {
+ this.$dialog.show({
+ body: this.$t("createAccount.inputPass")
+ });
+ return;
+ }
if (this.formItem.passwd1 != this.formItem.passwd2) {
this.$dialog.show({
body: this.$t('createAccount.passwordAgain'),
import: "导入",
back: "返回",
passwordAgain: "两次密码不一致,请检查后再试。",
+ inputAlias: "请输入账户别名",
+ inputKey: "请输入秘钥别名",
+ inputPass: "请输入密码",
},
help: {
title: "帮助",
import: "Import",
back: "Back",
passwordAgain: "The passwords are inconsistent twice. Please check and try again.",
+ inputAlias: "Please enter the account alias.",
+ inputKey: "Please enter the key alias.",
+ inputPass: "Please enter your password.",
},
help: {
title: "Help",
bytom.accounts.listAddressUseServer(account.guid).then(addresses => {
let balance = 0;
addresses.forEach(item => {
- if (item.assets != null) {
- item.assets.forEach(asset => {
+ if (item.balances != null) {
+ item.balances.forEach(asset => {
if (asset.asset == ASSET_BTM) {
balance += asset.balance;
}
bytom.accounts
.listAccountUseServer()
.then(accounts => {
- console.log(accounts);
+ console.log("refreshAccounts", accounts);
globalAccounts = accounts;
globalAccounts.forEach(account => {
if (account.balance == null) {
return;
}
- console.log(111, event.data);
+ console.log("event.data", event.data);
if(event.data.bty == 'transfer'){
chrome.runtime.sendMessage(event.data, function (response) {
- console.log(222, response);
+ console.log("transfer response", response);
});
}