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 @@