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. 421
      pages/fingerPage/index.vue
  5. 149
      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; //
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": {

421
pages/fingerPage/index.vue

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

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

@ -7,9 +7,9 @@
<view class="title">
{{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>
@ -52,17 +52,17 @@
<u-mask :show="show" z-index="10"></u-mask>
<u-mask :show="show2" z-index="10"></u-mask>
</view>
<scroll-view :scroll-x="true" class="" v-if="wordType">
<!-- @click="toWord(item)" -->
<view class="scroll">
<view class="item" v-for="item,index in worcon" @touchend.prevent="toWord(item)">
{{item}}
<scroll-view :scroll-x="true" class="" v-if="wordType">
<!-- @click="toWord(item)" -->
<view class="scroll">
<view class="item" v-for="item,index in worcon" @touchend.prevent="toWord(item)">
{{item}}
</view>
</view>
</view>
</scroll-view>
<!-- <u-keyboard mode="car" v-model="show222"></u-keyboard> -->
</scroll-view>
<!-- <u-keyboard mode="car" v-model="show222"></u-keyboard> -->
</view>
</view>
@ -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,
defaultPhoneHeight:'', //
nowPhoneHeight:'', //
worcon: [],
keyUp: '',
foucStatus: false,
defaultPhoneHeight: '', //
nowPhoneHeight: '', //
};
},
computed: {
@ -105,46 +105,46 @@
},
},
methods: {
nowPhoneHeight(){
if(this.defaultPhoneHeight != this.nowPhoneHeight){
//
//
//this.tabbar = true
}else{
//
//
this.wordType=false
}
},
hideMon(){
this.wordType=false
nowPhoneHeight() {
if (this.defaultPhoneHeight != this.nowPhoneHeight) {
//
//
//this.tabbar = true
} else {
//
//
this.wordType = false
}
},
getmon(){
hideMon() {
this.wordType = false
},
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,7 +160,7 @@
},
//
confirm() {
if(this.wordInfo==''){
if (this.wordInfo == '') {
uni.showToast({
title: this.$t('index').MnemonicsError,
icon: 'none',
@ -168,23 +168,14 @@
})
return;
}
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;
}
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) {
@ -195,9 +186,9 @@
})
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) {
@ -213,24 +204,24 @@
url: '/pages/menu/backUp/transPaw/index'
})
}
}
}
},
},
onLoad(item) {
this.defaultPhoneHeight = window.innerHeight
window.onresize = ()=>{
this.nowPhoneHeight = window.innerHeight
}
if (item != '' || item != undefined) {
this.defaultPhoneHeight = window.innerHeight
window.onresize = () => {
this.nowPhoneHeight = window.innerHeight
}
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

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
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