|
|
@ -1,64 +1,63 @@ |
|
|
|
<template> |
|
|
|
<view class=""> |
|
|
|
<navigation :showBack="true"> |
|
|
|
Import by mnemonics |
|
|
|
Import mnemonics |
|
|
|
</navigation> |
|
|
|
<view class="main"> |
|
|
|
<view class="title"> |
|
|
|
Mnemonic import verification |
|
|
|
</view> |
|
|
|
|
|
|
|
<textarea v-model="wordInfo" class="textareaa" placeholder="Enter mnemonic words separated by spaces" placeholder-style="color:rgb(224,229,242)"> |
|
|
|
|
|
|
|
</textarea> |
|
|
|
|
|
|
|
|
|
|
|
<u-button class="custom-style" @click="confirm">Confirm</u-button> |
|
|
|
|
|
|
|
|
|
|
|
<view class="info_con" v-if="show"> |
|
|
|
<image src="../../../../static/tongyonh/xg.png" mode="aspectFit" class="img2" @click="show=false"></image> |
|
|
|
<image src="../../../../static/tongyonh/Frame60.png" mode="aspectFit" class="img"></image> |
|
|
|
<view class="info"> |
|
|
|
Successful |
|
|
|
</view> |
|
|
|
<view class="text"> |
|
|
|
Backup mnemonic completed! |
|
|
|
</view> |
|
|
|
<view class="btn"> |
|
|
|
Confirm |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="info_con" v-if="show2"> |
|
|
|
<image src="../../../../static/tongyonh/xg.png" mode="aspectFit" class="img2" @click="show2=false"></image> |
|
|
|
<image src="../../../../static/tongyonh/Subtract.png" mode="aspectFit" class="img"></image> |
|
|
|
<view class="info"> |
|
|
|
Invalid Seed |
|
|
|
</view> |
|
|
|
<view class="text"> |
|
|
|
You entered the wrong booster words, <br>please try again. |
|
|
|
</view> |
|
|
|
<view class="btncon"> |
|
|
|
<view class="can" @click="show2=false"> |
|
|
|
Cancel |
|
|
|
</view> |
|
|
|
<view class="con" @click="restart"> |
|
|
|
Confirm |
|
|
|
</view> |
|
|
|
|
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<u-mask :show="show" z-index="10"></u-mask> |
|
|
|
<u-mask :show="show2" z-index="10"></u-mask> |
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="title"> |
|
|
|
Mnemonics import verification |
|
|
|
</view> |
|
|
|
|
|
|
|
<textarea v-model="wordInfo" class="textareaa" placeholder="Enter mnemonic words separated by spaces" placeholder-style="color:rgb(224,229,242)"> |
|
|
|
</textarea> |
|
|
|
<u-button class="custom-style" @click="confirm">Confirm</u-button> |
|
|
|
|
|
|
|
|
|
|
|
<view class="info_con" v-if="show"> |
|
|
|
<image src="../../../../static/tongyonh/xg.png" mode="aspectFit" class="img2" @click="show=false"> |
|
|
|
</image> |
|
|
|
<image src="../../../../static/tongyonh/Frame60.png" mode="aspectFit" class="img"></image> |
|
|
|
<view class="info"> |
|
|
|
Successful |
|
|
|
</view> |
|
|
|
<view class="text"> |
|
|
|
Backup mnemonic completed! |
|
|
|
</view> |
|
|
|
<view class="btn"> |
|
|
|
Confirm |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="info_con" v-if="show2"> |
|
|
|
<image src="../../../../static/tongyonh/xg.png" mode="aspectFit" class="img2" @click="show2=false"> |
|
|
|
</image> |
|
|
|
<image src="../../../../static/tongyonh/Subtract.png" mode="aspectFit" class="img"></image> |
|
|
|
<view class="info"> |
|
|
|
Invalid Seed |
|
|
|
</view> |
|
|
|
<view class="text"> |
|
|
|
You entered the wrong booster words, <br>please try again. |
|
|
|
</view> |
|
|
|
<view class="btncon"> |
|
|
|
<view class="can" @click="show2=false"> |
|
|
|
Cancel |
|
|
|
</view> |
|
|
|
<view class="con" @click="restart"> |
|
|
|
Confirm |
|
|
|
</view> |
|
|
|
|
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<u-mask :show="show" z-index="10"></u-mask> |
|
|
|
<u-mask :show="show2" z-index="10"></u-mask> |
|
|
|
</view> |
|
|
|
|
|
|
|
</view> |
|
|
|
|
|
|
|
</view> |
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
@ -66,182 +65,75 @@ |
|
|
|
export default { |
|
|
|
data() { |
|
|
|
return { |
|
|
|
mnemonics:[], |
|
|
|
wordArr:[], |
|
|
|
show: false, |
|
|
|
index:0, |
|
|
|
returnIndex:0, |
|
|
|
// 拿来对比的 |
|
|
|
mnemonics2:[], |
|
|
|
show2:false, |
|
|
|
wordInfo:'', |
|
|
|
walletInfo:{}, |
|
|
|
go:true, |
|
|
|
name:'', |
|
|
|
mnemonics: [], |
|
|
|
wordArr: [], |
|
|
|
show: false, |
|
|
|
index: 0, |
|
|
|
returnIndex: 0, |
|
|
|
// 拿来对比的 |
|
|
|
mnemonics2: [], |
|
|
|
show2: false, |
|
|
|
wordInfo: '', |
|
|
|
walletInfo: {}, |
|
|
|
go: false, |
|
|
|
name: '', |
|
|
|
typename:'', |
|
|
|
info: {}, |
|
|
|
}; |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
// 成功去到设置交易密码 |
|
|
|
goTranPaw(){ |
|
|
|
goTranPaw() { |
|
|
|
uni.navigateTo({ |
|
|
|
url:'/pages/menu/backUp/transPaw/index' |
|
|
|
url: '/pages/menu/backUp/transPaw/index' |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 失败重刷新 |
|
|
|
restart(){ |
|
|
|
restart() { |
|
|
|
uni.redirectTo({ |
|
|
|
url:'../backUp4/index' |
|
|
|
url: '../backUp4/index' |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 提交 |
|
|
|
confirm(){ |
|
|
|
if(this.wordInfo==''){ |
|
|
|
uni.showToast({ |
|
|
|
title: 'Cannot be empty', |
|
|
|
icon: 'none', |
|
|
|
duration: 1500 |
|
|
|
}) |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
var a=uni.getStorageSync('createWalletName') |
|
|
|
if(a=='BTC'&&a!=''&&a!=undefined){ |
|
|
|
this.walletInfo=uni.getStorageSync('walletInfo'); |
|
|
|
var mnemonic=this.wordInfo; |
|
|
|
uni.setStorageSync('word',mnemonic); |
|
|
|
let btc; |
|
|
|
console.log(1111111) |
|
|
|
try{ |
|
|
|
btc=this.$Token.generateBtc(mnemonic); |
|
|
|
}catch(e){ |
|
|
|
uni.showToast({ |
|
|
|
title: e.message, |
|
|
|
icon: 'none', |
|
|
|
duration: 1500 |
|
|
|
}) |
|
|
|
|
|
|
|
return; |
|
|
|
} |
|
|
|
for(var i=0;i<this.walletInfo.BTC.length;i++){ |
|
|
|
if(this.walletInfo.BTC[i].address==btc.address){ |
|
|
|
uni.showToast({ |
|
|
|
title: 'The wallet has been imported', |
|
|
|
icon: 'none', |
|
|
|
duration: 1500 |
|
|
|
}) |
|
|
|
this.go=false; |
|
|
|
}else{ |
|
|
|
this.go=true; |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
if(this.go){ |
|
|
|
uni.showToast({ |
|
|
|
title: 'Import succeeded', |
|
|
|
icon: 'success', |
|
|
|
duration: 1500 |
|
|
|
}) |
|
|
|
setTimeout(()=>{ |
|
|
|
uni.navigateTo({ |
|
|
|
url:'/pages/menu/backUp/transPaw/index' |
|
|
|
}) |
|
|
|
},1500) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if(a=='ETH'&&a!=''&&a!=undefined){ |
|
|
|
this.walletInfo=uni.getStorageSync('walletInfo'); |
|
|
|
var mnemonic=this.wordInfo; |
|
|
|
uni.setStorageSync('word',mnemonic); |
|
|
|
let eth; |
|
|
|
try{ |
|
|
|
eth=this.$Token.generateEth(mnemonic); |
|
|
|
}catch(e){ |
|
|
|
confirm() { |
|
|
|
this.walletInfo = uni.getStorageSync('walletInfo'); |
|
|
|
if (this.wordInfo == '') { |
|
|
|
uni.showToast({ |
|
|
|
title: e.message, |
|
|
|
title: 'Cannot be empty', |
|
|
|
icon: 'none', |
|
|
|
duration: 1500 |
|
|
|
}) |
|
|
|
|
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
for(var i=0;i<this.walletInfo.ETH.length;i++){ |
|
|
|
if(this.walletInfo.ETH[i].address==eth.address){ |
|
|
|
uni.showToast({ |
|
|
|
title: 'The wallet has been imported', |
|
|
|
icon: 'none', |
|
|
|
duration: 1500 |
|
|
|
}) |
|
|
|
this.go=false; |
|
|
|
}else{ |
|
|
|
this.go=true; |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
if(this.go){ |
|
|
|
uni.showToast({ |
|
|
|
title: 'Import succeeded', |
|
|
|
icon: 'success', |
|
|
|
duration: 1500 |
|
|
|
}) |
|
|
|
setTimeout(()=>{ |
|
|
|
uni.navigateTo({ |
|
|
|
url:'/pages/menu/backUp/transPaw/index' |
|
|
|
}) |
|
|
|
},1500) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(a=='TRX'&&a!=''&&a!=undefined){ |
|
|
|
this.walletInfo=uni.getStorageSync('walletInfo'); |
|
|
|
var mnemonic=this.wordInfo; |
|
|
|
uni.setStorageSync('word',mnemonic); |
|
|
|
let tron=this.$Token.generateTron(mnemonic); |
|
|
|
console.log(tron,444444) |
|
|
|
for(var i=0;i<this.walletInfo.TRON.length;i++){ |
|
|
|
if(this.walletInfo.TRON[i].address==tron.address){ |
|
|
|
uni.showToast({ |
|
|
|
title: 'The wallet has been imported', |
|
|
|
icon: 'none', |
|
|
|
duration: 1500 |
|
|
|
}) |
|
|
|
this.go=false; |
|
|
|
}else{ |
|
|
|
this.go=true; |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
if(this.go){ |
|
|
|
uni.showToast({ |
|
|
|
title: 'successfully', |
|
|
|
icon: 'success', |
|
|
|
duration: 1500 |
|
|
|
}) |
|
|
|
setTimeout(()=>{ |
|
|
|
uni.navigateTo({ |
|
|
|
url:'/pages/menu/backUp/transPaw/index' |
|
|
|
}) |
|
|
|
},1500) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.typename = uni.getStorageSync('createWalletName') |
|
|
|
|
|
|
|
this.walletInfo = uni.getStorageSync('walletInfo'); |
|
|
|
for(var i=0;i<this.walletInfo[this.typename].length;i++){ |
|
|
|
if( this.wordInfo==this.walletInfo[this.typename][i].address){ |
|
|
|
uni.showToast({ |
|
|
|
title: 'The wallet has been imported', |
|
|
|
icon: 'none', |
|
|
|
duration: 1500 |
|
|
|
}) |
|
|
|
return; |
|
|
|
}else{ |
|
|
|
uni.setStorageSync('word', this.wordInfo); |
|
|
|
uni.navigateTo({ |
|
|
|
url:'/pages/menu/backUp/transPaw/index' |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
onLoad(item) { |
|
|
|
|
|
|
|
if(item!=''||item!=undefined){ |
|
|
|
uni.setStorageSync('createWalletName',item.name) |
|
|
|
|
|
|
|
if (item != '' || item != undefined) { |
|
|
|
uni.setStorageSync('createWalletName', item.name) |
|
|
|
} |
|
|
|
}, |
|
|
|
}; |
|
|
@ -250,12 +142,13 @@ |
|
|
|
.custom-style { |
|
|
|
height: 112rpx; |
|
|
|
text-align: center; |
|
|
|
color: #fff; |
|
|
|
color: #fff; |
|
|
|
background-color: #5B53FF !important; |
|
|
|
border-radius: 40rpx; |
|
|
|
margin-top: 50rpx; |
|
|
|
border-radius: 40rpx; |
|
|
|
margin-top: 50rpx; |
|
|
|
} |
|
|
|
.u-default-hover{ |
|
|
|
|
|
|
|
.u-default-hover { |
|
|
|
background-color: #5B53FF !important; |
|
|
|
border-radius: 40rpx !important; |
|
|
|
color: #fff !important; |
|
|
@ -264,7 +157,5 @@ |
|
|
|
</style> |
|
|
|
|
|
|
|
<style> |
|
|
|
|
|
|
|
@import './index.css'; |
|
|
|
|
|
|
|
</style> |
|
|
|