|
@ -150,7 +150,7 @@ |
|
|
</view> |
|
|
</view> |
|
|
|
|
|
|
|
|
</view> |
|
|
</view> |
|
|
<u-mask z-index="10" :show="show" @click="show = false"></u-mask> |
|
|
<u-mask z-index="10" :show="show"></u-mask> |
|
|
<!-- <u-mask z-index="1000" :show="show2" @click="show2 = false"></u-mask> --> |
|
|
<!-- <u-mask z-index="1000" :show="show2" @click="show2 = false"></u-mask> --> |
|
|
<view class="zhiwen_con" v-if="showFinger"> |
|
|
<view class="zhiwen_con" v-if="showFinger"> |
|
|
<view class="tiao" @click="cancel"> |
|
|
<view class="tiao" @click="cancel"> |
|
@ -164,7 +164,7 @@ |
|
|
Touch the fingerprint sensor |
|
|
Touch the fingerprint sensor |
|
|
</view> |
|
|
</view> |
|
|
<view class="flex con"> |
|
|
<view class="flex con"> |
|
|
<view class="textt1" @click="goPassword"> |
|
|
<view class="textt1" @click="goPassword" v-if="!passShow"> |
|
|
Use Password |
|
|
Use Password |
|
|
</view> |
|
|
</view> |
|
|
<view class="textt2" @click="cancel"> |
|
|
<view class="textt2" @click="cancel"> |
|
@ -174,7 +174,7 @@ |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
|
|
|
|
|
|
<view class="zhiwen_con" v-if="false"> |
|
|
<view class="zhiwen_con" v-if="fingerFail"> |
|
|
<view class="tiao"> |
|
|
<view class="tiao"> |
|
|
</view> |
|
|
</view> |
|
|
<view class="bigtitle"> |
|
|
<view class="bigtitle"> |
|
@ -183,10 +183,10 @@ |
|
|
<view class="bottom_con"> |
|
|
<view class="bottom_con"> |
|
|
<image src="../../../../static/tongyonh/alert-circle.png" mode="aspectFit" class="img1"></image> |
|
|
<image src="../../../../static/tongyonh/alert-circle.png" mode="aspectFit" class="img1"></image> |
|
|
<view class="text1 red"> |
|
|
<view class="text1 red"> |
|
|
Fingerprint not recognized. <br>Try again. |
|
|
Fingerprint not recognized. <br><text @click="">Try again</text> . |
|
|
</view> |
|
|
</view> |
|
|
<view class="flex con"> |
|
|
<view class="flex con"> |
|
|
<view class="textt1"> |
|
|
<view class="textt1" @click="goPassword"> |
|
|
Use Password |
|
|
Use Password |
|
|
</view> |
|
|
</view> |
|
|
<view class="textt2"> |
|
|
<view class="textt2"> |
|
@ -196,7 +196,7 @@ |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
|
|
|
|
|
|
<view class="zhiwen_con" v-if="false"> |
|
|
<view class="zhiwen_con" v-if="fingerSuccess"> |
|
|
<view class="tiao"> |
|
|
<view class="tiao"> |
|
|
</view> |
|
|
</view> |
|
|
<view class="bigtitle"> |
|
|
<view class="bigtitle"> |
|
@ -207,14 +207,14 @@ |
|
|
<view class="text1 green"> |
|
|
<view class="text1 green"> |
|
|
Fingerprint recognized. |
|
|
Fingerprint recognized. |
|
|
</view> |
|
|
</view> |
|
|
<view class="flex con"> |
|
|
<!-- <view class="flex con"> |
|
|
<view class="textt1"> |
|
|
<view class="textt1"> |
|
|
Use Password |
|
|
Use Password |
|
|
</view> |
|
|
</view> |
|
|
<view class="textt2"> |
|
|
<view class="textt2"> |
|
|
Cancel |
|
|
Confirm |
|
|
</view> |
|
|
|
|
|
</view> |
|
|
</view> |
|
|
|
|
|
</view> --> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
|
|
|
|
|
@ -245,6 +245,10 @@ |
|
|
addressInfo:{}, |
|
|
addressInfo:{}, |
|
|
recipientAddress:'', |
|
|
recipientAddress:'', |
|
|
transAmount:'', |
|
|
transAmount:'', |
|
|
|
|
|
fingerSuccess:false, |
|
|
|
|
|
fingerFail:false, |
|
|
|
|
|
// 是否显示使用密码,有设置指纹就不显示 |
|
|
|
|
|
passShow:false, |
|
|
// 不用指纹去密码页面存的信息 |
|
|
// 不用指纹去密码页面存的信息 |
|
|
transInfoPass:{ |
|
|
transInfoPass:{ |
|
|
fromAddress:'', |
|
|
fromAddress:'', |
|
@ -274,8 +278,7 @@ |
|
|
this.showFinger=true |
|
|
this.showFinger=true |
|
|
this.showBottom=false; |
|
|
this.showBottom=false; |
|
|
// 指纹识别成功返回一个true |
|
|
// 指纹识别成功返回一个true |
|
|
var bltype=this.$walletUtil.fingerprint(); |
|
|
this.fingerprint(); |
|
|
console.log(bltype,444444) |
|
|
|
|
|
// 存储去密码页面的信息 |
|
|
// 存储去密码页面的信息 |
|
|
this.transInfoPass.fromAddress=this.addressInfo.address; |
|
|
this.transInfoPass.fromAddress=this.addressInfo.address; |
|
|
this.transInfoPass.toAddress=this.recipientAddress; |
|
|
this.transInfoPass.toAddress=this.recipientAddress; |
|
@ -321,17 +324,147 @@ |
|
|
}) |
|
|
}) |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
if( this.transAmount>this.addressInfo.balance){ |
|
|
// if( this.transAmount>this.addressInfo.balance){ |
|
|
|
|
|
// uni.showToast({ |
|
|
|
|
|
// title: 'Sorry, your credit is running low', |
|
|
|
|
|
// icon: 'none', |
|
|
|
|
|
// duration: 1500 |
|
|
|
|
|
// }) |
|
|
|
|
|
// return |
|
|
|
|
|
// } |
|
|
|
|
|
this.showBottom=true; |
|
|
|
|
|
this.show=true; |
|
|
|
|
|
}, |
|
|
|
|
|
// 指纹识别 |
|
|
|
|
|
|
|
|
|
|
|
fingerprint: function(sett) { |
|
|
|
|
|
let bltype=true; |
|
|
|
|
|
// #ifdef APP-PLUS |
|
|
|
|
|
if (!plus.fingerprint.isSupport()) { |
|
|
uni.showToast({ |
|
|
uni.showToast({ |
|
|
title: 'Sorry, your credit is running low', |
|
|
title: 'This device does not support fingerprint identification', |
|
|
icon: 'none', |
|
|
icon: 'none', |
|
|
duration: 1500 |
|
|
duration: 1500 |
|
|
}) |
|
|
}) |
|
|
return |
|
|
// this.disabled = true; |
|
|
|
|
|
} else if (!plus.fingerprint.isKeyguardSecure()) { |
|
|
|
|
|
uni.showToast({ |
|
|
|
|
|
title: 'This device is not equipped with a password lock screen and cannot use fingerprint identification', |
|
|
|
|
|
icon: 'none', |
|
|
|
|
|
duration: 1500 |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
} else if (!plus.fingerprint.isEnrolledFingerprints()) { |
|
|
|
|
|
uni.showToast({ |
|
|
|
|
|
title: 'There is no fingerprint entered in this device. Please turn it on in the setting', |
|
|
|
|
|
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.showToast({ |
|
|
|
|
|
// title: 'Fingerprint identification succeeded', |
|
|
|
|
|
// icon: 'none', |
|
|
|
|
|
// duration: 1500, |
|
|
|
|
|
// }) |
|
|
|
|
|
// 存储设置里开启指纹后的状态,隐藏使用密码 |
|
|
|
|
|
|
|
|
|
|
|
// uni.setStorageSync('fingerPass',true) |
|
|
|
|
|
|
|
|
|
|
|
that.showBottom=false; |
|
|
|
|
|
that.fingerSuccess=true; |
|
|
|
|
|
console.log(that.fingerSuccess,454545) |
|
|
|
|
|
}, function(e) { |
|
|
|
|
|
switch (e.code) { |
|
|
|
|
|
case e.AUTHENTICATE_MISMATCH: |
|
|
|
|
|
// plus.nativeUI.toast('Fingerprint matching failed, please re-enter'); |
|
|
|
|
|
// uni.setStorageSync('fingerPass',false) |
|
|
|
|
|
console.log(that.showFinger,454545) |
|
|
|
|
|
that.showBottom=false; |
|
|
|
|
|
that.fingerFail=true; |
|
|
|
|
|
console.log(that.fingerFail,454545) |
|
|
|
|
|
break; |
|
|
|
|
|
case e.AUTHENTICATE_OVERLIMIT: |
|
|
|
|
|
plus.nativeUI.closeWaiting(); //兼容Android平台关闭等待框 |
|
|
|
|
|
// plus.nativeUI.alert('The number of fingerprint identification failures exceeds the limit. Please use other methods for authentication'); |
|
|
|
|
|
// uni.setStorageSync('fingerPass',false) |
|
|
|
|
|
console.log(that.showFinger,454545) |
|
|
|
|
|
that.showBottom=false; |
|
|
|
|
|
that.fingerFail=true; |
|
|
|
|
|
console.log(that.fingerFail,454545) |
|
|
|
|
|
break; |
|
|
|
|
|
case e.CANCEL: |
|
|
|
|
|
plus.nativeUI.toast('Recognition has been cancelled'); |
|
|
|
|
|
// uni.setStorageSync('fingerPass',false) |
|
|
|
|
|
console.log(that.showFinger,454545) |
|
|
|
|
|
that.showBottom=false; |
|
|
|
|
|
that.fingerFail=true; |
|
|
|
|
|
console.log(that.fingerFail,454545) |
|
|
|
|
|
break; |
|
|
|
|
|
default: |
|
|
|
|
|
plus.nativeUI.closeWaiting(); //兼容Android平台关闭等待框 |
|
|
|
|
|
uni.setStorageSync('fingerPass',false) |
|
|
|
|
|
console.log(that.showFinger,454545) |
|
|
|
|
|
that.showBottom=false; |
|
|
|
|
|
that.fingerFail=true; |
|
|
|
|
|
console.log(that.fingerFail,454545) |
|
|
|
|
|
plus.nativeUI.alert('Fingerprint identification failed, please try again'); |
|
|
|
|
|
break; |
|
|
} |
|
|
} |
|
|
this.showBottom=true; |
|
|
}); |
|
|
|
|
|
// Android平台手动弹出等待提示框 |
|
|
|
|
|
if ('Android' == plus.os.name) { |
|
|
this.show=true; |
|
|
this.show=true; |
|
|
|
|
|
/* plus.nativeUI.showWaiting('指纹识别中...').onclose = function() { |
|
|
|
|
|
plus.fingerprint.cancel(); |
|
|
|
|
|
} */ |
|
|
|
|
|
} |
|
|
|
|
|
// #endif |
|
|
|
|
|
|
|
|
|
|
|
// #ifdef MP-WEIXIN |
|
|
|
|
|
wx.startSoterAuthentication({ |
|
|
|
|
|
requestAuthModes: ['fingerPrint'], |
|
|
|
|
|
challenge: '123456', |
|
|
|
|
|
authContent: '请用指纹解锁', |
|
|
|
|
|
success(res) { |
|
|
|
|
|
uni.showToast({ |
|
|
|
|
|
title: '识别成功', |
|
|
|
|
|
mask: false, |
|
|
|
|
|
duration: 1500 |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
// #endif |
|
|
|
|
|
} |
|
|
|
|
|
// #endif |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
goAddress(text){ |
|
|
goAddress(text){ |
|
|
console.log(text) |
|
|
console.log(text) |
|
|
uni.navigateTo({ |
|
|
uni.navigateTo({ |
|
@ -344,6 +477,10 @@ |
|
|
if(uni.getStorageSync('myTransAddress')){ |
|
|
if(uni.getStorageSync('myTransAddress')){ |
|
|
this.recipientAddress=uni.getStorageSync('myTransAddress').address |
|
|
this.recipientAddress=uni.getStorageSync('myTransAddress').address |
|
|
} |
|
|
} |
|
|
|
|
|
// 每次进来拿缓存里有没有指纹 |
|
|
|
|
|
if(uni.getStorageSync('fingerPass')){ |
|
|
|
|
|
this.passShow=uni.getStorageSync('fingerPass') |
|
|
|
|
|
} |
|
|
this.addressInfo=uni.getStorageSync('infoWallet') |
|
|
this.addressInfo=uni.getStorageSync('infoWallet') |
|
|
console.log(this.addressInfo,1111) |
|
|
console.log(this.addressInfo,1111) |
|
|
} |
|
|
} |
|
|