From 21d3023a9b7b6aff68c1170e345951396b1c6cfd Mon Sep 17 00:00:00 2001 From: 单军华 Date: Tue, 31 Jul 2018 13:35:21 +0800 Subject: [PATCH] no message --- screendisplay/screendisplay/Classes/检测/Controller/MonitoringMapViewController.m | 74 +++++++++++++++++++++++++++++------- 1 files changed, 59 insertions(+), 15 deletions(-) diff --git "a/screendisplay/screendisplay/Classes/\346\243\200\346\265\213/Controller/MonitoringMapViewController.m" "b/screendisplay/screendisplay/Classes/\346\243\200\346\265\213/Controller/MonitoringMapViewController.m" index 6c707e0..f3ad1b6 100644 --- "a/screendisplay/screendisplay/Classes/\346\243\200\346\265\213/Controller/MonitoringMapViewController.m" +++ "b/screendisplay/screendisplay/Classes/\346\243\200\346\265\213/Controller/MonitoringMapViewController.m" @@ -24,6 +24,7 @@ BMKActionPaopaoView * pPaopaoView; UILabel * titleLabel; UILabel * addressLabel; + UILabel * macLabel; NSTimer * myTimer; // ������������������ int hCurrentIndex; } @@ -362,7 +363,7 @@ annotationView.annotation = annotation; // ������popView��������� - CGFloat hWidth = 180; + CGFloat hWidth = 200; CGFloat hHight = 80; if(popView == nil) { @@ -383,7 +384,7 @@ // title if(titleLabel==nil) { - titleLabel = [[UILabel alloc]initWithFrame:CGRectMake(AdaptedWidth(10), AdaptedHeight(10), AdaptedWidth(hWidth-20-10), AdaptedHeight(20))]; + titleLabel = [[UILabel alloc]initWithFrame:CGRectMake(AdaptedWidth(10), AdaptedHeight(10), AdaptedWidth(hWidth-20-10), AdaptedHeight(15))]; titleLabel.font = AdaptedFontSize(10); titleLabel.textColor = kUIColorFromRGB(0xff7800); @@ -391,14 +392,25 @@ [popViewBk addSubview:titleLabel]; } + // title + if(macLabel==nil) + { + macLabel = [[UILabel alloc]initWithFrame:CGRectMake(AdaptedWidth(10), AdaptedHeight(10+15+2), AdaptedWidth(hWidth-20-10), AdaptedHeight(15))]; + + macLabel.font = AdaptedFontSize(9); + macLabel.textColor = kUIColorFromRGB(0x595959); + macLabel.textAlignment = NSTextAlignmentLeft; + [popViewBk addSubview:macLabel]; + } + // ������ if(addressLabel==nil) { - addressLabel = [[UILabel alloc]initWithFrame:CGRectMake(AdaptedWidth(10), AdaptedHeight(10+20+2), AdaptedWidth(hWidth-20-10), AdaptedHeight(20))]; + addressLabel = [[UILabel alloc]initWithFrame:CGRectMake(AdaptedWidth(10), AdaptedHeight(10+15+2+15+2), AdaptedWidth(hWidth-20-10), AdaptedHeight(15))]; addressLabel.textColor = kUIColorFromRGB(0x595959); addressLabel.textAlignment = NSTextAlignmentLeft; - addressLabel.font = AdaptedFontSize(10); + addressLabel.font = AdaptedFontSize(9); [popViewBk addSubview:addressLabel]; } @@ -407,7 +419,8 @@ } titleLabel.text = pModel.device_name; - addressLabel.text = pModel.address; + macLabel.text = [NSString stringWithFormat:@"MAC:%@",pModel.mac]; + addressLabel.text = [NSString stringWithFormat:@"������:%@",pModel.address]; ((BMKPinAnnotationView *)annotationView).paopaoView = pPaopaoView; popView = ((BMKPinAnnotationView *)annotationView).paopaoView ; @@ -423,14 +436,33 @@ -(void)clickPopView { - DetailDataViewController * page = [[DetailDataViewController alloc] init]; - //[self presentViewController:page animated:YES completion:nil]; - page.deviceModel = [self.deviceSevice.deviceViewModels objectAtIndex:hCurrentIndex]; - [UserDefault setObject:page.deviceModel.mac forKey:@"mac"]; - [UserDefault setObject:page.deviceModel.state forKey:@"state"]; - [UserDefault synchronize];//������synchronize���������������������������������,���������������NSUserDefaults������������������������������������ - [self.navigationController pushViewController:page animated:YES]; - NSLog(@"clickPopView"); + DeviceModel* model = [self.deviceSevice.deviceViewModels objectAtIndex:hCurrentIndex]; + + if([model.state intValue] == 4) + { + // Make toast with a title + [self.navigationController.view makeToast:@"���������������������������������������������!" + duration:3.0 + position:CSToastPositionBottom + title:@"������������" + image:nil + style:nil + completion:nil]; + + //[MBProgressHUD showWarn:@"���������������������������������������������!" ToView:self.view]; + //[Global alertMessageEx:@"���������������������������������������������!" title:@"������������" okTtitle:nil cancelTitle:@"������" delegate:self]; + } + else + { + DetailDataViewController * page = [[DetailDataViewController alloc] init]; + //[self presentViewController:page animated:YES completion:nil]; + page.deviceModel = [self.deviceSevice.deviceViewModels objectAtIndex:hCurrentIndex]; + [UserDefault setObject:page.deviceModel.mac forKey:@"mac"]; + [UserDefault setObject:page.deviceModel.state forKey:@"state"]; + [UserDefault synchronize];//������synchronize���������������������������������,���������������NSUserDefaults������������������������������������ + [self.navigationController pushViewController:page animated:YES]; + NSLog(@"clickPopView"); + } } -(void)closePopView @@ -454,7 +486,8 @@ { DeviceModel *pModel = [self.deviceSevice.deviceViewModels objectAtIndex:[((BMKPointAnnotation*)view.annotation).customIndex intValue]]; titleLabel.text = pModel.device_name; - addressLabel.text = pModel.address; + macLabel.text = [NSString stringWithFormat:@"MAC:%@",pModel.mac]; + addressLabel.text = [NSString stringWithFormat:@"������:%@",pModel.address]; hCurrentIndex = [((BMKPointAnnotation*)view.annotation).customIndex intValue]; [popView setHidden:NO]; NSLog(@"didSelectAnnotationView"); @@ -524,7 +557,18 @@ } else { - [Global alertMessageEx:desc title:@"������������������" okTtitle:nil cancelTitle:@"OK" delegate:self]; + // Make toast with a title + if(!bIsUpdate) + { + [Global alertMessageEx:desc title:@"������������������" okTtitle:nil cancelTitle:@"OK" delegate:self]; + } +// [self.navigationController.view makeToast:@"���������������������������������������������!" +// duration:3.0 +// position:CSToastPositionBottom +// title:@"������������" +// image:nil +// style:nil +// completion:nil]; } }]; } -- Gitblit v1.8.0