Browse Source

人脸核身

apple 5 years ago
parent
commit
00a202a5e4

+ 6 - 10
ios/JianYuIOS/JianYuIOS.xcodeproj/project.pbxproj

@@ -7,6 +7,7 @@
 	objects = {
 
 /* Begin PBXBuildFile section */
+		1810C2B024E4E1D8006B8232 /* ZKFaceVerifyMsgView.m in Sources */ = {isa = PBXBuildFile; fileRef = 1810C2AF24E4E1D8006B8232 /* ZKFaceVerifyMsgView.m */; };
 		182ECCFB22FD221100FFC79E /* qidongye@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 182ECCFA22FD221000FFC79E /* qidongye@2x.png */; };
 		182ECCFD22FD223A00FFC79E /* logo.png in Resources */ = {isa = PBXBuildFile; fileRef = 182ECCFC22FD223A00FFC79E /* logo.png */; };
 		183DDB9224961EA400F58FB5 /* dropload.js in Resources */ = {isa = PBXBuildFile; fileRef = 183DDB6B24961EA400F58FB5 /* dropload.js */; };
@@ -102,8 +103,6 @@
 		C550BF342018590A00F0BC2A /* libsqlite3.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = C550BF332018590A00F0BC2A /* libsqlite3.tbd */; };
 		C550BF362018591400F0BC2A /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C550BF352018591400F0BC2A /* CoreGraphics.framework */; };
 		C555EC282047DC5E0084642F /* LXNetworkManager.m in Sources */ = {isa = PBXBuildFile; fileRef = C555EC262047DC5E0084642F /* LXNetworkManager.m */; };
-		C55FF3BF20230E7E0088AECC /* NewWebController.m in Sources */ = {isa = PBXBuildFile; fileRef = C55FF3BD20230E7E0088AECC /* NewWebController.m */; };
-		C55FF3C020230E7E0088AECC /* NewWebController.xib in Resources */ = {isa = PBXBuildFile; fileRef = C55FF3BE20230E7E0088AECC /* NewWebController.xib */; };
 		C5B194D4202EA46D00F0AC76 /* arrowLeft@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = C5B194D3202EA46C00F0AC76 /* arrowLeft@2x.png */; };
 		C5BE6E422011D99100F28B36 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C5BE6E402011D99100F28B36 /* Main.storyboard */; };
 		C5BE6E442011D99100F28B36 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C5BE6E432011D99100F28B36 /* Assets.xcassets */; };
@@ -135,6 +134,8 @@
 		0CA962A24EED00910F83394E /* libPods-JianYuIOS.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-JianYuIOS.a"; sourceTree = BUILT_PRODUCTS_DIR; };
 		10D9BC27D00CB4DF3F791728 /* Pods-JianYuIOS.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-JianYuIOS.release.xcconfig"; path = "Pods/Target Support Files/Pods-JianYuIOS/Pods-JianYuIOS.release.xcconfig"; sourceTree = "<group>"; };
 		1800141B24CFC19200EEC1AF /* 剑鱼标讯Debug.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = "剑鱼标讯Debug.entitlements"; sourceTree = "<group>"; };
+		1810C2AE24E4E1D8006B8232 /* ZKFaceVerifyMsgView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ZKFaceVerifyMsgView.h; sourceTree = "<group>"; };
+		1810C2AF24E4E1D8006B8232 /* ZKFaceVerifyMsgView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ZKFaceVerifyMsgView.m; sourceTree = "<group>"; };
 		182ECCFA22FD221000FFC79E /* qidongye@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "qidongye@2x.png"; sourceTree = "<group>"; };
 		182ECCFC22FD223A00FFC79E /* logo.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = logo.png; sourceTree = "<group>"; };
 		183DDB6B24961EA400F58FB5 /* dropload.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = dropload.js; sourceTree = "<group>"; };
@@ -267,9 +268,6 @@
 		C550BF352018591400F0BC2A /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
 		C555EC262047DC5E0084642F /* LXNetworkManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LXNetworkManager.m; sourceTree = "<group>"; };
 		C555EC272047DC5E0084642F /* LXNetworkManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LXNetworkManager.h; sourceTree = "<group>"; };
-		C55FF3BC20230E7E0088AECC /* NewWebController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NewWebController.h; sourceTree = "<group>"; };
-		C55FF3BD20230E7E0088AECC /* NewWebController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = NewWebController.m; sourceTree = "<group>"; };
-		C55FF3BE20230E7E0088AECC /* NewWebController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = NewWebController.xib; sourceTree = "<group>"; };
 		C5B194D3202EA46C00F0AC76 /* arrowLeft@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "arrowLeft@2x.png"; sourceTree = "<group>"; };
 		C5BE6E372011D99100F28B36 /* 剑鱼标讯.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "剑鱼标讯.app"; sourceTree = BUILT_PRODUCTS_DIR; };
 		C5BE6E412011D99100F28B36 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
@@ -397,6 +395,8 @@
 			children = (
 				18C78C0E24E240CE001208F2 /* ZKClipboardView.h */,
 				18C78C0C24E240CE001208F2 /* ZKClipboardView.m */,
+				1810C2AE24E4E1D8006B8232 /* ZKFaceVerifyMsgView.h */,
+				1810C2AF24E4E1D8006B8232 /* ZKFaceVerifyMsgView.m */,
 				18C78C0D24E240CE001208F2 /* ZKModal.h */,
 				18C78C0F24E240CE001208F2 /* ZKModal.m */,
 			);
@@ -582,9 +582,6 @@
 				18C9D8E6219A5F9F001AC829 /* UITabBar+badge.m */,
 				1859ECB324923B290046A36F /* JYNewWebController.h */,
 				1859ECB424923B290046A36F /* JYNewWebController.m */,
-				C55FF3BC20230E7E0088AECC /* NewWebController.h */,
-				C55FF3BD20230E7E0088AECC /* NewWebController.m */,
-				C55FF3BE20230E7E0088AECC /* NewWebController.xib */,
 				C550BEF520180AF000F0BC2A /* AppDelegate.h */,
 				C550BEF620180AF000F0BC2A /* AppDelegate.m */,
 				C5BE6E402011D99100F28B36 /* Main.storyboard */,
@@ -742,7 +739,6 @@
 				C5D01D7E20282543007F207E /* back_normal@2x.png in Resources */,
 				183DDB9324961EA400F58FB5 /* template-web.js in Resources */,
 				183DDBA424961EA400F58FB5 /* 20200522173921005m1D95f05.png in Resources */,
-				C55FF3C020230E7E0088AECC /* NewWebController.xib in Resources */,
 				18E05CFB22F11CDE001E5B44 /* AlipaySDK.bundle in Resources */,
 				183DDBB024961EA400F58FB5 /* fastclick.min.js in Resources */,
 				183DDB9D24961EA400F58FB5 /* vue-router.min.js in Resources */,
@@ -862,7 +858,6 @@
 			files = (
 				1859ECB524923B290046A36F /* JYNewWebController.m in Sources */,
 				18EF1114232F683C006D4579 /* UIDevice+Hardware.m in Sources */,
-				C55FF3BF20230E7E0088AECC /* NewWebController.m in Sources */,
 				C519972D2020238D007946E8 /* LXMD5.m in Sources */,
 				18C9D8E7219A5F9F001AC829 /* UITabBar+badge.m in Sources */,
 				C555EC282047DC5E0084642F /* LXNetworkManager.m in Sources */,
@@ -889,6 +884,7 @@
 				18C78C1B24E240CE001208F2 /* ZKModal.m in Sources */,
 				C550BEF920180AF000F0BC2A /* AppDelegate.m in Sources */,
 				18C78C1A24E240CE001208F2 /* ZKClipboardView.m in Sources */,
+				1810C2B024E4E1D8006B8232 /* ZKFaceVerifyMsgView.m in Sources */,
 				18C78C5424E24421001208F2 /* ZKMethod.m in Sources */,
 				18C78C4724E24407001208F2 /* NJKWebViewProgressView.m in Sources */,
 				187B4EE621EC635700A9368D /* GlobalData.m in Sources */,

BIN
ios/JianYuIOS/JianYuIOS.xcworkspace/xcuserdata/apple.xcuserdatad/UserInterfaceState.xcuserstate


+ 3 - 3
ios/JianYuIOS/JianYuIOS/BaseClass1/PrefixHeader.pch

@@ -76,7 +76,6 @@ _Pragma("clang diagnostic pop")\
 #import <JavaScriptCore/JavaScriptCore.h>
 #import <UShareUI/UShareUI.h>
 #import <UMSocialCore/UMSocialCore.h>
-#import "NewWebController.h"
 #import <UMSocialCore/UMSocialCore.h>
 #import <AFNetworking.h>
 #import "NoNetView.h"
@@ -146,6 +145,7 @@ _Pragma("clang diagnostic pop")\
 #import "NJKWebViewProgress.h"
 #import "JYNewWebController.h"
 #import "ZKClipboardView.h"
+#import "ZKFaceVerifyMsgView.h"
 
 
 //#define kHost @"http://web-jydev-ws.jianyu360.cn/" //王山
@@ -156,7 +156,7 @@ _Pragma("clang diagnostic pop")\
 
 //#define kHost @"http://web-jydev-wky.jianyu360.cn/" //王凯悦
 
-#define kHost @"http://web-jydev-zxl.jianyu360.cn/" //张鑫磊
+//#define kHost @"http://web-jydev-zxl.jianyu360.cn/" //张鑫磊
 
 //#define kHost @"http://web-jydev-xzh.jianyu360.cn/" //徐志恒
 
@@ -170,7 +170,7 @@ _Pragma("clang diagnostic pop")\
 //#define kHost @"http://res.jianyu360.com/"    //正式http
 
 
-//#define kHost @"http://app2-jytest.jianyu360.cn/"  //测试http
+#define kHost @"http://app2-jytest.jianyu360.cn/"  //测试http
 //#define kHost @"https://app2-jytest.jianyu360.cn/" //测试https
 
 //#define kHost @"http://app-i1.jianyu360.com/"   //新正式

+ 173 - 9
ios/JianYuIOS/JianYuIOS/Classes(模块)/JYNewExpViewController.m

@@ -11,7 +11,7 @@
 #import "JYTabBarController.h"
 #import <CoreLocation/CoreLocation.h>
 
-@interface JYNewExpViewController ()<WKNavigationDelegate,WKUIDelegate,WKScriptMessageHandler,CLLocationManagerDelegate,UINavigationControllerDelegate,UIImagePickerControllerDelegate,SKProductsRequestDelegate>
+@interface JYNewExpViewController ()<WKNavigationDelegate,WKUIDelegate,WKScriptMessageHandler,CLLocationManagerDelegate,UINavigationControllerDelegate,UIImagePickerControllerDelegate,SKProductsRequestDelegate,ZKClipboardViewDelegate,WBFaceVerifyCustomerServiceDelegate>
 {
     CGPoint startTouch;
     BOOL _isMoving;
@@ -21,7 +21,8 @@
 @property (nonatomic, strong) WKWebView *webView;
 @property(nonatomic, assign)BOOL updateNotify;
 @property(nonatomic, strong)NoNetView *noNetView;
-
+@property(nonatomic, strong)ZKClipboardView *clipboardView;
+@property(nonatomic, strong)ZKFaceVerifyMsgView *verifyMsgView;
 
 @end
 
@@ -38,6 +39,17 @@ NSString *const new_AesKey_3 = @"mGlAgnIBB8bx2nch";
     [self.navigationController setNavigationBarHidden:YES animated:animated];
     
 }
+
+//弹框
+-(ZKFaceVerifyMsgView *)verifyMsgView
+{
+    if(!_verifyMsgView) {
+        _verifyMsgView = [[ZKFaceVerifyMsgView alloc]initWithFrame:CGRectMake(0, 0, WIDTH*0.8, 150)];
+        _verifyMsgView.titleName = @"温馨提示";
+    }
+    return _verifyMsgView;
+}
+
 //进度条
 - (UIProgressView *)progressView
 {
@@ -48,6 +60,16 @@ NSString *const new_AesKey_3 = @"mGlAgnIBB8bx2nch";
     }
     return _progressView;
 }
+//弹框
+-(ZKClipboardView *)clipboardView
+{
+    if(!_clipboardView) {
+        _clipboardView = [[ZKClipboardView alloc]initWithFrame:CGRectMake(0, 0, WIDTH*0.8, 175)];
+        _clipboardView.delegate = self;
+    }
+    return _clipboardView;
+}
+
 //懒加载
 - (WKWebView *)webView
 {
@@ -85,6 +107,9 @@ NSString *const new_AesKey_3 = @"mGlAgnIBB8bx2nch";
                            @"inPurchasingVip",
                            @"wirteRight",
                            @"clearRight",
+                           @"savePic",
+                           @"ocrVerifyService",
+                           @"faceVerifyService",
         ];
         for (NSString*jsName in jsArr) {
             [config.userContentController addScriptMessageHandler:self name:jsName];
@@ -295,6 +320,12 @@ NSString *const new_AesKey_3 = @"mGlAgnIBB8bx2nch";
         [self jsWirteRight:message.body];
     }else if ([message.name isEqualToString:@"clearRight"]) {
         [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 {
         
     }
@@ -872,6 +903,107 @@ NSString *const new_AesKey_3 = @"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:@"getParam"];
+        } failed:^(NSError * _Nonnull error, id  _Nullable extension) {
+            /** SDK异常回调 */
+            NSLog(@"识别出错!!!"); //200101 用户取消操作
+            //弹出页面
+            if (error.code == 200101) {
+                self.verifyMsgView.descTitle = @"您取消了身份验证";
+            }else {
+                self.verifyMsgView.descTitle = @"身份验证失败";
+            }
+            [self.verifyMsgView show];
+            
+        }];
+    }));
+    
+    
+    
+
+}
+//人脸核身
+-(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) {
+            self.verifyMsgView.descTitle = @"活体检测失败";
+            [self.verifyMsgView show];
+        }];
+    }));
+}
+
+#pragma mark - WBFaceVerifyCustomerServiceDelegate
+-(void)wbfaceVerifyCustomerServiceDidFinishedWithFaceVerifyResult:(WBFaceVerifyResult *)faceVerifyResult{
+    if (faceVerifyResult.isSuccess) {
+        NSLog(@"活体检测成功:%@",faceVerifyResult.orderNo);
+        NSString *textJS =  [NSString stringWithFormat:@"faceVerifyResult('%@')",faceVerifyResult.orderNo];
+        [self isExitCallToJS:textJS withMethodName:@"faceEnd"];
+        self.verifyMsgView.descTitle = @"活体检测成功";
+        [self.verifyMsgView show];
+    }else {
+        NSLog(@"活体检测失败");
+        self.verifyMsgView.descTitle = @"活体检测失败";
+        [self.verifyMsgView show];
+    }
+}
+
+    
+//保存图片到相册
+#pragma mark 保存图片
+-(void)jsSavePic:(NSDictionary *)dict {
+    NSString *base64ImgData = [NSString stringWithFormat:@"%@",dict[@"imgbase64"]];
+    base64ImgData = [base64ImgData stringByReplacingOccurrencesOfString:@"data:image/png;base64," withString:@""];
+    NSData *data = [[NSData alloc]initWithBase64EncodedString:base64ImgData options:NSDataBase64DecodingIgnoreUnknownCharacters];
+    UIImage *saveImg = [UIImage imageWithData:data];
+    UIImageWriteToSavedPhotosAlbum(saveImg, self, @selector(image:didFinishSavingWithError:contextInfo:), NULL);
+}
+    
+#pragma mark 系统的完成保存图片的方法
+- (void)image: (UIImage *) image didFinishSavingWithError: (NSError *) error contextInfo: (void *) contextInfo
+{
+    NSString *msg = nil ;
+    if (error != NULL) {
+        msg = @"保存图片失败" ;
+    } else {
+        msg = @"保存图片成功" ;
+    }
+    [[LXViewControllerManager shareViewControllerManager] showHudOnlyText:msg delay:1];
+}
+
+
+
 
 #pragma mark  粘贴板
 -(void)jsWirteRight:(NSDictionary *)dict {
@@ -1266,9 +1398,10 @@ NSString *const new_AesKey_3 = @"mGlAgnIBB8bx2nch";
     }
 }
 -(void)alipayWXpayStatus:(NSNotification *)notification{
-    
-    NSString * status = [notification object];
-    [self performSelector:@selector(payStatus:) withObject:status afterDelay:2];
+     if(self.tabBarController.selectedIndex == 2) {
+         NSString * status = [notification object];
+         [self performSelector:@selector(payStatus:) withObject:status afterDelay:2];
+     }
 }
 -(void)payStatus:(NSString *)status
 {
@@ -1370,15 +1503,46 @@ NSString *const new_AesKey_3 = @"mGlAgnIBB8bx2nch";
 //粘贴板相关-梳理
 -(void)updateClipboard:(NSNotification *)notificaition{
     if(self.tabBarController.selectedIndex == 2) {
+        NSString *current_url = [self stringByEvaluatingJavaScriptFromString:@"document.location.href"];
         NSDictionary *dict = notificaition.userInfo;
         NSString *content = [NSString stringWithFormat:@"%@",dict[@"content"]];
-        //调用js
-        NSString *textJS =  [NSString stringWithFormat:@"distribInfo('%@')",content];
-        [self isExitCallToJS:textJS withMethodName:@"distribInfo"];
-
+        if ([current_url containsString:@"jyapp/free/login"]) {
+            NSLog(@"登录页面-调用js");
+            NSString *textJS =  [NSString stringWithFormat:@"distribInfo('%@')",content];
+            [self isExitCallToJS:textJS withMethodName:@"distribInfo"];
+            
+        }else {
+        
+            [[LXNetworkManager shareLXNetworkManager]postWithURLStr:[NSString stringWithFormat:@"%@distribution/share/getWordInfo",kHost] parameters:@{@"copyTxt":content} progress:^(NSProgress *progress) {
+                NSLog(@"%@",progress);
+            } success:^(id responseObject) {
+                NSLog(@"responseObject=%@",responseObject);
+                if ([responseObject objectForKey:@"data"]) {
+                    NSDictionary *dict = [[NSDictionary alloc]initWithDictionary:responseObject[@"data"]];
+                    self.clipboardView.title =dict[@"title"];
+                    self.clipboardView.subTitle =dict[@"subTitle"];
+                    self.clipboardView.imgUrl =dict[@"imgUrl"];
+                    self.clipboardView.appUrl =dict[@"appUrl"];
+                    self.clipboardView.butTxt =dict[@"butTxt"];
+                    self.clipboardView.bottomTxt =dict[@"bottomTxt"];
+                    [self.clipboardView show];
+                }
+            } failure:^(NSError *error) {
+                NSLog(@"error=%@",error);
+            }];
+        }
     }
 }
 
+#pragma mark  **** 代理方法
+-(void)clipboardClick:(NSString *)url {
+    NSString *tmpUrl = [NSString stringWithFormat:@"%@%@", kHost, url];
+    tmpUrl =  [tmpUrl stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
+    kMainQueue(^{
+        [self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:tmpUrl]]];
+    })
+}
+
 
 -(void)clearWeb{
     NSURLCache * cache = [NSURLCache sharedURLCache];

+ 179 - 9
ios/JianYuIOS/JianYuIOS/Classes(模块)/JYNewMineViewController.m

@@ -21,7 +21,7 @@
 
 
 
-@interface JYNewMineViewController ()<WKNavigationDelegate,WKUIDelegate,WKScriptMessageHandler,CLLocationManagerDelegate,UINavigationControllerDelegate,UIImagePickerControllerDelegate,SKProductsRequestDelegate>
+@interface JYNewMineViewController ()<WKNavigationDelegate,WKUIDelegate,WKScriptMessageHandler,CLLocationManagerDelegate,UINavigationControllerDelegate,UIImagePickerControllerDelegate,SKProductsRequestDelegate,WBFaceVerifyCustomerServiceDelegate,ZKClipboardViewDelegate>
 {
     CGPoint startTouch;
     BOOL _isMoving;
@@ -32,6 +32,8 @@
 @property(nonatomic, assign)BOOL updateNotify;
 @property(nonatomic, strong)NoNetView *noNetView;
 @property(nonatomic, strong)UIPanGestureRecognizer *recognizer;
+@property(nonatomic, strong)ZKClipboardView *clipboardView;
+@property(nonatomic, strong)ZKFaceVerifyMsgView *verifyMsgView;
 
 @end
 
@@ -51,6 +53,17 @@ NSString *const new_AesKey_4 = @"mGlAgnIBB8bx2nch";
         [self webViewFirstRequest];
     }
 }
+
+//弹框
+-(ZKFaceVerifyMsgView *)verifyMsgView
+{
+    if(!_verifyMsgView) {
+        _verifyMsgView = [[ZKFaceVerifyMsgView alloc]initWithFrame:CGRectMake(0, 0, WIDTH*0.8, 150)];
+        _verifyMsgView.titleName = @"温馨提示";
+    }
+    return _verifyMsgView;
+}
+
 //进度条
 - (UIProgressView *)progressView
 {
@@ -61,6 +74,16 @@ NSString *const new_AesKey_4 = @"mGlAgnIBB8bx2nch";
     }
     return _progressView;
 }
+//弹框
+-(ZKClipboardView *)clipboardView
+{
+    if(!_clipboardView) {
+        _clipboardView = [[ZKClipboardView alloc]initWithFrame:CGRectMake(0, 0, WIDTH*0.8, 175)];
+        _clipboardView.delegate = self;
+    }
+    return _clipboardView;
+}
+
 //懒加载
 - (WKWebView *)webView
 {
@@ -98,6 +121,9 @@ NSString *const new_AesKey_4 = @"mGlAgnIBB8bx2nch";
                            @"inPurchasingVip",
                            @"wirteRight",
                            @"clearRight",
+                           @"savePic",
+                           @"ocrVerifyService",
+                           @"faceVerifyService",
         ];
         for (NSString*jsName in jsArr) {
             [config.userContentController addScriptMessageHandler:self name:jsName];
@@ -312,6 +338,12 @@ NSString *const new_AesKey_4 = @"mGlAgnIBB8bx2nch";
         [self jsWirteRight:message.body];
     }else if ([message.name isEqualToString:@"clearRight"]) {
         [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 {
         
     }
@@ -397,7 +429,7 @@ NSString *const new_AesKey_4 = @"mGlAgnIBB8bx2nch";
 -(void)isExitCallToJS:(NSString *)jsStr withMethodName:(NSString *)name{
     NSString *jsName = [NSString stringWithFormat:@"function exist(){return !window['%@']};exist()",name];
     [_webView evaluateJavaScript:jsName completionHandler:^(id _Nullable result, NSError * _Nullable error) {
-        NSLog(@"是否存在 result:%@,error:%@",result,error);
+//        NSLog(@"是否存在 result:%@,error:%@",result,error);
         if ([result intValue]==0) {
             [self executeCallJS:jsStr];
         }else {
@@ -437,6 +469,7 @@ NSString *const new_AesKey_4 = @"mGlAgnIBB8bx2nch";
     
     //监听底部栏
     [NSTimer scheduledTimerWithTimeInterval:3 target:self selector:@selector(bottomFourListening) userInfo:nil repeats:YES];
+ 
 }
 
 -(void)bottomFourListening {
@@ -893,6 +926,107 @@ NSString *const new_AesKey_4 = @"mGlAgnIBB8bx2nch";
         [[LXViewControllerManager shareViewControllerManager] showHudOnlyText:appName delay:2];
     }
 }
+    
+#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:@"getParam"];
+        } failed:^(NSError * _Nonnull error, id  _Nullable extension) {
+            /** SDK异常回调 */
+            NSLog(@"识别出错!!!"); //200101 用户取消操作
+            //弹出页面
+            if (error.code == 200101) {
+                self.verifyMsgView.descTitle = @"您取消了身份验证";
+            }else {
+                self.verifyMsgView.descTitle = @"身份验证失败";
+            }
+            [self.verifyMsgView show];
+            
+        }];
+    }));
+    
+    
+    
+
+}
+//人脸核身
+-(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) {
+            self.verifyMsgView.descTitle = @"活体检测失败";
+            [self.verifyMsgView show];
+        }];
+    }));
+}
+
+#pragma mark - WBFaceVerifyCustomerServiceDelegate
+-(void)wbfaceVerifyCustomerServiceDidFinishedWithFaceVerifyResult:(WBFaceVerifyResult *)faceVerifyResult{
+    if (faceVerifyResult.isSuccess) {
+        NSLog(@"活体检测成功:%@",faceVerifyResult.orderNo);
+        NSString *textJS =  [NSString stringWithFormat:@"faceVerifyResult('%@')",faceVerifyResult.orderNo];
+        [self isExitCallToJS:textJS withMethodName:@"faceEnd"];
+        self.verifyMsgView.descTitle = @"活体检测成功";
+        [self.verifyMsgView show];
+    }else {
+        NSLog(@"活体检测失败");
+        self.verifyMsgView.descTitle = @"活体检测失败";
+        [self.verifyMsgView show];
+    }
+}
+
+    
+//保存图片到相册
+#pragma mark 保存图片
+-(void)jsSavePic:(NSDictionary *)dict {
+    NSString *base64ImgData = [NSString stringWithFormat:@"%@",dict[@"imgbase64"]];
+    base64ImgData = [base64ImgData stringByReplacingOccurrencesOfString:@"data:image/png;base64," withString:@""];
+    NSData *data = [[NSData alloc]initWithBase64EncodedString:base64ImgData options:NSDataBase64DecodingIgnoreUnknownCharacters];
+    UIImage *saveImg = [UIImage imageWithData:data];
+    UIImageWriteToSavedPhotosAlbum(saveImg, self, @selector(image:didFinishSavingWithError:contextInfo:), NULL);
+}
+    
+#pragma mark 系统的完成保存图片的方法
+- (void)image: (UIImage *) image didFinishSavingWithError: (NSError *) error contextInfo: (void *) contextInfo
+{
+    NSString *msg = nil ;
+    if (error != NULL) {
+        msg = @"保存图片失败" ;
+    } else {
+        msg = @"保存图片成功" ;
+    }
+    [[LXViewControllerManager shareViewControllerManager] showHudOnlyText:msg delay:1];
+}
+    
+    
 
 #pragma mark  粘贴板
 -(void)jsWirteRight:(NSDictionary *)dict {
@@ -1300,9 +1434,10 @@ NSString *const new_AesKey_4 = @"mGlAgnIBB8bx2nch";
     }
 }
 -(void)alipayWXpayStatus:(NSNotification *)notification{
-    
-    NSString * status = [notification object];
-    [self performSelector:@selector(payStatus:) withObject:status afterDelay:2];
+     if(self.tabBarController.selectedIndex == 3) {
+         NSString * status = [notification object];
+         [self performSelector:@selector(payStatus:) withObject:status afterDelay:2];
+     }
 }
 -(void)payStatus:(NSString *)status
 {
@@ -1403,15 +1538,50 @@ NSString *const new_AesKey_4 = @"mGlAgnIBB8bx2nch";
 //粘贴板相关-梳理
 -(void)updateClipboard:(NSNotification *)notificaition{
     if(self.tabBarController.selectedIndex == 3) {
+        NSString *current_url = [self stringByEvaluatingJavaScriptFromString:@"document.location.href"];
         NSDictionary *dict = notificaition.userInfo;
         NSString *content = [NSString stringWithFormat:@"%@",dict[@"content"]];
-        //调用js
-        NSString *textJS =  [NSString stringWithFormat:@"distribInfo('%@')",content];
-        [self isExitCallToJS:textJS withMethodName:@"distribInfo"];
-    
+        if ([current_url containsString:@"jyapp/free/login"]) {
+            NSLog(@"登录页面-调用js");
+            NSString *textJS =  [NSString stringWithFormat:@"distribInfo('%@')",content];
+            [self isExitCallToJS:textJS withMethodName:@"distribInfo"];
+            
+        }else {
+        
+            [[LXNetworkManager shareLXNetworkManager]postWithURLStr:[NSString stringWithFormat:@"%@distribution/share/getWordInfo",kHost] parameters:@{@"copyTxt":content} progress:^(NSProgress *progress) {
+                NSLog(@"%@",progress);
+            } success:^(id responseObject) {
+                NSLog(@"responseObject=%@",responseObject);
+                if ([responseObject objectForKey:@"data"]) {
+                    NSDictionary *dict = [[NSDictionary alloc]initWithDictionary:responseObject[@"data"]];
+                    self.clipboardView.title =dict[@"title"];
+                    self.clipboardView.subTitle =dict[@"subTitle"];
+                    self.clipboardView.imgUrl =dict[@"imgUrl"];
+                    self.clipboardView.appUrl =dict[@"appUrl"];
+                    self.clipboardView.butTxt =dict[@"butTxt"];
+                    self.clipboardView.bottomTxt =dict[@"bottomTxt"];
+                    [self.clipboardView show];
+                }
+            } failure:^(NSError *error) {
+                NSLog(@"error=%@",error);
+            }];
+        }
     }
 }
 
+#pragma mark  **** 代理方法
+-(void)clipboardClick:(NSString *)url {
+    NSString *tmpUrl = [NSString stringWithFormat:@"%@%@", kHost, url];
+    tmpUrl =  [tmpUrl stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
+    kMainQueue(^{
+        [self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:tmpUrl]]];
+    })
+}
+
+
+
+
+
 
 -(void)clearWeb{
     NSURLCache * cache = [NSURLCache sharedURLCache];

+ 91 - 96
ios/JianYuIOS/JianYuIOS/Classes(模块)/JYNewSearchViewController.m

@@ -40,7 +40,7 @@
 @property(nonatomic, strong)NoNetView *noNetView;
 @property(nonatomic, strong)UIPanGestureRecognizer *recognizer;
 @property(nonatomic, strong)ZKClipboardView *clipboardView;
-
+@property(nonatomic, strong)ZKFaceVerifyMsgView *verifyMsgView;
 
 
 
@@ -59,7 +59,17 @@ NSString *const new_AesKey_1 = @"mGlAgnIBB8bx2nch";
     [super viewWillAppear:animated];
     [self.navigationController setNavigationBarHidden:YES animated:animated];
 }
-////弹框
+
+//弹框
+-(ZKFaceVerifyMsgView *)verifyMsgView
+{
+    if(!_verifyMsgView) {
+        _verifyMsgView = [[ZKFaceVerifyMsgView alloc]initWithFrame:CGRectMake(0, 0, WIDTH*0.8, 150)];
+        _verifyMsgView.titleName = @"温馨提示";
+    }
+    return _verifyMsgView;
+}
+//弹框
 -(ZKClipboardView *)clipboardView
 {
     if(!_clipboardView) {
@@ -530,42 +540,29 @@ NSString *const new_AesKey_1 = @"mGlAgnIBB8bx2nch";
     [[SKPaymentQueue defaultQueue] addTransactionObserver:self];
 
     
-    
-    
-    for (int i=0; i<10000; i++) {
-        
-    }
-    NSLog(@"测试");
-
-    UIButton *btn1 = [ZKControl createButtonWithFrame:CGRectMake(100, 200, 50, 50) title:@"ocr" imageName:nil bgImageName:nil target:self method:@selector(btn1click)];
-    UIButton *btn2 = [ZKControl createButtonWithFrame:CGRectMake(200, 200, 50, 50) title:@"face" imageName:nil bgImageName:nil target:self method:@selector(btn2click)];
-    [self.view addSubview:btn1];
-    [self.view addSubview:btn2];
-
-  
 }
 
 
--(void)btn1click{
-    //调用接口
-    [[LXNetworkManager shareLXNetworkManager]postWithURLStr:[NSString stringWithFormat:@"%@jyapp/tencentcloud/ocr",kHost] parameters:nil progress:^(NSProgress *progress) {
-    } success:^(id responseObject) {
-        NSLog(@"responseObject=%@",responseObject);
-        [self jsOcrVerifyService:responseObject[@"data"]];
-    } failure:^(NSError *error) {
-    
-    }];
-}
--(void)btn2click{
-    //调用接口
-    [[LXNetworkManager shareLXNetworkManager]postWithURLStr:[NSString stringWithFormat:@"%@jyapp/tencentcloud/ocr",kHost] parameters:@{@"token":[LXUserDefaults token]} progress:^(NSProgress *progress) {
-    } success:^(id responseObject) {
-        NSLog(@"responseObject=%@",responseObject);
-        [self jsFaceVerifyService:responseObject[@"data"]];
-    } failure:^(NSError *error) {
-    
-    }];
-}
+//-(void)btn1click{
+//    //调用接口
+//    [[LXNetworkManager shareLXNetworkManager]postWithURLStr:[NSString stringWithFormat:@"%@jyapp/tencentcloud/ocr",kHost] parameters:nil progress:^(NSProgress *progress) {
+//    } success:^(id responseObject) {
+//        NSLog(@"responseObject=%@",responseObject);
+//        [self jsOcrVerifyService:responseObject[@"data"]];
+//    } failure:^(NSError *error) {
+//
+//    }];
+//}
+//-(void)btn2click{
+//    //调用接口
+//    [[LXNetworkManager shareLXNetworkManager]postWithURLStr:[NSString stringWithFormat:@"%@jyapp/tencentcloud/ocr",kHost] parameters:@{@"token":[LXUserDefaults token]} progress:^(NSProgress *progress) {
+//    } success:^(id responseObject) {
+//        NSLog(@"responseObject=%@",responseObject);
+//        [self jsFaceVerifyService:responseObject[@"data"]];
+//    } failure:^(NSError *error) {
+//
+//    }];
+//}
 
 
 
@@ -1195,33 +1192,38 @@ NSString *const new_AesKey_1 = @"mGlAgnIBB8bx2nch";
 }
 
 
-
-
-
-
-
 #pragma mark   *****人脸核身
 //ocr验证
 -(void)jsOcrVerifyService:(NSDictionary *)dict{
-    NSLog(@"ocr-%@",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((^{
-        NSString *orderNo = [NSString stringWithFormat:@"%@",dict[@"orderNo"]];
-        NSString *nonce = [NSString stringWithFormat:@"%@",dict[@"nonce"]];
-        NSString *userId = [NSString stringWithFormat:@"%@",dict[@"userId"]];
-        NSString *sign = [NSString stringWithFormat:@"%@",dict[@"sign"]];
         WBOCRConfig *config = [WBOCRConfig sharedConfig];
         config.needRecordVideo = NO;
         config.SDKType = WBOCRSDKTypeIDCardNormal; // 身份证两面识别
-        [[WBOCRService sharedService] startOCRServiceWithConfig:[WBOCRConfig sharedConfig] version:@"1.0.0" appId:OCRAPPID nonce:nonce userId:userId sign:sign orderNo:orderNo startSucceed:^{
+        [[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:@"getParam"];
         } failed:^(NSError * _Nonnull error, id  _Nullable extension) {
             /** SDK异常回调 */
-            NSLog(@"识别出错!!!");
-            NSLog(@"error:%@",error);
+            NSLog(@"识别出错!!!"); //200101 用户取消操作
+            //弹出页面
+            if (error.code == 200101) {
+                self.verifyMsgView.descTitle = @"您取消了身份验证";
+            }else {
+                self.verifyMsgView.descTitle = @"身份验证失败";
+            }
+            [self.verifyMsgView show];
+            
         }];
     }));
     
@@ -1231,60 +1233,42 @@ NSString *const new_AesKey_1 = @"mGlAgnIBB8bx2nch";
 }
 //人脸核身
 -(void)jsFaceVerifyService:(NSDictionary *)dict {
-
-    WBFaceVerifySDKConfig *config = [WBFaceVerifySDKConfig sdkConfig];
-    config.recordVideo = NO;
-    config.theme = WBFaceVerifyThemeDarkness;
-//    [WBFaceVerifyCustomerService sharedInstance].delegate = self;
+    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"]];
-//    WBFaceUserInfo *userInfo = [[WBFaceUserInfo alloc] init];
-//    userInfo.idType = @"01";
-//    userInfo.name = @"xxxx";
-//    userInfo.idNo = @"xxxx";
-    
     kMainQueue((^{
-        [[WBFaceVerifyCustomerService sharedInstance] loginInLiveCheckAndCompareWithSourceImageService:userId nonce:nonce sign:sign appid:OCRAPPID orderNo:orderNo apiVersion:@"1.0.0" licence:LICENCE faceType:WBFaceVerifyLivingType_Action faceId:faceId sdkConfig:[WBFaceVerifySDKConfig sdkConfig] success:^{
-            NSLog(@"识别成功");
+        [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) {
-            NSLog(@"识别出错!!!");
-            NSString *message = [NSString stringWithFormat:@"%@", error.desc];
-            NSLog(@"message: %@", message);
-            NSLog(@"error: %@", error);
+            self.verifyMsgView.descTitle = @"活体检测失败";
+            [self.verifyMsgView show];
         }];
     }));
 }
 
-
-
-
-
-#pragma mark  粘贴板
--(void)jsWirteRight:(NSDictionary *)dict {
-    NSString *txt = [NSString stringWithFormat:@"%@",dict[@"txt"]];
-    [[UIPasteboard generalPasteboard]setString:txt];
-}
--(void)jsClearRight:(NSDictionary *)dict {
-    //清粘贴板数据
-    [[UIPasteboard generalPasteboard]setString:@""];
-}
--(NSString *)jsReadRight:(NSDictionary *)dict {
-    NSString  *content = [UIPasteboard generalPasteboard].string;
-    return content;
+#pragma mark - WBFaceVerifyCustomerServiceDelegate
+-(void)wbfaceVerifyCustomerServiceDidFinishedWithFaceVerifyResult:(WBFaceVerifyResult *)faceVerifyResult{
+    if (faceVerifyResult.isSuccess) {
+        NSLog(@"活体检测成功:%@",faceVerifyResult.orderNo);
+        NSString *textJS =  [NSString stringWithFormat:@"faceVerifyResult('%@')",faceVerifyResult.orderNo];
+        [self isExitCallToJS:textJS withMethodName:@"faceEnd"];
+        self.verifyMsgView.descTitle = @"活体检测成功";
+        [self.verifyMsgView show];
+    }else {
+        NSLog(@"活体检测失败");
+        self.verifyMsgView.descTitle = @"活体检测失败";
+        [self.verifyMsgView show];
+    }
 }
 
-
-
-
-
-
-
-
-
-
+    
 //保存图片到相册
 #pragma mark 保存图片
 -(void)jsSavePic:(NSDictionary *)dict {
@@ -1294,7 +1278,7 @@ NSString *const new_AesKey_1 = @"mGlAgnIBB8bx2nch";
     UIImage *saveImg = [UIImage imageWithData:data];
     UIImageWriteToSavedPhotosAlbum(saveImg, self, @selector(image:didFinishSavingWithError:contextInfo:), NULL);
 }
-
+    
 #pragma mark 系统的完成保存图片的方法
 - (void)image: (UIImage *) image didFinishSavingWithError: (NSError *) error contextInfo: (void *) contextInfo
 {
@@ -1312,9 +1296,19 @@ NSString *const new_AesKey_1 = @"mGlAgnIBB8bx2nch";
 
 
 
-
-
-
+#pragma mark  粘贴板
+-(void)jsWirteRight:(NSDictionary *)dict {
+    NSString *txt = [NSString stringWithFormat:@"%@",dict[@"txt"]];
+    [[UIPasteboard generalPasteboard]setString:txt];
+}
+-(void)jsClearRight:(NSDictionary *)dict {
+    //清粘贴板数据
+    [[UIPasteboard generalPasteboard]setString:@""];
+}
+-(NSString *)jsReadRight:(NSDictionary *)dict {
+    NSString  *content = [UIPasteboard generalPasteboard].string;
+    return content;
+}
 
 
 
@@ -1878,9 +1872,10 @@ NSString *const new_AesKey_1 = @"mGlAgnIBB8bx2nch";
     }
 }
 -(void)alipayWXpayStatus:(NSNotification *)notification{
-    
-    NSString * status = [notification object];
-    [self performSelector:@selector(payStatus:) withObject:status afterDelay:2];
+    if(self.tabBarController.selectedIndex == 0) {
+        NSString * status = [notification object];
+        [self performSelector:@selector(payStatus:) withObject:status afterDelay:2];
+    }
 }
 -(void)payStatus:(NSString *)status
 {

+ 175 - 9
ios/JianYuIOS/JianYuIOS/Classes(模块)/JYNewSubViewController.m

@@ -11,7 +11,7 @@
 #import "JYTabBarController.h"
 #import <CoreLocation/CoreLocation.h>
 
-@interface JYNewSubViewController ()<WKNavigationDelegate,WKUIDelegate,WKScriptMessageHandler,CLLocationManagerDelegate,UINavigationControllerDelegate,UIImagePickerControllerDelegate,SKProductsRequestDelegate>
+@interface JYNewSubViewController ()<WKNavigationDelegate,WKUIDelegate,WKScriptMessageHandler,CLLocationManagerDelegate,UINavigationControllerDelegate,UIImagePickerControllerDelegate,SKProductsRequestDelegate,ZKClipboardViewDelegate,WBFaceVerifyCustomerServiceDelegate>
 {
     CGPoint startTouch;
     BOOL _isMoving;
@@ -21,7 +21,8 @@
 @property (nonatomic, strong) WKWebView *webView;
 @property(nonatomic, assign)BOOL updateNotify;
 @property(nonatomic, strong)NoNetView *noNetView;
-
+@property(nonatomic, strong)ZKClipboardView *clipboardView;
+@property(nonatomic, strong)ZKFaceVerifyMsgView *verifyMsgView;
 
 @end
 
@@ -46,6 +47,17 @@ NSString *const new_AesKey_2 = @"mGlAgnIBB8bx2nch";
         }
     }
 }
+
+//弹框
+-(ZKFaceVerifyMsgView *)verifyMsgView
+{
+    if(!_verifyMsgView) {
+        _verifyMsgView = [[ZKFaceVerifyMsgView alloc]initWithFrame:CGRectMake(0, 0, WIDTH*0.8, 150)];
+        _verifyMsgView.titleName = @"温馨提示";
+    }
+    return _verifyMsgView;
+}
+
 //进度条
 - (UIProgressView *)progressView
 {
@@ -56,6 +68,17 @@ NSString *const new_AesKey_2 = @"mGlAgnIBB8bx2nch";
     }
     return _progressView;
 }
+//弹框
+-(ZKClipboardView *)clipboardView
+{
+    if(!_clipboardView) {
+        _clipboardView = [[ZKClipboardView alloc]initWithFrame:CGRectMake(0, 0, WIDTH*0.8, 175)];
+        _clipboardView.delegate = self;
+    }
+    return _clipboardView;
+}
+
+
 //懒加载
 - (WKWebView *)webView
 {
@@ -93,6 +116,9 @@ NSString *const new_AesKey_2 = @"mGlAgnIBB8bx2nch";
                            @"inPurchasingVip",
                            @"wirteRight",
                            @"clearRight",
+                           @"savePic",
+                           @"ocrVerifyService",
+                           @"faceVerifyService",
         ];
         for (NSString*jsName in jsArr) {
             [config.userContentController addScriptMessageHandler:self name:jsName];
@@ -299,6 +325,12 @@ NSString *const new_AesKey_2 = @"mGlAgnIBB8bx2nch";
         [self jsWirteRight:message.body];
     }else if ([message.name isEqualToString:@"clearRight"]) {
         [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 {
         
     }
@@ -881,6 +913,106 @@ NSString *const new_AesKey_2 = @"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:@"getParam"];
+        } failed:^(NSError * _Nonnull error, id  _Nullable extension) {
+            /** SDK异常回调 */
+            NSLog(@"识别出错!!!"); //200101 用户取消操作
+            //弹出页面
+            if (error.code == 200101) {
+                self.verifyMsgView.descTitle = @"您取消了身份验证";
+            }else {
+                self.verifyMsgView.descTitle = @"身份验证失败";
+            }
+            [self.verifyMsgView show];
+            
+        }];
+    }));
+    
+    
+    
+
+}
+//人脸核身
+-(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) {
+            self.verifyMsgView.descTitle = @"活体检测失败";
+            [self.verifyMsgView show];
+        }];
+    }));
+}
+
+#pragma mark - WBFaceVerifyCustomerServiceDelegate
+-(void)wbfaceVerifyCustomerServiceDidFinishedWithFaceVerifyResult:(WBFaceVerifyResult *)faceVerifyResult{
+    if (faceVerifyResult.isSuccess) {
+        NSLog(@"活体检测成功:%@",faceVerifyResult.orderNo);
+        NSString *textJS =  [NSString stringWithFormat:@"faceVerifyResult('%@')",faceVerifyResult.orderNo];
+        [self isExitCallToJS:textJS withMethodName:@"faceEnd"];
+        self.verifyMsgView.descTitle = @"活体检测成功";
+        [self.verifyMsgView show];
+    }else {
+        NSLog(@"活体检测失败");
+        self.verifyMsgView.descTitle = @"活体检测失败";
+        [self.verifyMsgView show];
+    }
+}
+
+    
+//保存图片到相册
+#pragma mark 保存图片
+-(void)jsSavePic:(NSDictionary *)dict {
+    NSString *base64ImgData = [NSString stringWithFormat:@"%@",dict[@"imgbase64"]];
+    base64ImgData = [base64ImgData stringByReplacingOccurrencesOfString:@"data:image/png;base64," withString:@""];
+    NSData *data = [[NSData alloc]initWithBase64EncodedString:base64ImgData options:NSDataBase64DecodingIgnoreUnknownCharacters];
+    UIImage *saveImg = [UIImage imageWithData:data];
+    UIImageWriteToSavedPhotosAlbum(saveImg, self, @selector(image:didFinishSavingWithError:contextInfo:), NULL);
+}
+    
+#pragma mark 系统的完成保存图片的方法
+- (void)image: (UIImage *) image didFinishSavingWithError: (NSError *) error contextInfo: (void *) contextInfo
+{
+    NSString *msg = nil ;
+    if (error != NULL) {
+        msg = @"保存图片失败" ;
+    } else {
+        msg = @"保存图片成功" ;
+    }
+    [[LXViewControllerManager shareViewControllerManager] showHudOnlyText:msg delay:1];
+}
+
+
 #pragma mark  粘贴板
 -(void)jsWirteRight:(NSDictionary *)dict {
     NSString *txt = [NSString stringWithFormat:@"%@",dict[@"txt"]];
@@ -1267,9 +1399,10 @@ NSString *const new_AesKey_2 = @"mGlAgnIBB8bx2nch";
     }
 }
 -(void)alipayWXpayStatus:(NSNotification *)notification{
-    
-    NSString * status = [notification object];
-    [self performSelector:@selector(payStatus:) withObject:status afterDelay:2];
+     if(self.tabBarController.selectedIndex == 1) {
+         NSString * status = [notification object];
+         [self performSelector:@selector(payStatus:) withObject:status afterDelay:2];
+     }
 }
 -(void)payStatus:(NSString *)status
 {
@@ -1381,15 +1514,48 @@ NSString *const new_AesKey_2 = @"mGlAgnIBB8bx2nch";
 //粘贴板相关-梳理
 -(void)updateClipboard:(NSNotification *)notificaition{
     if(self.tabBarController.selectedIndex == 1) {
+        NSString *current_url = [self stringByEvaluatingJavaScriptFromString:@"document.location.href"];
         NSDictionary *dict = notificaition.userInfo;
         NSString *content = [NSString stringWithFormat:@"%@",dict[@"content"]];
-        //调用js
-        NSString *textJS =  [NSString stringWithFormat:@"distribInfo('%@')",content];
-        [self isExitCallToJS:textJS withMethodName:@"distribInfo"];
-     
+        if ([current_url containsString:@"jyapp/free/login"]) {
+            NSLog(@"登录页面-调用js");
+            NSString *textJS =  [NSString stringWithFormat:@"distribInfo('%@')",content];
+            [self isExitCallToJS:textJS withMethodName:@"distribInfo"];
+            
+        }else {
+        
+            [[LXNetworkManager shareLXNetworkManager]postWithURLStr:[NSString stringWithFormat:@"%@distribution/share/getWordInfo",kHost] parameters:@{@"copyTxt":content} progress:^(NSProgress *progress) {
+                NSLog(@"%@",progress);
+            } success:^(id responseObject) {
+                NSLog(@"responseObject=%@",responseObject);
+                if ([responseObject objectForKey:@"data"]) {
+                    NSDictionary *dict = [[NSDictionary alloc]initWithDictionary:responseObject[@"data"]];
+                    self.clipboardView.title =dict[@"title"];
+                    self.clipboardView.subTitle =dict[@"subTitle"];
+                    self.clipboardView.imgUrl =dict[@"imgUrl"];
+                    self.clipboardView.appUrl =dict[@"appUrl"];
+                    self.clipboardView.butTxt =dict[@"butTxt"];
+                    self.clipboardView.bottomTxt =dict[@"bottomTxt"];
+                    [self.clipboardView show];
+                }
+            } failure:^(NSError *error) {
+                NSLog(@"error=%@",error);
+            }];
+        }
     }
 }
 
+#pragma mark  **** 代理方法
+-(void)clipboardClick:(NSString *)url {
+    NSString *tmpUrl = [NSString stringWithFormat:@"%@%@", kHost, url];
+    tmpUrl =  [tmpUrl stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
+    kMainQueue(^{
+        [self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:tmpUrl]]];
+    })
+}
+
+
+
 
 -(void)clearWeb{
     NSURLCache * cache = [NSURLCache sharedURLCache];

+ 0 - 17
ios/JianYuIOS/JianYuIOS/NewWebController.h

@@ -1,17 +0,0 @@
-//
-//  NewWebController.h
-//  JianYuIOS
-//
-//  Created by lixianglan on 2018/2/1.
-//  Copyright © 2018年 lixianglan. All rights reserved.
-//
-
-#import <UIKit/UIKit.h>
-
-@interface NewWebController : UIViewController
-
-@property(nonatomic, strong)NSString *url;
-
-@property(nonatomic, strong)NSString *titleShow;
-
-@end

+ 0 - 280
ios/JianYuIOS/JianYuIOS/NewWebController.m

@@ -1,280 +0,0 @@
-//
-//  NewWebController.m
-//  JianYuIOS
-//
-//  Created by lixianglan on 2018/2/1.
-//  Copyright © 2018年 lixianglan. All rights reserved.
-//
-
-#import "NewWebController.h"
-
-@protocol JYNewWebControllerJSExport<JSExport>
-
-
-
-//支付相关
-JSExportAs(wxPay, -(void)jsWxPay:(NSString *)jsonString);
-
-JSExportAs(aliPay, -(void)jsAliPay:(NSString*)str);
-
-@end
-
-
-
-@interface NewWebController ()<UIWebViewDelegate,JYNewWebControllerJSExport>
-
-@property (weak, nonatomic) IBOutlet UIWebView *webView;
-
-@property (weak, nonatomic) IBOutlet NSLayoutConstraint *topC;
-@property(nonatomic, strong)LXProgressView *progressView;
-@property (weak, nonatomic) IBOutlet UIView *topView;
-@property (weak, nonatomic) IBOutlet UILabel *titleLbl;
-@property (weak, nonatomic) IBOutlet NSLayoutConstraint *topViewH;
-
-
-@property (nonatomic,strong)UIButton *backBtn;
-
-@end
-
-@implementation NewWebController
-
-- (void)viewDidLoad {
-    [super viewDidLoad];
-    // Do any additional setup after loading the view from its nib.
-    if (IphonexAboveScreen) {
-        self.topC.constant = 20;
-        [self.view updateConstraints];
-    }
-    
-    NSLog(@"%@",self.titleShow);
-    if (self.titleShow) {
-        self.titleLbl.text = self.titleShow;
-        
-        if([self.titleShow isEqualToString:@"-1"]) {
-            self.topC.constant = -20;
-            [self.webView updateConstraints];
-            self.topViewH.constant = 0;
-            self.topView.hidden = YES;
-            [self.view updateConstraints];
-        }
-    }else{
-        
-        [self addBackButton];
-        
-        self.topC.constant = -20;
-        [self.webView updateConstraints];
-        
-        self.topViewH.constant = 0;
-        self.topView.hidden = YES;
-        [self.view updateConstraints];
-    }
-    
-    self.webView.scrollView.bounces = NO;
-    self.webView.delegate = self;
-    
-    
-    
-    self.webView.autoresizingMask = (UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight);
-    self.webView.scalesPageToFit=YES;
-    self.webView.multipleTouchEnabled=YES;
-    self.webView.userInteractionEnabled=YES;
-    
-    NSLog(@"%f",HEIGHT)
-    if (HEIGHT >=812) {
-        if (@available(iOS 11.0, *)) {
-            self.webView.scrollView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
-        }
-    }
-    
-    
-    
-    
-    
-    
-//    [[LXViewControllerManager shareViewControllerManager] showHudText:nil];
-    [self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:self.url]]];
-    
-    //支付状态通知
-    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(alipayWXpayStatus:) name:AlipayWXpayStatus object:nil];
-    
-    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(dismissSelf) name:@"kNewWebControllerDismiss" object:nil];
-}
-
-
-
--(void)addBackButton
-{
-    
-    self.backBtn = [UIButton buttonWithType:UIButtonTypeCustom];
-    if(iPhoneX) {
-        self.backBtn.frame = CGRectMake(15, 51, 30, 30);
-        self.backBtn.layer.cornerRadius = 15;
-        self.backBtn.layer.masksToBounds = YES;
-    }else {
-        self.backBtn.frame = CGRectMake(15, 27, 30, 30);
-        self.backBtn.layer.cornerRadius = 15;
-        self.backBtn.layer.masksToBounds = YES;
-    }
-    
-    self.backBtn.backgroundColor = [UIColor blackColor];
-    [self.backBtn setImage:[UIImage imageNamed:@"back_normal"] forState:UIControlStateNormal];
-    [self.backBtn addTarget:self action:@selector(backBtnClick) forControlEvents:UIControlEventTouchUpInside];
-    
-    
-    
-    [self.view addSubview:self.backBtn];
-}
-
--(void)backBtnClick
-{
-    if (self.webView.canGoBack) {// web能退 就后退
-        [self.webView goBack];
-    }else{// 跳回上级页面
-        [self dismissViewControllerAnimated:NO completion:nil];
-    }
-}
-
--(void)dismissSelf{
-    kMainQueue(^{
-        [self dismissViewControllerAnimated:NO completion:nil];
-    });
-}
-
-
-#pragma mark  收到z支付通知
--(void)alipayWXpayStatus:(NSNotification *)notification{
-    
-    NSString * status = [notification object];
-    [self performSelector:@selector(payStatus:) withObject:status afterDelay:2];
-}
-
--(void)payStatus:(NSString *)status
-{
-    //目前延时两秒
-    NSLog(@"支付状态:%@",status);
-    JSContext *context = [self.webView valueForKeyPath:@"documentView.webView.mainFrame.javaScriptContext"];
-    NSString * textJS1 = [NSString stringWithFormat:@"payCallBack('%@')", status];
-    [context evaluateScript:textJS1];
-}
-
-#pragma mark  支付相关
-
--(void)jsWxPay:(NSString *)jsonString
-{
-    if ([LXUserDefaults isInstallWeiXin] != 1) { // 没有安装wx
-        [[LXViewControllerManager shareViewControllerManager] showHudOnlyText:@"请先安装微信再进行支付!" delay:1.5];
-        return;
-    }
-
-    NSData *jsonData = [jsonString dataUsingEncoding:NSUTF8StringEncoding];
-    NSError *err;
-    NSDictionary *dic = [NSJSONSerialization JSONObjectWithData:jsonData options:NSJSONReadingMutableContainers error:&err];
-    if(err) {
-        NSLog(@"json解析失败:%@",err);
-        return;
-    }
-    //吊起微信
-    PayReq *request = [[PayReq alloc] init] ;
-    request.openID = dic[@"Appid"];
-    request.partnerId = dic[@"Partnerid"];
-    request.prepayId= dic[@"Prepayid"];
-    request.package = @"Sign=WXPay";
-    request.nonceStr= dic[@"Noncestr"];
-    request.timeStamp= [dic[@"Timestamp"] intValue];
-    request.sign= dic[@"Sign"];
-
-    kMainQueue(^{
-        [WXApi sendReq:request];
-    });
-}
--(void)jsAliPay:(NSString*)str
-{
-    kMainQueue(^{
-        [[AlipaySDK defaultService] payOrder:str fromScheme:@"jianyuiosapp" callback:nil];
-    });
-    
-    
-}
-
-
-
-
-#pragma mark  webView代理方法
--(void)webViewDidFinishLoad:(UIWebView *)webView{
-//    [[LXViewControllerManager shareViewControllerManager] hideHud];
-    [self removeProgresView];
-    // Disable user selection
-
-
-    [[LXViewControllerManager shareViewControllerManager] hideHud];
-    
-    
-    JSContext *context = [webView valueForKeyPath:@"documentView.webView.mainFrame.javaScriptContext"];
-    // Disable user selection
-    [webView stringByEvaluatingJavaScriptFromString:@"document.documentElement.style.webkitUserSelect='none';"];
-    // Disable callout
-    [webView stringByEvaluatingJavaScriptFromString:@"document.documentElement.style.webkitTouchCallout='none';"];
-    
-    context[@"JyObj"] = self;
-    [context evaluateScript:@"afterPageInit()"];
-}
-
-
-
-
-
-
--(void)webViewDidStartLoad:(UIWebView *)webView{
-    if (!self.titleShow) {
-        [self addProgressView];
-    }
-}
-
-// 显示加载进度条
--(void)addProgressView{
-    if (self.progressView) {
-        [self.progressView removeFromSuperview];
-        self.progressView = nil;
-    }
-    self.progressView = [[LXProgressView alloc] init];
-    self.progressView.frame = CGRectMake(0, CGRectGetMinY(self.webView.frame), kCurrentDeviceWidth, 2);
-    [self.view addSubview:self.progressView];
-}
-
-// 移除加载进度条
--(void)removeProgresView{
-    self.progressView.progress = .99;
-    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
-        if (self.progressView) {
-            [self.progressView removeFromSuperview];
-            self.progressView = nil;
-        }
-    });
-}
-
-
-- (IBAction)back:(id)sender {
-    if (self.webView.canGoBack) {// web能退 就后退
-        [self.webView goBack];
-    }else{// 跳回上级页面
-        [self dismissViewControllerAnimated:NO completion:nil];
-    }
-    
-}
-
-- (void)didReceiveMemoryWarning {
-    [super didReceiveMemoryWarning];
-    // Dispose of any resources that can be recreated.
-}
-
-/*
-#pragma mark - Navigation
-
-// In a storyboard-based application, you will often want to do a little preparation before navigation
-- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
-    // Get the new view controller using [segue destinationViewController].
-    // Pass the selected object to the new view controller.
-}
-*/
-
-@end

+ 0 - 94
ios/JianYuIOS/JianYuIOS/NewWebController.xib

@@ -1,94 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="16097" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
-    <device id="retina4_7" orientation="portrait" appearance="light"/>
-    <dependencies>
-        <deployment identifier="iOS"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="16087"/>
-        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
-    </dependencies>
-    <objects>
-        <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="NewWebController">
-            <connections>
-                <outlet property="titleLbl" destination="06y-Wp-KW0" id="MiT-E3-Te4"/>
-                <outlet property="topC" destination="E3n-th-ijR" id="e15-2Z-on4"/>
-                <outlet property="topView" destination="9yt-yG-Kvh" id="IpQ-dh-IEH"/>
-                <outlet property="topViewH" destination="Lgr-zi-miA" id="plS-Gz-RUI"/>
-                <outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
-                <outlet property="webView" destination="hKS-9A-lkH" id="K1j-ax-gsj"/>
-            </connections>
-        </placeholder>
-        <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
-        <view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="i5M-Pr-FkT">
-            <rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
-            <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
-            <subviews>
-                <webView contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="hKS-9A-lkH">
-                    <rect key="frame" x="0.0" y="64" width="375" height="603"/>
-                    <color key="backgroundColor" red="0.36078431370000003" green="0.38823529410000002" blue="0.4039215686" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
-                </webView>
-                <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="9yt-yG-Kvh">
-                    <rect key="frame" x="0.0" y="0.0" width="375" height="64"/>
-                    <subviews>
-                        <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="jaM-FE-122">
-                            <rect key="frame" x="5" y="28" width="50" height="30"/>
-                            <constraints>
-                                <constraint firstAttribute="height" constant="30" id="Msz-3m-4I2"/>
-                                <constraint firstAttribute="width" constant="50" id="Vpk-My-rKC"/>
-                            </constraints>
-                            <inset key="imageEdgeInsets" minX="0.0" minY="1" maxX="27" maxY="0.0"/>
-                            <state key="normal" image="arrowLeft.png"/>
-                            <userDefinedRuntimeAttributes>
-                                <userDefinedRuntimeAttribute type="boolean" keyPath="clipsToBounds" value="YES"/>
-                                <userDefinedRuntimeAttribute type="string" keyPath="layer.cornerRadius" value="15"/>
-                            </userDefinedRuntimeAttributes>
-                            <connections>
-                                <action selector="back:" destination="-1" eventType="touchUpInside" id="GOB-1L-p0S"/>
-                            </connections>
-                        </button>
-                        <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="公告信息" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="06y-Wp-KW0">
-                            <rect key="frame" x="153" y="26" width="69.5" height="30"/>
-                            <constraints>
-                                <constraint firstAttribute="height" constant="30" id="Gfe-3C-N33"/>
-                            </constraints>
-                            <fontDescription key="fontDescription" type="system" pointSize="17"/>
-                            <color key="textColor" red="0.26666666666666666" green="0.26666666666666666" blue="0.26666666666666666" alpha="1" colorSpace="calibratedRGB"/>
-                            <nil key="highlightedColor"/>
-                        </label>
-                        <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="wOH-mK-Uts">
-                            <rect key="frame" x="0.0" y="63.5" width="375" height="0.5"/>
-                            <color key="backgroundColor" red="0.66666666666666663" green="0.66666666666666663" blue="0.66666666666666663" alpha="1" colorSpace="calibratedRGB"/>
-                            <constraints>
-                                <constraint firstAttribute="height" constant="0.5" id="aOS-Xz-aty"/>
-                            </constraints>
-                        </view>
-                    </subviews>
-                    <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
-                    <constraints>
-                        <constraint firstAttribute="bottom" secondItem="jaM-FE-122" secondAttribute="bottom" constant="6" id="1at-TP-5lA"/>
-                        <constraint firstAttribute="bottom" secondItem="06y-Wp-KW0" secondAttribute="bottom" constant="8" id="3hO-T4-5vD"/>
-                        <constraint firstItem="06y-Wp-KW0" firstAttribute="centerX" secondItem="9yt-yG-Kvh" secondAttribute="centerX" id="96I-yk-1cF"/>
-                        <constraint firstAttribute="bottom" secondItem="wOH-mK-Uts" secondAttribute="bottom" id="BHV-bI-Z0s"/>
-                        <constraint firstAttribute="height" constant="64" id="Lgr-zi-miA"/>
-                        <constraint firstAttribute="trailing" secondItem="wOH-mK-Uts" secondAttribute="trailing" id="cRa-Ny-bGV"/>
-                        <constraint firstItem="wOH-mK-Uts" firstAttribute="leading" secondItem="9yt-yG-Kvh" secondAttribute="leading" id="huX-fE-F19"/>
-                        <constraint firstItem="jaM-FE-122" firstAttribute="leading" secondItem="9yt-yG-Kvh" secondAttribute="leading" constant="5" id="keK-BA-Dlv"/>
-                    </constraints>
-                </view>
-            </subviews>
-            <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
-            <constraints>
-                <constraint firstAttribute="trailing" secondItem="9yt-yG-Kvh" secondAttribute="trailing" id="1lW-Bt-Y4d"/>
-                <constraint firstAttribute="trailing" secondItem="hKS-9A-lkH" secondAttribute="trailing" id="6nu-EY-FNH"/>
-                <constraint firstItem="9yt-yG-Kvh" firstAttribute="top" secondItem="i5M-Pr-FkT" secondAttribute="top" id="E3n-th-ijR"/>
-                <constraint firstItem="hKS-9A-lkH" firstAttribute="leading" secondItem="i5M-Pr-FkT" secondAttribute="leading" id="HeZ-y1-nVG"/>
-                <constraint firstAttribute="bottom" secondItem="hKS-9A-lkH" secondAttribute="bottom" id="Ysb-dr-ykz"/>
-                <constraint firstItem="hKS-9A-lkH" firstAttribute="top" secondItem="9yt-yG-Kvh" secondAttribute="bottom" id="ZBl-A3-xFX"/>
-                <constraint firstItem="9yt-yG-Kvh" firstAttribute="leading" secondItem="i5M-Pr-FkT" secondAttribute="leading" id="i13-TT-Cqr"/>
-            </constraints>
-            <point key="canvasLocation" x="29.600000000000001" y="38.23088455772114"/>
-        </view>
-    </objects>
-    <resources>
-        <image name="arrowLeft.png" width="10.5" height="19"/>
-    </resources>
-</document>

+ 28 - 0
ios/JianYuIOS/JianYuIOS/tool/ZKFaceVerifyMsgView.h

@@ -0,0 +1,28 @@
+//
+//  ZKFaceVerifyMsgView.h
+//  JianYuIOS
+//
+//  Created by apple on 2020/8/13.
+//  Copyright © 2020 lixianglan. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface ZKFaceVerifyMsgView : UIView
+
+-(instancetype)initWithFrame:(CGRect)frame;
+
+@property (nonatomic,copy)NSString *titleName;
+
+@property (nonatomic,copy)NSString *descTitle;
+
+-(void)show;
+-(void)dismiss;
+
+
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 85 - 0
ios/JianYuIOS/JianYuIOS/tool/ZKFaceVerifyMsgView.m

@@ -0,0 +1,85 @@
+//
+//  ZKFaceVerifyMsgView.m
+//  JianYuIOS
+//
+//  Created by apple on 2020/8/13.
+//  Copyright © 2020 lixianglan. All rights reserved.
+//
+
+#import "ZKFaceVerifyMsgView.h"
+#import "ZKModal.h"
+
+@interface ZKFaceVerifyMsgView()
+
+
+@property (nonatomic,strong)UILabel *titleLabel;
+@property (nonatomic,strong)UILabel *descLabel;
+
+@end
+
+@implementation ZKFaceVerifyMsgView
+
+-(instancetype)initWithFrame:(CGRect)frame
+{
+    if (self = [super initWithFrame:frame]) {
+        
+        self.backgroundColor = [UIColor whiteColor];
+    
+        self.layer.masksToBounds = YES;
+        self.layer.cornerRadius = 10;
+        CGFloat B_H = 50;
+        UIButton *button = [ZKControl createButtonWithFrame:CGRectMake(0, self.height-B_H, self.width, B_H) title:@"知道了" titleColor:UIColorFromRGB(0x795441) titleFont:15 imageName:nil bgImageName:nil target:self method:@selector(doneClick)];
+        UIView *lineView = [ZKControl createViewWithFrame:CGRectMake(0, self.height-B_H-1, self.width, 1) color:UIColorFromRGB(0xEEEEEE)];
+        [self addSubview:button];
+        [self addSubview:lineView];
+        
+        UILabel *titleLabel = [ZKControl createLabelWithFrame:CGRectMake(0, 0, self.width, 40) font:15 text:@"" TextAlignment:NSTextAlignmentCenter TextColor:UIColorFromRGB(0x000000) bgColor:nil];
+        [self addSubview:titleLabel];
+        self.titleLabel = titleLabel;
+        
+        UILabel *descLabel = [ZKControl createLabelWithFrame:CGRectMake(15, titleLabel.bottom, self.width-30, lineView.top-titleLabel.bottom) font:15 text:@"" TextAlignment:NSTextAlignmentCenter TextColor:UIColorFromRGB(0x000000) bgColor:nil];
+        descLabel.alpha = 0.5;
+        descLabel.numberOfLines = 0;
+        [self addSubview:descLabel];
+        self.descLabel = descLabel;
+    }
+    
+    return self;
+}
+
+-(void)doneClick
+{
+    [[ZKModal sharedInstance] hide];
+}
+
+-(void)show
+{
+    [[ZKModal sharedInstance] showWithContentView:self andAnimated:YES];
+}
+-(void)dismiss
+{
+    [[ZKModal sharedInstance] hide];
+}
+
+-(void)setTitleName:(NSString *)titleName
+{
+    _titleName = titleName;
+    self.titleLabel.text = _titleName;
+}
+-(void)setDescTitle:(NSString *)descTitle
+{
+    _descTitle = descTitle;
+    self.descLabel.text = _descTitle;
+    self.descLabel.attributedText = [ZKMethod getAttributedStringWithString:self.descLabel.text lineSpace:5 with:Center];
+}
+
+
+/*
+// Only override drawRect: if you perform custom drawing.
+// An empty implementation adversely affects performance during animation.
+- (void)drawRect:(CGRect)rect {
+    // Drawing code
+}
+*/
+
+@end