diff --git a/pages/menu/backUp/backUp5/index.vue b/pages/menu/backUp/backUp5/index.vue
index ba6efe8..c62e334 100644
--- a/pages/menu/backUp/backUp5/index.vue
+++ b/pages/menu/backUp/backUp5/index.vue
@@ -112,180 +112,145 @@
return;
}
- var a = uni.getStorageSync('createWalletName')
+ const a = uni.getStorageSync('createWalletName')
console.log(a)
- if (a == 'BTC' && a != '' && a != undefined) {
- try {
this.walletInfo = uni.getStorageSync('walletInfo');
var mnemonic = this.wordInfo;
uni.setStorageSync('privateKey', mnemonic);
- console.log(mnemonic)
-
- let btc = this.$Token.importBtcPrivateKey(mnemonic);
-
-
- for (var i = 0; i < this.walletInfo.BTC.length; i++) {
- if (this.walletInfo.BTC[i].privateKey == btc.privateKey) {
- uni.showToast({
- title: 'The wallet has been imported',
- icon: 'none',
- duration: 1500
- })
- this.go = false;
- } else {
- this.go = true;
- }
-
- }
- } catch (err) {
- uni.showToast({
- title: 'Private key does not exist',
- icon: 'none',
- duration: 1500
- })
-
- }
- if (this.go) {
- uni.showToast({
- title: 'Import succeeded',
- icon: 'success',
- duration: 1500
- })
- setTimeout(() => {
+ // privateKeyEstablishWallet
+ console.log(mnemonic)
+
uni.navigateTo({
url: '/pages/menu/backUp/transPaw2/index'
})
- }, 1500)
- }
- }
- if (a == 'ETH' && a != '' && a != undefined) {
- try {
- this.walletInfo = uni.getStorageSync('walletInfo');
- var mnemonic = this.wordInfo;
- uni.setStorageSync('privateKey', mnemonic);
- console.log(mnemonic)
-
- let eth = this.$Token.importEthPrivateKey(mnemonic);
-
-
- for (var i = 0; i < this.walletInfo.ETH.length; i++) {
- if (this.walletInfo.ETH[i].privateKey == eth.privateKey) {
- uni.showToast({
- title: 'The wallet has been imported',
- icon: 'none',
- duration: 1500
- })
- this.go = false;
- } else {
- this.go = true;
- }
-
- }
- } catch (err) {
- uni.showToast({
- title: 'Private key does not exist',
- icon: 'none',
- duration: 1500
- })
-
- }
- if (this.go) {
- uni.showToast({
- title: 'Import succeeded',
- icon: 'success',
- duration: 1500
- })
- setTimeout(() => {
- uni.navigateTo({
- url: '/pages/menu/backUp/transPaw2/index'
- })
- }, 1500)
-
- }
- }
-
-
-
- if (a == 'TRX' && a != '' && a != undefined) {
- try {
- this.walletInfo = uni.getStorageSync('walletInfo');
- var mnemonic = this.wordInfo;
- console.log(this.wordInfo)
- uni.setStorageSync('privateKey', mnemonic);
- console.log(mnemonic)
-
- this.info = this.$Token.importTronPrivateKey(mnemonic);
-
-
- for (var i = 0; i < this.walletInfo.TRON.length; i++) {
- if (this.walletInfo.TRON[i].privateKey == this.info.privateKey) {
- uni.showToast({
- title: 'The wallet has been imported',
- icon: 'none',
- duration: 1500
- })
- this.go = false;
- } else {
-
- this.go = true;
- }
-
- }
- } catch (err) {
- console.log(err)
- uni.showToast({
- title: 'Private key does not exist',
- icon: 'none',
- duration: 1500
- })
-
- }
- if (this.go) {
- console.log(this.info, 111)
- this.$store.commit('addTroni', 1)
- let that = this;
- this.$TronUtil.getTronBalance(this.info.address).then((res) => {
- that.info.balance = res
-
- }).catch(err => {
- console.log(err)
- })
- this.info.coinList = [
- {
- name: "TRX",
- name2: "TRX",
- xname: 'TRON',
- icon: require('@/static/tongyonh/tron1.png'),
- balance: this.info.balance
- },
- {
- name:"USDT",
- name2:"TRC20-USDT",
- xname:'Tether USD',
- contractAddress:'TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t',
- icon:require('@/static/tongyonh/tether_usd.png')
- }
- ];
- uni.setStorageSync('wallet', this.info)
- uni.setStorageSync('walleti', this.info.privateKey)
-
- this.walletInfo.TRON[this.$store.state.troni] = this.info
- uni.setStorageSync('walletInfo', this.walletInfo)
- uni.showToast({
- title: 'Import succeeded',
- icon: 'success',
- duration: 1500
- })
- setTimeout(() => {
- uni.navigateTo({
- url: '/pages/menu/backUp/transPaw2/index'
- })
- }, 1500)
-
- }
- }
+ // if (a == 'ETH' && a != '' && a != undefined) {
+ // try {
+ // this.walletInfo = uni.getStorageSync('walletInfo');
+ // var mnemonic = this.wordInfo;
+ // uni.setStorageSync('privateKey', mnemonic);
+ // console.log(mnemonic)
+
+ // let eth = this.$Token.importEthPrivateKey(mnemonic);
+
+
+ // for (var i = 0; i < this.walletInfo.ETH.length; i++) {
+ // if (this.walletInfo.ETH[i].privateKey == eth.privateKey) {
+ // uni.showToast({
+ // title: 'The wallet has been imported',
+ // icon: 'none',
+ // duration: 1500
+ // })
+ // this.go = false;
+ // } else {
+ // this.go = true;
+ // }
+
+ // }
+ // } catch (err) {
+ // uni.showToast({
+ // title: 'Private key does not exist',
+ // icon: 'none',
+ // duration: 1500
+ // })
+
+ // }
+ // if (this.go) {
+ // uni.showToast({
+ // title: 'Import succeeded',
+ // icon: 'success',
+ // duration: 1500
+ // })
+ // setTimeout(() => {
+ // uni.navigateTo({
+ // url: '/pages/menu/backUp/transPaw2/index'
+ // })
+ // }, 1500)
+
+ // }
+ // }
+
+
+
+ // if (a == 'TRX' && a != '' && a != undefined) {
+ // try {
+ // this.walletInfo = uni.getStorageSync('walletInfo');
+ // var mnemonic = this.wordInfo;
+ // console.log(this.wordInfo)
+ // uni.setStorageSync('privateKey', mnemonic);
+ // console.log(mnemonic)
+
+ // this.info = this.$Token.importTronPrivateKey(mnemonic);
+
+
+ // for (var i = 0; i < this.walletInfo.TRON.length; i++) {
+ // if (this.walletInfo.TRON[i].privateKey == this.info.privateKey) {
+ // uni.showToast({
+ // title: 'The wallet has been imported',
+ // icon: 'none',
+ // duration: 1500
+ // })
+ // this.go = false;
+ // } else {
+
+ // this.go = true;
+ // }
+
+ // }
+ // } catch (err) {
+ // console.log(err)
+ // uni.showToast({
+ // title: 'Private key does not exist',
+ // icon: 'none',
+ // duration: 1500
+ // })
+
+ // }
+ // if (this.go) {
+ // console.log(this.info, 111)
+ // this.$store.commit('addTroni', 1)
+ // let that = this;
+ // this.$TronUtil.getTronBalance(this.info.address).then((res) => {
+ // that.info.balance = res
+
+ // }).catch(err => {
+ // console.log(err)
+ // })
+ // this.info.coinList = [
+ // {
+ // name: "TRX",
+ // name2: "TRX",
+ // xname: 'TRON',
+ // icon: require('@/static/tongyonh/tron1.png'),
+ // balance: this.info.balance
+ // },
+ // {
+ // name:"USDT",
+ // name2:"TRC20-USDT",
+ // xname:'Tether USD',
+ // contractAddress:'TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t',
+ // icon:require('@/static/tongyonh/tether_usd.png')
+ // }
+ // ];
+ // uni.setStorageSync('wallet', this.info)
+ // uni.setStorageSync('walleti', this.info.privateKey)
+
+ // this.walletInfo.TRON[this.$store.state.troni] = this.info
+ // uni.setStorageSync('walletInfo', this.walletInfo)
+ // uni.showToast({
+ // title: 'Import succeeded',
+ // icon: 'success',
+ // duration: 1500
+ // })
+ // setTimeout(() => {
+ // uni.navigateTo({
+ // url: '/pages/menu/backUp/transPaw2/index'
+ // })
+ // }, 1500)
+
+ // }
+ // }
},
diff --git a/pages/menu/backUp/transPaw/index.vue b/pages/menu/backUp/transPaw/index.vue
index 10ada2f..f05d83b 100644
--- a/pages/menu/backUp/transPaw/index.vue
+++ b/pages/menu/backUp/transPaw/index.vue
@@ -83,6 +83,7 @@
var a = uni.getStorageSync('createWalletName')
var mnemonic = uni.getStorageSync('word');
this.$walletUtil.mnemonicEstablishWallet(a,mnemonic,e)
+
uni.showToast({
title: 'Set successfully',
icon: 'success',
diff --git a/pages/menu/collection/index.vue b/pages/menu/collection/index.vue
index 2853f4e..aff163f 100644
--- a/pages/menu/collection/index.vue
+++ b/pages/menu/collection/index.vue
@@ -21,7 +21,7 @@
-
+
@@ -100,7 +100,7 @@
showMsg(item,index){
this.test=item
this.testindex=index
- if(uni.getStorageSync('wallet').coinList[0].name2=='ETH'){
+ if(uni.getStorageSync('wallet').type=='ETH'){
this.showbottom=false
this.goDetail();
}else{
@@ -127,7 +127,7 @@
goDetail2(itemm,index){
uni.setStorageSync('proid',this.test.id)
uni.setStorageSync('wallet',itemm)
- uni.setStorageSync('walleti',itemm.privateKey)
+ uni.setStorageSync('walleti',itemm.address)
console.log(itemm,444)
uni.setStorageSync('nftIndex',this.testindex)
let item = JSON.stringify(this.test)
diff --git a/pages/menu/setting/index.vue b/pages/menu/setting/index.vue
index 8e80a79..005ce87 100644
--- a/pages/menu/setting/index.vue
+++ b/pages/menu/setting/index.vue
@@ -19,7 +19,7 @@
- Payment password
+ Language settings
English
diff --git a/pages/menu/token/btc/index.vue b/pages/menu/token/btc/index.vue
index 1725624..4403d48 100644
--- a/pages/menu/token/btc/index.vue
+++ b/pages/menu/token/btc/index.vue
@@ -16,14 +16,8 @@
:class="{'money_con': userObject.coinList[0].xname=='Ethereum', 'money_con2': userObject.coinList[0].xname=='Bitcoin', 'money_con3': userObject.coinList[0].xname=='TRON'}">
-
- 0.00 BTC
-
-
- 0.00 ETH
-
-
- 0.00 TRX
+
+ {{infoWallet.balance}}
≈ $0.0
@@ -146,16 +140,15 @@
}],
infoWallet: {},
current: 0,
- pageSize: 10,
+ pageSize: 20,
pageNum: 1,
- param: {
- 'address': '',
- 'pageNum': 1,
- 'pageSize': 10,
- },
- address:'0x56eddb7aa87536c09ccc2793473599fd21a8b17f',
- address2:'0x56eddb7aa87536c09ccc2793473599fd21a8b17f',
- type:'',
+
+ balance:0,
+
+ address:'',
+ type:'all',
+ trueType:'',
+ contract:'',
}
},
methods: {
@@ -194,15 +187,14 @@
},
getWalletInfo() {
-
- // this.address = this.infoWallet.address
- // this.address2 = this.infoWallet.address
- this.param.address = this.address
this.userObject = this.infoWallet
var that = this
- this.$dataUtil.transactionData('ETH', this.type, this.address2, '0xdac17f958d2ee523a2206206994597c13d831ec7',
- 1, 20,
+ console.log(this.trueType, this.type, this.address, this.contract,
+ this.pageNum, this.pageSize)
+ this.$dataUtil.transactionData(this.trueType, this.type, this.address, this.contract,
+ this.pageNum, this.pageSize,
function(data) {
+ console.log(data,121211212112121)
if(data.length==0){
that.showInfo=true;
}else{
@@ -211,7 +203,6 @@
that.trxs = data
that.trxs2 = data
console.log(that.trxs, 12121)
- console.log(data)
})
@@ -232,14 +223,15 @@
}
},
onLoad(option) {
-
const item = JSON.parse(option.item);
this.infoWallet = item
-
+ this.address=item.address
+ this.trueType=item.type
+ console.log(this.infoWallet,1111)
this.getWalletInfo()
},
onReachBottom() {
- this.param.pageSize += 5;
+ this.pageSize += 5;
this.getWalletInfo()
}
};
diff --git a/pages/menu/token/btc/index2.vue b/pages/menu/token/btc/index2.vue
index 1579ee1..eecf55a 100644
--- a/pages/menu/token/btc/index2.vue
+++ b/pages/menu/token/btc/index2.vue
@@ -1,34 +1,19 @@
-
- {{userObjectss.name2}}
-
-
-
+ {{xname}}
-
- 0.00 BTC
-
-
- 0.00
-
-
- 0.00 TRX
+
+ {{infoWallet.balance}}
≈ $0.0
-
+
@@ -58,39 +43,7 @@
-
-
-
-
-
- {{item.to}}
-
-
-
- {{item.time}}
-
-
-
-
-
- -
- {{item.value}}
-
- {{item.network}}
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{item.to}}
-
-
- {{item.from}}
+
+
+ {{item.address}}
{{item.time}}
@@ -126,36 +77,7 @@
-
-
-
-
-
- {{item.from}}
-
-
-
- {{item.time}}
-
-
-
-
-
- +
- {{item.value}}
-
- {{item.network}}
-
-
-
-
-
-
-
-
-
+
@@ -192,29 +114,33 @@
trxs2: [],
address: '',
userObject: {},
- userObjectss: {},
showInfo: false,
list: [{
- name: 'All'
+ name: 'All',
+
}, {
- name: 'Send'
+ name: 'Send',
+
}, {
name: 'Receive',
+
}],
- infoWallet:{},
+ infoWallet: {},
current: 0,
- pageSize:10,
- pageNum:1,
- param : {
- 'address':'',
- 'pageNum':1,
- 'pageSize':10,
- 'address2':'',
- },
+ pageSize: 20,
+ pageNum: 1,
+
+ balance:0,
+
+ address:'',
+ type:'all',
+ trueType:'',
+ contract:'',
+ xname:'',
}
},
methods: {
- goSend(){
+ goSend() {
let itemm = JSON.stringify(this.infoWallet)
uni.navigateTo({
url: '/pages/menu/sendToken/transfer2/index?item=' + itemm
@@ -234,92 +160,68 @@
},
change(index) {
- console.log(index)
+ if(index==0){
+ this.type='all'
+ }
+ if(index==1){
+ this.type='send'
+ }
+ if(index==2){
+ this.type='receive'
+ }
this.current = index;
console.log(this.current)
-
+ this.getWalletInfo();
},
- getWalletInfo(){
- if (this.infoWallet.coinList[0].xname == 'Ethereum') {
- this.param.address2=this.infoWallet.address
- this.address = this.userObjectss.contractAddress
- this.address2 =this.userObjectss.contractAddress
- console.log( this.userObjectss.contractAddress,111)
- this.param.address= this.userObjectss.contractAddress
- console.log(this.param,2222)
- this.userObject = this.infoWallet
- const post = api.addressOther(
- this.param
- )
- post.then(res => {
- console.log(res, 77)
- if (res.data.code == 404) {
- this.showInfo = true;
- return;
+
+ getWalletInfo() {
+ this.userObject = this.infoWallet
+ var that = this
+ this.$dataUtil.transactionData(this.trueType, this.type, this.address, this.contract,
+ this.pageNum, this.pageSize,
+ function(data) {
+ console.log(data,121211212112121)
+ if(data.length==0){
+ that.showInfo=true;
+ }else{
+ that.showInfo=false;
}
-
- this.trxs = res.data.data
- console.log(this.trxs,7878)
- for (var i = 0; i < this.trxs.length; i++) {
- this.trxs[i].from = this.trxs[i].from.substring(0, 6) + '...' + this.trxs[i].from
- .substring(35, this.trxs[i].from.length);
- this.trxs[i].to = this.trxs[i].to.substring(0, 6) + '...' + this.trxs[i].to.substring(
- 35, this.trxs[i].to.length);
- this.trxs[i].time = index.formatyymmddhhmmss(this.trxs[i].time);
- this.trxs[i].value = parseFloat(this.trxs[i].value).toFixed(0)
- }
-
+ that.trxs = data
+ that.trxs2 = data
+ console.log(that.trxs, 12121)
})
- this.address = this.address.substring(0, 6) + '...' + this.address.substring(35, this.address.length);
- this.getInfo()
- } else if (this.infoWallet.coinList[0].xname == 'TRON') {
- this.address = this.infoWallet.address
- this.param.address=this.address
- this.address2 = this.infoWallet.address
- this.userObject =this.infoWallet
- const post = api.addresstrx(
- this.param
- )
- post.then(res => {
- if (res.data.code == 404) {
- this.showInfo = true;
- return;
- }
- if (res.data.data.network == 'TRX') {
- this.trxs = res.data.data.txs
- for (var i = 0; i < this.trxs.length; i++) {
- this.trxs[i].from = this.trxs[i].from.substring(0, 6) + '...' + this.trxs[i].from
- .substring(35, this.trxs[i].from.length);
- this.trxs[i].to = this.trxs[i].to.substring(0, 6) + '...' + this.trxs[i].to.substring(
- 35, this.trxs[i].to.length);
- this.trxs[i].time = index.formatyymmddhhmmss(this.trxs[i].time);
- this.trxs[i].value = parseFloat(this.trxs[i].value).toFixed(5)
- }
- }
-
- })
- this.address = this.address.substring(0, 6) + '...' + this.address.substring(35, this.address.length);
- }
+
+
+
+
+
+
+
},
- getInfo() {
- this.param.address=this.address2
- const post = api.addressOther(
- this.param
- )
- post.then(res => {
- this.trxs2 = res.data.data.txs
- })
- }
+ getInfo() {
+ this.param.address = this.address2
+ const post = api.address(
+ this.param
+ )
+ post.then(res => {
+ this.trxs2 = res.data.data.txs
+ })
+ }
},
onLoad(option) {
- this.userObjectss=uni.getStorageSync('daiInfo')
- console.log(this.userObjectss,777)
const item = JSON.parse(option.item);
this.infoWallet = item
- this.getWalletInfo()
+ this.address=item.address
+ this.trueType=item.type
+ var index=uni.getStorageSync('otherCoin')
+ this.contract=item.coinList[index].contractAddress
+
+ this.xname=item.coinList[index].xname
+ console.log(this.infoWallet,1111)
+ this.getWalletInfo()
},
onReachBottom() {
- this.param.pageSize+=5;
+ this.pageSize += 5;
this.getWalletInfo()
}
};
diff --git a/pages/menu/wallet/index.vue b/pages/menu/wallet/index.vue
index 5e5062a..70a73f3 100644
--- a/pages/menu/wallet/index.vue
+++ b/pages/menu/wallet/index.vue
@@ -126,26 +126,21 @@
goTrans(itemm,index) {
console.log(index,444)
let item = JSON.stringify(this.userObj2)
- if(this.userObj2.coinList[0].xname=='Bitcoin'){
+ console.log(item,454545)
+ if(index==0){
uni.navigateTo({
- url:'/pages/menu/token/btctrue/index?item='+item
- })
+ url:'/pages/menu/token/btc/index?item='+item
+ })
}else{
- if(index==0){
- uni.navigateTo({
- url:'/pages/menu/token/btc/index?item='+item
- })
- }else{
- uni.setStorageSync('daiInfo',itemm)
- uni.navigateTo({
- url:'/pages/menu/token/btc/index2?item='+item
- })
- }
-
-
+ // 代币页面
+ uni.setStorageSync('otherCoin',index)
+ uni.navigateTo({
+ url:'/pages/menu/token/btc/index2?item='+item
+ })
}
+
+ },
- },
// 唤醒摄像头
chooseImage() {
var _this = this
@@ -165,8 +160,7 @@
url: './cwallet/index'
})
}
- },
-
+ }
};