From f338bb377a9e2f87f876cf8c5f0124d84da85bea Mon Sep 17 00:00:00 2001 From: chenqiyang <1406175257@qq.com> Date: 星期三, 15 三月 2023 14:18:40 +0800 Subject: [PATCH] 1.引入自定义button和scrollview 2.引入时间选择器组件 3.完善临时密码功能 4.修改部分类名 --- EZSDK/EZSDK/EZSDK.m | 86 ++++++++++++++++++++++++++++++++++-------- 1 files changed, 69 insertions(+), 17 deletions(-) diff --git a/EZSDK/EZSDK/EZSDK.m b/EZSDK/EZSDK/EZSDK.m index cfb414f..81b7859 100644 --- a/EZSDK/EZSDK/EZSDK.m +++ b/EZSDK/EZSDK/EZSDK.m @@ -18,12 +18,24 @@ #import "EZPlaybackViewController.h" #import "EZDeviceTableViewController.h" #import "EZHCNetDeviceSDK.h" - - +#import "EZMessagePhotoViewController.h" +#import "HDLEZVisitorRecordViewController.h" @implementation EZSDK + +/// ++ (instancetype)sharedInstance{ + static EZSDK *instance = nil; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + if (!instance) { + instance = [[EZSDK alloc] init]; + } + }); + return instance; +} static BOOL isHavelibInit=NO; @@ -31,10 +43,10 @@ 鍒濆鍖朣DK 浼犲叆鍥藉唴鐗坘ey 鍜屾捣澶栫増globalAppKey */ -+ (BOOL)initLibWithAppKey:(NSString *)appKey globalAppKey:(NSString *)globalAppKey +- (BOOL)initLibWithAppKey:(NSString *)appKey globalAppKey:(NSString *)globalAppKey { - if (!isHavelibInit) { + [EZOPENSDK setDebugLogEnable:YES]; // isHavelibInit=YES; // NSLog(@"绗竴娆″垵濮嬪寲钀ょ煶搴�"); if (!LanguageIsChinese) { @@ -43,13 +55,15 @@ NSLog(@"娴峰鐗坘ey--%@",globalAppKey); }else{ isHavelibInit = [EZOpenSDK initLibWithAppKey:appKey]; + [[GlobalKit shareKit] setHdlAppKey:appKey]; NSLog(@"鍥藉唴鐗坘ey--%@", appKey); } - [EZHCNetDeviceSDK initSDK]; [EZOPENSDK enableP2P:YES]; - [EZOPENSDK setDebugLogEnable:YES]; +// [EZOPENSDK setDebugLogEnable:YES]; NSLog(@"EZOpenSDK Version = %@", [EZOPENSDK getVersion]); +// NSLog(@"EZOpenSDK treamToken= %@", ); + } return isHavelibInit; } @@ -57,7 +71,7 @@ /** 璁剧疆SDK鐨刟ccessToken */ -+(void)setEZAccessToken:(NSString *) accessToken +-(void)setEZAccessToken:(NSString *) accessToken { [[GlobalKit shareKit] setAccessToken:accessToken]; [EZOPENSDK setAccessToken:accessToken]; @@ -66,7 +80,7 @@ /** 璁剧疆HDLSDK鐨刟ccessToken */ -+(void)setHDlAccessToken:(NSString *) accessToken refreshToken:(NSString *) refreshToken +-(void)setHDlAccessToken:(NSString *) accessToken refreshToken:(NSString *) refreshToken { [[GlobalKit shareKit] setHdlAccessToken:accessToken]; [[GlobalKit shareKit] setHdlRefreshToken:refreshToken]; @@ -74,14 +88,14 @@ /** 璁剧疆SDK鐨勬渤涓滄帴鍙g殑requestHttpsHost鍜屽钩鍙� 鏍囪瘑锛�1.on+(榛樿) 2.evoyo */ -+(void)setRequestHttpsHostAndPlatform:(NSString *) requestHttpsHost platform:(int)platform homeId:(NSString *)homeId{ +-(void)setRequestHttpsHostAndPlatform:(NSString *) requestHttpsHost platform:(int)platform homeId:(NSString *)homeId{ [[GlobalKit shareKit] setGlobalRequestHttpsHost:requestHttpsHost]; [[GlobalKit shareKit] setHdlPlatform:platform]; [[GlobalKit shareKit] setHdlHomeId:homeId]; } //鑾峰彇褰撳墠灞忓箷鏄剧ず鐨剉iewcontroller (杩欓噷闈㈣幏鍙栫殑鐩稿綋浜巖ootViewController) -+(UINavigationController *)getCurrentVC +-(UINavigationController *)getCurrentVC { UIWindow * window = [[UIApplication sharedApplication] keyWindow]; if (window.windowLevel != UIWindowLevelNormal) @@ -104,7 +118,7 @@ /** 鐩存帴璺宠浆鍒拌悿鐭虫憚鍍忓ご鍒楄〃 */ -+(void)go2EZvizMonitor +-(void)go2EZvizMonitor { // NSLog(@"go2EZvizMonitor"); //鑾峰彇EZMain鐨剆troyboard鏂囦欢 @@ -121,25 +135,43 @@ /** 璺宠浆娣诲姞娣诲姞璁惧 */ -+(void)addEzvizMonitor +-(void)addEzvizMonitor { +// // NSLog(@"娣诲姞鎽勫儚澶�"); +// if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0) { +// UIStoryboard *addDeviceStoryBoard = [UIStoryboard storyboardWithName:@"AddDevice" bundle:nil]; +// EZAddByQRCodeViewController *rootViewController = [addDeviceStoryBoard instantiateViewControllerWithIdentifier:@"AddByQRCode"]; +// [[self getCurrentVC] setNavigationBarHidden:NO]; +// [[self getCurrentVC] pushViewController:rootViewController animated:YES]; +// } else { +// // [UIView dd_showMessage:@"iOS 7.0浠ヤ笅鎵爜鍔熻兘璇疯嚜琛屽疄鐜�"]; +// NSLog(@"iOS 7.0浠ヤ笅鎵爜鍔熻兘璇疯嚜琛屽疄鐜�"); +// } + [self addEzvizMonitorWithDeviceType:HDLEZDeviceType_Default]; +} + +/** + 璺宠浆娣诲姞娣诲姞璁惧 + @param deviceType 璁惧绫诲瀷 + */ +- (void)addEzvizMonitorWithDeviceType:(HDLEZDeviceType)deviceType{ // NSLog(@"娣诲姞鎽勫儚澶�"); if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0) { UIStoryboard *addDeviceStoryBoard = [UIStoryboard storyboardWithName:@"AddDevice" bundle:nil]; EZAddByQRCodeViewController *rootViewController = [addDeviceStoryBoard instantiateViewControllerWithIdentifier:@"AddByQRCode"]; + rootViewController.deviceType=deviceType; [[self getCurrentVC] setNavigationBarHidden:NO]; [[self getCurrentVC] pushViewController:rootViewController animated:YES]; } else { // [UIView dd_showMessage:@"iOS 7.0浠ヤ笅鎵爜鍔熻兘璇疯嚜琛屽疄鐜�"]; NSLog(@"iOS 7.0浠ヤ笅鎵爜鍔熻兘璇疯嚜琛屽疄鐜�"); } - } /** 鏌ョ湅瑙嗛鐩戞帶鐩存挱 */ -+(void)Play:(EZDeviceInfo*)deviceInfo +-(void)Play:(EZDeviceInfo*)deviceInfo { UIStoryboard *addDeviceStoryBoard = [UIStoryboard storyboardWithName:@"EZMain" bundle:nil]; EZLivePlayViewController *rootViewController = [addDeviceStoryBoard instantiateViewControllerWithIdentifier:@"EZLivePlayViewController"]; @@ -155,7 +187,7 @@ /// 鎸囧畾搴忓垪鍙锋挱鏀� /// @param deviceSerial 搴忓垪鍙� -+(void)PlayWithDeviceSerial:(NSString *)deviceSerial{ +-(void)PlayWithDeviceSerial:(NSString *)deviceSerial{ //鑾峰彇璁惧鍒楄〃鎺ュ彛 [EZOpenSDK getDeviceInfo:deviceSerial completion:^(EZDeviceInfo *deviceInfo, NSError *error) { if(error) @@ -172,7 +204,7 @@ /** 鎵撳紑鎽勫儚澶磋缃〉闈� */ -+(void)setting:(EZDeviceInfo*)deviceInfo +-(void)setting:(EZDeviceInfo*)deviceInfo { UIStoryboard *settingStoryBoard=[UIStoryboard storyboardWithName:@"EZMain" bundle:nil]; EZSettingViewController *settingVC=[settingStoryBoard instantiateViewControllerWithIdentifier:@"EZSettingViewController"]; @@ -184,7 +216,7 @@ /** 鍥炴斁鎾斁鍘嗗彶 */ -+(void)playBackVideo:(EZDeviceInfo*)deviceInfo +-(void)playBackVideo:(EZDeviceInfo*)deviceInfo { UIStoryboard *playBackStoryBoard=[UIStoryboard storyboardWithName:@"EZMain" bundle:nil]; EZPlaybackViewController *playBackVC=[playBackStoryBoard instantiateViewControllerWithIdentifier:@"EZPlaybackViewController"]; @@ -193,7 +225,27 @@ [[self getCurrentVC] pushViewController:playBackVC animated:YES]; } +/**涓存椂瀵嗙爜椤� + @param deviceId 璁惧id + */ +- (void)toTemPassView:(NSString*)deviceId{ + HDLEZVisitorRecordViewController *vc=[[HDLEZVisitorRecordViewController alloc] init]; + vc.deviceId=deviceId; + [[self getCurrentVC] setNavigationBarHidden:YES]; + [[self getCurrentVC] pushViewController:vc animated:YES]; +} +//// +//-(void)goToEZMessagePhotoVC:(EZAlarmInfo*)alarmInfo{ +// UIStoryboard *addDeviceStoryBoard = [UIStoryboard storyboardWithName:@"EZMain" bundle:nil]; +// EZMessagePhotoViewController *rootViewController = [addDeviceStoryBoard instantiateViewControllerWithIdentifier:@"EZMessagePhotoViewController"]; +// // NSLog(@"play--iphone--rootViewController"); +// rootViewController.info = alarmInfo; +//// NSLog(@"play--iphone--deviceName -%@",rootViewController.deviceInfo.deviceName); +//// rootViewController.cameraIndex=0; +// [[self getCurrentVC] setNavigationBarHidden:NO]; +// [[self getCurrentVC] pushViewController:rootViewController animated:YES]; +//} //+(void)MonitorPushMessage:(NSString *)MonitorType ID:(NSString *)ID //{ // [CommonList login]; -- Gitblit v1.8.0