|
|
@ -8,7 +8,7 @@ |
|
|
|
<view class="main_con"> |
|
|
|
|
|
|
|
<view class="item flex"> |
|
|
|
<view class="text1"> |
|
|
|
<view class="text1"> |
|
|
|
{{i18n.fingerPass}} |
|
|
|
</view> |
|
|
|
<u-switch v-model="checked" active-color="#5B53FF" @change="fingerPass()"></u-switch> |
|
|
@ -119,11 +119,13 @@ |
|
|
|
this.checked=false; |
|
|
|
this.show=false; |
|
|
|
this.printCancel(); |
|
|
|
|
|
|
|
}, |
|
|
|
// 取消指纹识别 |
|
|
|
printCancel(){ |
|
|
|
this.show=false; |
|
|
|
plus.fingerprint.cancel(); |
|
|
|
console.log(4545454545) |
|
|
|
this.showFinger=false |
|
|
|
}, |
|
|
|
|
|
|
@ -195,27 +197,22 @@ |
|
|
|
plus.nativeUI.closeWaiting(); //兼容Android平台关闭等待框 |
|
|
|
// 指纹验证成功后走这里 |
|
|
|
// 存储设置里开启指纹后的状态,隐藏使用密码 |
|
|
|
|
|
|
|
uni.setStorageSync('fingerPass',true) |
|
|
|
console.log(that.showFinger,454545) |
|
|
|
that.showFinger=false; |
|
|
|
that.fingerSuccess=true; |
|
|
|
that.show=false; |
|
|
|
console.log(that.showFinger,454545) |
|
|
|
}, function(e) { |
|
|
|
switch (e.code) { |
|
|
|
case e.AUTHENTICATE_MISMATCH: |
|
|
|
// plus.nativeUI.toast('Fingerprint matching failed, please re-enter'); |
|
|
|
plus.nativeUI.toast(that.$t('index').Fingerprintmatchingfailed); |
|
|
|
uni.setStorageSync('fingerPass',false) |
|
|
|
console.log(that.showFinger,454545) |
|
|
|
that.showFinger=false; |
|
|
|
that.fingerFail=true; |
|
|
|
that.checked=false |
|
|
|
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'); |
|
|
|
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.showFinger=false; |
|
|
@ -224,12 +221,13 @@ |
|
|
|
console.log(that.fingerFail,454545) |
|
|
|
break; |
|
|
|
case e.CANCEL: |
|
|
|
plus.nativeUI.toast('Recognition has been cancelled'); |
|
|
|
plus.nativeUI.toast(that.$t('index').Recognitioncancelled); |
|
|
|
uni.setStorageSync('fingerPass',false) |
|
|
|
console.log(that.showFinger,454545) |
|
|
|
that.showFinger=false; |
|
|
|
that.checked=false |
|
|
|
that.fingerFail=true; |
|
|
|
that.show=false; |
|
|
|
console.log(that.fingerFail,454545) |
|
|
|
break; |
|
|
|
default: |
|
|
@ -240,7 +238,7 @@ |
|
|
|
that.checked=false |
|
|
|
that.fingerFail=true; |
|
|
|
console.log(that.fingerFail,454545) |
|
|
|
plus.nativeUI.alert('Fingerprint identification failed, please try again'); |
|
|
|
plus.nativeUI.alert(that.$t('index').Fingerprintidentificationfailed); |
|
|
|
break; |
|
|
|
} |
|
|
|
}); |
|
|
|