宠物店修改

This commit is contained in:
kai60
2020-05-02 14:56:49 +08:00
parent 8fca79324a
commit 53f06fcf43
100 changed files with 2672 additions and 198 deletions
@@ -43,6 +43,10 @@
#import "PushMessageModel.h"
#import "IfishInformationListViewCell.h"//资讯
#import "JHRefresh.h"//refresh
#import "PetStoresViewController.h"
#import "StoreNameView.h"
#import "ConnectingAquarVC.h"
#import "SecondConnectWifiController.h"
@interface IfishDeviceViewController ()<UITableViewDelegate,UITableViewDataSource,LxPopViewDelegate,ShopTtemListDelegate>
@property(nonatomic,strong)UITableView *tableView;
@@ -52,6 +56,7 @@
@property(nonatomic,strong) DXPopover *popover;
@property(nonatomic,strong) NSArray *cameraArr;
@property(nonatomic,strong) NSMutableDictionary *petStores;
@property(nonatomic,strong) UIButton*rightButton;
@@ -373,18 +378,40 @@ Assign BOOL isPush;
//设备信息
NSArray*deviceArray=dataDic[@"device"];
NSArray*cameraA=dataDic[@"camera"];
//宠物店
NSMutableDictionary*petStores=[NSMutableDictionary dictionary];
NSMutableArray *deviceArr = [[NSMutableArray alloc] init];
if ([deviceArray count]!=0) {
for (NSDictionary*deviceDic in deviceArray) {
DeviceModel*devicemodel=[[DeviceModel alloc] initWithDict:deviceDic];
[deviceArr insertObject:devicemodel atIndex:0];
if (devicemodel.storeName.length)//宠物笼
{
NSString*storeName=devicemodel.storeName;
NSMutableArray*array=petStores[storeName];
if (!array) {
array=[NSMutableArray array];
}
[array insertObject:devicemodel atIndex:0];
petStores[storeName]=array;
}
else {
[deviceArr insertObject:devicemodel atIndex:0];
}
}
}
[[DataCenter defaultDtacenter]setValue:deviceArr forKey:@"deviceInfo"];
self.petStores=petStores;
[[DataCenter defaultDtacenter]setValue:petStores forKey:@"petStores"];
//存储摄像头设备信息
NSMutableArray *camras = [[NSMutableArray alloc] init];
if (cameraA .count !=0) {
@@ -805,6 +832,7 @@ Assign BOOL isPush;
self.deviceArr =[dataContorl getallDevices];
self.cameraArr =[dataContorl getallCameras];
self.petStores= [[DataCenter defaultDtacenter]valueForKey:@"petStores"];
[self getTotalDeviceArrWith:self.deviceArr addCameraArr:self.cameraArr];
[self.tableView reloadData];
@@ -839,6 +867,16 @@ Assign BOOL isPush;
[self.totalArr addObject:deviceListModel];
}
for (NSString *store in self.petStores) {
FormatTankAddCamera *deviceListModel =[[FormatTankAddCamera alloc] init];
deviceListModel.list = self.petStores[store];
deviceListModel.type = @"pets";
deviceListModel.deviceName = store;
deviceListModel.imgeaName = @"petsImage";
[self.totalArr addObject:deviceListModel];
}
}
@@ -1184,7 +1222,48 @@ Assign BOOL isPush;
[[Socketsingleton sharedInstance] cutOffSocket];
[[IfishDataUnity shareDataInstance] initAppCenterVcWith:model.device addWithdissMisVc:nil];
}else if ([model.type isEqualToString:@"camera"]){
}
else if ([model.type isEqualToString:@"pets"])
{
// PetStoresViewController*store=[[PetStoresViewController alloc]init];
// store.store=model;
[[DataCenter defaultDtacenter] setValue:model forKey:@"currentStore"];
DeviceModel*pushDevice=nil;
NSString*macid=[[DataCenter defaultDtacenter].cache stringForKey:@"currentPetDevice"];
if (macid.length)
{
BOOL find=NO;
for (DeviceModel*de in model.list) {
if ([macid isEqualToString:de.macAddress])
{
find=YES;
pushDevice=de;
break;
}
}
if (find)
{
}
else
{
pushDevice=model.list.firstObject;
}
}
else
{
pushDevice=model.list.firstObject;
}
[[DataCenter defaultDtacenter].cache setString:pushDevice.macAddress forKey:@"currentPetDevice"];
[[Socketsingleton sharedInstance] cutOffSocket];
[[IfishDataUnity shareDataInstance] initAppCenterVcWith:pushDevice addWithdissMisVc:nil];
}
else if ([model.type isEqualToString:@"camera"]){
// self.hidesBottomBarWhenPushed = YES;
// IfishP2PPlayBackListViewController *cameraShopVC=[[IfishP2PPlayBackListViewController alloc]init];
@@ -1547,7 +1626,7 @@ Assign BOOL isPush;
}
NSIndexSet *asset = [NSIndexSet indexSetWithIndex:2];
[weskSelf.tableView reloadSections:asset withRowAnimation:UITableViewRowAnimationNone];
[weskSelf.tableView reloadSections:asset withRowAnimation:UITableViewRowAnimationAutomatic];
}
[weskSelf.progressHud hide:YES];