Vue指纹识别验证 h5plus

news/2025/2/11 8:14:21/

 

 

效果图:


//点击事件   开启关闭指纹识别验证

<mu-list><mu-list-item button :ripple="false" @click="fingerprintVerification"><mu-list-item-title>指纹验证</mu-list-item-title><mu-list-item-action><mu-switch v-model="zhiwen" readonly></mu-switch></mu-list-item-action></mu-list-item></mu-list>
//组件
<finger-print v-if="showFinger" :fingertext="fingertext" @cancel="cancel_from"></finger-print>

//组件代码

<template><div class="finger-print"><!--弹窗--><div class="white_content"><div style="height: 220px;text-align: center;"><div style="padding:20px"><i class="iconfont" style="font-size: 50px;color: #B9862F;">&#xe72f;</i><p style="font-size: 16px;color: black;">{{fingertext ||'请扫描指纹'}}</p><p style="font-size: 12px;color: black;">验证身份以完成交易</p></div></div><div class="btn"><div class="btn-cancel" @click="cancel()">取消</div></div></div><!--覆盖层--><div class="black_overlay"></div></div>
</template><script>export default {name: 'smsCode',data() {return {}},mounted() {},methods: {//取消cancel(){this.$emit('cancel');}},props: {fingertext: {type: String,require: true,},},computed: {},watch: {}}
</script><style scoped>.finger-print {}
/**
弹窗样式
**/.finger-print .white_content {position: fixed;top: 50%;left: 50%;width: 80%;min-height: 220px;border: 1px solid #D6E9F1;border-radius: 8px;background-color: white;z-index: 99999999;transform: translate(-50%, -50%);}.finger-print .btn {height: 50px;line-height: 50px;position: absolute;bottom: 0;width: 100%;border-top: 1px solid #f5f5f5;}.finger-print .btn .btn-cancel {color: #B9862F;float: left;font-size: 14px;width: 100%;background-color: white;border-bottom-left-radius: 8px;border-right: 1px solid #f5f5f5;text-align: center;}/*** 覆盖层样式*/.finger-print .black_overlay {position: fixed;top: 0;left: 0;width: 100%;height: 100%;background-color: rgba(0, 0, 0, .6);z-index: 99999998;opacity: .80;}
</style>

//import,components,data

import FingerPrint from '@/components/Fingerprint'components: {'finger-print': FingerPrint},data() {return {zhiwen: false,showFinger: false,fingertext: '请扫描指纹'}},

 

//开启指纹验证fingerprintVerification() {let _this = this;if(this.zhiwen) {this.zhiwen = false;return;}if(!window.plus) return;// 检查是否支持指纹识别if(plus.fingerprint) {if(!plus.fingerprint.isSupport()) {plus.nativeUI.alert('此设备不支持指纹识别');return;}if(!plus.fingerprint.isKeyguardSecure()) {plus.nativeUI.alert('此设备未设置密码锁屏,无法使用指纹识别');return;}if(!plus.fingerprint.isEnrolledFingerprints()) {plus.nativeUI.alert('此设备未录入指纹,请到设置中开启');return;}//开启指纹识别验证()this.showFinger = truethis.fingertext = '请扫描指纹'var waiting = null;plus.fingerprint.authenticate(function() {plus.nativeUI.alert('指纹识别成功');_this.zhiwen = true_this.showFinger = false;}, function(e) {switch(e.code) {case e.AUTHENTICATE_MISMATCH:plus.nativeUI.toast('指纹匹配失败,请重新输入');_this.fingertext = '指纹匹配失败,请重试'break;case e.AUTHENTICATE_OVERLIMIT:plus.nativeUI.alert('指纹识别失败次数超出限制,请使用其它方式进行认证');_this.showFinger = false;break;default:plus.nativeUI.alert('指纹识别失败(' + e.code + '),请重试');_this.fingertext = '指纹识别失败(' + e.code + '),请重试'break;}})} else {plus.nativeUI.alert('当前环境不支持指纹识别API,请更新到最新版本');}},

 

 


http://www.ppmy.cn/news/535309.html

相关文章

Swifit指纹识别小Demo

废话不说直接上代码 import UIKit import LocalAuthenticationclass FingerprintVerifyManager {//单例实现static let instance FingerprintVerifyManager()private init(){}//验证完的闭包回调typealias TouchIdVerify (isSuccess:Bool, error:NSError?) ->()//调用指…

基于matlab的指纹识别系统

基于matlab的指纹识别系统 随着科学技术的不断发展&#xff0c;自动化的指纹识别技术如今已经被人们广泛地应用在银行、商业交易、公安部门、海关部门等需要对人的身份进识别的领域&#xff0c;而本文所描述的是对自动化指纹识别系统的研究现状以及自动化指纹识别系统的基本算…

神经网络matlab指纹识别_毕业设计论文-matlab指纹识别技术(含代码).doc

摘 要 本文系统地介绍了指纹识别技术的发展和国内外研究应用现状,阐述了建立指纹识别系统的必要性和意义。以数字图像处理为基础,研究指纹识别的原理和方法,重点分析基于神经网络指纹识别算法、滤波特征和不变矩指纹识别算法和指纹匹配算法,将matlab作为仿真工具,针对已有…

Linux调用Windows指纹识别,生物识别--指纹识别用于web登录

一、背景和目的 指纹识别把一个人同他的指纹对应起来,通过比较他的指纹和预先保存的指纹进行比较,就可以验证他的真实身份。 本文基于web登录方式验证指纹身份,通过登录页选择指纹识别登录,验证成功后web实现自动登录。 二、设备选型 2.1设备型号 指纹仪.png 要求具有二次开…

MATLAB指纹识别算法实现

摘 要 由于指纹所具有的普遍性&#xff0c;唯一性和不变性&#xff0c;以及指纹识别技术具有很高的可行性和实用性&#xff0c;使之成为目前最流行、也最可靠的个人身份认证技术之一。 本文主要对指纹图像进行三方面处理&#xff1a;图像预处理、特征提取和特征匹配。图像预处理…

python指纹识别_厉害吧!Python都能做指纹识别播报了

指纹识别技术是目前最成熟且价格便宜的生物特征识别技术。目前来说指纹识别的技术应用最为广泛&#xff0c;我们不仅在门禁、考勤系统中可以看到指纹识别技术的身影&#xff0c;市场上有了更多指纹识别的应用&#xff1a;如笔记本电脑、手机、汽车、银行支付都可应用指纹识别的…

指纹识别传感器技术演变历程

指纹识别传感器技术演变历程 密码的使用在我们的生活中无处不在&#xff1a;手机解锁、网站用户登录、网上/移动支付。安全起见&#xff0c;人们往往在不同类型的账户设置不同的密码&#xff0c;比如手机银行的登录密码和支付密码会不一样&#xff0c;并且还需要定期更换密码。…

指纹识别 python实现_Python实现指纹识别你见过没?

指纹模块为集成了光路和指纹处理部分的一体化指纹处理模块&#xff0c;具有体积小、功耗低、接口简单的特点&#xff0c;可靠性高、识别速度快、干湿手指适应性好&#xff0c;指纹搜索速度快。通讯接口为USB和UART两种通信接口。 1、指纹特征 指纹算法从获取的指纹图像中提取的…