|
@@ -13,7 +13,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
-@interface JYNewSearchViewController ()<WKNavigationDelegate,WKUIDelegate,WKScriptMessageHandler,CLLocationManagerDelegate,UINavigationControllerDelegate,UIImagePickerControllerDelegate,CLLocationManagerDelegate,SKProductsRequestDelegate,SKPaymentTransactionObserver>
|
|
|
+@interface JYNewSearchViewController ()<WKNavigationDelegate,WKUIDelegate,WKScriptMessageHandler,CLLocationManagerDelegate,UINavigationControllerDelegate,UIImagePickerControllerDelegate,CLLocationManagerDelegate,SKProductsRequestDelegate,SKPaymentTransactionObserver,ZKClipboardViewDelegate>
|
|
|
{
|
|
|
NSInteger _timeTick;
|
|
|
NSInteger _time;
|
|
@@ -39,7 +39,7 @@
|
|
|
|
|
|
@property(nonatomic, strong)NoNetView *noNetView;
|
|
|
@property(nonatomic, strong)UIPanGestureRecognizer *recognizer;
|
|
|
-
|
|
|
+@property(nonatomic, strong)ZKClipboardView *clipboardView;
|
|
|
|
|
|
|
|
|
|
|
@@ -60,14 +60,14 @@ NSString *const new_AesKey_1 = @"mGlAgnIBB8bx2nch";
|
|
|
[self.navigationController setNavigationBarHidden:YES animated:animated];
|
|
|
}
|
|
|
////弹框
|
|
|
-//-(ZKClipboardView *)clipboardView
|
|
|
-//{
|
|
|
-// if(!_clipboardView) {
|
|
|
-// _clipboardView = [[ZKClipboardView alloc]initWithFrame:CGRectMake(0, 0, WIDTH*0.8, 175)];
|
|
|
-// _clipboardView.delegate = self;
|
|
|
-// }
|
|
|
-// return _clipboardView;
|
|
|
-//}
|
|
|
+-(ZKClipboardView *)clipboardView
|
|
|
+{
|
|
|
+ if(!_clipboardView) {
|
|
|
+ _clipboardView = [[ZKClipboardView alloc]initWithFrame:CGRectMake(0, 0, WIDTH*0.8, 175)];
|
|
|
+ _clipboardView.delegate = self;
|
|
|
+ }
|
|
|
+ return _clipboardView;
|
|
|
+}
|
|
|
|
|
|
//进度条
|
|
|
- (UIProgressView *)progressView
|
|
@@ -526,9 +526,36 @@ NSString *const new_AesKey_1 = @"mGlAgnIBB8bx2nch";
|
|
|
[[SKPaymentQueue defaultQueue] addTransactionObserver:self];
|
|
|
|
|
|
|
|
|
+ NSLog(@"sdk version:%@",[[WBOCRService sharedService] sdkVersion]);
|
|
|
+
|
|
|
+ UIButton *btn = [ZKControl createButtonWithFrame:CGRectMake(100, 200, 50, 50) title:@"测试" imageName:@"" bgImageName:@"" target:self method:@selector(btnClick)];
|
|
|
+ [self.view addSubview:btn];
|
|
|
+
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+-(void)btnClick{
|
|
|
+ NSString *posturl = [NSString stringWithFormat:@"%@jyapp/faceDiscern/getNonceTicket",kHost];
|
|
|
+ [[LXNetworkManager shareLXNetworkManager] postWithURLStr:posturl parameters:@{@"token":[LXUserDefaults token]} progress:^(NSProgress *progress) {
|
|
|
+ NSLog(@"%@",progress);
|
|
|
+ } success:^(id responseObject) {
|
|
|
+ NSLog(@"responseObject=%@",responseObject);
|
|
|
+ if ([responseObject objectForKey:@"data"]) {
|
|
|
+ [self getOcrService:responseObject[@"data"]];
|
|
|
+ }
|
|
|
+ } failure:^(NSError *error) {
|
|
|
+ NSLog(@"error=%@",error);
|
|
|
+ }];
|
|
|
+
|
|
|
}
|
|
|
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
-(void)bottomOneListening {
|
|
|
if(self.tabBarController.selectedIndex == 0) {
|
|
|
[self judgeIsHiddenBottom];
|
|
@@ -670,15 +697,15 @@ NSString *const new_AesKey_1 = @"mGlAgnIBB8bx2nch";
|
|
|
//写数据
|
|
|
// [self writeWKWebData:webView.URL];
|
|
|
|
|
|
- if (![GlobalData shareInstance].isOpen) {
|
|
|
+ if (![GlobalData shareInstance].isOpen) {//第一次打开
|
|
|
[GlobalData shareInstance].isOpen = YES;
|
|
|
- [self performSelector:@selector(pasteboard) withObject:nil afterDelay:0.5];
|
|
|
+ [self performSelector:@selector(pasteboard) withObject:nil afterDelay:1.5];
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-(void)pasteboard {
|
|
|
NSString *content = [UIPasteboard generalPasteboard].string;
|
|
|
- if ([content containsString:@"剑鱼标讯"]) {
|
|
|
+ if ([content containsString:@"剑鱼标讯"]) {//第一次打开页面时候
|
|
|
[[NSNotificationCenter defaultCenter] postNotificationName:UpdateClipboard object:nil userInfo:@{@"content":content}];
|
|
|
}
|
|
|
}
|
|
@@ -912,7 +939,7 @@ NSString *const new_AesKey_1 = @"mGlAgnIBB8bx2nch";
|
|
|
|
|
|
//js方法登录成功
|
|
|
-(void)jsLoginSuccess:(NSDictionary *)dict {
|
|
|
- NSLog(@"search登录成功提示");
|
|
|
+ NSLog(@"search登录成功提示:%@",dict);
|
|
|
NSString *status = [NSString stringWithFormat:@"%@",dict[@"status"]];
|
|
|
[GlobalData shareInstance].isReLogin = YES;
|
|
|
if([status isEqualToString:@"S"]) {
|
|
@@ -923,9 +950,11 @@ NSString *const new_AesKey_1 = @"mGlAgnIBB8bx2nch";
|
|
|
JYTabBarController *tab = (JYTabBarController *)delegate.window.rootViewController;
|
|
|
tab.selectedIndex = pushIndex;
|
|
|
pushIndex = 0;
|
|
|
+
|
|
|
}));
|
|
|
}else {
|
|
|
[self webViewFirstRequest];
|
|
|
+
|
|
|
}
|
|
|
|
|
|
}else if ([status isEqualToString:@""]) {
|
|
@@ -935,6 +964,9 @@ NSString *const new_AesKey_1 = @"mGlAgnIBB8bx2nch";
|
|
|
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
-(void)jsBackUrl:(NSDictionary *)dict {
|
|
|
NSString *status = [NSString stringWithFormat:@"%@",dict[@"status"]];
|
|
|
if([status isEqualToString:@"H"]) {
|
|
@@ -1856,16 +1888,85 @@ NSString *const new_AesKey_1 = @"mGlAgnIBB8bx2nch";
|
|
|
//粘贴板相关-梳理
|
|
|
-(void)updateClipboard:(NSNotification *)notificaition{
|
|
|
if(self.tabBarController.selectedIndex == 0) {
|
|
|
+ NSString *current_url = [self stringByEvaluatingJavaScriptFromString:@"document.location.href"];
|
|
|
NSDictionary *dict = notificaition.userInfo;
|
|
|
NSString *content = [NSString stringWithFormat:@"%@",dict[@"content"]];
|
|
|
- //调用js
|
|
|
-// [self isExitCallToJS:@"tIOSt()" withMethodName:@"tIOSt"];
|
|
|
- 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);
|
|
|
+ }];
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
+-(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)getOcrService:(NSDictionary *)dict {
|
|
|
+
|
|
|
+ /*data = {
|
|
|
+ nonceStr = 64lwqjoobn0q9931nemys7q8yxor5x6u;
|
|
|
+ "nonce_ticket" = MzL8NdFWuVUPxp2UMenw01Jzmr4b2CZ08YBgkqhpwFVnmKqghKCIOUhrAs9adZix;
|
|
|
+ "order_code" = A1597130809229670;
|
|
|
+ userid = "";
|
|
|
+ }*/
|
|
|
+ NSLog(@"%@",dict);
|
|
|
+ WBOCRConfig *config = [WBOCRConfig sharedConfig];
|
|
|
+ config.needRecordVideo = NO;
|
|
|
+ config.SDKType = WBOCRSDKTypeIDCardNormal; // 身份证两面识别
|
|
|
+ [[WBOCRService sharedService] startOCRServiceWithConfig:[WBOCRConfig sharedConfig]
|
|
|
+ version:[[WBOCRService sharedService] sdkVersion]
|
|
|
+ appId:@"1256928877"
|
|
|
+ nonce:dict[@"nonceStr"]
|
|
|
+ userId:dict[@"userid"]
|
|
|
+ sign:dict[@"nonce_ticket"]
|
|
|
+ orderNo:dict[@"order_code"]
|
|
|
+ startSucceed:^{
|
|
|
+ /** SDK服务拉起成功回调 */
|
|
|
+ NSLog(@"启动SDK成功!!!");
|
|
|
+ }recognizeSucceed:^(id _Nonnull resultInfoModel,id extension) {
|
|
|
+ /** SDK本次识别成功回调 */
|
|
|
+ NSLog(@"SDK识别成功!!!");
|
|
|
+ }failed:^(NSError * _Nonnull error,id extension) {
|
|
|
+ /** SDK异常回调 */
|
|
|
+ NSLog(@"识别出错!!!");
|
|
|
+ NSLog(@"error:%@",error);
|
|
|
+ }];
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
|
|
|
-(void)clearWeb{
|