|
|
@ -8,8 +8,8 @@ |
|
|
|
{{i18n.Mnemonicsimportverification}} |
|
|
|
</view> |
|
|
|
|
|
|
|
<u-input type="textarea" :clearable="false" v-model="wordInfo" @input="getmon()" :placeholder="teee" class="textareaa" placeholderStyle="color:rgb(224,229,242)" |
|
|
|
:focus="foucStatus" @blur="hideMon" /> |
|
|
|
<u-input type="textarea" :clearable="false" v-model="wordInfo" @input="getmon()" :placeholder="teee" |
|
|
|
class="textareaa" placeholderStyle="color:rgb(224,229,242)" :focus="foucStatus" @blur="hideMon" /> |
|
|
|
|
|
|
|
<u-button class="custom-style" @click="confirm">{{i18n.Confirm}}</u-button> |
|
|
|
|
|
|
@ -73,8 +73,8 @@ |
|
|
|
export default { |
|
|
|
data() { |
|
|
|
return { |
|
|
|
show222:'', |
|
|
|
wordType:false, |
|
|
|
show222: '', |
|
|
|
wordType: false, |
|
|
|
teee: this.$t('index').separatedbyspaces, |
|
|
|
mnemonics: [], |
|
|
|
wordArr: [], |
|
|
@ -90,13 +90,13 @@ |
|
|
|
name: '', |
|
|
|
typename: '', |
|
|
|
info: {}, |
|
|
|
worcon:[], |
|
|
|
keyUp:'', |
|
|
|
foucStatus:false, |
|
|
|
worcon: [], |
|
|
|
keyUp: '', |
|
|
|
foucStatus: false, |
|
|
|
|
|
|
|
|
|
|
|
defaultPhoneHeight:'', //屏幕默认高度 |
|
|
|
nowPhoneHeight:'', //屏幕现在的高度 |
|
|
|
defaultPhoneHeight: '', //屏幕默认高度 |
|
|
|
nowPhoneHeight: '', //屏幕现在的高度 |
|
|
|
}; |
|
|
|
}, |
|
|
|
computed: { |
|
|
@ -106,45 +106,45 @@ |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
|
|
|
|
nowPhoneHeight(){ |
|
|
|
if(this.defaultPhoneHeight != this.nowPhoneHeight){ |
|
|
|
nowPhoneHeight() { |
|
|
|
if (this.defaultPhoneHeight != this.nowPhoneHeight) { |
|
|
|
//手机键盘被唤起了。 |
|
|
|
|
|
|
|
//写软键盘唤起你需要做的操作 |
|
|
|
//如this.tabbar = true |
|
|
|
}else{ |
|
|
|
} else { |
|
|
|
//手机键盘被关闭了。 |
|
|
|
//写软键盘关闭你需要做的操作 |
|
|
|
this.wordType=false |
|
|
|
this.wordType = false |
|
|
|
} |
|
|
|
}, |
|
|
|
hideMon(){ |
|
|
|
this.wordType=false |
|
|
|
hideMon() { |
|
|
|
this.wordType = false |
|
|
|
}, |
|
|
|
getmon(){ |
|
|
|
getmon() { |
|
|
|
console.log(this.wordInfo) |
|
|
|
var ss = this.wordInfo.split(" ") |
|
|
|
this.keyUp=ss[ss.length-1]; |
|
|
|
console.log(ss[ss.length-1],444) |
|
|
|
this.worcon=this.$Token.searchMnemonic(ss[ss.length-1]) |
|
|
|
if(this.worcon.length>0){ |
|
|
|
this.wordType=true; |
|
|
|
}else if(this.worcon.length==0){ |
|
|
|
this.keyUp = ss[ss.length - 1]; |
|
|
|
console.log(ss[ss.length - 1], 444) |
|
|
|
this.worcon = this.$Token.searchMnemonic(ss[ss.length - 1]) |
|
|
|
if (this.worcon.length > 0) { |
|
|
|
this.wordType = true; |
|
|
|
} else if (this.worcon.length == 0) { |
|
|
|
uni.showToast({ |
|
|
|
title: '无效的助记词', |
|
|
|
icon: 'none', |
|
|
|
duration: 1500 |
|
|
|
}) |
|
|
|
} |
|
|
|
console.log(this.worcon,444444) |
|
|
|
console.log(this.worcon, 444444) |
|
|
|
}, |
|
|
|
toWord(item){ |
|
|
|
console.log(this.keyUp+item,78787878) |
|
|
|
this.wordInfo+=item+' ' |
|
|
|
this.wordInfo=this.wordInfo.replace(this.keyUp+item,item) |
|
|
|
this.keyUp=''; |
|
|
|
this.wordType=false |
|
|
|
console.log(this.foucStatus,7878787878787787777777777) |
|
|
|
toWord(item) { |
|
|
|
console.log(this.keyUp + item, 78787878) |
|
|
|
this.wordInfo += item + ' ' |
|
|
|
this.wordInfo = this.wordInfo.replace(this.keyUp + item, item) |
|
|
|
this.keyUp = ''; |
|
|
|
this.wordType = false |
|
|
|
console.log(this.foucStatus, 7878787878787787777777777) |
|
|
|
}, |
|
|
|
// 成功去到设置交易密码 |
|
|
|
goTranPaw() { |
|
|
@ -160,18 +160,7 @@ |
|
|
|
}, |
|
|
|
// 提交 |
|
|
|
confirm() { |
|
|
|
if(this.wordInfo==''){ |
|
|
|
uni.showToast({ |
|
|
|
title: this.$t('index').MnemonicsError, |
|
|
|
icon: 'none', |
|
|
|
duration: 1500 |
|
|
|
}) |
|
|
|
return; |
|
|
|
} |
|
|
|
this.typename=uni.getStorageSync('createWalletName') |
|
|
|
if(!this.typename){ |
|
|
|
|
|
|
|
if(this.wordInfo.split(" ").length%12!=0){ |
|
|
|
if (this.wordInfo == '') { |
|
|
|
uni.showToast({ |
|
|
|
title: this.$t('index').MnemonicsError, |
|
|
|
icon: 'none', |
|
|
@ -179,12 +168,14 @@ |
|
|
|
}) |
|
|
|
return; |
|
|
|
} |
|
|
|
this.typename = uni.getStorageSync('createWalletName') |
|
|
|
if (!this.typename) { |
|
|
|
uni.setStorageSync('word', this.wordInfo); |
|
|
|
uni.navigateTo({ |
|
|
|
url: '/pages/menu/backUp/transPaw/index' |
|
|
|
}) |
|
|
|
|
|
|
|
}else{ |
|
|
|
} else { |
|
|
|
this.walletInfo = uni.getStorageSync('walletInfo'); |
|
|
|
console.log(this.walletInfo, 123654) |
|
|
|
if (this.wordInfo == null) { |
|
|
@ -226,11 +217,11 @@ |
|
|
|
|
|
|
|
}, |
|
|
|
onLoad(item) { |
|
|
|
this.defaultPhoneHeight = window.innerHeight |
|
|
|
window.onresize = ()=>{ |
|
|
|
this.defaultPhoneHeight = window.innerHeight |
|
|
|
window.onresize = () => { |
|
|
|
this.nowPhoneHeight = window.innerHeight |
|
|
|
} |
|
|
|
if (item != '' || item != undefined) { |
|
|
|
} |
|
|
|
if (item != '' && item != undefined) { |
|
|
|
uni.setStorageSync('createWalletName', item.name) |
|
|
|
} |
|
|
|
}, |
|
|
|