V5.0.0正式版:

1、加热棒内容修改;
2、首页商品删除,更改为行业资讯;
3、绚多设备更名显示;
4、bugly更换为新版本;
5、摄像头显示bug修复;
6、开屏广告显示不全修复;
This commit is contained in:
wbzhan
2019-08-23 16:11:17 +08:00
parent 374a0fed46
commit 23c5d6f60d
50 changed files with 1499 additions and 897 deletions
+59 -64
View File
@@ -28,14 +28,15 @@
@interface IfishHotBarVc ()<UITableViewDelegate,UITableViewDataSource,ChangeWaterDelegate,IfishHistoryViewBottomBarDelete>
@property (weak, nonatomic) IBOutlet UITableView *mainTableView;
@property (strong, nonatomic) UITableView *mainTableView;
@property(nonatomic,strong)NSMutableArray*datas;
@property(nonatomic,strong)IFishWaterChangeView*changeWaterView;
@property(nonatomic,strong)IfishHistoryView*historyView;
@property (weak, nonatomic) IBOutlet UILabel *templetrueLable;
@property(nonatomic,strong)IfishHotBarVo*vo;
@property(nonatomic,strong)IfishHotBarHeader*header;
@property(nonatomic,assign)NSInteger curDay;
Assign BOOL isInitHostoryView;
@end
@implementation IfishHotBarVc
@@ -52,9 +53,6 @@
return _header;
}
-(void)initUI{
}
-(void)wenduRequest{// 查询设备状态信息
searchDeviceModel*xinxiModel=[[searchDeviceModel alloc]init];
@@ -67,38 +65,23 @@
[[Socketsingleton sharedInstance].clientSocket readDataWithTimeout:-1 tag:0];
[self getHotBarInfo];
}
-(IfishHistoryView *)historyView{
if (_historyView==nil) {
_historyView=[IfishHistoryView getView];
_historyView.frame=self.view.bounds;
if (!_historyView) {
_historyView=InitObject(IfishHistoryView);
_historyView.myDeleget=self;
[self.view addSubview:_historyView];
[_historyView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.mas_equalTo(self.view);
}];
}
// _historyView.hidden=NO;
return _historyView;
}
-(void)clickBottomBarWithIdx:(NSInteger)idx{
if (idx==10) {
self.curDay++;
if (self.curDay>7) {
[SVProgressHUD showInfoWithStatus:@"只能查询前七天数据!"];
self.curDay=7;
return;
}
}else{
self.curDay--;
if(self.curDay<0){
[SVProgressHUD showInfoWithStatus:@"只能查询前七天数据!"];
self.curDay=0;
return;
}
}
//获取历史流量数据
-(void)getHistoryDataRequest{
self.isInitHostoryView = YES;
NSDate *curDate = [NSDate dateWithTimeInterval:self.curDay*60*60*-24 sinceDate:[NSDate date]];
NSDateFormatter *dateFormatter=[[NSDateFormatter alloc]init];//创建一个日期格式化器
@@ -106,7 +89,7 @@
NSLog(@"%@",[dateFormatter stringFromDate:curDate]);//2015-11-20 08:24:04
NSString*curDateStr=[dateFormatter stringFromDate:curDate];
// __block NSString*b_dateStr=curDateStr;
// __block NSString*b_dateStr=curDateStr;
[SVProgressHUD showWithMaskType:SVProgressHUDMaskTypeBlack];
NSDictionary*para=@{@"heaterMacAddress":self.devicemodel.macAddress,@"date":curDateStr};//yyyy-mm-dd
self.historyView.curdateStr=curDateStr;
@@ -130,15 +113,37 @@
[SVProgressHUD showInfoWithStatus:@"网络在开小差,请稍后!"];
}];
}
-(void)clickBottomBarWithIdx:(NSInteger)idx{
if (idx==10) {
self.curDay++;
if (self.curDay>7) {
[SVProgressHUD showInfoWithStatus:@"只能查询前七天数据!"];
self.curDay=7;
return;
}
}else{
self.curDay--;
if(self.curDay<0){
[SVProgressHUD showInfoWithStatus:@"只能查询前七天数据!"];
self.curDay=0;
return;
}
}
[self getHistoryDataRequest];
}
#pragma mark----设置参数代理---
-(IFishWaterChangeView *)changeWaterView{
if(_changeWaterView==nil){
_changeWaterView=[IFishWaterChangeView getView];
_changeWaterView.frame=self.view.bounds;
_changeWaterView=[[IFishWaterChangeView alloc]init];
[self.view addSubview:_changeWaterView];
// [_changeWaterView.picker reloadAllComponents];
[self.changeWaterView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.mas_equalTo(self.view);
}];
_changeWaterView.myDelegate=self;
}
_changeWaterView.hidden=NO;
@@ -216,8 +221,9 @@
vo.subTitle=@"";
[_datas addObject:vo];
//预警温度 add V5.0.0
IfishHotBarVo*vo1=[[IfishHotBarVo alloc]init];
vo1.title=@"鱼缸容量 ";
vo1.title=@"预警温度 ";
vo1.iconUrl=@"容积图标";
vo1.isShowArrow=YES;
vo1.subTitle=@"";
@@ -226,7 +232,7 @@
vo2.title=@"水泵流量";
vo2.iconUrl=@"流量标";
vo2.isShowArrow=NO;
vo2.subTitle=@"";
vo2.subTitle=@"无水";
[_datas addObject:vo2];
IfishHotBarVo*vo3=[[IfishHotBarVo alloc]init];
vo3.title=@"历史趋势";
@@ -250,11 +256,17 @@
- (void)viewDidLoad {
[super viewDidLoad];
self.isInitHostoryView = NO;
// Do any additional setup after loading the view from its nib.
self.mainTableView = [[UITableView alloc]initWithFrame:CGRectZero style:UITableViewStylePlain];
[self.mainTableView registerNib:[UINib nibWithNibName:@"IFishHotBarCell" bundle:nil] forCellReuseIdentifier:HOTBARCELL];
self.mainTableView.rowHeight=70;
self.mainTableView.dataSource=self;
self.mainTableView.delegate=self;
[self.view addSubview:self.mainTableView];
[self.mainTableView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.mas_equalTo(self.view);
}];
[self.mainTableView reloadData];
[self getHotBarInfo];
self.tableView=self.mainTableView;
@@ -273,28 +285,15 @@
self.navigationItem.leftBarButtonItem=backItem;
self.navigationItem.rightBarButtonItem=[[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"ifishnav_dropview_list"] style:0 target:self action:@selector(clickMoreBtn)];
[self.view bringSubviewToFront:self.popView];
}
//-(void)updateNameInLocal{
// NSArray* deviceArr =[dataContorl getallDevices];
// for (DeviceModel *device in deviceArr) {
// if (device.deviceId==self.devicemodel.deviceId) {
// device.defaultShowName=self.title;
// [[DataCenter defaultDtacenter]setValue:deviceArr forKey:@"deviceInfo"];
// break;
// }
// }
//
//
//}
-(void)viewWillAppear:(BOOL)animated{
[super viewWillAppear:animated];
[self.navigationController.navigationBar setBackgroundImage:[UIImage imageNamed:@"blackbar.png"] forBarMetrics:UIBarMetricsDefault];
NSString*dTitle=[[NSUserDefaults standardUserDefaults] valueForKey:@"dTitle"];
self.title=self.devicemodel.showName;
// [self updateNameInLocal];
}
@@ -457,12 +456,8 @@
self.historyView.datas=self.vo.phs;
self.historyView.hidden=YES;
}
IfishHotBarVo*vo=self.datas[1];
if (self.vo.heater.heaterVolume.length) {
vo.title=[NSString stringWithFormat:@"鱼缸容量 %@L",self.vo.heater.heaterVolume];
vo.subTitle=[NSString stringWithFormat:@"推荐流量:%.1fL--%.1fL",[self.vo.heater.heaterVolume intValue]*1.5,[self.vo.heater.heaterVolume intValue]*2.0];
}
//去除鱼缸容积,改为设置预警温度
IfishHotBarVo*vo1=self.datas[4];
if (self.vo.heater.heaterCycle.length) {
if (self.vo.heater.heaterReminderTime.length) {
@@ -497,13 +492,15 @@
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
if (indexPath.row==3) {
if (!self.isInitHostoryView) {
[self getHistoryDataRequest];
}
self.historyView.hidden=NO;
// self.historyView.datas=self.vo.phs;
}else if (indexPath.row==2){
}
else{
// [self wenduRequest];
[self changeWaterView];
self.changeWaterView.hotVo=self.vo;
self.changeWaterView.viewType=indexPath.row;
@@ -541,10 +538,8 @@
-(void)updateUiWithInfo:(NSString*)info{
NSString*templeture=[info substringWithRange:NSMakeRange(36, 4)];
// templeture=[NSString stringWithFormat:@"0x%@",templeture];
UInt64 temp=[dataContorl hexToTen:templeture];
float tempFloat=temp*0.1;
// self.templetrueLable.text=[NSString stringWithFormat:@"%llu°c",temp];
self.header.degreeLable.text=[NSString stringWithFormat:@"%0.1f°c",tempFloat];
//流量 46
NSString*ph=[info substringWithRange:NSMakeRange(46, 4)];
@@ -552,11 +547,11 @@
IfishHotBarVo*vo2=self.datas[2];
// phV=0;
vo2.phv=phV;
vo2.title=[NSString stringWithFormat:@"水循环 %lluL",phV];
if (phV<=120) {
vo2.subTitle=@"流量警告:加热器停止加热,进入保护状态";
//phV给499,则为正常,其余的都是无水-V5.0.0
if (phV==499) {
vo2.subTitle=@"正常";
}else{
vo2.subTitle=@"";
vo2.subTitle=@"无水";
}
self.vo.heaterNum=[info substringWithRange:NSMakeRange(40, 4)];