From 0611c6147bbe33a1bc7edfc9f3c9b1354226b137 Mon Sep 17 00:00:00 2001 From: kai60 Date: Mon, 19 Oct 2020 22:17:35 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=86=E9=A2=91=E5=BD=95=E5=88=B6bug?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .DS_Store | Bin 10244 -> 10244 bytes Ifish.xcodeproj/project.pbxproj | 4 +- Ifish/Common/CommonUtils.m | 2 +- Ifish/Utinitys/Define.h | 4 ++ Ifish/Utinitys/EGOCache/EGOCache.h | 1 + Ifish/Utinitys/EGOCache/EGOCache.m | 7 ++++ .../IfishP2PMonitorController.m | 4 +- .../CameraNoParyBackVideoView.m | 10 ++--- .../IfishP2PPlayBackListViewController.m | 12 +++++- .../IfishP2PPlayBackListViewController.xib | 36 ++++++++++++------ .../PlayBackViewController.xib | 6 +-- .../CameraRecordViewController.m | 33 ++++++++++++---- 12 files changed, 85 insertions(+), 34 deletions(-) diff --git a/.DS_Store b/.DS_Store index 8aeb8d7ee2e1ff906aa724e17bcc25d92a0c8ef4..df46f5a3f1059b573a6367ae52b27f0ebc5b849d 100644 GIT binary patch delta 106 zcmZn(XbG6$jIU^hRb_GTUdc2=g{m6P2?l|*v$U0jlK@{<@C7&!hsNqi(V?~o%% XVzQ= 812.0f; + return ([[UIApplication sharedApplication] statusBarFrame].size.height> 20); }else{ return NO; } diff --git a/Ifish/Utinitys/Define.h b/Ifish/Utinitys/Define.h index 3a532ab..484e7c1 100644 --- a/Ifish/Utinitys/Define.h +++ b/Ifish/Utinitys/Define.h @@ -81,6 +81,10 @@ alpha:1.0] #define MAINSCREEN_SCALE [[UIScreen mainScreen] scale] #define KWidth_Scale [UIScreen mainScreen].bounds.size.width/375.0f +#define IS_iPhoneX [CommonUtils isIphoneX] +#define TabbarHeight (IS_iPhoneX?83:49) +#define MyNavBarHeight (IS_iPhoneX?88:64) +#define StatusBarHeight (IS_iPhoneX?[[UIApplication sharedApplication] statusBarFrame].size.height:20) #import "MyControl.h" #import "DataCenter.h" #import "UserModel.h" diff --git a/Ifish/Utinitys/EGOCache/EGOCache.h b/Ifish/Utinitys/EGOCache/EGOCache.h index ab84607..6490587 100755 --- a/Ifish/Utinitys/EGOCache/EGOCache.h +++ b/Ifish/Utinitys/EGOCache/EGOCache.h @@ -66,6 +66,7 @@ FOUNDATION_EXPORT const unsigned char EGOCacheVersionString[]; - (NSString* __nullable)stringForKey:(NSString* __nonnull)key; - (void)setString:(NSString* __nonnull)aString forKey:(NSString* __nonnull)key; +- (void)setSynString:(NSString*)aString forKey:(NSString*)key; - (void)setString:(NSString* __nonnull)aString forKey:(NSString* __nonnull)key withTimeoutInterval:(NSTimeInterval)timeoutInterval; - (NSDate* __nullable)dateForKey:(NSString* __nonnull)key; diff --git a/Ifish/Utinitys/EGOCache/EGOCache.m b/Ifish/Utinitys/EGOCache/EGOCache.m index de8abda..262d966 100755 --- a/Ifish/Utinitys/EGOCache/EGOCache.m +++ b/Ifish/Utinitys/EGOCache/EGOCache.m @@ -274,6 +274,13 @@ static inline NSString* cachePathForKey(NSString* directory, NSString* key) { - (void)setString:(NSString*)aString forKey:(NSString*)key { [self setString:aString forKey:key withTimeoutInterval:self.defaultTimeoutInterval]; } +- (void)setSynString:(NSString*)aString forKey:(NSString*)key { + CHECK_FOR_EGOCACHE_PLIST(); + NSString* cachePath = cachePathForKey(_directory, key); + [[aString dataUsingEncoding:NSUTF8StringEncoding] writeToFile:cachePath atomically:YES]; + [self setCacheTimeoutInterval:self.defaultTimeoutInterval forKey:key]; +} + - (void)setString:(NSString*)aString forKey:(NSString*)key withTimeoutInterval:(NSTimeInterval)timeoutInterval { [self setData:[aString dataUsingEncoding:NSUTF8StringEncoding] forKey:key withTimeoutInterval:timeoutInterval]; diff --git a/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/IfishP2PMonitorController.m b/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/IfishP2PMonitorController.m index 19c6aad..66cbcf1 100644 --- a/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/IfishP2PMonitorController.m +++ b/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/IfishP2PMonitorController.m @@ -632,7 +632,7 @@ Strong UIImage *screenShotImage;//截图 //布防撤防、对讲、截图工具栏 ****** 云台 - CameraBottomHView *bottomToolHView = [[CameraBottomHView alloc] initWithFrame:CGRectMake(0.0, CGRectGetMaxY(self.segControl.frame) + 10, width, height-CGRectGetMaxY(self.segControl.frame))]; + CameraBottomHView *bottomToolHView = [[CameraBottomHView alloc] initWithFrame:CGRectMake(0.0, CGRectGetMaxY(self.segControl.frame) + 10, width, height-CGRectGetMaxY(self.segControl.frame)- MyNavBarHeight -10)]; bottomToolHView.cameraHViewDelegate = self; bottomToolHView.camera = self.contact; [self.view addSubview:bottomToolHView]; @@ -640,7 +640,7 @@ Strong UIImage *screenShotImage;//截图 self.bottomToolHView.hidden = NO; //底部view 水族箱view - UIView *bottomHView = [[UIView alloc] initWithFrame:CGRectMake(0.0, CGRectGetMaxY(self.segControl.frame) + 10, width, height-CGRectGetMaxY(self.segControl.frame)-10)]; + UIView *bottomHView = [[UIView alloc] initWithFrame:CGRectMake(0.0, CGRectGetMaxY(self.segControl.frame) + 10, width, height-CGRectGetMaxY(self.segControl.frame)-10-MyNavBarHeight)]; bottomHView.backgroundColor = JWUIColorFromRGB(0xdddddd); [self.view addSubview:bottomHView]; self.bottomFishHView = bottomHView; diff --git a/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/IfishP2PPlayBack/CameraNoParyBackVideoView.m b/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/IfishP2PPlayBack/CameraNoParyBackVideoView.m index b7b647d..9be5d95 100644 --- a/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/IfishP2PPlayBack/CameraNoParyBackVideoView.m +++ b/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/IfishP2PPlayBack/CameraNoParyBackVideoView.m @@ -22,7 +22,7 @@ if (self) { CGFloat viewH =200; - UIView *holdView = [[UIView alloc] initWithFrame:CGRectMake(0,frame.size.height/2 -viewH, kScreenSize.width, viewH)]; + UIView *holdView = [[UIView alloc] initWithFrame:self.bounds]; self.backgroundColor = TABLE_BACKGROUD_COLOR; holdView.backgroundColor = TABLE_BACKGROUD_COLOR; //self.backgroundColor = [UIColor redColor]; @@ -55,15 +55,15 @@ if (self.dataType == noDataViewTypeNOSDCard) { - CGFloat imgX = self.frame.size.width/2 - 110*KWidth_Scale/2; - self.backImg.frame =CGRectMake(imgX ,kScreenSize.height/4,110*KWidth_Scale, 110*KWidth_Scale*0.82); + CGFloat imgX = self.frame.size.width/2 - 110/2; + self.backImg.frame =CGRectMake(imgX,(self.frame.size.height-110*0.82)/2, 110, 110*0.82); self.title.frame =CGRectMake(0, CGRectGetMaxY(self.backImg.frame) + 20 , self.frame.size.width,20); self.subTitle.frame = CGRectMake(0, CGRectGetMaxY(self.title.frame) + 10, self.frame.size.width,20); }else{ - CGFloat imgX = self.frame.size.width/2 - 90*KWidth_Scale/2; - self.backImg.frame =CGRectMake(imgX ,kScreenSize.height/4,90*KWidth_Scale, 90*KWidth_Scale*0.86); + CGFloat imgX = self.frame.size.width/2 - 110/2; + self.backImg.frame =CGRectMake(imgX,(self.frame.size.height-110*0.82)/2, 110, 110*0.82); self.title.frame =CGRectMake(0, CGRectGetMaxY(self.backImg.frame) + 23 , self.frame.size.width,20); //self.backgroundColor = [UIColor blueColor]; } diff --git a/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/IfishP2PPlayBack/IfishP2PPlayBackListViewController.m b/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/IfishP2PPlayBack/IfishP2PPlayBackListViewController.m index 6e884c2..07ac4e4 100644 --- a/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/IfishP2PPlayBack/IfishP2PPlayBackListViewController.m +++ b/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/IfishP2PPlayBack/IfishP2PPlayBackListViewController.m @@ -73,6 +73,7 @@ if (success) { self.hasSDCard=YES; + [self initNoSDDataViewHidden:YES]; } else { @@ -164,8 +165,8 @@ NSString *string = [formatter stringFromDate:nowDate]; // [self.startBtn setTitle:[formatter stringFromDate:[nowDate dateByAddingTimeInterval:-60*60]] forState:UIControlStateNormal]; [self.endBtn setTitle:string forState:UIControlStateNormal]; - self.startDate=nowDate; - self.startDate=[nowDate dateByAddingTimeInterval:-60*60*2]; + self.startDate=[nowDate dateByAddingTimeInterval:-60*60]; + self.endDate=nowDate; } - (IBAction)startTimeClick:(UIButton *)sender { @@ -215,6 +216,10 @@ } - (IBAction)searchClick:(UIButton *)sender { + if ([self.startDate compare:self.endDate]==NSOrderedDescending) { + [self.view makeToast:@"开始时间必须小于结束时间"]; + return;; + } [MBProgressHUD showHUDAddedTo:self.view animated:YES]; [[GWP2PClient sharedClient] getDevicePlaybackFilesWithDeviceID:self.camera.cameraId devicePassword:self.camera.cameraPass startDate:self.startDate endDate:self.endDate completionBlock:^(GWP2PClient *client, BOOL success, NSDictionary *dataDictionary) { [MBProgressHUD hideHUDForView:self.view animated:YES]; @@ -226,6 +231,7 @@ NSArray*files=dataDictionary[@"files"]; if ([files isKindOfClass:[NSArray class]]&&files.count) { + [self initNoVideoDataViewHidden:YES]; [self.playbackFiles addObjectsFromArray:files]; [self.tableView reloadData]; @@ -238,6 +244,7 @@ else { [self initNoVideoDataViewHidden:NO]; + [self connectDevice]; } }]; } @@ -290,6 +297,7 @@ [self.navigationController pushViewController:play animated:YES]; + [tableView deselectRowAtIndexPath:indexPath animated:YES]; } diff --git a/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/IfishP2PPlayBack/IfishP2PPlayBackListViewController.xib b/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/IfishP2PPlayBack/IfishP2PPlayBackListViewController.xib index 985a991..d522aaa 100644 --- a/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/IfishP2PPlayBack/IfishP2PPlayBackListViewController.xib +++ b/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/IfishP2PPlayBack/IfishP2PPlayBackListViewController.xib @@ -48,15 +48,15 @@ - +