bitcooo
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

154 lines
3.1 KiB

<template>
<view class="">
<navigation :showBack="true" :bgnum="false">
<text class="big_title">
{{i18n.transPaw}}
</text>
</navigation>
<view class="main">
<view class="big_title" v-if="borNum">
{{i18n.settransPaw}}
</view>
<view class="big_title" v-if="borNum2">
{{i18n.transPawAgain}}
</view>
<view class="title">
{{i18n.Securetransaction}} <br>{{i18n.Securetransaction2}}
</view>
<u-message-input @finish="finish" inactive-color="#E0E5F2" active-color="#5B53FF" :width="94" :maxlength="6"
mode="box" :focus="fes" :dot-fill="true" v-if="borNum"></u-message-input>
<u-message-input @finish="finish2" :inactive-color="info?'#F16063':'#E0E5F2'" active-color="#5B53FF"
:width="94" :maxlength="6" mode="box" :focus="fes" :dot-fill="true" v-if="borNum2" @change="back">
</u-message-input>
<view class="infoText" v-if="info">
{{i18n.Passworddiscrepansies}}
</view>
</view>
</view>
</view>
</template>
<script>
import cont from "@/components/navigation/navigation.vue"
export default {
data() {
return {
password: '',
password2: '',
msg: '',
msgLength: 0,
fes: false,
borNum: true,
borNum2: false,
info: false,
word: {},
walletInfo: {},
btcBalance: 0,
ethBbalance: 0,
trxBbalance: 0,
}
},
watch: {
},
methods: {
// 首次创建三条主链钱包 首次执行这里
setWalletInfo(e) {
this.word = uni.getStorageSync('word');
this.$walletUtil.initialWallet(this.word,this.password )
},
// 删除密码触发
back(e) {
if (e.length < 6) {
this.info = false;
}
},
finish2(e) {
if (this.password != e) {
this.info = true;
return;
} else {
//这个判断是否首次建立钱包
if(uni.getStorageSync('walletInfo')){
var a = uni.getStorageSync('createWalletName')
var mnemonic = uni.getStorageSync('word');
try {
this.$walletUtil.mnemonicEstablishWallet(a,mnemonic,e)
uni.showToast({
title: 'Set successfully',
icon: 'success',
duration: 1500,
})
setTimeout(() => {
uni.navigateTo({
url: '../../wallet/index'
})
}, 1500)
}
catch(err){
uni.showToast({
title: 'Creation failed',
icon: 'none',
duration: 1500,
})
}
}else{
this.setWalletInfo();
uni.showToast({
title: 'Set successfully',
icon: 'success',
duration: 1500,
})
setTimeout(() => {
uni.navigateTo({
url: '../../wallet/index'
})
}, 1500)
}
this.info = false;
}
},
// 第一次存密码
finish(e) {
this.password = e
var that = this;
that.borNum = false;
that.borNum2 = false;
setTimeout(() => {
that.borNum2 = true;
}, 50)
},
},
onLoad() {
},
computed: {
i18n() {
return this.$t('index')
},
}
};
</script>
<style scoped>
</style>
<style>
@import './index.css';
</style>