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. 387
      pages/fingerPage/index.vue
  5. 119
      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. 17065
      unpackage/dist/dev/app-plus/app-service.js
  10. 33111
      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; // max-width: 828rpx; //
margin: auto !important; margin: auto !important;
} }
page{margin-top:50rpx}
/* #endif */ /* #endif */
@import "uview-ui/index.scss"; @import "uview-ui/index.scss";
</style> </style>

4
components/navigation/navigation.vue

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

17
pages.json

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

387
pages/fingerPage/index.vue

@ -1,22 +1,22 @@
<template> <template>
<view class="rela"> <view class="rela">
<view class="main"> <view class="main">
<image src="../../static/tongyonh/Group285.png" mode="aspectFit" class="logo"></image> <image src="../../static/tongyonh/Group285.png" mode="aspectFit" class="logo"></image>
<view class="fingcon"> <view class="fingcon">
<image src="../../static/tongyonh/zhiwen.png" mode="aspectFit" class="finimg" @click="goFinger"></image> <image src="../../static/tongyonh/zhiwen.png" mode="aspectFit" class="finimg" @click="goFinger"></image>
<view class="te1"> <view class="te1">
{{i18n.Clicktoverify}} {{i18n.Clicktoverify}}
</view> </view>
</view> </view>
<view class="passTex" @click="gopwd"> <view class="passTex" @click="gopwd">
<!-- <view class="lans" @click="show = true"> <!-- <view class="lans" @click="show = true">
{{i18n.lans}} {{i18n.lans}}
</view> --> </view> -->
{{i18n.Loginwith}} {{i18n.Loginwith}}
</view> </view>
</view> </view>
<u-mask z-index="10" :show="show"></u-mask> <u-mask z-index="10" :show="show"></u-mask>
@ -30,7 +30,7 @@
{{i18n.Cancel}} {{i18n.Cancel}}
</view> </view>
</view> </view>
<u-select :confirm-text="cnt" :cancel-text="can" v-model="show" :list="list3" @confirm="confirm"></u-select> <u-select :confirm-text="cnt" :cancel-text="can" v-model="show" :list="list3" @confirm="confirm"></u-select>
</view> </view>
@ -41,8 +41,8 @@
export default { export default {
data() { data() {
return { return {
cnt:this.$t('index').Confirm, cnt: this.$t('index').Confirm,
can:this.$t('index').Cancel, can: this.$t('index').Cancel,
checked: false, checked: false,
show: false, show: false,
showFinger: false, showFinger: false,
@ -50,7 +50,7 @@
fingerFail: false, fingerFail: false,
hou_jia_w: false, hou_jia_w: false,
language: this.$store.state.language == 'en' ? 'English' : '简体中文', language: this.$store.state.language == 'en' ? 'English' : '简体中文',
show: false, show: false,
list3: [{ list3: [{
label: this.$t('index').langfan, label: this.$t('index').langfan,
disabled: false, disabled: false,
@ -78,195 +78,216 @@
}) })
console.log(123456465) console.log(123456465)
}, },
confirm(e){ confirm(e) {
uni.setStorageSync('lang',e[0].value) uni.setStorageSync('lang', e[0].value)
if (e[0].value == 'c') { if (e[0].value == 'c') {
this._i18n.locale = 'en' this._i18n.locale = 'en'
this.$store.commit('setLanguage', 'en') this.$store.commit('setLanguage', 'en')
uni.setStorageSync('langTrue', 'English') uni.setStorageSync('langTrue', 'English')
uni.setStorageSync("language", 'en') uni.setStorageSync("language", 'en')
uni.redirectTo({ uni.redirectTo({
url:'/pages/fingerPage/index' url: '/pages/fingerPage/index'
}) })
} else if (e[0].value == 'a') { } else if (e[0].value == 'a') {
this._i18n.locale = 'zh-CN' this._i18n.locale = 'zh-CN'
this.$store.commit('setLanguage', 'zh-CN') this.$store.commit('setLanguage', 'zh-CN')
uni.setStorageSync("language", 'zh-CN') uni.setStorageSync("language", 'zh-CN')
uni.setStorageSync('langTrue', '简体中文') uni.setStorageSync('langTrue', '简体中文')
uni.redirectTo({ 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._i18n.locale = 'zh-CNF'
this.$store.commit('setLanguage', 'zh-CNF') this.$store.commit('setLanguage', 'zh-CNF')
uni.setStorageSync("language", 'zh-CNF') uni.setStorageSync("language", 'zh-CNF')
uni.setStorageSync('langTrue', '繁體中文') uni.setStorageSync('langTrue', '繁體中文')
uni.redirectTo({ uni.redirectTo({
url:'/pages/fingerPage/index' url: '/pages/fingerPage/index'
}) })
} }
}, },
goFinger(){ goFinger() {
this.showFinger=true; this.showFinger = true;
this.show=true; this.show = true;
this.fingerPass() this.fingerPass()
}, },
// //
cancel_hou() { cancel_hou() {
this.hou_jia_w = false; this.hou_jia_w = false;
this.show = false; this.show = false;
this.checked = true; this.checked = true;
}, },
// //
confirm_hou() { confirm_hou() {
this.checked = false this.checked = false
this.hou_jia_w = false; this.hou_jia_w = false;
this.show = false; this.show = false;
uni.setStorageSync('fingerPass', false) uni.setStorageSync('fingerPass', false)
}, },
// //
cancel() { cancel() {
this.showFinger = false; this.showFinger = false;
this.checked = false; this.checked = false;
this.show = false; this.show = false;
this.printCancel(); this.printCancel();
}, },
// //
printCancel() { printCancel() {
this.show = false; this.show = false;
this.showFinger = false this.showFinger = false
console.log(this.showFinger,777777777777) console.log(this.showFinger, 777777777777)
plus.fingerprint.cancel(); plus.fingerprint.cancel();
}, },
fingerPass() { fingerPass() {
console.log(this.checked) console.log(this.checked)
// //
this.show = true; this.show = true;
this.showFinger = true; this.showFinger = true;
this.fingerprint(true); this.fingerprint(true);
}, },
fingerprint: function() { fingerprint: function() {
// //
// #ifdef APP-PLUS // #ifdef APP-PLUS
if (!plus.fingerprint.isSupport()) { if (!plus.fingerprint.isSupport()) {
uni.showToast({ uni.showToast({
title: this.$t('index').fingerprintidentification, title: this.$t('index').fingerprintidentification,
icon: 'none', icon: 'none',
duration: 1500 duration: 1500
}) })
// this.disabled = true; // this.disabled = true;
} else if (!plus.fingerprint.isKeyguardSecure()) { } else if (!plus.fingerprint.isKeyguardSecure()) {
uni.showToast({ uni.showToast({
title: this.$t('index').notequipped, title: this.$t('index').notequipped,
icon: 'none', icon: 'none',
duration: 1500 duration: 1500
}) })
} else if (!plus.fingerprint.isEnrolledFingerprints()) { } else if (!plus.fingerprint.isEnrolledFingerprints()) {
uni.showToast({ uni.showToast({
title: this.$t('index').oninthesetting, title: this.$t('index').oninthesetting,
icon: 'none', icon: 'none',
duration: 1500 duration: 1500
}) })
// this.disabled = true; // this.disabled = true;
} else { } else {
// this.result = ''; // this.result = '';
// // this.disabled = false; // // this.disabled = false;
// #ifdef MP-WEIXIN // #ifdef MP-WEIXIN
// this.disabled = false; // this.disabled = false;
uni.showToast({ uni.showToast({
title: 'Please use it in wechat real machine. The simulator does not support it', title: 'Please use it in wechat real machine. The simulator does not support it',
icon: 'none', icon: 'none',
duration: 1500 duration: 1500
}) })
// #endif // #endif
// #ifndef APP-PLUS || MP-WEIXIN // #ifndef APP-PLUS || MP-WEIXIN
uni.showToast({ uni.showToast({
title: 'Fingerprint identification is not supported on this platform', title: 'Fingerprint identification is not supported on this platform',
icon: 'none', icon: 'none',
duration: 1500, duration: 1500,
}) })
// #endif // #endif
// //
let that = this; let that = this;
// #ifdef APP-PLUS // #ifdef APP-PLUS
plus.fingerprint.authenticate(function() { plus.fingerprint.authenticate(function() {
plus.nativeUI.closeWaiting(); //Android
//
// 使
uni.setStorageSync('fingerPass', true)
that.showFinger = false;
that.fingerSuccess = true;
that.show = false;
uni.reLaunch({
url: '/pages/menu/wallet/index'
})
}, function(e) {
//
switch (e.code) {
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;
break;
case e.AUTHENTICATE_OVERLIMIT:
plus.nativeUI.closeWaiting(); //Android plus.nativeUI.closeWaiting(); //Android
// plus.nativeUI.alert(that.$t('index').Thenumberoffingerprint);
// 使 // uni.setStorageSync('fingerPass',false)
uni.setStorageSync('fingerPass', true)
that.showFinger = false; that.showFinger = false;
that.fingerSuccess = true; that.fingerFail = true;
that.checked = false
that.show = false; that.show = false;
uni.reLaunch({ break;
url:'/pages/menu/wallet/index' case e.CANCEL:
}) plus.nativeUI.toast(that.$t('index').Recognitioncancelled);
}, function(e) { // uni.setStorageSync('fingerPass',false)
// that.showFinger = false;
switch (e.code) { that.checked = false
case e.AUTHENTICATE_MISMATCH: that.fingerFail = true;
plus.nativeUI.toast(that.$t('index').Fingerprintmatchingfailed); that.show = false;
// uni.setStorageSync('fingerPass',false) break;
that.showFinger=false; default:
that.fingerFail=true; plus.nativeUI.closeWaiting(); //Android
that.checked=false // uni.setStorageSync('fingerPass',false)
that.show=false; that.showFinger = false;
break; that.checked = false
case e.AUTHENTICATE_OVERLIMIT: that.show = false;
plus.nativeUI.closeWaiting(); //Android that.fingerFail = true;
plus.nativeUI.alert(that.$t('index').Thenumberoffingerprint); plus.nativeUI.alert(that.$t('index').Fingerprintidentificationfailed);
// uni.setStorageSync('fingerPass',false) break;
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;
break;
default:
plus.nativeUI.closeWaiting(); //Android
// uni.setStorageSync('fingerPass',false)
that.showFinger=false;
that.checked=false
that.show=false;
that.fingerFail=true;
plus.nativeUI.alert(that.$t('index').Fingerprintidentificationfailed);
break;
}
});
// Android
if ('Android' == plus.os.name) {
this.show = true;
/* plus.nativeUI.showWaiting('...').onclose = function() {
plus.fingerprint.cancel();
} */
}
// #endif
} }
// #endif });
}, // Android
change(status) { if ('Android' == plus.os.name) {
this.show = true;
/* plus.nativeUI.showWaiting('...').onclose = function() {
plus.fingerprint.cancel();
} */
}
// #endif
}
// #endif
},
change(status) {
}, },
}, },
onLoad() { onLoad() {
// //
let fingerPass=uni.getStorageSync('fingerPass');
console.log(fingerPass,"fingerPass")
if (uni.getStorageSync('fingerPass')) { if (uni.getStorageSync('fingerPass')) {
this.showFinger=true; this.showFinger = true;
this.show=true; this.show = true;
this.fingerPass() 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
}

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

@ -8,8 +8,8 @@
{{i18n.Mnemonicsimportverification}} {{i18n.Mnemonicsimportverification}}
</view> </view>
<u-input type="textarea" :clearable="false" v-model="wordInfo" @input="getmon()" :placeholder="teee" class="textareaa" placeholderStyle="color:rgb(224,229,242)" <u-input type="textarea" :clearable="false" v-model="wordInfo" @input="getmon()" :placeholder="teee"
:focus="foucStatus" @blur="hideMon" /> class="textareaa" placeholderStyle="color:rgb(224,229,242)" :focus="foucStatus" @blur="hideMon" />
<u-button class="custom-style" @click="confirm">{{i18n.Confirm}}</u-button> <u-button class="custom-style" @click="confirm">{{i18n.Confirm}}</u-button>
@ -52,17 +52,17 @@
<u-mask :show="show" z-index="10"></u-mask> <u-mask :show="show" z-index="10"></u-mask>
<u-mask :show="show2" z-index="10"></u-mask> <u-mask :show="show2" z-index="10"></u-mask>
</view> </view>
<scroll-view :scroll-x="true" class="" v-if="wordType"> <scroll-view :scroll-x="true" class="" v-if="wordType">
<!-- @click="toWord(item)" --> <!-- @click="toWord(item)" -->
<view class="scroll"> <view class="scroll">
<view class="item" v-for="item,index in worcon" @touchend.prevent="toWord(item)"> <view class="item" v-for="item,index in worcon" @touchend.prevent="toWord(item)">
{{item}} {{item}}
</view> </view>
</view> </view>
</scroll-view> </scroll-view>
<!-- <u-keyboard mode="car" v-model="show222"></u-keyboard> --> <!-- <u-keyboard mode="car" v-model="show222"></u-keyboard> -->
</view> </view>
</view> </view>
@ -73,8 +73,8 @@
export default { export default {
data() { data() {
return { return {
show222:'', show222: '',
wordType:false, wordType: false,
teee: this.$t('index').separatedbyspaces, teee: this.$t('index').separatedbyspaces,
mnemonics: [], mnemonics: [],
wordArr: [], wordArr: [],
@ -90,13 +90,13 @@
name: '', name: '',
typename: '', typename: '',
info: {}, info: {},
worcon:[], worcon: [],
keyUp:'', keyUp: '',
foucStatus:false, foucStatus: false,
defaultPhoneHeight:'', // defaultPhoneHeight: '', //
nowPhoneHeight:'', // nowPhoneHeight: '', //
}; };
}, },
computed: { computed: {
@ -106,45 +106,45 @@
}, },
methods: { methods: {
nowPhoneHeight(){ nowPhoneHeight() {
if(this.defaultPhoneHeight != this.nowPhoneHeight){ if (this.defaultPhoneHeight != this.nowPhoneHeight) {
// //
// //
//this.tabbar = true //this.tabbar = true
}else{ } else {
// //
// //
this.wordType=false this.wordType = false
} }
}, },
hideMon(){ hideMon() {
this.wordType=false this.wordType = false
}, },
getmon(){ getmon() {
console.log(this.wordInfo) console.log(this.wordInfo)
var ss = this.wordInfo.split(" ") var ss = this.wordInfo.split(" ")
this.keyUp=ss[ss.length-1]; this.keyUp = ss[ss.length - 1];
console.log(ss[ss.length-1],444) console.log(ss[ss.length - 1], 444)
this.worcon=this.$Token.searchMnemonic(ss[ss.length-1]) this.worcon = this.$Token.searchMnemonic(ss[ss.length - 1])
if(this.worcon.length>0){ if (this.worcon.length > 0) {
this.wordType=true; this.wordType = true;
}else if(this.worcon.length==0){ } else if (this.worcon.length == 0) {
uni.showToast({ uni.showToast({
title: '无效的助记词', title: '无效的助记词',
icon: 'none', icon: 'none',
duration: 1500 duration: 1500
}) })
} }
console.log(this.worcon,444444) console.log(this.worcon, 444444)
}, },
toWord(item){ toWord(item) {
console.log(this.keyUp+item,78787878) console.log(this.keyUp + item, 78787878)
this.wordInfo+=item+' ' this.wordInfo += item + ' '
this.wordInfo=this.wordInfo.replace(this.keyUp+item,item) this.wordInfo = this.wordInfo.replace(this.keyUp + item, item)
this.keyUp=''; this.keyUp = '';
this.wordType=false this.wordType = false
console.log(this.foucStatus,7878787878787787777777777) console.log(this.foucStatus, 7878787878787787777777777)
}, },
// //
goTranPaw() { goTranPaw() {
@ -160,7 +160,7 @@
}, },
// //
confirm() { confirm() {
if(this.wordInfo==''){ if (this.wordInfo == '') {
uni.showToast({ uni.showToast({
title: this.$t('index').MnemonicsError, title: this.$t('index').MnemonicsError,
icon: 'none', icon: 'none',
@ -168,23 +168,14 @@
}) })
return; return;
} }
this.typename=uni.getStorageSync('createWalletName') this.typename = uni.getStorageSync('createWalletName')
if(!this.typename){ 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.setStorageSync('word', this.wordInfo);
uni.navigateTo({ uni.navigateTo({
url: '/pages/menu/backUp/transPaw/index' url: '/pages/menu/backUp/transPaw/index'
}) })
}else{ } else {
this.walletInfo = uni.getStorageSync('walletInfo'); this.walletInfo = uni.getStorageSync('walletInfo');
console.log(this.walletInfo, 123654) console.log(this.walletInfo, 123654)
if (this.wordInfo == null) { if (this.wordInfo == null) {
@ -226,11 +217,11 @@
}, },
onLoad(item) { onLoad(item) {
this.defaultPhoneHeight = window.innerHeight this.defaultPhoneHeight = window.innerHeight
window.onresize = ()=>{ window.onresize = () => {
this.nowPhoneHeight = window.innerHeight this.nowPhoneHeight = window.innerHeight
} }
if (item != '' || item != undefined) { if (item != '' && item != undefined) {
uni.setStorageSync('createWalletName', item.name) uni.setStorageSync('createWalletName', item.name)
} }
}, },

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

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

2
pages/menu/setting/index.vue

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

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

File diff suppressed because one or more lines are too long

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

File diff suppressed because one or more lines are too long

33111
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 //获取Child
getPrivateKey: function(mnemonic, hdpath) { getPrivateKey: function(mnemonic, hdpath) {
if (mnemonic.split(" ").length % 12 > 0) {
throw new Error("mnemonic error");
}
let seed = bip39.mnemonicToSeedSync(mnemonic); let seed = bip39.mnemonicToSeedSync(mnemonic);
const node = bip32.fromSeed(seed); const node = bip32.fromSeed(seed);
const child = node.derivePath(hdpath); const child = node.derivePath(hdpath);

Loading…
Cancel
Save