|
@@ -17,7 +17,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
-@interface JYNewSearchViewController ()<WKNavigationDelegate,WKUIDelegate,WKScriptMessageHandler,CLLocationManagerDelegate,UINavigationControllerDelegate,UIImagePickerControllerDelegate,CLLocationManagerDelegate,SKProductsRequestDelegate,SKPaymentTransactionObserver,ZKClipboardViewDelegate,WBFaceVerifyCustomerServiceDelegate,UIDocumentPickerDelegate>
|
|
|
+@interface JYNewSearchViewController ()<WKNavigationDelegate,WKUIDelegate,WKScriptMessageHandler,CLLocationManagerDelegate,UINavigationControllerDelegate,UIImagePickerControllerDelegate,CLLocationManagerDelegate,SKProductsRequestDelegate,SKPaymentTransactionObserver,ZKClipboardViewDelegate,UIDocumentPickerDelegate>
|
|
|
{
|
|
|
NSInteger pushIndex;//第几个模块过来的
|
|
|
BOOL isLoadRedDot;
|
|
@@ -373,10 +373,6 @@ NSString *const new_AesKey_1 = @"mGlAgnIBB8bx2nch";
|
|
|
[self jsClearRight:message.body];
|
|
|
}else if ([message.name isEqualToString:@"savePic"]) {
|
|
|
[self jsSavePic:message.body];
|
|
|
- }else if ([message.name isEqualToString:@"ocrVerifyService"]) {
|
|
|
- [self jsOcrVerifyService:message.body];
|
|
|
- }else if ([message.name isEqualToString:@"faceVerifyService"]) {
|
|
|
- [self jsFaceVerifyService:message.body];
|
|
|
}else if ([message.name isEqualToString:@"skipAppointTab"]) {
|
|
|
[self jsSkipAppointTab:message.body];
|
|
|
}else if ([message.name isEqualToString:@"refreshAppointTab"]) {
|
|
@@ -1262,89 +1258,6 @@ NSString *const new_AesKey_1 = @"mGlAgnIBB8bx2nch";
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-#pragma mark *****人脸核身
|
|
|
-//ocr验证
|
|
|
--(void)jsOcrVerifyService:(NSDictionary *)dict{
|
|
|
- NSLog(@"ocr:%@",dict);
|
|
|
- NSString *orderNo = [NSString stringWithFormat:@"%@",dict[@"orderNo"]];
|
|
|
- NSString *nonce = [NSString stringWithFormat:@"%@",dict[@"nonce"]];
|
|
|
- NSString *userId = [NSString stringWithFormat:@"%@",dict[@"userId"]];
|
|
|
- NSString *sign = [NSString stringWithFormat:@"%@",dict[@"sign"]];
|
|
|
- kMainQueue((^{
|
|
|
- WBOCRConfig *config = [WBOCRConfig sharedConfig];
|
|
|
- config.needRecordVideo = NO;
|
|
|
- config.SDKType = WBOCRSDKTypeIDCardNormal; // 身份证两面识别
|
|
|
- [[WBOCRService sharedService] startOCRServiceWithConfig:config version:@"1.0.0" appId:OCRAPPID nonce:nonce userId:userId sign:sign orderNo:orderNo startSucceed:^{
|
|
|
- /** SDK服务拉起成功回调 */
|
|
|
- NSLog(@"启动SDK成功!!!");
|
|
|
- } recognizeSucceed:^(id _Nonnull resultModel, id _Nullable extension) {
|
|
|
- /** SDK本次识别成功回调 */
|
|
|
- NSLog(@"SDK识别成功!!!");
|
|
|
- //调用js - 告知成功
|
|
|
- NSString *textJS = [NSString stringWithFormat:@"ocrVerifyResult('%@')",orderNo];
|
|
|
- [self isExitCallToJS:textJS withMethodName:@"ocrVerifyResult"];
|
|
|
- } failed:^(NSError * _Nonnull error, id _Nullable extension) {
|
|
|
- /** SDK异常回调 */
|
|
|
- NSLog(@"识别出错!!!"); //200101 用户取消操作
|
|
|
- //弹出页面
|
|
|
- if (error.code == 200101) {
|
|
|
- self.verifyMsgView.descTitle = @"您取消了身份验证";
|
|
|
- }else {
|
|
|
- self.verifyMsgView.descTitle = @"身份验证失败";
|
|
|
- }
|
|
|
- [self.verifyMsgView show];
|
|
|
-
|
|
|
- NSString *textJS = [NSString stringWithFormat:@"ocrVerifyResult('%@')",@""];
|
|
|
- [self isExitCallToJS:textJS withMethodName:@"ocrVerifyResult"];
|
|
|
-
|
|
|
- }];
|
|
|
- }));
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-}
|
|
|
-//人脸核身
|
|
|
--(void)jsFaceVerifyService:(NSDictionary *)dict {
|
|
|
- NSLog(@"face:%@",dict);
|
|
|
- NSString *orderNo = [NSString stringWithFormat:@"%@",dict[@"orderNo"]];
|
|
|
- NSString *nonce = [NSString stringWithFormat:@"%@",dict[@"nonce"]];
|
|
|
- NSString *userId = [NSString stringWithFormat:@"%@",dict[@"userId"]];
|
|
|
- NSString *sign = [NSString stringWithFormat:@"%@",dict[@"sign"]];
|
|
|
- NSString *faceId = [NSString stringWithFormat:@"%@",dict[@"faceId"]];
|
|
|
- kMainQueue((^{
|
|
|
- [WBFaceVerifyCustomerService sharedInstance].delegate = self;
|
|
|
- WBFaceVerifySDKConfig *config = [WBFaceVerifySDKConfig sdkConfig];
|
|
|
- config.recordVideo = NO;
|
|
|
- config.theme = WBFaceVerifyThemeDarkness;
|
|
|
- [[WBFaceVerifyCustomerService sharedInstance] loginInLiveCheckAndCompareWithSourceImageService:userId nonce:nonce sign:sign appid:OCRAPPID orderNo:orderNo apiVersion:@"1.0.0" licence:LICENCE faceType:WBFaceVerifyLivingType_Action faceId:faceId sdkConfig:config success:^{
|
|
|
-
|
|
|
- } failure:^(WBFaceError * _Nonnull error) {
|
|
|
-
|
|
|
- }];
|
|
|
- }));
|
|
|
-}
|
|
|
-
|
|
|
-#pragma mark - WBFaceVerifyCustomerServiceDelegate
|
|
|
--(void)wbfaceVerifyCustomerServiceDidFinishedWithFaceVerifyResult:(WBFaceVerifyResult *)faceVerifyResult{
|
|
|
- if (faceVerifyResult.isSuccess) {
|
|
|
- NSLog(@"活体检测成功:%@",faceVerifyResult.orderNo);
|
|
|
- NSString *textJS = [NSString stringWithFormat:@"faceVerifyResult('%@')",faceVerifyResult.orderNo];
|
|
|
- [self isExitCallToJS:textJS withMethodName:@"faceVerifyResult"];
|
|
|
- self.verifyMsgView.descTitle = @"活体检测成功";
|
|
|
- [self.verifyMsgView show];
|
|
|
- }else {
|
|
|
- NSLog(@"活体检测失败");
|
|
|
- self.verifyMsgView.descTitle = @"活体检测失败";
|
|
|
- [self.verifyMsgView show];
|
|
|
-
|
|
|
- NSString *textJS = [NSString stringWithFormat:@"faceVerifyResult('%@')",@""];
|
|
|
- [self isExitCallToJS:textJS withMethodName:@"faceVerifyResult"];
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-
|
|
|
//保存图片到相册
|
|
|
#pragma mark 保存图片
|
|
|
-(void)jsSavePic:(NSDictionary *)dict {
|