| | |
| | | #import "EZAreaInfo.h" |
| | | #import "EZUserInfo.h" |
| | | #import "Toast+UIView.h" |
| | | #import "EZVideoTalkViewcontroller.h" |
| | | //#import "EZVideoTalkViewcontroller.h" |
| | | #import "EZMultiChannelRealPlayVC.h" |
| | | #import "EZHubDebugViewController.h" |
| | | #import "GlobalKit.h" |
| | |
| | | |
| | | @implementation EZDeviceTableViewController |
| | | |
| | | -(void)viewWillDisappear:(BOOL)animated |
| | | { |
| | | // self.navigationController.navigationBarHidden = YES;//2021-02-01 添加隐藏navigationBarHidden |
| | | } |
| | | |
| | | - (void)viewDidLoad |
| | | { |
| | | [super viewDidLoad]; |
| | | |
| | | // [[UIBarButtonItem appearance] setBackButtonTitlePositionAdjustment:UIOffsetMake(0, -60) |
| | | // forBarMetrics:UIBarMetricsDefault]; |
| | | |
| | | // Uncomment the following line to preserve selection between presentations. |
| | | // self.clearsSelectionOnViewWillAppear = NO; |
| | |
| | | // self.title. |
| | | |
| | | self.logoutBtn.title = NSLocalizedString(@"Logout", @"注销"); |
| | | self.logoutBtn.title = @""; |
| | | [self.logoutBtn setEnabled: NO]; |
| | | |
| | | [self checkEZIsLogin]; |
| | | |
| | | // self.addButton=nil; |
| | | self.addButton=[[UIBarButtonItem alloc] init]; |
| | | // self.addButton=[UIImage imageNamed:@""]; |
| | | } |
| | | |
| | | |
| | | - (void)viewWillAppear:(BOOL)animated |
| | | { |
| | | [super viewWillAppear:animated]; |
| | | |
| | | self.navigationController.navigationBar.hidden = NO;//2021-02-01 |
| | | |
| | | if (_needRefresh) |
| | | { |
| | | _needRefresh = NO; |
| | |
| | | return; |
| | | } |
| | | [weakSelf.deviceList removeAllObjects]; |
| | | [weakSelf.deviceList addObjectsFromArray:deviceList]; |
| | | HDLEZLog(@"获取到的设备列表:%@",deviceList); |
| | | NSMutableArray *finalDeviceList=[NSMutableArray arrayWithArray:deviceList]; |
| | | if (self.filterTypes&&self.filterTypes.count!=0) {//判断是否需要过滤 |
| | | for (EZDeviceInfo *deviceInfo in deviceList) { |
| | | HDLEZLog(@"获取到的设备列表category:%@",deviceInfo.category); |
| | | if ([self.filterTypes containsObject:[HDLEZConstants turnNil:deviceInfo.category]]) { |
| | | [finalDeviceList removeObject:deviceInfo]; |
| | | } |
| | | } |
| | | } |
| | | [weakSelf.deviceList addObjectsFromArray:finalDeviceList]; |
| | | [weakSelf.tableView reloadData]; |
| | | [weakSelf.tableView.header endRefreshing]; |
| | | if (weakSelf.deviceList.count == totalCount) |
| | |
| | | // [weakSelf.view makeToast:error.description duration:2.0 position:@"bottom"]; |
| | | // return; |
| | | // } |
| | | [weakSelf.deviceList addObjectsFromArray:deviceList]; |
| | | |
| | | NSMutableArray *finalDeviceList=[NSMutableArray arrayWithArray:deviceList]; |
| | | if (self.filterTypes&&self.filterTypes.count!=0) {//判断是否需要过滤 |
| | | for (EZDeviceInfo *deviceInfo in deviceList) { |
| | | if ([self.filterTypes containsObject:[HDLEZConstants turnNil:deviceInfo.category]]) { |
| | | [finalDeviceList removeObject:deviceInfo]; |
| | | } |
| | | } |
| | | } |
| | | [weakSelf.deviceList addObjectsFromArray:finalDeviceList]; |
| | | // [weakSelf.deviceList addObjectsFromArray:deviceList]; |
| | | [weakSelf.tableView reloadData]; |
| | | [weakSelf.tableView.footer endRefreshing]; |
| | | if (weakSelf.deviceList.count == totalCount) |
| | |
| | | } |
| | | |
| | | - (void) go2VideoTalk:(EZDeviceInfo *)deviceInfo { |
| | | EZVideoTalkViewcontroller *vc = [EZVideoTalkViewcontroller videoTalkVC]; |
| | | vc.deviceInfo = deviceInfo; |
| | | [self.navigationController pushViewController:vc animated:YES]; |
| | | // EZVideoTalkViewcontroller *vc = [EZVideoTalkViewcontroller videoTalkVC]; |
| | | // vc.deviceInfo = deviceInfo; |
| | | // [self.navigationController pushViewController:vc animated:YES]; |
| | | } |
| | | |
| | | - (IBAction)go2MultiPlay:(id)sender { |