Browse Source

密码

master
vee 4 years ago
parent
commit
82c181f51c
  1. 2
      App.vue
  2. 4
      components/navigation/navigation.vue
  3. 17
      pages.json
  4. 83
      pages/fingerPage/index.vue
  5. 85
      pages/menu/backUp/backUp4/index.vue
  6. 6
      pages/menu/backUp/transPaw/index.vue
  7. 2
      pages/menu/setting/index.vue
  8. 4
      unpackage/dist/dev/app-plus/app-config-service.js
  9. 17055
      unpackage/dist/dev/app-plus/app-service.js
  10. 19945
      unpackage/dist/dev/app-plus/app-view.js
  11. BIN
      unpackage/dist/dev/app-plus/static/tongyonh/Frame.png
  12. BIN
      unpackage/dist/dev/app-plus/static/tongyonh/Illustration.png
  13. BIN
      unpackage/dist/dev/app-plus/static/tongyonh/Nftimg.png
  14. 4
      utils/TokenUtil.js

2
App.vue

@ -4,7 +4,7 @@
max-width: 828rpx; //
margin: auto !important;
}
page{margin-top:50rpx}
/* #endif */
@import "uview-ui/index.scss";
</style>

4
components/navigation/navigation.vue

@ -63,7 +63,7 @@
.nav-head{
height: 40rpx;
background-color: #fff;
background-color: #fafafa;
text-align: center;
font-weight: 700;
font-size: 36rpx;
@ -76,7 +76,7 @@
align-items: center;
// margin-top: 80rpx;
position: sticky;
top: 20px;
top: 40rpx;
width: 100%;
z-index: 8;

17
pages.json

@ -3,12 +3,18 @@
"^u-(.*)": "@/uview-ui/components/u-$1/u-$1.vue"
},
"pages": [ //pageshttps://uniapp.dcloud.io/collocation/pages
// {
// "path": "pages/index",
// "style": {
// "navigationStyle": "custom"
// }
// },
{
"path": "pages/index",
"path": "pages/fingerPage/index",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "pages/register/index",
@ -17,12 +23,7 @@
}
},
{
"path": "pages/fingerPage/index",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "pages/fingerPage/password/index",
"style": {

83
pages/fingerPage/index.vue

@ -41,8 +41,8 @@
export default {
data() {
return {
cnt:this.$t('index').Confirm,
can:this.$t('index').Cancel,
cnt: this.$t('index').Confirm,
can: this.$t('index').Cancel,
checked: false,
show: false,
showFinger: false,
@ -78,8 +78,8 @@
})
console.log(123456465)
},
confirm(e){
uni.setStorageSync('lang',e[0].value)
confirm(e) {
uni.setStorageSync('lang', e[0].value)
if (e[0].value == 'c') {
this._i18n.locale = 'en'
@ -87,7 +87,7 @@
uni.setStorageSync('langTrue', 'English')
uni.setStorageSync("language", 'en')
uni.redirectTo({
url:'/pages/fingerPage/index'
url: '/pages/fingerPage/index'
})
} else if (e[0].value == 'a') {
@ -96,21 +96,21 @@
uni.setStorageSync("language", 'zh-CN')
uni.setStorageSync('langTrue', '简体中文')
uni.redirectTo({
url:'/pages/fingerPage/index'
url: '/pages/fingerPage/index'
})
} else if (e[0].value == 'b'){
} else if (e[0].value == 'b') {
this._i18n.locale = 'zh-CNF'
this.$store.commit('setLanguage', 'zh-CNF')
uni.setStorageSync("language", 'zh-CNF')
uni.setStorageSync('langTrue', '繁體中文')
uni.redirectTo({
url:'/pages/fingerPage/index'
url: '/pages/fingerPage/index'
})
}
},
goFinger(){
this.showFinger=true;
this.show=true;
goFinger() {
this.showFinger = true;
this.show = true;
this.fingerPass()
},
//
@ -138,7 +138,7 @@
printCancel() {
this.show = false;
this.showFinger = false
console.log(this.showFinger,777777777777)
console.log(this.showFinger, 777777777777)
plus.fingerprint.cancel();
},
@ -203,7 +203,7 @@
that.fingerSuccess = true;
that.show = false;
uni.reLaunch({
url:'/pages/menu/wallet/index'
url: '/pages/menu/wallet/index'
})
}, function(e) {
//
@ -211,35 +211,35 @@
case e.AUTHENTICATE_MISMATCH:
plus.nativeUI.toast(that.$t('index').Fingerprintmatchingfailed);
// uni.setStorageSync('fingerPass',false)
that.showFinger=false;
that.fingerFail=true;
that.checked=false
that.show=false;
that.showFinger = false;
that.fingerFail = true;
that.checked = false
that.show = false;
break;
case e.AUTHENTICATE_OVERLIMIT:
plus.nativeUI.closeWaiting(); //Android
plus.nativeUI.alert(that.$t('index').Thenumberoffingerprint);
// uni.setStorageSync('fingerPass',false)
that.showFinger=false;
that.fingerFail=true;
that.checked=false
that.show=false;
that.showFinger = false;
that.fingerFail = true;
that.checked = false
that.show = false;
break;
case e.CANCEL:
plus.nativeUI.toast(that.$t('index').Recognitioncancelled);
// uni.setStorageSync('fingerPass',false)
that.showFinger=false;
that.checked=false
that.fingerFail=true;
that.show=false;
that.showFinger = false;
that.checked = false
that.fingerFail = true;
that.show = false;
break;
default:
plus.nativeUI.closeWaiting(); //Android
// uni.setStorageSync('fingerPass',false)
that.showFinger=false;
that.checked=false
that.show=false;
that.fingerFail=true;
that.showFinger = false;
that.checked = false
that.show = false;
that.fingerFail = true;
plus.nativeUI.alert(that.$t('index').Fingerprintidentificationfailed);
break;
}
@ -262,11 +262,32 @@
},
onLoad() {
//
let fingerPass=uni.getStorageSync('fingerPass');
console.log(fingerPass,"fingerPass")
if (uni.getStorageSync('fingerPass')) {
this.showFinger=true;
this.show=true;
this.showFinger = true;
this.show = true;
this.fingerPass()
}
let walletInfo= uni.getStorageSync('walletInfo');
if (!walletInfo || walletInfo == '') {
uni.reLaunch({
url: '/pages/register/index'
})
} else {
// #ifdef APP-PLUS
//
if (!uni.getStorageSync('fingerPass')) {
uni.reLaunch({
url: '/pages/fingerPage/password/index'
})
return;
}
// #endif
}

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

@ -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)
}
},

6
pages/menu/backUp/transPaw/index.vue

@ -74,14 +74,17 @@
}
},
finish2(e) {
debugger
if (this.password != e) {
this.info = true;
return;
} else {
//
if(uni.getStorageSync('walletInfo')){
var walletInfo=uni.getStorageSync('walletInfo');
if(walletInfo){
var a = uni.getStorageSync('createWalletName')
var mnemonic = uni.getStorageSync('word');
console.log(mnemonic,456446)
try {
this.$walletUtil.mnemonicEstablishWallet(a,mnemonic,e)
uni.showToast({
@ -96,6 +99,7 @@
}, 1500)
}
catch(err){
console.log(err)
uni.showToast({
title:this.$t('index').Creationfailed,
icon: 'none',

2
pages/menu/setting/index.vue

@ -124,7 +124,7 @@
this.checked = false
this.hou_jia_w = false;
this.show = false;
uni.setStorageSync('fingerPass', false)
uni.removeStorageSync('fingerPass', false)
},
//
cancel() {

4
unpackage/dist/dev/app-plus/app-config-service.js

File diff suppressed because one or more lines are too long

17055
unpackage/dist/dev/app-plus/app-service.js

File diff suppressed because one or more lines are too long

19945
unpackage/dist/dev/app-plus/app-view.js

File diff suppressed because one or more lines are too long

BIN
unpackage/dist/dev/app-plus/static/tongyonh/Frame.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 244 KiB

BIN
unpackage/dist/dev/app-plus/static/tongyonh/Illustration.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 229 KiB

BIN
unpackage/dist/dev/app-plus/static/tongyonh/Nftimg.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 196 KiB

4
utils/TokenUtil.js

@ -37,9 +37,7 @@ let token = {
},
//获取Child
getPrivateKey: function(mnemonic, hdpath) {
if (mnemonic.split(" ").length % 12 > 0) {
throw new Error("mnemonic error");
}
let seed = bip39.mnemonicToSeedSync(mnemonic);
const node = bip32.fromSeed(seed);
const child = node.derivePath(hdpath);

Loading…
Cancel
Save