From a46a054ab26cca1f0a046e136d432eb41f339c89 Mon Sep 17 00:00:00 2001 From: kai60 Date: Thu, 19 May 2022 22:38:53 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=80=E9=94=AE=E5=96=82=E9=B1=BC=E7=95=8C?= =?UTF-8?q?=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../XuanduoTempratueCorrectViewController.h | 2 +- .../XuanduoTempratueCorrectViewController.m | 1410 +---------------- .../XuTo/XuanduoTempratureCorrectView.h | 1 + .../XuTo/XuanduoTempratureCorrectView.m | 5 + .../XuTo/XuanduoTempratureCorrectView.xib | 43 + .../XuTo/XuanduofishFeedViewController.h | 2 +- .../XuTo/XuanduofishFeedViewController.m | 23 +- 7 files changed, 121 insertions(+), 1365 deletions(-) diff --git a/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/XuanduoTempratueCorrectViewController.h b/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/XuanduoTempratueCorrectViewController.h index b6c3d1d..da3e4e3 100644 --- a/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/XuanduoTempratueCorrectViewController.h +++ b/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/XuanduoTempratueCorrectViewController.h @@ -15,7 +15,7 @@ NS_ASSUME_NONNULL_BEGIN @class Xuanduo2Model; -@interface XuanduoTempratueCorrectViewController : FatherController +@interface XuanduoTempratueCorrectViewController : BaseViewController @property (nonatomic,strong) UIActivityIndicatorView*indicatorView; @property (nonatomic ,strong) id dataModel; diff --git a/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/XuanduoTempratueCorrectViewController.m b/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/XuanduoTempratueCorrectViewController.m index 7109768..29e1637 100644 --- a/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/XuanduoTempratueCorrectViewController.m +++ b/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/XuanduoTempratueCorrectViewController.m @@ -50,6 +50,7 @@ static NSString *timerTypeFlag = @"TimerTypeTableViewCell"; @property (nonatomic,strong) NSMutableDictionary *timeDic; @property(nonatomic,copy) NSString *nextChangeDateLabel; @property(nonatomic,strong) MyHud *XuTohud; +@property(nonatomic,strong)XuanduoTempratureCorrectView*tempView; @end @@ -80,13 +81,13 @@ static NSString *timerTypeFlag = @"TimerTypeTableViewCell"; [defuat synchronize]; self.nextChangeDateLabel=self.waterInfmodel.remindDate; - [self.tableView reloadData]; + }]; } [Socketsingleton sharedInstance].communiteDelegate = self; //关闭打开的section _selectSection = -1; - [self.tableView reloadData]; + @@ -113,7 +114,17 @@ static NSString *timerTypeFlag = @"TimerTypeTableViewCell"; [self creatIndicatorView]; [Socketsingleton sharedInstance].communiteDelegate = self; } - + -(void)creatIndicatorView{ + + _indicatorView=[[UIActivityIndicatorView alloc]initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge]; + _indicatorView.frame=CGRectMake(kScreenSize.width/2-50,kScreenSize.height/2-100,100, 100); + _indicatorView.backgroundColor=IndicatorBack_COLOR; + _indicatorView.layer.masksToBounds=YES; + _indicatorView.layer.cornerRadius=5; + AppDelegate *delegate= [[UIApplication sharedApplication] delegate]; + [delegate.window addSubview:_indicatorView]; + + } - (void)refreshWithData:(Xuanduo3fModel*)model { NSString*low = model.miniTemp; @@ -127,1383 +138,60 @@ static NSString *timerTypeFlag = @"TimerTypeTableViewCell"; - (void)setupTable { - XuToControlName *name = [UserExtendataArchaver currentNewXuToControlName:self.currentdevice.macAddress]; - if ([self.currentdevice.type isEqualToString:DECICE_TYPE_XUANDUO3F]) - { - name=[UserExtendataArchaver currentPetsXuToControlName:self.currentdevice.macAddress]; - } - // _titieArr = @[@"循环泵",@"增氧泵",@"灯光1",@"灯光2",@"造浪泵",@"杀菌灯"]; - _titieArr = @[name.xunhuanPump,name.zengyangPump,name.light1,name.light2,name.zaolangPump,name.shajunLight]; - - _imgArr = @[@"循环棒",@"增氧泵",@"灯光1",@"灯光2",@"造浪",@"杀菌"]; - - - if ([self.currentdevice.type isEqualToString:DECICE_TYPE_XUANDUO3F]) - { - _titieArr = @[name.xunhuanPump,name.zaolangPump,name.light1]; - _imgArr = @[@"照明开",@"换气开",@"杀菌开"]; - } - - - - _selectSection = -1; - for (int i = 0; i<_titieArr.count; i++) { - NSMutableArray *dataArr = [NSMutableArray arrayWithCapacity:0]; - if (![_titieArr[i] isEqualToString:@"杀菌"]) - { - [dataArr addObject:plusflag]; - } - - [self.timeDic setObject:dataArr forKey:_titieArr[i]]; - } - self.tableView.backgroundColor=COLOR_MIAN; - self.tableView.separatorStyle=UITableViewCellSeparatorStyleNone; - [self.tableView registerNib:[UINib nibWithNibName:temperatureCellid bundle:nil] forCellReuseIdentifier:temperatureCellid]; - [self.tableView registerNib:[UINib nibWithNibName:changeWaterCellid bundle:nil] forCellReuseIdentifier:changeWaterCellid]; - [self.tableView registerNib:[UINib nibWithNibName:addCellid bundle:nil] forCellReuseIdentifier:addCellid]; - //[self.tableView registerNib:[UINib nibWithNibName:timerTypeFlag bundle:nil] forCellReuseIdentifier:timerTypeFlag]; - [self.tableView registerNib:[UINib nibWithNibName:setTimerflag bundle:nil] forCellReuseIdentifier:setTimerflag]; + self.view.backgroundColor=COLOR_MIAN; XuanduoTempratureCorrectView*tempView=[XuanduoTempratureCorrectView viewFromXib]; - tempView.frame=CGRectMake(10, 10, 300, 200); + tempView.frame=CGRectMake(10, 10, 300, 150); tempView.centerX=self.view.centerX; + tempView.layer.cornerRadius=10; + + tempView.textField.keyboardType=UIKeyboardTypeASCIICapable; + tempView.textField.delegate=self; + [tempView becomeFirstResponder]; + UIToolbar *toolbar = [[UIToolbar alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, 30)];//创建toolbar + UIBarButtonItem *sure = [[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:self action:@selector(sure)]; + UIBarButtonItem *space = [[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil]; + UIBarButtonItem *cancel = [[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemCancel target:self action:@selector(cancel)]; + [toolbar setItems:@[sure,space,cancel]]; + tempView.textField.inputAccessoryView=toolbar; [self.view addSubview:tempView]; + self.tempView=tempView; + UILabel*label=[[UILabel alloc]initWithFrame:CGRectZero]; + label.textColor=[UIColor whiteColor]; + label.font=[UIFont systemFontOfSize:12]; + label.numberOfLines=0; + label.text=@"温度校准值需在+-5℃以内,超过+-5℃请更换水温抬头,更换探头后,需点击取消校准按钮,清除上一次温度校准的误差值"; + CGSize size= [label.text boundingRectWithSize:CGSizeMake(300, MAXFLOAT) options:(NSStringDrawingUsesFontLeading | NSStringDrawingTruncatesLastVisibleLine | NSStringDrawingUsesLineFragmentOrigin) attributes:@{NSFontAttributeName: label.font} context:NULL].size; + label.frame=CGRectMake((self.view.frame.size.width-size.width)/2.0, CGRectGetMaxY(tempView.frame)+10, size.width, size.height); + [self.view addSubview:label]; } --(void)clickCell:(TimerTypeTableViewCell *)cell button:(UIButton *)button timerType:(NSInteger )type -{ - XuanduoTimerSettingViewController *_settingVC = [[XuanduoTimerSettingViewController alloc] init]; - _settingVC.currentdevice = self.currentdevice; - _settingVC.dataModel = self.dataModel; - _settingVC.readMode=self.readMode; - _settingVC.timerType=type; - [self.navigationController pushViewController:_settingVC animated:YES]; -} + #pragma mark - Table view data source -- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { - return 0; -} -- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { - return 0; -} - -- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { - if (indexPath.section == 0){ - TemperatureSetCell *cell = [tableView dequeueReusableCellWithIdentifier:temperatureCellid]; - TemperatureSetModel *model=[[TemperatureSetModel alloc]init]; - model.title = @"定时设置"; - cell.titleLabel.text = model.title; - NSLog(@"wendu str = %@",_wenduString); - model.temperatureLabel = _wenduString; - cell.temperaturelabel.text = model.temperatureLabel; - [cell.temPSwitch addTarget:self action:@selector(xuTotempSwitchAction:) forControlEvents:UIControlEventTouchUpInside]; - cell.temperaturelabel.hidden=YES; - cell.temPSwitch.hidden=YES; - cell.icon.hidden=NO; - cell.icon.image=[UIImage imageNamed:@"定时"]; - cell.titileLabelLayout.constant=40; - if (self.dataModel) { - Xuanduo2Model*model=self.dataModel; - if ([model.alarmSwitch isEqualToString:@"01"]) { - - [cell.temPSwitch setBackgroundImage:[UIImage imageNamed:@"greenbtn_big"] forState:UIControlStateNormal]; - cell.temPSwitch.selected = NO; - - }else{ - - [cell.temPSwitch setBackgroundImage:[UIImage imageNamed:@"graybtn_big"] forState:UIControlStateNormal]; - - cell.temPSwitch.selected = YES; - } - - } - - return cell; - }else if(indexPath.section == 1 && indexPath.row == 0){ - if (![self.currentdevice.waterRemind isEqual:[NSNull null]]) { - ChangeWaterCell *cell = [tableView dequeueReusableCellWithIdentifier:changeWaterCellid]; - [cell.ChangeWaterSwitch addTarget:self action:@selector(xuTochangeWaterSwitch:) forControlEvents:UIControlEventTouchUpInside]; - - if ([self.waterInfmodel.waterremind isEqualToString:@"1"]) { - [cell.ChangeWaterSwitch setBackgroundImage:[UIImage imageNamed:@"greenbtn_big"] forState:UIControlStateNormal]; - cell.ChangeWaterSwitch.selected = NO; - cell.backgroundView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"firstSetCell"]]; - _huanShuiSwitchIsOn=YES; - }else{ - [cell.ChangeWaterSwitch setBackgroundImage:[UIImage imageNamed:@"graybtn_big"] forState:UIControlStateNormal]; - cell.ChangeWaterSwitch.selected = YES; - _huanShuiSwitchIsOn=NO; - cell.backgroundView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"set_cellBack"]]; - } - - if (self.waterInfmodel.remindcycle == 0) { - //在未获取换水信息时暂时显示 - cell.huanshuiDaylabel.text=@"换水时间"; - if ([self.currentdevice.type isEqualToString:DECICE_TYPE_XUANDUO3F]) - { - cell.huanshuiDaylabel.text=@"杀菌时间"; - cell.titleLabel.text=@"杀菌提醒"; - } - }else{ - - cell.huanshuiDaylabel.text=[NSString stringWithFormat:@"%ld天",(long)self.waterInfmodel.remindcycle]; - - } - - - return cell; - - } - }else if (indexPath.section==1 && indexPath.row == 1){ - - static NSString*nextHuanShuiLablecellId=@"labelcell"; - UITableViewCell*cell=[tableView dequeueReusableCellWithIdentifier:nextHuanShuiLablecellId]; - if (cell==nil) { - cell=[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:nextHuanShuiLablecellId]; - } - if (_huanShuiSwitchIsOn) { - - cell.textLabel.text=[NSString stringWithFormat:@"下次换水时间:%@",self.waterInfmodel.remindDate]; - if (!self.waterInfmodel.remindDate) { - cell.textLabel.text=[NSString stringWithFormat:@"下次换水时间:%@",self.nextChangeDateLabel]; - } - - if ([self.currentdevice.type isEqualToString:DECICE_TYPE_XUANDUO3F]) - { - cell.textLabel.text=[NSString stringWithFormat:@"下次杀菌时间:%@",self.waterInfmodel.remindDate]; - if (!self.waterInfmodel.remindDate) { - cell.textLabel.text=[NSString stringWithFormat:@"下次杀菌时间:%@",self.nextChangeDateLabel]; - } - - } - - cell.textLabel.font=[UIFont systemFontOfSize:15]; - [cell.textLabel sizeToFit]; - - cell.textLabel.textColor =[UIColor colorWithRed:146.0/256.0 green:146.0/256.0 blue:146.0/256.0 alpha:1]; - cell.backgroundView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"secondSetCell"]]; - - } - else{ - cell.textLabel.text=@""; - } - cell.userInteractionEnabled = NO; - return cell; - - }else if(indexPath.section -2== _titieArr.count && indexPath.row == 0&&[self.currentdevice.type isEqualToString:DECICE_TYPE_XUANDUO3F]){ - TemperatureSetCell *cell = [tableView dequeueReusableCellWithIdentifier:temperatureCellid]; - TemperatureSetModel *model=[[TemperatureSetModel alloc]init]; - model.title = @"恒温设置"; - cell.titleLabel.text = model.title; - - Xuanduo3fModel*xmodel=(Xuanduo3fModel*)_dataModel; - NSString*heating = xmodel.heatingTemperature; - UInt64 heat = [dataContorl hexToTen:heating]; - - float formatheat = heat/10; - model.temperatureLabel = [NSString stringWithFormat:@"%f",formatheat]; - cell.temPSwitch.hidden=YES; - cell.temperaturelabel.frame=cell.temPSwitch.frame; - - Xuanduo3fModel*model3=self.dataModel; - int mac=[dataContorl hexToTen:model3.heatingTemperature]; - - //float TPlabel=mac/10+(mac%10)*0.1; - float temp = mac/10.0; - NSString *stringTemp = [NSString stringWithFormat:@"%.1f℃",temp]; - cell.temperaturelabel.textAlignment=NSTextAlignmentRight; - [cell.temperaturelabel setAttributedText:[NSString ls_changeFontAndColor:[UIFont systemFontOfSize:15] Color:nil TotalString:stringTemp SubStringArray:@[@"℃"]]]; - - - - - return cell; - - } - else { - if (indexPath.section - 2 < _titieArr.count && _selectSection == indexPath.section) { - NSArray *dataArr = [self.timeDic objectForKey:_titieArr[indexPath.section-2]]; - BOOL havePlus = [dataArr containsObject:plusflag]; - if (havePlus && (indexPath.row == dataArr.count-1)) { - TimerTypeTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:timerTypeFlag]; - if (!cell) { - cell=[[TimerTypeTableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:timerTypeFlag]; - } - cell.delegate=self; - return cell; - }else { - SetTimerCell *cell = [tableView dequeueReusableCellWithIdentifier:setTimerflag forIndexPath:indexPath]; - cell.switchBtn.tag = kSwitchBtnTag + indexPath.row; - [cell.switchBtn addTarget:self action:@selector(switchAction:) forControlEvents:UIControlEventTouchUpInside]; - XuanduoTimerGroup *group = [dataArr objectAtIndex:havePlus?indexPath.row+1:indexPath.row]; - cell.model=group; - if ([group isKindOfClass:[XuanduoTimerGroup class]]) - { - BOOL isOn = NO; - if ([group.status isEqualToString:@"01"]) { - isOn = YES; - } - [cell configTitleLabel:[NSString stringWithFormat:@"时段%@",group.groupNumber] timer:group.time switchStatus:isOn]; - cell.selectionStyle = UITableViewCellSelectionStyleNone; - - } - else if([group isKindOfClass:[XuanduoCycleModel class]]) - { - XuanduoCycleModel*model=group; - BOOL isOn = NO; - if ([model.status isEqualToString:@"00"]) { - isOn = YES; - } - - - - [cell configTitleLabel:@"循环开关" timer:[NSString stringWithFormat:@"持续时长%d分钟",[dataContorl hexToTen:model.lastTime]] switchStatus:isOn]; - cell.selectionStyle = UITableViewCellSelectionStyleNone; - - } - return cell; - } - } - } - return [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:@""]; -} - --(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{ - if (indexPath.section == 0) { - return 50; - }else if (indexPath.section == 1 && indexPath.row == 0){ - return 0; - }else if (indexPath.section == 1 && indexPath.row == 1){ - if (!_huanShuiSwitchIsOn) { - }else { - return 0; - } - }else if (indexPath.section - 2 <_titieArr.count) { - NSArray *dataArr = [self.timeDic objectForKey:_titieArr[indexPath.section-2]]; - BOOL havePlus = [dataArr containsObject:plusflag]; - if (_selectSection == indexPath.section) { - if (havePlus && indexPath.row == dataArr.count - 1) { - return 40; - }else{ - return 50; - } - }else { - return 0; - } - } - else if(indexPath.section - 2 ==_titieArr.count&&[self.currentdevice.type isEqualToString:DECICE_TYPE_XUANDUO3F]) - { - return 50; - } - - return 0; -} - -#pragma mark tableView 头视图和脚视图 --(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{ - if (section == 0) { - return 5; - }else if (section == 2){ - return 40; - }else if (section == 3){ - return 40; - }else if (section == 4){ - return 40; - }else if (section == 5){ - - return [self.currentdevice.type isEqualToString:DECICE_TYPE_XUANDUO3F]?0:40; - }else if (section == 6){ - return 40; - }else if (section == 7){ - return 40; - }else { - return CGFLOAT_MIN; - } - -} - -- (UIView*)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section { - if (section == 0) { - UIView *oneHeader = [[UIView alloc] init]; - oneHeader.backgroundColor = COLOR_MIAN; - return oneHeader; - }else if(section == 2){ - XuanduoSelectHeader *headerView = [XuanduoSelectHeader shareHeaderView]; - headerView.controlBtn.tag = kBtnTag + section; - if (_selectSection == section) { - headerView.controlBtn.selected = YES; - } - [headerView.controlBtn addTarget:self action:@selector(foldAction:) forControlEvents:UIControlEventTouchUpInside]; - [headerView configWithImageName:_imgArr[section-2] labelName:_titieArr[section-2]]; - return headerView; - }else if(section == 3){ - XuanduoSelectHeader *headerView = [XuanduoSelectHeader shareHeaderView]; - headerView.controlBtn.tag = kBtnTag + section; - if (_selectSection == section) { - headerView.controlBtn.selected = YES; - } - [headerView.controlBtn addTarget:self action:@selector(foldAction:) forControlEvents:UIControlEventTouchUpInside]; - [headerView configWithImageName:_imgArr[section-2] labelName:_titieArr[section-2]]; - return headerView; - }else if(section == 4){ - XuanduoSelectHeader *headerView = [XuanduoSelectHeader shareHeaderView]; - headerView.controlBtn.tag = kBtnTag + section; - if (_selectSection == section) { - headerView.controlBtn.selected = YES; - } - [headerView.controlBtn addTarget:self action:@selector(foldAction:) forControlEvents:UIControlEventTouchUpInside]; - [headerView configWithImageName:_imgArr[section-2] labelName:_titieArr[section-2]]; - return headerView; - }else if(section == 5){ - if ([self.currentdevice.type isEqualToString:DECICE_TYPE_XUANDUO3F]) - { - UIView *oneHeader = [[UIView alloc] init]; - oneHeader.backgroundColor = COLOR_MIAN; - return oneHeader; - } - else - { - XuanduoSelectHeader *headerView = [XuanduoSelectHeader shareHeaderView]; - headerView.controlBtn.tag = kBtnTag + section; - if (_selectSection == section) { - headerView.controlBtn.selected = YES; - } - [headerView.controlBtn addTarget:self action:@selector(foldAction:) forControlEvents:UIControlEventTouchUpInside]; - [headerView configWithImageName:_imgArr[section-2] labelName:_titieArr[section-2]]; - return headerView; - } - - }else if(section == 6){ - XuanduoSelectHeader *headerView = [XuanduoSelectHeader shareHeaderView]; - headerView.controlBtn.tag = kBtnTag + section; - if (_selectSection == section) { - headerView.controlBtn.selected = YES; - } - [headerView.controlBtn addTarget:self action:@selector(foldAction:) forControlEvents:UIControlEventTouchUpInside]; - [headerView configWithImageName:_imgArr[section-2] labelName:_titieArr[section-2]]; - return headerView; - }else if(section == 7){ - XuanduoSelectHeader *headerView = [XuanduoSelectHeader shareHeaderView]; - headerView.controlBtn.tag = kBtnTag + section; - if (_selectSection == section) { - headerView.controlBtn.selected = YES; - } - [headerView.controlBtn addTarget:self action:@selector(foldAction:) forControlEvents:UIControlEventTouchUpInside]; - [headerView configWithImageName:_imgArr[section-2] labelName:_titieArr[section-2]]; - return headerView; - } - - return nil; -} - -#pragma mark tableView 点击事件 - --(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{ - _indexPath = indexPath; - if (indexPath.section==0) { -// _mypicView=[[MyPickerView alloc]init]; -// -// _mypicView.frame=CGRectMake(0, 0, kScreenSize.width, kScreenSize.height); -// [self.view.window addSubview:_mypicView]; -// [_mypicView.sureButton addTarget:self action:@selector(mypicViewRemoveByDone) forControlEvents:UIControlEventTouchUpInside]; -// [self temperatureMainQueue]; - - }else if (indexPath.section==1){ - //换水提醒日期选择 - _remindPic=[[remindCyclePic alloc]initWithFrame:CGRectMake(0, 0, kScreenSize.width, kScreenSize.height) type:self.currentdevice.type]; - - _remindPic.frame=CGRectMake(0, 0, kScreenSize.width, kScreenSize.height); - _remindPic.type=self.currentdevice.type; - [self.view.window addSubview:_remindPic]; - [_remindPic.sureBtn addTarget:self action:@selector(xuToremindCyclePicDone) forControlEvents:UIControlEventTouchUpInside]; - [self huanShuiMainQueue]; - }else if(indexPath.section-2==_titieArr.count){ - //恒温设置 - _remindPic=[[remindCyclePic alloc]initWithFrame:CGRectMake(0, 0, kScreenSize.width, kScreenSize.height) type:@"temp"]; - _remindPic.type=@"temp"; - - _remindPic.frame=CGRectMake(0, 0, kScreenSize.width, kScreenSize.height); - [self.view.window addSubview:_remindPic]; - [_remindPic.sureBtn addTarget:self action:@selector(xuToremindCyclePicDone) forControlEvents:UIControlEventTouchUpInside]; - [self huanShuiMainQueue]; - }else { - SetTimerCell *cell = [self.tableView cellForRowAtIndexPath:_indexPath]; - if ([cell isKindOfClass:[PlusTableViewCell class]]) { - return; - } - else if([cell isKindOfClass:[SetTimerCell class]]&&[cell.model isKindOfClass:[XuanduoCycleModel class]]) - { - //恒温设置 - _cycleModel=cell.model; - _remindPic=[[remindCyclePic alloc]initWithFrame:CGRectMake(0, 0, kScreenSize.width, kScreenSize.height) type:@"cycle"]; - _remindPic.type=@"cycle"; - - _remindPic.frame=CGRectMake(0, 0, kScreenSize.width, kScreenSize.height); - [self.view.window addSubview:_remindPic]; - [_remindPic.sureBtn addTarget:self action:@selector(xuToremindCyclePicDone) forControlEvents:UIControlEventTouchUpInside]; - [self huanShuiMainQueue]; - } - else - { - [self addTimer:nil]; - - } - } -} - --(void)temperatureMainQueue{ - NSArray*lowArr=[_mypicView.picArr objectAtIndex:0]; - NSArray*heighArr=[_mypicView.picArr objectAtIndex:2]; - for (NSInteger i=0; i + @@ -66,11 +67,38 @@ + + + + + + + + + + + + + + + + + + @@ -79,17 +107,32 @@ + + + + + + + + + + + + + + + diff --git a/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/XuanduofishFeedViewController.h b/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/XuanduofishFeedViewController.h index b6d39f0..b08dcb5 100644 --- a/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/XuanduofishFeedViewController.h +++ b/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/XuanduofishFeedViewController.h @@ -15,7 +15,7 @@ NS_ASSUME_NONNULL_BEGIN @class Xuanduo2Model; -@interface XuanduofishFeedViewController : FatherController +@interface XuanduofishFeedViewController : BaseViewController @property (nonatomic,strong) UIActivityIndicatorView*indicatorView; @property (nonatomic ,strong) id dataModel; diff --git a/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/XuanduofishFeedViewController.m b/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/XuanduofishFeedViewController.m index 19095a3..405315e 100644 --- a/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/XuanduofishFeedViewController.m +++ b/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/XuanduofishFeedViewController.m @@ -45,7 +45,7 @@ static NSString *timerTypeFlag = @"TimerTypeTableViewCell"; @property(nonatomic,strong) setRemindWaterModel *waterInfmodel; @property(nonatomic,strong) Xuanduo2TimerModel *timerModel; @property(nonatomic,strong) XuanduoCycleModel *cycleModel; - +@property(nonatomic,strong)UITableView*tableView; @property (nonatomic,strong) NSMutableDictionary *timeDic; @property(nonatomic,copy) NSString *nextChangeDateLabel; @property(nonatomic,strong) MyHud *XuTohud; @@ -126,6 +126,7 @@ static NSString *timerTypeFlag = @"TimerTypeTableViewCell"; - (void)setupTable { + self.view.backgroundColor=COLOR_MIAN; XuToControlName *name = [UserExtendataArchaver currentNewXuToControlName:self.currentdevice.macAddress]; if ([self.currentdevice.type isEqualToString:DECICE_TYPE_XUANDUO3F]) { @@ -156,6 +157,14 @@ static NSString *timerTypeFlag = @"TimerTypeTableViewCell"; [self.timeDic setObject:dataArr forKey:_titieArr[i]]; } + UITableView*tableView=[[UITableView alloc]initWithFrame:CGRectMake(0, 0, kScreenWidth, 300) style:UITableViewStylePlain]; + if (@available(iOS 15.0, *)) + { + tableView.sectionHeaderTopPadding=0; + } + tableView.delegate=self; + tableView.dataSource=self; + self.tableView=tableView; self.tableView.backgroundColor=COLOR_MIAN; self.tableView.separatorStyle=UITableViewCellSeparatorStyleNone; [self.tableView registerNib:[UINib nibWithNibName:temperatureCellid bundle:nil] forCellReuseIdentifier:temperatureCellid]; @@ -163,9 +172,19 @@ static NSString *timerTypeFlag = @"TimerTypeTableViewCell"; [self.tableView registerNib:[UINib nibWithNibName:addCellid bundle:nil] forCellReuseIdentifier:addCellid]; //[self.tableView registerNib:[UINib nibWithNibName:timerTypeFlag bundle:nil] forCellReuseIdentifier:timerTypeFlag]; [self.tableView registerNib:[UINib nibWithNibName:setTimerflag bundle:nil] forCellReuseIdentifier:setTimerflag]; + + UILabel*label=[[UILabel alloc]initWithFrame:CGRectZero]; + label.textColor=[UIColor whiteColor]; + label.font=[UIFont systemFontOfSize:12]; + label.numberOfLines=0; + label.text=@"将设备关联至一键喂鱼功能后,点击一键喂鱼开关时,所有关联的设备会同时按照设置好的操作执行,如您将循环泵、增氧泵、灯光1三个设备关联至一键喂鱼功能,并将循环泵设置关闭,增氧泵设置关闭,灯光1设置打开,喂鱼时,点击一键喂鱼按钮,系统将会把循环泵和增氧泵进行关闭,灯光1打开,方便鱼儿进食10分钟后,喂鱼结束,系统会自动恢复喂鱼前的设备状态(如果关联的设备有定时,会按照定时执行)。"; + CGSize size= [label.text boundingRectWithSize:CGSizeMake(300, MAXFLOAT) options:(NSStringDrawingUsesFontLeading | NSStringDrawingTruncatesLastVisibleLine | NSStringDrawingUsesLineFragmentOrigin) attributes:@{NSFontAttributeName: label.font} context:NULL].size; + label.frame=CGRectMake((kScreenWidth-size.width)/2.0, CGRectGetMaxY(self.tableView.frame)+20, size.width, size.height); + [self.view addSubview:label]; + } --(void)clickCell:(TimerTypeTableViewCell *)cell button:(UIButton *)button timerType:(NSInteger *)type +-(void)clickCell:(TimerTypeTableViewCell *)cell button:(UIButton *)button timerType:(NSInteger )type { XuanduoTimerSettingViewController *_settingVC = [[XuanduoTimerSettingViewController alloc] init]; _settingVC.currentdevice = self.currentdevice;