Commit a23a9e66 authored by ly's avatar ly

多典花更新

parent 95918c17
No preview for this file type
......@@ -20,4 +20,6 @@ yarn-error.log*
*.njsproj
*.sln
*.sw*
.history
\ No newline at end of file
.history
.DS_Store
/unpackage
......@@ -15,6 +15,10 @@
{
"playground" : "custom",
"type" : "uni-app:app-android"
},
{
"playground" : "custom",
"type" : "uni-app:app-ios"
}
]
}
<script>
// import { convertPromise } from './utils/header.js'
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() {
const common = uni.getStorageSync("m-headers")
if (!common) {
// this.loadDevice();
this.loadDevice();
this.loadNetwork();
// this.loadLocation();
this.loadLocation();
this.loadUuid()
}
plus.screen.lockOrientation("portrait-primary")
......@@ -99,32 +99,32 @@
});
},
// 获取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')
......
/**
* base : 基础业务API
* buyer : 买家API
*/
// 开发环境
const BASE = {
development: {
common: "http://portal.cloudsmake.cn",
buyer: "https://dell-buyer.billionsat.net",
h5:'http://192.168.0.23:8080/index.html#/loan'
},
stest: {
common: "https://dell-common.meimeiyouxin.com",
buyer: "https://dell-buyer.meimeiyouxin.com",
h5:'https://mmyx-h5-s.rockstect.cn/index.html#/'
},
ltest: {
common: "https://dell-common-l.meimeiyouxin.com",
buyer: "https://dell-buyer-l.meimeiyouxin.com",
h5:''
},
gray: {
common: "https://dell-common.meimeiyouxin.com",
buyer: "https://dell-buyer.meimeiyouxin.com",
h5:'https://mmyx-h5-g.rockstect.com/index.html#/'
},
prod: {
common: "https://api.yyhock.com",
buyer: "https://dell-buyer.meimeiyouxin.com",
h5:'https://mmyx-h5.rockstect.com/index.html#/'
}
}
let env = process.env.VUE_APP_BASE_NODE_ENV
/**
* ==========================
* APP打包运行需自定义环境env *
* development 开发环境 *
* stest S测试环境 *
* ltest L测试环境
* gray 灰度环境 *
* prod 生产环境 *
* ==========================
*/
// #ifdef APP-PLUS
env = "development";
// #endif
console.log("env", env);
const api = {
common: BASE[env].common,
buyer: BASE[env].buyer,
h5:BASE[env].h5
}
export default {
...api,
env,
};
const name = "花花有米"; //全局商城name
const schemeName = 'huahuayoumi' //唤醒app需要的schemeName
export default {
name: name,
schemeLink: `${schemeName}://`, //唤起app地址
downloadLink: "https://www.meimeiyouxin.com/download.html", //下载地址,下载app的地址
shareLink: "https://mobile.meimeiyouxin.com", //分享地址,也就是在h5中默认的复制地址
appid: "wxb8881aa695481bec", //小程序唯一凭证,即 AppID,可在「微信公众平台 - 设置 - 开发设置」页中获得。(需要已经成为开发者,且帐号没有异常状态)
aMapKey: "d04c16e59eab35d19812634b2b7cb548", //在高德中申请Web服务key
scanAuthNavigation:['https://mobile.meimeiyouxin.com'], //扫码认证跳转域名配置 会根据此处配置的路由进行跳转
iosAppId:"id6450257420", //AppStore的应用地址id 具体在分享->拷贝链接中查看
logo:"https://mmyx-res.meimeiyouxin.com/huahuayoumi/logo.png", //logo地址
customerServiceMobile:"4001035066", //客服电话
customerServiceEmail:"hhym@huahuayoumi.com", //客服邮箱
customerServiceUrl: "https://chatbot.aliyuncs.com/intl/index.htm?from=Knv39Casa0", // 阿里云客服
imWebSrc:"", //IM地址
enableGetClipboard: false, //是否启用粘贴板获取 scanAuthNavigation 中的链接,如果匹配则会跳转到对应页面
enableMiniBarStartUpApp: true, //是否在h5中右侧浮空按钮点击启动app
/**
* 如需更换主题请修改此处以及uni.scss中的全局颜色
*/
mainColor: "#ff9f28", // 主题色
lightColor: "#FF6E26", // 高亮主题色
aiderLightColor: "#ff9f28", // 辅助高亮颜色
};
......@@ -2,7 +2,7 @@
"name" : "多典花",
"appid" : "__UNI__DE04B13",
"description" : "",
"versionName" : "1.0.0",
"versionName" : "1.0.1",
"versionCode" : 101,
"transformPx" : false,
/* 5+App特有相关 */
......@@ -73,7 +73,17 @@
/* SDK配置 */
"sdkConfigs" : {
"ad" : {},
"geolocation" : {}
"geolocation" : {
"system" : {
"__platform__" : [ "ios", "android" ]
},
"amap" : {
"name" : "amap_13669606635BrsJEpZoq",
"__platform__" : [ "ios", "android" ],
"appkey_ios" : "219171ea69d16fa01856326bfce37395",
"appkey_android" : "d5eb8009720b7ef9e540d1869d3c5f15"
}
}
},
"icons" : {
"android" : {
......@@ -123,7 +133,26 @@
},
/* 模块配置 */
"modules" : {
"Camera" : {}
"Camera" : {},
"Geolocation" : {},
"Contacts" : {},
"Barcode" : {}
},
"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.
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