Commit 5eca05ec authored by ly's avatar ly

添加贷超相关代码

parent 38920c16
No preview for this file type
<script>
import { convertPromise } from './utils/header.js'
import Permission from '@/js_sdk/wa-permission/permission'
// import { SelectLocation } from "./utils/authPerission";
export default {
onLaunch: function() {
const common = uni.getStorageSync("m-headers")
if (!common) {
this.loadDevice();
this.loadNetwork();
// this.loadLocation();
this.loadUuid()
}
plus.screen.lockOrientation("portrait-primary")
console.log('App Launch')
},
methods:{
// 获取common当中的设备信息
loadDevice: function() {
const that = this;
convertPromise('getSystemInfo').then(result => {
const deviceInfo = {
// token:uuidObtain,
deviceType: result.deviceType,
appName: result.appName,
deviceId: result.deviceId,
device: result.osName,
deviceName: result.platform,
appVersion: result.appWgtVersion,
osVersion: result.osVersion ? result.osVersion : result.system,
mobileType: result.model,
screenHeight: result.screenHeight,
screenWidth: result.screenWidth,
resolution: result.windowWidth + '*' + result.screenHeight
};
// 本地存储
uni.setStorage({
key: 'm-device-info',
data: JSON.stringify(deviceInfo),
success: function() {
console.log('m-device-info存储成功');
}
});
}).catch(err => {
//that.toast('获取设备信息失败')
uni.showModal({
title: '"多典花"想访问您的设备信息',
content: '通过访问您的设备信息,提高您授信通过率。',
showCancel: false,
confirmText: '去设置',
success: function(res) {
if (res.confirm) {
Permission.gotoAppPermissionSetting()
}
}
});
})
},
// 获取common当中的网络信息
loadNetwork: function() {
const that = this;
convertPromise('getNetworkType').then(result => {
const networkInfo = {
networkStatus: result.networkType
};
// 网络信息存储
uni.setStorage({
key: 'm-network-info',
data: JSON.stringify(networkInfo),
success: function() {
console.log('m-network-info存储成功');
}
});
}).catch(err => {
that.toast('获取网络信息失败')
})
},
//获取uuid
loadUuid: function() {
// plus.device.uuid
plus.device.getInfo({
success: function(e) {
const deviceInfo = {
token: e.uuid,
};
uni.setStorage({
key: 'm-load-udid',
data: JSON.stringify(deviceInfo),
success: function() {
console.log('uuid存储成功');
}
})
},
fail: function(e) {
console.log('getDeviceInfo failed: ' + JSON.stringify(e));
}
});
},
// 获取common当中的位置信息
// loadLocation: function() {
// const that = this;
// // 苹果测试手机如果没有插入手机卡,获取定位之后会解析失败,报错
// SelectLocation(() => {
// convertPromise('getLocation', {
// type: 'wgs84',
// geocode: true
// }).then(result => {
// const locationInfo = {
// lat: String(result.latitude),
// lng: String(result.longitude)
// };
// uni.setStorage({
// key: 'm-location-info',
// data: JSON.stringify(locationInfo),
// success: function() {
// console.log('m-location-info存储成功');
// }
// });
// }).catch(err => {
// console.log(err, '错误了')
// // that.toast('获取位置信息失败')
// })
// })
// }
},
onShow: function() {
console.log('App Show')
},
onHide: function() {
console.log('App Hide')
}
}
</script>
<style>
/*每个页面公共css */
</style>
<script>
import { convertPromise } from './utils/header.js'
import Permission from '@/js_sdk/wa-permission/permission'
import { SelectLocation } from "./utils/authPerission";
export default {
onLaunch: function() {
const common = uni.getStorageSync("m-headers")
if (!common) {
this.loadDevice();
this.loadNetwork();
this.loadLocation();
this.loadUuid()
}
plus.screen.lockOrientation("portrait-primary")
console.log('App Launch')
},
methods:{
// 获取common当中的设备信息
loadDevice: function() {
const that = this;
convertPromise('getSystemInfo').then(result => {
const deviceInfo = {
// token:uuidObtain,
deviceType: result.deviceType,
appName: result.appName,
deviceId: result.deviceId,
device: result.osName,
deviceName: result.platform,
appVersion: result.appWgtVersion,
osVersion: result.osVersion ? result.osVersion : result.system,
mobileType: result.model,
screenHeight: result.screenHeight,
screenWidth: result.screenWidth,
resolution: result.windowWidth + '*' + result.screenHeight
};
// 本地存储
uni.setStorage({
key: 'm-device-info',
data: JSON.stringify(deviceInfo),
success: function() {
console.log('m-device-info存储成功');
}
});
}).catch(err => {
//that.toast('获取设备信息失败')
uni.showModal({
title: '"多典花"想访问您的设备信息',
content: '通过访问您的设备信息,提高您授信通过率。',
showCancel: false,
confirmText: '去设置',
success: function(res) {
if (res.confirm) {
Permission.gotoAppPermissionSetting()
}
}
});
})
},
// 获取common当中的网络信息
loadNetwork: function() {
const that = this;
convertPromise('getNetworkType').then(result => {
const networkInfo = {
networkStatus: result.networkType
};
// 网络信息存储
uni.setStorage({
key: 'm-network-info',
data: JSON.stringify(networkInfo),
success: function() {
console.log('m-network-info存储成功');
}
});
}).catch(err => {
that.toast('获取网络信息失败')
})
},
//获取uuid
loadUuid: function() {
// plus.device.uuid
plus.device.getInfo({
success: function(e) {
const deviceInfo = {
token: e.uuid,
};
uni.setStorage({
key: 'm-load-udid',
data: JSON.stringify(deviceInfo),
success: function() {
console.log('uuid存储成功');
}
})
},
fail: function(e) {
console.log('getDeviceInfo failed: ' + JSON.stringify(e));
}
});
},
// 获取common当中的位置信息
loadLocation: function() {
const that = this;
// 苹果测试手机如果没有插入手机卡,获取定位之后会解析失败,报错
SelectLocation(() => {
convertPromise('getLocation', {
type: 'wgs84',
geocode: true
}).then(result => {
const locationInfo = {
lat: String(result.latitude),
lng: String(result.longitude)
};
uni.setStorage({
key: 'm-location-info',
data: JSON.stringify(locationInfo),
success: function() {
console.log('m-location-info存储成功');
}
});
}).catch(err => {
console.log(err, '错误了')
// that.toast('获取位置信息失败')
})
})
}
},
onShow: function() {
console.log('App Show')
},
onHide: function() {
console.log('App Hide')
}
}
</script>
<style>
/*每个页面公共css */
</style>
import App from './App'
// #ifndef VUE3
import Vue from 'vue'
Vue.config.productionTip = false
App.mpType = 'app'
import mixin from './mixin/index'
import Modal from './components/modal/modal'
import goodsItem from './components/goodsItem/index'
import request from './utils/request.js'
Vue.component('view-modal', Modal);
Vue.component('view-goods', goodsItem);
Vue.prototype.$request = request
Vue.mixin(mixin)
const app = new Vue({
...App
})
app.$mount()
// #endif
// #ifdef VUE3
import { createSSRApp } from 'vue'
export function createApp() {
const app = createSSRApp(App)
return {
app
}
}
// #endif
\ No newline at end of file
import App from './App'
// #ifndef VUE3
import Vue from 'vue'
Vue.config.productionTip = false
App.mpType = 'app'
import mixin from './mixin/index'
import Modal from './components/modal/modal'
import goodsItem from './components/goodsItem/index'
import bankList from './components/bankList/bankList'
import request from './utils/request.js'
Vue.component('view-modal', Modal);
Vue.component('bank-list', bankList);
Vue.component('view-goods', goodsItem);
Vue.prototype.$request = request
Vue.mixin(mixin)
const app = new Vue({
...App
})
app.$mount()
// #endif
// #ifdef VUE3
import { createSSRApp } from 'vue'
export function createApp() {
const app = createSSRApp(App)
return {
app
}
}
// #endif
\ No newline at end of file
<script>
<script>
import { convertPromise } from './utils/header.js'
import Permission from '@/js_sdk/wa-permission/permission'
// import { SelectLocation } from "./utils/authPerission";
import { SelectLocation } from "./utils/authPerission";
export default {
onLaunch: function() {
onLaunch: function() {
const common = uni.getStorageSync("m-headers")
if (!common) {
this.loadDevice();
this.loadNetwork();
// this.loadLocation();
this.loadLocation();
this.loadUuid()
}
}
plus.screen.lockOrientation("portrait-primary")
console.log('App Launch')
},
methods:{
},
methods:{
// 获取common当中的设备信息
loadDevice: function() {
const that = this;
......@@ -99,36 +99,36 @@
});
},
// 获取common当中的位置信息
// loadLocation: function() {
// const that = this;
// // 苹果测试手机如果没有插入手机卡,获取定位之后会解析失败,报错
// SelectLocation(() => {
// convertPromise('getLocation', {
// type: 'wgs84',
// geocode: true
// }).then(result => {
// const locationInfo = {
// lat: String(result.latitude),
// lng: String(result.longitude)
loadLocation: function() {
const that = this;
// 苹果测试手机如果没有插入手机卡,获取定位之后会解析失败,报错
SelectLocation(() => {
convertPromise('getLocation', {
type: 'wgs84',
geocode: true
}).then(result => {
const locationInfo = {
lat: String(result.latitude),
lng: String(result.longitude)
// };
// uni.setStorage({
// key: 'm-location-info',
// data: JSON.stringify(locationInfo),
// success: function() {
// console.log('m-location-info存储成功');
// }
// });
// }).catch(err => {
// console.log(err, '错误了')
// // that.toast('获取位置信息失败')
// })
// })
// }
};
uni.setStorage({
key: 'm-location-info',
data: JSON.stringify(locationInfo),
success: function() {
console.log('m-location-info存储成功');
}
});
}).catch(err => {
console.log(err, '错误了')
// that.toast('获取位置信息失败')
})
})
}
},
onShow: function() {
console.log('App Show')
},
},
onHide: function() {
console.log('App Hide')
......@@ -138,4 +138,4 @@
<style>
/*每个页面公共css */
</style>
</style>
No preview for this file type
<template>
<view v-if="showSelf" class="dialog" :style="{'z-index': zIndex}">
<view class="dialog-mark" @click.self="closeMyself" :style="{'z-index': zIndex + 1}" @click="cancel"></view>
<transition name="dialog">
<view class="dialog-sprite" :style="{'z-index': zIndex + 2}">
<!-- 标题 -->
<section v-if="title" class="header">
<!-- 标题 -->
<view class='titleT'>{{ title }}</view>
<view class='titleI' @click="cancel"></view>
</section>
<!-- 弹窗的主题内容 -->
<section class="dialog-body">
<slot></slot>
</section>
</view>
</transition>
</view>
</template>
<script>
export default {
name:"bankList",
props: {
//弹窗组件是否显示 默认不显示 必传属性
show: {
type: Boolean,
default: false,
required: true,
},
title: {
type: String,
required: true,
},
showCancel: {
typs: Boolean,
default: false,
required: false,
},
cancelText: {
type: String,
default: '取消',
required: false,
},
confirmText: {
type: String,
default: '确定',
required: false,
},
},
data() {
return {
name: 'dialog',
showSelf: false,
zIndex: this.getZIndex(),
bodyOverflow: ''
};
},
watch: {
show(val) {
if (!val) {
this.closeMyself()
} else {
this.showSelf = val
}
}
},
created() {
this.showSelf = this.show;
},
mounted() {
// this.forbidScroll()
},
methods:{
/** 禁止页面滚动 */
// forbidScroll() {
// this.bodyOverflow = document.body.style.overflow
// document.body.style.overflow = 'hidden'
// },
/** 每次获取之后 zindex 自动增加 */
getZIndex() {
let zIndexInit = 20190315;
return zIndexInit++
},
/** 取消按钮操作 */
cancel() {
this.$emit('cancel', false);
},
/** 确认按钮操作 */
confirm() {
this.$emit('confirm', false)
},
/** 点击遮罩关闭弹窗 */
closeMyself(event) {
this.showSelf = false;
// this.sloveBodyOverflow()
},
/** 恢复页面的滚动 */
// sloveBodyOverflow() {
// document.body.style.overflow = this.bodyOverflow;
// },
}
}
</script>
<style lang='less' scoped>
// 弹窗动画
// 弹窗动画
.dialog-enter-active,
.dialog-leave-active {
transition: opacity 0.5s;
}
.dialog-enter,
.dialog-leave-to {
opacity: 0.5;
}
.dialog {
position: fixed;
top: 0;
right: 0;
width: 100%;
height: 100%;
// 内容层 z-index要比遮罩大,否则会被遮盖
.dialog-mark {
position: absolute;
top: 0;
height: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.6);
}
}
.dialog-sprite {
// 移动端使用felx布局
position: absolute;
top: 10%;
left: 5%;
right: 5%;
bottom: 10%;
display: flex;
flex-direction: column;
max-height: 80%;
min-height: 180px;
overflow: hidden;
z-index: 23456765435;
background: #fff;
border-radius: 12px;
.header {
padding: 32rpx;
font-size: 32rpx;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #333333;
line-height: 45rpx;
text-align: center;
}
.dialog-body {
/* background: linear-gradient( 180deg, #F2F6FF 0%, #FFFFFF 100%); */
flex: 1;
overflow-x: hidden;
overflow-y: scroll;
background: linear-gradient(180deg, #f2f6ff 0%, #ffffff 100%);
/* padding-top: 2px; */
border-top:3rpx solid #F2F6FF;
}
.dialog-footer {
position: relative;
display: flex;
width: 100%;
// flex-shrink: 1;
&::after {
content: "";
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 1px;
background: #ddd;
transform: scaleY(0.5);
}
.btn {
flex: 1;
text-align: center;
padding: 15px;
font-size: 17px;
&:nth-child(2) {
position: relative;
&::after {
content: "";
position: absolute;
left: 0;
top: 0;
width: 1px;
height: 100%;
background: #ddd;
transform: scaleX(0.5);
}
}
}
.btn-confirm {
color: #43ac43;
}
}
}
</style>
.card-page{
width: 706rpx;
height: 359rpx;
background: url('../../static/com/card-bg.png') 0 0 no-repeat;
background-size: 706rpx 359rpx;
.card-main{
padding-top:29rpx;
text-align: center;
font-family: PingFangSC, PingFang SC;
font-weight: 400;
color: #FFFFFF;
font-style: normal;
.main-title{
height: 40rpx;
font-size: 28rpx;
line-height: 40rpx;
}
.main-num{
padding:15rpx 0 23rpx;
height: 73rpx;
font-family: DIN, DIN;
font-weight: bold;
font-size: 60rpx;
color: #FFFFFF;
line-height: 73rpx;
}
.main-des{
height: 33rpx;
font-family: PingFangSC, PingFang SC;
font-weight: 400;
font-size: 24rpx;
color: #FFFFFF;
line-height: 33rpx;
}
.main-btn{
margin:27rpx auto 0;
width: 349rpx;
height: 66rpx;
background: #FFFFFF;
border-radius: 33rpx;
font-family: PingFangSC, PingFang SC;
font-weight: 500;
font-size: 26rpx;
color: #2263E6;
line-height: 66rpx;
text-align: center;
font-style: normal;
}
}
}
\ No newline at end of file
<template>
<view class='card-page'>
<view class='card-main' v-for="item in cardIndex" :key="item.appNo">
<view class='main-title'>{{item.button.tittle}}</view>
<view class='main-num'>{{item.totalCreditAmt}}</view>
<view class='main-des'>{{item.creditTip}}</view>
<view class='main-btn' v-if="item.button.clickable==1" @click="clickBtn(item.button.url,item.appNo,process,item.button.label)">{{item.button.label}}</view>
<view class='main-btn' v-else >{{item.button.label}}</view>
</view>
</view>
</template>
<script>
export default {
name:"moduleCard",
props:{
cardIndex:Array,
process:Number
},
methods:{
clickBtn(item,itemVal,process,label){
const token=uni.getStorageSync('token')
console.log(token,'这是按钮')
if(token==''){
this.Go('uni:/pages/login/login')
}else{
uni.setStorageSync('appNo',itemVal)
if(process>=3 && label=='激活额度'){
this.onCredit()
}else{
this.Go(item)
}
}
},
// 授信提交
onCredit(){
const self=this
const appNO=uni.getStorageSync('appNo')
const params={
"appNo": appNO
}
// return false
self.$request('/app/v1/credit','POST',params).then(res => {
console.log(res,'credit');
self.toast('授信提交成功,请稍后查看')
self.$emit("mydemo")
}).catch(err=>{
console.log(err,'请求出错')
})
},
}
}
</script>
<style src='./index.less' lang="less" scoped></style>
\ No newline at end of file
This diff is collapsed.
<template>
<picker @change="bindPickerChange" @columnchange="columnchange" :range="array" range-key="name" :value="value" mode="multiSelector">
<slot></slot>
</picker>
</template>
<script>
import AllAddress from './data.js'
let selectVal = ['','','']
let selectCode = ['','','']
export default {
data() {
return{
value: [0,0,0],
array: [],
index: 0
}
},
created() {
this.initSelect()
},
methods:{
// 初始化地址选项
initSelect() {
this.updateSourceDate() // 更新源数据
.updateAddressDate() // 更新结果数据
.updateAddressCode()// 更新结果数据
.$forceUpdate() // 触发双向绑定
},
// 地址控件改变控件
columnchange(d) {
this.updateSelectIndex(d.detail.column, d.detail.value) // 更新选择索引
.updateSourceDate() // 更新源数据
.updateAddressDate() // 更新结果数据
.updateAddressCode()// 更新结果数据
.$forceUpdate() // 触发双向绑定
},
/**
* 更新源数据
* */
updateSourceDate() {
this.array = []
this.array[0] = AllAddress.map(obj => {
return {
name: obj.provinceName,
cityCode:obj.provinceCode
}
})
this.array[1] = AllAddress[this.value[0]].city.map(obj => {
return {
name: obj.cityName,
cityCode:obj.cityCode
}
})
this.array[2] = AllAddress[this.value[0]].city[this.value[1]].county.map(obj => {
return {
name: obj.countyName,
cityCode:obj.countyCode
}
})
return this
},
/**
* 更新索引
* */
updateSelectIndex(column, value){
let arr = JSON.parse(JSON.stringify(this.value))
arr[column] = value
if(column === 0 ) {
arr[1] = 0
arr[2] = 0
}
if(column === 1 ) {
arr[2] = 0
}
this.value = arr
return this
},
/**
* 更新结果数据
* */
updateAddressDate() {
selectVal[0] = this.array[0][this.value[0]].name
selectVal[1] = this.array[1][this.value[1]].name
selectVal[2] = this.array[2][this.value[2]].name
return this
},
updateAddressCode() {
selectCode[0] = this.array[0][this.value[0]].cityCode
selectCode[1] = this.array[1][this.value[1]].cityCode
selectCode[2] = this.array[2][this.value[2]].cityCode
return this
},
/**
* 点击确定
* */
bindPickerChange(e) {
this.$emit('change', {
index: selectCode,
data: selectVal
})
return this
}
}
}
</script>
<style>
</style>
......@@ -2,20 +2,22 @@ import App from './App'
// #ifndef VUE3
import Vue from 'vue'
Vue.config.productionTip = false
Vue.config.productionTip = false
App.mpType = 'app'
import mixin from './mixin/index'
import Modal from './components/modal/modal'
import goodsItem from './components/goodsItem/index'
import bankList from './components/bankList/bankList'
import request from './utils/request.js'
Vue.component('view-modal', Modal);
Vue.component('bank-list', bankList);
Vue.component('view-goods', goodsItem);
Vue.prototype.$request = request
Vue.mixin(mixin)
const app = new Vue({
...App
})
const app = new Vue({
...App
})
app.$mount()
// #endif
......@@ -26,5 +28,5 @@ export function createApp() {
return {
app
}
}
}
// #endif
\ No newline at end of file
......@@ -3,7 +3,7 @@
"appid" : "__UNI__DE04B13",
"description" : "",
"versionName" : "1.0.0",
"versionCode" : 101,
"versionCode" : 102,
"transformPx" : false,
/* 5+App特有相关 */
"app-plus" : {
......@@ -28,6 +28,8 @@
"permissions" : [
"<uses-feature android:name=\"android.hardware.camera\"/>",
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.CALL_PHONE\"/>",
......@@ -39,6 +41,7 @@
"<uses-permission android:name=\"android.permission.INTERNET\"/>",
"<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>",
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
"<uses-permission android:name=\"android.permission.READ_CONTACTS\"/>",
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
"<uses-permission android:name=\"android.permission.RECORD_AUDIO\"/>",
......@@ -53,17 +56,27 @@
"ios" : {
"dSYMs" : false,
"privacyDescription" : {
"NSLocationWhenInUseUsageDescription" : "",
"NSLocationAlwaysUsageDescription" : "",
"NSLocationAlwaysAndWhenInUseUsageDescription" : "",
"NSPhotoLibraryUsageDescription" : "为了给您提供意见反馈服务,请允许访问您的相册信息"
"NSLocationWhenInUseUsageDescription" : "为保护您账户安全,便于为您提供所在区域专属产品和服务,请您开启定位权限",
"NSLocationAlwaysUsageDescription" : "为保护您账户安全,便于为您提供所在区域专属产品和服务,请您开启定位权限",
"NSLocationAlwaysAndWhenInUseUsageDescription" : "为保护您账户安全,便于为您提供所在区域专属产品和服务,请您开启定位权限",
"NSPhotoLibraryUsageDescription" : "为了给您提供意见反馈服务,请允许访问您的相册信息",
"NSCameraUsageDescription" : "以便于您可以使用正常使用身份证认证、刷脸、申请借款等功能"
},
"idfa" : false
},
/* SDK配置 */
"sdkConfigs" : {
"ad" : {},
"geolocation" : {}
"geolocation" : {
"system" : {
"__platform__" : [ "ios", "android" ]
},
"amap" : {
"__platform__" : [ "ios", "android" ],
"appkey_ios" : "219171ea69d16fa01856326bfce37395",
"appkey_android" : "d5eb8009720b7ef9e540d1869d3c5f15"
}
}
},
"icons" : {
"android" : {
......@@ -109,7 +122,25 @@
},
/* 模块配置 */
"modules" : {
"Camera" : {}
"Camera" : {},
"Contacts" : {},
"Geolocation" : {}
},
"nativePlugins" : {
"AThree-LFv2" : {
"__plugin_info__" : {
"name" : "LFv2",
"description" : "LFv2",
"platforms" : "Android,iOS",
"url" : "",
"android_package_name" : "",
"ios_bundle_id" : "",
"isCloud" : false,
"bought" : -1,
"pid" : "",
"parameters" : {}
}
}
}
},
/* 快应用特有相关 */
......
//
// LFLivenessDetetorManager.h
// LFLivenessSDK
//
// Created by linkface on 2019/6/20.
// Copyright © 2019 linkface. All rights reserved.
//
#import <UIKit/UIKit.h>
#import <AVFoundation/AVFoundation.h>
#import "LFLivenessEnumType.h"
NS_ASSUME_NONNULL_BEGIN
@protocol LFLivenessDetetorManagerDelegate <NSObject>
/**
* 活体检测成功回调
*
* @param data 回传加密后的二进制数据
* @param arrLFImage 根据指定输出方案回传 LFImage 数组 , LFImage属性见 LFImage.h
* @param lfVideoData 传 NSData hack接口数据
*/
- (void)livenessDidSuccessfulGetData:(nullable NSData *)data
lfImages:(nullable NSArray *)arrLFImage
lfVideoData:(nullable NSData *)lfVideoData;
/**
* 活体检测失败回调
*
* @param iErrorType 失败的类型
* @param iDetectionType 失败时的检测模块类型
* @param iDetectionIndex 失败时的检测模块在动作序列中的位置, 从0开始
* @param data 回传加密后的二进制数据
* @param arrLFImage 根据指定输出方案回传 LFImage 数组 , LFImage属性见 LFImage.h
* @param lfVideoData 根据指定输出方案回传 NSData 视频数据
*/
- (void)livenessDidFailWithErrorType:(LivefaceErrorType)iErrorType
detectionType:(LivefaceDetectionType)iDetectionType
detectionIndex:(int)iDetectionIndex
data:(nullable NSData *)data
lfImages:(nullable NSArray *)arrLFImage
lfVideoData:(nullable NSData *)lfVideoData;
/**
* 活体检测被取消的回调
*
* @param iDetectionType 检测被取消时的检测模块类型
* @param iDetectionIndex 检测被取消时的检测模块在动作序列中的位置, 从0开始
*/
- (void)livenessDidCancelWithDetectionType:(LivefaceDetectionType)iDetectionType
detectionIndex:(int)iDetectionIndex;
/**
返回人脸数据是否符合要求和人脸对应的屏幕面积
@param faceChange 人脸光线亮度相关
@param faceArea 人脸面积
*/
- (void)livenessDidFaceChange:(LivefaceChangeValue)faceChange faceArea:(int)faceArea facePose:(LivefaceChangeValue)facePose;
/**
loading 动画是调用该方法;
@param image 动作图片用于高斯模糊使用
*/
- (void)livenessLoadingViewAnimation:(UIImage *)image;
@optional
/**
* 每个检测模块开始的回调方法
*
* @param iDetectionType 当前开始检测的模块类型
* @param iDetectionIndex 当前开始检测的模块在动作序列中的位置, 从0开始.
*/
- (void)livenessDidStartDetectionWithDetectionType:(LivefaceDetectionType)iDetectionType
detectionIndex:(int)iDetectionIndex;
/**
* 每一帧数据回调一次,回调当前模块已用时间及当前模块允许的最大处理时间.
*
* @param dPast 当前模块检测已用时间
* @param dDurationPerModel 当前模块检测总时间
*/
- (void)livenessTimeDidPast:(double)dPast
durationPerModel:(double)dDurationPerModel;
/** 帧率 */
- (void)videoFrameRate:(int)rate;
- (void)lfLivenessDetetorManagerX:(float)xNum yNum:(float)yNum arrM:(NSMutableArray*)arrM;
- (void)lfLivenessDetetorTop3:(NSMutableArray*)arrM;
@end
typedef void(^LFLivenessDetetorResultBlock)(NSString *token, NSDictionary *result);
@interface LFLivenessDetetorManager : NSObject
@property(nonatomic,weak)id <LFLivenessDetetorManagerDelegate>delegate;
/**
Debug
*/
@property(nonatomic,assign) BOOL bDebug;
/// 张嘴阈值
@property (nonatomic, assign) float LFMouth;
/// 点头阈值
@property (nonatomic, assign) float LFLowAndUpPitch;
/// 摇头阈值
@property (nonatomic, assign) float LFYaw;
/// 眨眼阈值
@property (nonatomic, assign) float LFOpenEye;
/**
* 初始化方法 使用默认model名称
*
*
* @param dDurationPerModel 每个模块允许的最大检测时间,小于等于0时为不设置超时时间.
* @param strBundlePath 资源路径 可nil
*
* @return 活体检测器实例
*/
- (instancetype)initWithDuration:(double)dDurationPerModel
resourcesBundlePath:( NSString * _Nullable )strBundlePath;
/**
* 校验Token
* 由于 token 的唯一性,每一次调用 startDetection 检测方法都需要重新初始化该 Manager.
*
* @param token token 必传 时效性5分钟
* @param callback 返回校验结果
*
*/
- (void)checkToken:(NSString * _Nullable )token
callback:(LFLivenessDetetorResultBlock)callback;
/**
* 对连续输入帧进行人脸跟踪及活体检测
*
* @param sampleBuffer 每一帧的图像数据
*/
- (void)trackAndDetectWithCMSampleBuffer:(CMSampleBufferRef)sampleBuffer;
/**
* 活体检测器配置方法
* @param delegate 回调代理
* @param queue 回调线程
* @param arrDetection 动作序列, 如 @[ @(LIVE_MOUTH) ,@(LIVE_NOD) ,@(LIVE_YAW)] , 参照 LFLivenessEnumType.h
*/
- (void)setDelegate:(id <LFLivenessDetetorManagerDelegate>)delegate
callBackQueue:(dispatch_queue_t)queue
detectionSequence:(NSArray *)arrDetection;
/**
* 设置活体检测器默认输出方案及难易度, 可根据需求在 startDetection 之前调用使生效 , 且需要在调用setDelegate:callBackQueue:detectionSequence:之后调用.
*
* @param iOutputType 活体检测成功后的输出方案, 默认为 LIVE_OUTPUT_SINGLE_IMAGE
* @param iComplexity 活体检测的复杂度, 默认为 LIVE_COMPLEXITY_NORMAL
*/
- (void)setOutputType:(LivefaceOutputType)iOutputType
complexity:(LivefaceComplexity)iComplexity;
/**
* 设置活体检测器是否输出视频 可根据需求在 startDetection 之前调用使生效 , 且需要在调用setDelegate:callBackQueue:detectionSequence:之后调用.
*
* @param outVideo 活体检测器是否输出视频, 默认为YES
* @param videoQuality 活体检测器视频质量, 默认为低质量 LIVE_LOW_QUALITY_VIDEO
*/
- (void)setOutVideo:(BOOL)outVideo videoQuality:(LivefaceVideoQualityType)videoQuality;
/**
识别结果等待loading
@param loadingView 要执行的等待动画视图
@param complete 等待完成回调
*/
- (void)loadingViewBlock:(void(^)(void))loadingView complete:(void(^)(void))complete;
/**
* 开始检测, 检测的输出方案以及难易程度为之前最近一次调用 setOutputType:complexity: 所指定方案及难易程度.
*/
- (void)startDetection;
/**
* 取消检测
*/
- (void)cancelDetection;
/**
* 获取SDK版本
*
* @return SDK版本字符串信息
*/
+ (NSString *)getSDKVersion;
@end
NS_ASSUME_NONNULL_END
//
// LFLivenessEnumType.h
// LFLivenessDetector
//
// Copyright (c) 2017-2018 LINKFACE Corporation. All rights reserved.
//
#ifndef LFLivenessEnumType_h
#define LFLivenessEnumType_h
/**
* 活体检测失败类型
*/
typedef NS_ENUM(NSInteger, LivefaceErrorType) {
/**
* 算法SDK初始化失败
*/
LIVENESS_INIT_FAILD = 0,
/**
* 相机权限获取失败
*/
LIVENESS_CAMERA_ERROR,
/**
* token验证未通过,无效token
*/
LIVENESS_TOKEN_INVALID,
/**
* token验证未通过,bundle_id未绑定
*/
LIVENESS_TOKEN_UNBOUND,
/**
* token验证失败
*/
LIVENESS_TOKEN_ERROR,
/**
* 人脸变更
*/
LIVENESS_FACE_CHANGED,
/**
* 检测超时
*/
LIVENESS_TIMEOUT,
/**
* 应用即将被挂起
*/
LIVENESS_WILL_RESIGN_ACTIVE,
/**
* 内部错误
*/
LIVENESS_INTERNAL_ERROR,
/**
* 其他错误
*/
LINENESS_OTHER_ERROR,
/**
* 中途人脸变更
*/
LIVENESS_FACE_CHANGED_WAY,
};
typedef NS_ENUM(NSInteger,LivefaceChangeValue){
/**
* 没有人脸
*/
LIVE_FACE_NO = 0,
/**
* 太近了
*/
LIVE_FACE_FAR,
/**
* 太远了
*/
LIVE_FACE_NEAR,
/**
* 多张人脸
*/
LIVE_FACE_MANY,
/**
* 检测到人脸
*/
LIVE_FACE_HAVE,
/**
* 人脸符合要求
*/
LIVE_FACE_NOMAL,
/**
* 光线太暗了
*
*/
LIVE_FACE_NOENOUGH_LIGHT,
/**
* 光线太亮了
*
*/
LIVE_FACE_TOO_LIGHT,
/**
* 手机晃动
*
*/
LIVE_FACE_SHAKE,
/**
* 请正对屏幕
*
*/
LIVE_FACE_POSE_ERROR
};
/**
* 检测模块类型
*/
typedef NS_ENUM(NSInteger, LivefaceDetectionType) {
/**
* 未定义类型
*/
LIVE_NONE = 0,
/**
* 眨眼检测
*/
LIVE_BLINK,
/**
* 张嘴检测
*/
LIVE_MOUTH,
/**
* 上下点头检测
*/
LIVE_NOD,
/**
* 左右转头检测
*/
LIVE_YAW
};
/**
* 输出方案
*/
typedef NS_ENUM(NSUInteger, LivefaceOutputType) {
/**
* 单图方案
*/
LIVE_OUTPUT_SINGLE_IMAGE,
/**
* 多图方案
*/
LIVE_OUTPUT_MULTI_IMAGE,
};
/**
* 活体检测复杂度
*/
typedef NS_ENUM(NSUInteger, LivefaceComplexity) {
/**
* 简单, 人脸变更时不会回调 LIVENESS_FACE_CHANGED 错误, 活体阈值低
*/
LIVE_COMPLEXITY_EASY,
/**
* 一般, 人脸变更时会回调 LIVENESS_FACE_CHANGED 错误, 活体阈值较低
*/
LIVE_COMPLEXITY_NORMAL,
/**
* 较难, 人脸变更时会回调 LIVENESS_FACE_CHANGED 错误, 活体阈较高
*/
LIVE_COMPLEXITY_HARD,
/**
* 困难, 人脸变更时会回调 LIVENESS_FACE_CHANGED 错误, 活体阈值高
*/
LIVE_COMPLEXITY_HELL
};
/**
* 视频质量
*/
typedef NS_ENUM(NSUInteger, LivefaceVideoQualityType) {
/**
* 低质量视频方案
*/
LIVE_LOW_QUALITY_VIDEO,
/**
* 高质量视频方案
*/
LIVE_HIGH_QUALITY_VIDEO
};
#endif /* LFLivenessEnumType_h */
//
// LFLivenessSDK.h
// LFLivenessSDK
//
// Created by linkface on 2019/6/19.
// Copyright © 2019 linkface. All rights reserved.
//
#import <UIKit/UIKit.h>
//! Project version number for LFLivenessSDK.
FOUNDATION_EXPORT double LFLivenessSDKVersionNumber;
//! Project version string for LFLivenessSDK.
FOUNDATION_EXPORT const unsigned char LFLivenessSDKVersionString[];
// In this header, you should import all the public headers of your framework using statements like #import <LFLivenessSDK/PublicHeader.h>
#import "LFLivenessDetetorManager.h"
#import "LFLivenessEnumType.h"
framework module LFLivenessSDK {
umbrella header "LFLivenessSDK.h"
export *
module * { export * }
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>files</key>
<dict>
<key>Headers/LFLivenessDetetorManager.h</key>
<data>
EUxCWiFCGOQ+xe/1wUDv0rta60I=
</data>
<key>Headers/LFLivenessEnumType.h</key>
<data>
2NT8Th0GwxG0a3aCn0vUC6O00sE=
</data>
<key>Headers/LFLivenessSDK.h</key>
<data>
vy+vVRCZ+Z3dWU1kHFUGfKzotCU=
</data>
<key>Info.plist</key>
<data>
Sk8vXE5496A9jLETLgWi+g0Hz4c=
</data>
<key>Modules/module.modulemap</key>
<data>
6+fccUNmAtAoOz3ERF0RMn4KK4k=
</data>
</dict>
<key>files2</key>
<dict>
<key>Headers/LFLivenessDetetorManager.h</key>
<dict>
<key>hash</key>
<data>
EUxCWiFCGOQ+xe/1wUDv0rta60I=
</data>
<key>hash2</key>
<data>
ffOgQSwzJQJFdL21KHEZhfdSLRXHEsE2euee04FkjkQ=
</data>
</dict>
<key>Headers/LFLivenessEnumType.h</key>
<dict>
<key>hash</key>
<data>
2NT8Th0GwxG0a3aCn0vUC6O00sE=
</data>
<key>hash2</key>
<data>
aB9G5bBpuVAbyrmCmPXXydwTMEblXuciHN8uscLXHKM=
</data>
</dict>
<key>Headers/LFLivenessSDK.h</key>
<dict>
<key>hash</key>
<data>
vy+vVRCZ+Z3dWU1kHFUGfKzotCU=
</data>
<key>hash2</key>
<data>
5d4e+0A8ZkiOqFbVEZ8ovdGxZysFFTfFS4EhwSqV+Gk=
</data>
</dict>
<key>Modules/module.modulemap</key>
<dict>
<key>hash</key>
<data>
6+fccUNmAtAoOz3ERF0RMn4KK4k=
</data>
<key>hash2</key>
<data>
IcHY7lnWsW165aGHScAjR2lLu4OOLdp8NrYUqREfPCo=
</data>
</dict>
</dict>
<key>rules</key>
<dict>
<key>^.*</key>
<true/>
<key>^.*\.lproj/</key>
<dict>
<key>optional</key>
<true/>
<key>weight</key>
<real>1000</real>
</dict>
<key>^.*\.lproj/locversion.plist$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>1100</real>
</dict>
<key>^Base\.lproj/</key>
<dict>
<key>weight</key>
<real>1010</real>
</dict>
<key>^version.plist$</key>
<true/>
</dict>
<key>rules2</key>
<dict>
<key>.*\.dSYM($|/)</key>
<dict>
<key>weight</key>
<real>11</real>
</dict>
<key>^(.*/)?\.DS_Store$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>2000</real>
</dict>
<key>^.*</key>
<true/>
<key>^.*\.lproj/</key>
<dict>
<key>optional</key>
<true/>
<key>weight</key>
<real>1000</real>
</dict>
<key>^.*\.lproj/locversion.plist$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>1100</real>
</dict>
<key>^Base\.lproj/</key>
<dict>
<key>weight</key>
<real>1010</real>
</dict>
<key>^Info\.plist$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>20</real>
</dict>
<key>^PkgInfo$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>20</real>
</dict>
<key>^embedded\.provisionprofile$</key>
<dict>
<key>weight</key>
<real>20</real>
</dict>
<key>^version\.plist$</key>
<dict>
<key>weight</key>
<real>20</real>
</dict>
</dict>
</dict>
</plist>
//
// LFBankCard.h
// LinkfaceForOCRNew
//
// Created by linkface on 2019/3/26.
// Copyright © 2019 SenseTime. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface LFBankCard : NSObject
// appID
@property (nonatomic, copy) NSString *appID;
// appSecret
@property (nonatomic, copy) NSString *appSecret;
// 拍照
@property (nonatomic, assign) NSInteger isAuto;
// 横竖卡
@property (nonatomic, assign) NSInteger isVertical;
// 亮度值,默认128
@property (nonatomic, assign) NSInteger brightNumber;
@property (nonatomic, strong) UIImage *imgOriginCaptured; // 摄像头捕捉到的图像
@property (nonatomic, strong) UIImage *imgOriginCroped; // 摄像头捕捉到的框内的图像
@property (nonatomic, strong) UIImage *imgCardDetected; // 检测出的卡片图像(裁剪图)
@property (nonatomic, strong) UIImage *imgCardNumber; // 检测出的卡片号码图片
@property (nonatomic, copy) NSString *strVersion; // SDK版本号
@property (nonatomic, copy) NSString *request_id; // request_id
@property (nonatomic, copy) NSString *strNumber; // 卡号
@property (nonatomic, copy) NSString *strBankName; // 银行名称
@property (nonatomic, copy) NSString *strBankIdentificationNumber; // 银行编号
@property (nonatomic, copy) NSString *strCardName; // 卡片名称
@property (nonatomic, copy) NSString *strCardType; // 卡片类型
@property (nonatomic, copy) NSString *strSpacedNumber; // 带空格的卡号
@property (nonatomic, strong, readonly) NSData *encryptedData; // 加密数据
/*! @brief bDebug 调试开关(控制NSLog的输出)
*/
@property (nonatomic, assign) BOOL bDebug;
@property (nonatomic, assign) BOOL isScanVerticalCard; // 是否扫描竖卡
@property (nonatomic, assign) BOOL shouldFullCard; //是否卡片完整才返回
/*!
* @brief LFBankCard 初始化函数
*
* 在使用银行卡识别功能之前调用, 可以初始化一次,多次进行银行卡识别。
* @param modelPath bankcard路径
* @param extraPath bankextra路径
* @return 如果数据完整,初始化成功,返回 LFBankCard 对象;否则返回 nil 。
*/
- (instancetype)initWithModelPath:(NSString *)modelPath extraPath:(NSString *)extraPath;
- (instancetype)init NS_UNAVAILABLE;
/*! @brief recognizeCard 接口提供银行卡检测和识别功能,用于图片输入
*
* 上传图片最大大小 5MB,图片分辨率最大支持 3000px*3000px,过小分辨率可能导致识别不出小的文字
* @param imageCard 上传的图片
* @return 检测识别结果的状态。
* 0 : 识别失败
* 1 : 识别成功
* 当识别成功后,离线版请在上述成员变量strNumber, numberType 中获取识别结果 在线版返回加密数据 encryptedData
*/
- (int)recognizeCard:(UIImage *)imageCard Complete:(void (^)(BOOL success))complete;
/*! @brief recognizeCardWithBuffer 接口提供银行卡检测和识别功能,用于视频帧数据输入
*
* @param pImageCard 视频帧数据,格式是BGRA格式
* @param iWidth 视频帧图像的宽度
* @param iHeight 视频帧图像的高度
* @return 检测识别结果的状态。
* 0 : 识别失败
* 1 : 识别成功
* 当识别成功后,在线版请在上述成员变量strNumber, numberType 中获取识别结果 离线版返回加密数据 encryptedData
*/
- (int)recognizeCardWithBuffer:(unsigned char *)pImageCard width:(int)iWidth height:(int)iHeight;
// 获取SDK版本号
+ (NSString *)getSDKVersion;
@end
NS_ASSUME_NONNULL_END
//
// LFIDCard.h
// LinkfaceForOCRNew
//
// Created by linkface on 2019/3/26.
// Copyright © 2019 SenseTime. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
typedef NS_ENUM(NSInteger, LFIDCardMode) {
kIDCardSmart = 0, //身份证正面反面智能检测
kIDCardFrontal, //身份证正面
kIDCardBack, //身份证背面
};
typedef NS_ENUM(NSInteger, LFIDCardSide) {
LFIDCardSideBack = 1, //身份证背面
LFIDCardSideFront, //身份证正面
};
typedef NS_ENUM(NSInteger, LFIDCardType) {
LFIDCardTypeUnknow = 0, ///< 未知
LFIDCardTypeNormal, ///< 正常身份证
LFIDCardTypeTemp ///< 临时身份证
};
typedef NS_OPTIONS(uint32_t, LFIDCardItemOption) {
kIDCardItemAll = 0, ///全部包括
kIDCardItemName = 1 << 0, ///< 姓名
kIDCardItemSex = 1 << 1, ///< 性别
kIDCardItemNation = 1 << 2, ///< 民族
kIDCardItemBirthday = 1 << 3, ///< 生日
kIDCardItemAddr = 1 << 4, ///< 地址
kIDCardItemNum = 1 << 5, ///< 身份证号
kIDCardItemAuthority = 1 << 6, ///< 签发机关
kIDCardItemTimelimit = 1 << 7, ///< 有效期限
};
@interface LFIDCard : NSObject
// 是否开启人像返回
@property (nonatomic, assign) BOOL returnPortrait;
// appID
@property (nonatomic, copy) NSString *appID;
// appSecret
@property (nonatomic, copy) NSString *appSecret;
// 拍照
@property (nonatomic, assign) NSInteger isAuto;
// 横竖卡
@property (nonatomic, assign) NSInteger isVertical;
// 亮度值,默认128
@property (nonatomic, assign) NSInteger brightNumber;
@property (nonatomic, copy) NSString *strVersion; //SDK版本号
// Foreground Content
@property (nonatomic, copy) NSString *request_id; //request_id
@property (nonatomic, copy) NSString *strName; //姓名
@property (nonatomic, copy) NSString *strSex; //性别
@property (nonatomic, copy) NSString *strNation; //民族
@property (nonatomic, copy) NSString *strYear; //出生年
@property (nonatomic, copy) NSString *strMonth; //出生月
@property (nonatomic, copy) NSString *strDay; //出生日
@property (nonatomic, copy) NSString *strAddress; //住址
@property (nonatomic, copy) NSString *strID; //公民身份证号
// Background Content
@property (nonatomic, copy) NSString *strAuthority; //签发机关
@property (nonatomic, copy) NSString *strValidity; //有效期
// Image of Card & Face
@property (nonatomic, strong) UIImage *imgOriginCaptured; //摄像头捕捉到的图像
@property (nonatomic, strong) UIImage *imgOriginCroped; //摄像头捕捉到的框内的图像
@property (nonatomic, strong) UIImage *imgCardDetected; //检测出的卡片图像(裁剪图)
@property (nonatomic, strong) UIImage *imgCardFace; //检测出的卡片人像
// Image of each Result
@property (nonatomic, strong) UIImage *imgName; //姓名
@property (nonatomic, strong) UIImage *imgSex; //性别
@property (nonatomic, strong) UIImage *imgNation; //民族
@property (nonatomic, strong) UIImage *imgYear; //出生年
@property (nonatomic, strong) UIImage *imgMonth; //出生月
@property (nonatomic, strong) UIImage *imgDay; //出生日
@property (nonatomic, strong) UIImage *imgAddress; //住址
@property (nonatomic, strong) UIImage *imgID; //公民身份证号
@property (nonatomic, strong) UIImage *imgAuthority; //签发机关
@property (nonatomic, strong) UIImage *imgValidity; //有效期
@property (nonatomic, assign) CGRect rectName; //姓名
@property (nonatomic, assign) CGRect rectSex; //性别
@property (nonatomic, assign) CGRect rectNation; //民族
@property (nonatomic, assign) CGRect rectYear; //出生年
@property (nonatomic, assign) CGRect rectMonth; //出生月
@property (nonatomic, assign) CGRect rectDay; //出生日
@property (nonatomic, assign) CGRect rectAddress; //住址
@property (nonatomic, assign) CGRect rectID; //公民身份证号
@property (nonatomic, assign) CGRect rectAuthority; //签发机关
@property (nonatomic, assign) CGRect rectValidity; //有效期
@property (nonatomic, copy) NSString *strDate; //出生年月日
@property (nonatomic, strong) UIImage *imgDate; //出生年月日
//身份证类型,(normal:正常拍摄、photocopy:复印件、PS:照片PS、reversion:翻拍、other:其他)
@property (nonatomic, copy) NSString *type;
/*! @brief iMode 控制识别身份证哪个面:
* 0 - kIDCardFrontal - 正面 ,
* 1 - kIDCardBack - 反面,
* 2 - kIDCardBothSides - 双面识别
* 3 - kIDCardSmart - 智能检测 (default)
*/
@property (nonatomic, assign) LFIDCardMode iMode;
@property (nonatomic, assign) BOOL shouldFullCard; //是否卡片完整才返回
// 表示检测到的身份证是那个面
@property (nonatomic) LFIDCardSide side;
/*! @brief bFaceExist 是否存在人像
*/
@property (nonatomic, assign) BOOL bFaceExist;
/*! @brief bDebug 调试开关(控制NSLog的输出)
*/
@property (nonatomic, assign) BOOL bDebug;
/*
是否开启身份证类型检测
*/
@property (nonatomic, assign) BOOL returnType;
/*!
* @brief LFBankCard 初始化函数
*
* 在使用银行卡识别功能之前调用, 可以初始化一次,多次进行银行卡识别。
* @param modelPath bankcard路径
* @param extraPath bankextra路径
* @return 如果数据完整,初始化成功,返回 LFBankCard 对象;否则返回 nil 。
*/
- (instancetype)initWithModelPath:(NSString *)modelPath extraPath:(NSString *)extraPath;
- (instancetype)init NS_UNAVAILABLE;
/*! @brief recognizeCard 接口提供身份证检测和识别功能,用于图片输入
*
* 上传图片最大大小 5MB,图片分辨率最大支持 3000px*3000px,过小分辨率可能导致识别不出小的文字
* @param imageCard 上传的图片
* @return 检测识别结果的状态。
* -2 : 无图像
* -1 : 检测不成功
* -3 : 检测成功, Alignment 不成功 (v3.4)
* 0 : 检测成功,识别不成功
* 1 : 识别有误,校验不成功
* 2 : 识别成功
* 当识别成功后,离线版请在上述成员变量strName, ... , strAuthority 中获取识别结果 在线版返回加密数据 encryptedData
* 也可调用下面的【getFrontalInfo 】函数获取识别结果
* 也可调用下面的【getBackSideInfo】函数获取识别结果
*/
- (int)recognizeCard:(UIImage *)imageCard complete:(void (^)(BOOL success))complete;
/*! @brief recognizeCardWithBuffer 接口提供身份证检测和识别功能,用于视频帧数据输入
*
* @param pImageCard 视频帧数据,格式是BGRA格式
* @param iWidth 视频帧图像的宽度
* @param iHeight 视频帧图像的高度
* @return 检测识别结果的状态。
* -2 : 无图像
* -1 : 检测不成功
* -3 : 检测成功, Alignment 不成功 (v3.4)
* 0 : 检测成功,识别不成功
* 1 : 识别有误,校验不成功
* 2 : 识别成功
* 当识别成功后,离线版请在上述成员变量strName, ... , strAuthority 中获取识别结果 在线版返回加密数据 encryptedData
* 也可调用下面的【getFrontalInfo 】函数获取识别结果的正面文字信息
* 也可调用下面的【getBackSideInfo】函数获取识别结果的背面文字信息
*/
- (int)recognizeCardWithBuffer:(unsigned char *)pImageCard width:(int)iWidth height:(int)iHeight;
- (int)recognizeCardWithBuffer:(CVPixelBufferRef)pixelBuffer;
- (void)setRecognizeItemsOptions:(LFIDCardItemOption)option;
// 获取SDK版本号
+ (NSString *)getSDKVersion;
//验证token
+ (void)authIDCardToken:(NSString *)token complete:(void (^)(BOOL success, NSURLResponse *response, NSData *data, NSError *connectionError))complete;
@end
NS_ASSUME_NONNULL_END
//
// OCR_SDK.h
// OCR_SDK
//
// Created by linkface on 2019/4/2.
// Copyright © 2019 linkface. All rights reserved.
//
#import <UIKit/UIKit.h>
//! Project version number for OCR_SDK.
FOUNDATION_EXPORT double OCR_SDKVersionNumber;
//! Project version string for OCR_SDK.
FOUNDATION_EXPORT const unsigned char OCR_SDKVersionString[];
// In this header, you should import all the public headers of your framework using statements like #import <OCR_SDK/PublicHeader.h>
#import "LFBankCard.h"
#import "LFIDCard.h"
framework module OCR_SDK {
umbrella header "OCR_SDK.h"
export *
module * { export * }
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment