Browse Source

修复初次导入助记词

master
vee 4 years ago
parent
commit
2c2501d0aa
  1. 89
      pages/menu/backUp/backUp4/index.vue
  2. 315
      pages/register/index.vue
  3. 4
      utils/locales/en.js
  4. 4
      utils/locales/zh-F.js
  5. 4
      utils/locales/zh.js

89
pages/menu/backUp/backUp4/index.vue

@ -5,10 +5,11 @@
</navigation>
<view class="main">
<view class="title">
{{i18n.Mnemonicsimportverification}}
{{i18n.Mnemonicsimportverification}}
</view>
<textarea v-model="wordInfo" class="textareaa" :placeholder="teee" placeholder-style="color:rgb(224,229,242)">
<textarea v-model="wordInfo" class="textareaa" :placeholder="teee"
placeholder-style="color:rgb(224,229,242)">
</textarea>
<u-button class="custom-style" @click="confirm">{{i18n.Confirm}}</u-button>
@ -18,13 +19,13 @@
</image>
<image src="../../../../static/tongyonh/Frame60.png" mode="aspectFit" class="img"></image>
<view class="info">
{{i18n.Successful}}
</view>
{{i18n.Successful}}
</view>
<view class="text">
{{i18n.backCom}}
</view>
<view class="btn">
{{i18n.Confirm}}
{{i18n.Confirm}}
</view>
</view>
@ -62,7 +63,7 @@
export default {
data() {
return {
teee:this.$t('index').separatedbyspaces,
teee: this.$t('index').separatedbyspaces,
mnemonics: [],
wordArr: [],
show: false,
@ -75,15 +76,15 @@
walletInfo: {},
go: false,
name: '',
typename:'',
typename: '',
info: {},
};
},
computed: {
i18n() {
return this.$t('index')
},
},
i18n() {
return this.$t('index')
},
},
methods: {
//
goTranPaw() {
@ -99,35 +100,57 @@
},
//
confirm() {
this.walletInfo = uni.getStorageSync('walletInfo');
if (this.wordInfo == '') {
uni.showToast({
title: this.$t('index').beempty,
icon: 'none',
duration: 1500
this.typename=uni.getStorageSync('createWalletName')
if(!this.typename){
if(this.wordInfo.split(" ").length%12!=0){
uni.showToast({
title: this.$t('index').MnemonicsError,
icon: 'none',
duration: 1500
})
return;
}
uni.setStorageSync('word', this.wordInfo);
uni.navigateTo({
url: '/pages/menu/backUp/transPaw/index'
})
return;
}
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){
}else{
this.walletInfo = uni.getStorageSync('walletInfo');
console.log(this.walletInfo, 123654)
if (this.wordInfo == null) {
uni.showToast({
title: this.$t('index').beempty,
icon: 'none',
duration: 1500
})
return;
}
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: this.$t('index').beenimported,
icon: 'none',
duration: 1500
})
return;
}else{
uni.setStorageSync('word', this.wordInfo);
uni.navigateTo({
url:'/pages/menu/backUp/transPaw/index'
})
}
} else {
uni.setStorageSync('word', this.wordInfo);
uni.navigateTo({
url: '/pages/menu/backUp/transPaw/index'
})
}
}
}
},

315
pages/register/index.vue

@ -1,101 +1,98 @@
<template>
<view class="main">
<view class="wrap">
<swiper class="swiper" :indicator-dots="indicatorDots" :autoplay="autoplay" :interval="interval" >
<swiper-item>
<view class="swiper-item">
<image src="../../static/tongyonh/phone_image.png" class="img1" mode="aspectFit"></image>
<view class="text_con">
<view class="text1">
Decentralised wallets,
self-directed assets
</view>
<view class="text2">
Local storage of private keys, safe and secure
</view>
</view>
</view>
</swiper-item>
<swiper-item>
<view class="swiper-item">
<image src="../../static/tongyonh/phone_image.png" class="img1" mode="aspectFit"></image>
<view class="text_con">
<view class="text1">
Decentralised wallets,
self-directed assets
</view>
<view class="text2">
Local storage of private keys, safe and secure
</view>
</view>
</view>
</swiper-item>
</swiper>
</view>
<view class="reg_con">
<view class="reg">
<view class="border">
<view class="item flex" @click="createWallet">
<view class="left flex">
<image src="../../static/tongyonh/create_wallet.png" mode="aspectFit" class="letimg"></image>
<view class="textcon">
<view class="text1" >
Create a wallet
<view class="wrap">
<swiper class="swiper" :indicator-dots="indicatorDots" :autoplay="autoplay" :interval="interval">
<swiper-item>
<view class="swiper-item">
<image src="../../static/tongyonh/phone_image.png" class="img1" mode="aspectFit"></image>
<view class="text_con">
<view class="text1">
Decentralised wallets,
self-directed assets
</view>
<view class="text2">
One identity management
Local storage of private keys, safe and secure
</view>
</view>
</view>
<image src="../../static/tongyonh/chevron_right_24px.png" class="rigimg" mode="aspectFit"></image>
</view>
</view>
</swiper-item>
<swiper-item>
<view class="swiper-item">
<image src="../../static/tongyonh/phone_image.png" class="img1" mode="aspectFit"></image>
<view class="text_con">
<view class="text1">
Decentralised wallets,
self-directed assets
</view>
<view class="text2">
Local storage of private keys, safe and secure
</view>
</view>
<view class="item flex" @click="loginWallet">
</view>
</swiper-item>
</swiper>
</view>
<view class="reg_con">
<view class="reg">
<view class="border">
<view class="item flex" @click="createWallet">
<view class="left flex">
<image src="../../static/tongyonh/login_wallet.png" mode="aspectFit" class="letimg"></image>
<image src="../../static/tongyonh/create_wallet.png" mode="aspectFit" class="letimg">
</image>
<view class="textcon">
<view class="text1">
Create a wallet
</view>
<view class="text2">
One identity management
</view>
</view>
</view>
<image src="../../static/tongyonh/chevron_right_24px.png" class="rigimg" mode="aspectFit">
</image>
</view>
</view>
<view class="item flex" @click="loginWallet">
<view class="left flex">
<image src="../../static/tongyonh/login_wallet.png" mode="aspectFit" class="letimg"></image>
<view class="textcon">
<view class="text1" >
<view class="text1">
Login to wallet
</view>
<view class="text2">
Restore existing wallets
Restore existing wallets
</view>
</view>
</view>
<image src="../../static/tongyonh/chevron_right_24px.png" class="rigimg" mode="aspectFit"></image>
</view>
</view>
<view class="select">
<u-checkbox-group @change="checkboxGroupChange">
<u-checkbox
@change="checkboxChange"
v-for="(item, index) in list2" :key="index"
v-model="item.checked"
:name="item.name"
active-color="#5B53FF"
> <text class="name">I have read and agree to the
<text class="active" @click.stop="Terms">Terms of Service</text>
</text> </u-checkbox>
</u-checkbox-group>
<image src="../../static/tongyonh/chevron_right_24px.png" class="rigimg" mode="aspectFit"></image>
</view>
</view>
<view class="select">
<u-checkbox-group @change="checkboxGroupChange">
<u-checkbox @change="checkboxChange" v-for="(item, index) in list2" :key="index"
v-model="item.checked" :name="item.name" active-color="#5B53FF"> <text class="name">I have read and agree to the
<text class="active" @click.stop="Terms">Terms of Service</text>
</text> </u-checkbox>
</u-checkbox-group>
</view>
</view>
</view>
</template>
@ -109,99 +106,95 @@
export default {
data() {
return {
list2: [
{
name: '',
checked: false,
disabled: false,
},
],
list: ['','../../../static/tongyonh/phone_image.png'],
indicatorDots:true,
autoplay:true,
interval:3000,
inde:1,
walletInfo:{},
}
list2: [{
name: '',
checked: false,
disabled: false,
}, ],
list: ['', '../../../static/tongyonh/phone_image.png'],
indicatorDots: true,
autoplay: true,
interval: 3000,
inde: 1,
walletInfo: {},
}
},
onLoad() {
},
onLoad() {},
onShow() {
console.log(uni.getStorageSync('walletInfo'))
if(uni.getStorageSync('walletInfo')) {
uni.reLaunch({
url: '/pages/menu/wallet/index'
})
}
// uni.clearStorageSync();
this.list2.checked = false;
},
console.log(uni.getStorageSync('walletInfo'))
if (uni.getStorageSync('walletInfo')) {
uni.reLaunch({
url: '/pages/menu/wallet/index'
})
}
// uni.clearStorageSync();
this.list2.checked = false;
},
methods: {
checkboxGroupChange(){
checkboxGroupChange() {
},
checkboxChange(){
if(this.inde%2==0){
this.list2[0].checked=false;
}else{
this.list2[0].checked=true;
checkboxChange() {
if (this.inde % 2 == 0) {
this.list2[0].checked = false;
} else {
this.list2[0].checked = true;
}
this.inde++
},
createWallet(){
if(this.list2[0].checked!=true){
uni.showToast({
title: 'Please check the terms of service',
icon: 'none',
duration: 1500
})
return;
}
var word=this.$Token.creatingWallets();
// ,
var word2=word.mnemonic
uni.setStorage({
key: 'word',
data: word2,
success: function() {
console.log('success',word2)
createWallet() {
if (this.list2[0].checked != true) {
uni.showToast({
title: 'Please check the terms of service',
icon: 'none',
duration: 1500
})
return;
}
var word = this.$Token.creatingWallets();
// ,
var word2 = word.mnemonic
uni.setStorage({
key: 'word',
data: word2,
success: function() {
console.log('success', word2)
}
});
console.log(this.list2.checked, 224)
this.list2[0].checked = false;
console.log(this.list2.checked, 444)
uni.navigateTo({
url: '../menu/backUp/index',
})
},
loginWallet() {
if (this.list2[0].checked != true) {
uni.showToast({
title: 'Please check the terms of service',
icon: 'none',
duration: 1500
})
return;
}
this.list2[0].checked = false;
uni.navigateTo({
url: '../menu/backUp/backUp4/index',
})
},
Terms() {
uni.navigateTo({
url: '../menu/about/terms/index',
})
}
});
console.log(this.list2.checked,224)
this.list2[0].checked=false;
console.log(this.list2.checked,444)
uni.navigateTo({
url:'../menu/backUp/index',
})
},
loginWallet(){
if(this.list2[0].checked!=true){
uni.showToast({
title: 'Please check the terms of service',
icon: 'none',
duration: 1500
})
return;
}
this.list2[0].checked=false;
uni.navigateTo({
url:'../menu/backUp/backUp4/index',
})
},
Terms(){
uni.navigateTo({
url:'../menu/about/terms/index',
})
}
},
},
}
</script>
<style>
@import './index.css';
</style>

4
utils/locales/en.js

@ -179,6 +179,7 @@ export default {
enteryourprivatekey: 'Please enter your private key',
beempty: 'Cannot be empty',
beenimported: 'The wallet has been imported',
MnemonicsError:'Mnemonics error',
// backup4
Importmnemonics: 'Import mnemonics',
Mnemonicsimportverification: 'Mnemonics import verification',
@ -222,6 +223,7 @@ export default {
offchain: 'Please enter a note (off-chain)',
TermsofServiceTxt:'This "Service Agreement" ("Agreement" or "Service Agreement") contains the terms and conditions governing your access and use of the websites and services (defined below) provided by us, and is between us and you or the entity you represent protocol. Please read this "Service Agreement" carefully before using this website or service. By using this website, or by clicking a button or check box to accept or agree to the terms of service of this "Service Agreement" (if this option is available), or fill in a service order, or, if earlier, use or otherwise access the service ("Effective Date"), you (1) accept and agree to this "Service Agreement" and any additional terms, rules and participation conditions that we publish from time to time, and (2) agree to the collection as described in our "Privacy Policy" , Use, disclosure, and other information processing activities. If you do not agree to this Service Agreement, you may not access or use the service.',
updateTitle:'Version upgrade prompt',
updateMsg:'A new version is found, do you want to update it?'
AgreementConfirmation:'I have read and agree to the',
}
}

4
utils/locales/zh-F.js

@ -178,6 +178,7 @@ export default {
enteryourprivatekey: '請輸入您的私密金鑰',
beempty: '不能為空',
beenimported: '錢包已經被導入',
MnemonicsError:'助記詞錯誤',
// backup4
Importmnemonics: '導入助記詞',
Mnemonicsimportverification: '助記符輸入驗證',
@ -220,6 +221,7 @@ export default {
offchain: '請輸入注釋(鏈外)',
TermsofServiceTxt:'本《服務協議》(“協議”或“服務協議”)包含管理您訪問和使用我們提供的網站和服務(定義如下)的條款和條件,並且是我們與您或您所代表的實體之間的協議。在使用本網站或服務之前,請仔細閱讀本《服務協議》。通過使用本網站,或單擊按鈕或複選框以接受或同意本《服務協議》的服務條款(如有該選項),或者填寫服務訂單,或者,如果更早,使用或以其他方式訪問服務(“生效日期”),您(1)接受並同意本《服務協議》以及我們不時發布的任何附加條款、規則和參與條件,以及(2)同意如我們的《隱私政策》中所述的收集、使用、披露和其他處理信息的活動。如果您不同意本《服務協議》,則您不得訪問或使用服務。',
updateTitle:'版本升級提示',
updateMsg:'發現新版本,是否更新?'
updateMsg:'發現新版本,是否更新?',
AgreementConfirmation:'我已經閱讀並且同意',
}
}

4
utils/locales/zh.js

@ -176,6 +176,7 @@ export default {
enteryourprivatekey: '请输入您的私钥',
beempty: '不能为空',
beenimported: '钱包已经被导入',
MnemonicsError:'助记词错误',
// backup4
Importmnemonics: '导入助记词',
Mnemonicsimportverification: '助记符输入验证',
@ -218,6 +219,7 @@ export default {
offchain: '请输入注释(链外)',
TermsofServiceTxt:'本《服务协议》(“协议”或“服务协议”)包含管理您访问和使用我们提供的网站和服务(定义如下)的条款和条件,并且是我们与您或您所代表的实体之间的协议。在使用本网站或服务之前,请仔细阅读本《服务协议》。通过使用本网站,或单击按钮或复选框以接受或同意本《服务协议》的服务条款(如有该选项),或者填写服务订单,或者,如果更早,使用或以其他方式访问服务(“生效日期”),您(1)接受并同意本《服务协议》以及我们不时发布的任何附加条款、规则和参与条件,以及(2)同意如我们的《隐私政策》中所述的收集、使用、披露和其他处理信息的活动。如果您不同意本《服务协议》,则您不得访问或使用服务。',
updateTitle:'版本升级提示',
updateMsg:'发现新版本,是否更新?'
updateMsg:'发现新版本,是否更新?',
AgreementConfirmation:'我已经阅读并且同意',
}
}

Loading…
Cancel
Save