You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
624 lines
27 KiB
624 lines
27 KiB
1 year ago
|
//
|
||
|
// baseTabViewController.m
|
||
|
// myWatch
|
||
|
//
|
||
|
// Created by mobao on 15/9/30.
|
||
|
// Copyright (c) 2015年 xTT. All rights reserved.
|
||
|
//
|
||
|
|
||
|
#import "baseTabViewController.h"
|
||
|
|
||
|
//#import "HomeCellInfo.h"//首页cell
|
||
|
//#import "messageHearderCell.h"//设备信息
|
||
|
//#import "WTMeCell.h"//输入框
|
||
|
//#import "ContactCell.h"//通讯录
|
||
|
|
||
|
//语音提醒相关
|
||
|
//#import "VoiceAlarm.h"
|
||
|
//#import "CJFileUtility.h"
|
||
|
//#import "VoiceConverter.h"
|
||
|
//#import "XHAudioPlayerHelper.h"
|
||
|
//#import "RecordingBtn.h"
|
||
|
//
|
||
|
//#import "DisturbBan.h"
|
||
|
|
||
|
//#import "Daily.h"
|
||
|
|
||
|
|
||
|
|
||
|
@interface baseTabViewController ()<DZNEmptyDataSetSource,DZNEmptyDataSetDelegate>
|
||
|
|
||
|
|
||
|
@end
|
||
|
|
||
|
@implementation baseTabViewController
|
||
|
|
||
|
- (void)appGoDeviceVC{
|
||
|
NSString *vcClassName = NSStringFromClass([[self.navigationController.viewControllers firstObject] class]);
|
||
|
if ([vcClassName isEqualToString:@"NoDeviceViewController"]) {
|
||
|
[self dismissViewControllerAnimated:YES completion:nil];
|
||
|
}else{
|
||
|
[self.navigationController popToRootViewControllerAnimated:YES];
|
||
|
}
|
||
|
}
|
||
|
|
||
|
- (void)viewDidLoad {
|
||
|
[super viewDidLoad];
|
||
|
// Do any additional setup after loading the view.
|
||
|
self.myTableView.backgroundColor = KKClearColor;
|
||
|
self.automaticallyAdjustsScrollViewInsets = NO;
|
||
|
|
||
|
// if (@available(iOS 11.0, *)) {
|
||
|
// self.myTableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
|
||
|
// } else {
|
||
|
// self.automaticallyAdjustsScrollViewInsets = NO;
|
||
|
// }
|
||
|
|
||
|
// add by lsz 2020-5-20
|
||
|
if (@available(iOS 15.0, *)) {
|
||
|
self.myTableView.sectionHeaderTopPadding = 0;
|
||
|
}
|
||
|
|
||
|
self.myTableView.emptyDataSetSource = self;
|
||
|
self.myTableView.emptyDataSetDelegate = self;
|
||
|
}
|
||
|
|
||
|
- (void)viewWillAppear:(BOOL)animated{
|
||
|
[super viewWillAppear:animated];
|
||
|
[self.myTableView reloadData];
|
||
|
|
||
|
}
|
||
|
|
||
|
- (UITableView *)myTableView{
|
||
|
if (!_myTableView) {
|
||
|
// _myTableView = [[UITableView alloc] initWithFrame:CGRectMake(0, iPhoneX_NavHeight, ScreenWidth, ScreenHeight-iPhoneX_NavHeight) style:UITableViewStyleGrouped];
|
||
|
if (@available(iOS 13.0, *)) {
|
||
|
_myTableView = [[UITableView alloc] initWithFrame:CGRectMake(0, iPhoneX_NavHeight, ScreenWidth, ScreenHeight-iPhoneX_NavHeight) style:UITableViewStyleInsetGrouped];
|
||
|
} else {
|
||
|
// Fallback on earlier versions
|
||
|
_myTableView = [[UITableView alloc] initWithFrame:CGRectMake(0, iPhoneX_NavHeight, ScreenWidth, ScreenHeight-iPhoneX_NavHeight) style:UITableViewStyleGrouped];
|
||
|
}
|
||
|
|
||
|
|
||
|
_myTableView.delegate = self;
|
||
|
_myTableView.dataSource = self;
|
||
|
[_myTableView registerClass:[baseCell class] forCellReuseIdentifier:@"baseCell"];
|
||
|
}
|
||
|
return _myTableView;
|
||
|
}
|
||
|
|
||
|
|
||
|
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
|
||
|
return self.myDataSource.count;
|
||
|
}
|
||
|
|
||
|
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
|
||
|
return [self.myDataSource[section] count];
|
||
|
}
|
||
|
|
||
|
-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
|
||
|
if (section == 0) {
|
||
|
return 0.01;
|
||
|
}
|
||
|
return 15 * FIX_SCREEN;
|
||
|
}
|
||
|
|
||
|
- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{
|
||
|
return 0.01;
|
||
|
}
|
||
|
|
||
|
- (UITableViewCellEditingStyle)tableView:(UITableView *)tableView
|
||
|
editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath{
|
||
|
id obj = self.myDataSource[indexPath.section];
|
||
|
|
||
|
if (![obj isKindOfClass:[baseModel class]]) {
|
||
|
return UITableViewCellEditingStyleNone;
|
||
|
}
|
||
|
return UITableViewCellEditingStyleDelete;
|
||
|
}
|
||
|
|
||
|
//删除
|
||
|
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
|
||
|
{
|
||
|
if (editingStyle == UITableViewCellEditingStyleDelete) {
|
||
|
baseModel *model = self.myDataSource[indexPath.section];
|
||
|
[model deleteSuccess:^{
|
||
|
// NSMutableArray *arr = self.myDataSource[indexPath.section];
|
||
|
[self.myDataSource removeObject:model];
|
||
|
[self.myTableView reloadData];
|
||
|
[self viewWillAppear:nil];
|
||
|
} failure:^{
|
||
|
|
||
|
}];
|
||
|
}
|
||
|
}
|
||
|
|
||
|
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
|
||
|
return 49;
|
||
|
}
|
||
|
|
||
|
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
|
||
|
baseCell *cell = [tableView dequeueReusableCellWithIdentifier:@"baseCell"];
|
||
|
if (!cell) {
|
||
|
cell = [[baseCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:@"baseCell"];
|
||
|
}
|
||
|
cell.textLabel.text = self.myDataSource[indexPath.section][indexPath.row];
|
||
|
return cell;
|
||
|
}
|
||
|
|
||
|
//- (void)tableView:(UITableView *)tableView willDisplayHeaderView:(UIView *)view forSection:(NSInteger)section{
|
||
|
// view.tintColor = tabHeaderBG;
|
||
|
//}
|
||
|
//
|
||
|
//- (void)tableView:(UITableView *)tableView willDisplayFooterView:(UIView *)view forSection:(NSInteger)section {
|
||
|
// view.tintColor = tabFooterBG;
|
||
|
//}
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
//- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{
|
||
|
// return [[UIView alloc]initWithFrame:CGRectZero];
|
||
|
//}
|
||
|
//
|
||
|
//- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section{
|
||
|
// return [[UIView alloc]initWithFrame:CGRectZero];
|
||
|
//}
|
||
|
|
||
|
//- (CGFloat)getTableView:(UITableView *)tableView
|
||
|
// indexPath:(NSIndexPath *)indexPath
|
||
|
// cellHeight:(NSString *)type{
|
||
|
// NSArray *sourceArr = [self getTabelSource:tableView.tag];
|
||
|
// if ([type isEqualToString:CStyleHomeLocation]) {
|
||
|
// return 130;
|
||
|
// }else if ([type isEqualToString:CStyleDeviceHeadName]){
|
||
|
// return 80 * FIX_SCREEN;
|
||
|
// }else if ([type isEqualToString:CStyleContact]){
|
||
|
// return 80;
|
||
|
// }else if ([type isEqualToString:CStyleButton]){
|
||
|
// return CGRectGetHeight(tableView.frame) / [sourceArr[indexPath.section] count];
|
||
|
// }else if ([type isEqualToString:CStyleRail]){
|
||
|
// return 70 * FIX_SCREEN;
|
||
|
// }else if ([type hasSuffix:@"Alarms"]){
|
||
|
// return 75 * FIX_SCREEN;
|
||
|
// }
|
||
|
// return 49 * FIX_SCREEN;
|
||
|
//}
|
||
|
|
||
|
|
||
|
|
||
|
//- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
|
||
|
// ConfigurationModel *cModel = [self getCModelForTableView:tableView indexPath:indexPath];
|
||
|
// return [self getTableView:tableView indexPath:indexPath cellHeight:cModel.cStyle];
|
||
|
//}
|
||
|
//
|
||
|
//- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
|
||
|
// ConfigurationModel *cModel = [self getCModelForTableView:tableView indexPath:indexPath];
|
||
|
// return [self getCellWithCModel:cModel tableView:tableView indexPath:indexPath];
|
||
|
//}
|
||
|
|
||
|
//- (UITableViewCell *)getCellWithCModel:(ConfigurationModel *)cModel
|
||
|
// tableView:(UITableView *)tableView
|
||
|
// indexPath:(NSIndexPath *)indexPath{
|
||
|
// WEAKSELF
|
||
|
// if ([cModel.cStyle hasPrefix:CStyleDefault]){
|
||
|
// NSString *identifier = cModel.cStyle;
|
||
|
// baseCell *cell = [tableView dequeueReusableCellWithIdentifier:identifier];
|
||
|
// if (!cell) {
|
||
|
// UITableViewCellStyle cellStyle = UITableViewCellStyleValue1;
|
||
|
// if ([cModel.cStyle hasSuffix:@"Center"]) {
|
||
|
// cellStyle = UITableViewCellStyleDefault;
|
||
|
// }
|
||
|
//
|
||
|
// cell = [[baseCell alloc] initWithStyle:cellStyle reuseIdentifier:identifier];
|
||
|
// if ([cModel.cStyle isEqualToString:CStyleDefault]){
|
||
|
//
|
||
|
// }else if ([cModel.cStyle hasSuffix:@"Center"]){
|
||
|
// cell.textLabel.textAlignment = NSTextAlignmentCenter;
|
||
|
// if ([cModel.cName isEqualToString:Function_107324]) {
|
||
|
// cell.textLabel.textColor = [UIColor whiteColor];
|
||
|
// cell.backgroundColor = [UIColor redColor];
|
||
|
// }
|
||
|
// }else if ([cModel.cStyle hasSuffix:@"Default1"]){
|
||
|
// cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
|
||
|
// }else if ([cModel.cStyle hasSuffix:@"Switch"]){
|
||
|
// cell = [[baseCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:cModel.cStyle];
|
||
|
// UISwitch *uiSwitch = [[UISwitch alloc] init];
|
||
|
// cell.accessoryView = uiSwitch;
|
||
|
// [uiSwitch addTarget:cell
|
||
|
// action:@selector(cellClick:)
|
||
|
// forControlEvents:UIControlEventValueChanged];
|
||
|
// if ([cModel.cName isEqualToString:Function_107325]) {
|
||
|
// uiSwitch.on = [self.infoDevice.opRejectStrangeCall boolValue];
|
||
|
// }else if ([cModel.cName isEqualToString:Function_107303]){
|
||
|
// uiSwitch.on = NO;
|
||
|
// if (self.infoDevice.upDownNotice) {
|
||
|
// uiSwitch.on = [self.infoDevice.upDownNotice boolValue];
|
||
|
// }
|
||
|
// }
|
||
|
// cell.block = ^(UISwitch *uiSwitch){
|
||
|
// if ([cModel.cName isEqualToString:Function_107325]) {
|
||
|
// weakSelf.infoDevice.opRejectStrangeCall = @(uiSwitch.on);
|
||
|
// }else if ([cModel.cName isEqualToString:Function_107303]){
|
||
|
// weakSelf.infoDevice.upDownNotice = @(uiSwitch.on);
|
||
|
// [User saveToFile];
|
||
|
// }else{
|
||
|
// weakSelf.editObj.status = @(uiSwitch.on);
|
||
|
// }
|
||
|
// if (cModel.caInterface) {
|
||
|
// [cModel interface:weakSelf
|
||
|
// parameters:nil
|
||
|
// method:@"POST" success:^(id responseObject) {
|
||
|
//
|
||
|
// } failure:^{
|
||
|
// uiSwitch.on = !uiSwitch.on;
|
||
|
// if ([cModel.cName isEqualToString:Function_107325]) {
|
||
|
// weakSelf.infoDevice.opRejectStrangeCall = @(uiSwitch.on);
|
||
|
// }else if ([cModel.cName isEqualToString:Function_107303]){
|
||
|
//
|
||
|
// }else{
|
||
|
// weakSelf.editObj.status = @(uiSwitch.on);
|
||
|
// }
|
||
|
// }];
|
||
|
// }
|
||
|
// };
|
||
|
// }else if ([cModel.cStyle hasSuffix:@"Select"]){
|
||
|
// cell = [[baseCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:cModel.cStyle];
|
||
|
// UIImageView *imageView = [[UIImageView alloc] init];
|
||
|
// imageView.image = [myHelper getImageWithName:@"重复_选中"];
|
||
|
// [imageView sizeToFit];
|
||
|
// cell.textLabel.text = [cModel getCellTitleLabel];
|
||
|
// if ([cell.textLabel.text hasSuffix:@"%d"]) {
|
||
|
// cell.textLabel.text = [NSString stringWithFormat:cell.textLabel.text,indexPath.row];
|
||
|
// }
|
||
|
//
|
||
|
// id value = [cModel getCellInputText:self];
|
||
|
// id defultValue = [cModel getCellParamsValue];
|
||
|
// if ([defultValue isKindOfClass:[NSString class]] &&
|
||
|
// [defultValue isEqualToString:@"index.row"]) {
|
||
|
// defultValue = [NSString stringWithFormat:@"%@",@(indexPath.row)];
|
||
|
// }else if ([defultValue isKindOfClass:[NSNumber class]]){
|
||
|
// defultValue = [NSString stringWithFormat:@"%@",defultValue];
|
||
|
// }
|
||
|
// if ([defultValue isEqualToString:value]) {
|
||
|
// cell.accessoryView = imageView;
|
||
|
// }else{
|
||
|
// cell.accessoryView = nil;
|
||
|
// }
|
||
|
//
|
||
|
// cell.block = ^(id sender){
|
||
|
//
|
||
|
// };
|
||
|
// return cell;
|
||
|
// }else if ([cModel.cStyle hasSuffix:@"Head"]){
|
||
|
// cell = [[baseCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:cModel.cStyle];
|
||
|
// UIImageView *imageView = [[UIImageView alloc] initWithImage:[cModel getCellInputText:self]];
|
||
|
// imageView.frame = CGRectMake(0, 0, (54 - 14) * FIX_SCREEN,
|
||
|
// (54 - 14) * FIX_SCREEN);
|
||
|
// cell.accessoryView = imageView;
|
||
|
//
|
||
|
// cell.block = ^(id sender){
|
||
|
//
|
||
|
// };
|
||
|
// }
|
||
|
// else if ([cModel.cStyle hasSuffix:@"Alarms"]){
|
||
|
// cell = [[baseCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:cModel.cStyle];
|
||
|
// cell.textLabel.font = [myHelper fixFoneSize:20 font:cell.textLabel.font];
|
||
|
// cell.detailTextLabel.font = [myHelper fixFoneSize:15 font:cell.detailTextLabel.font];
|
||
|
//
|
||
|
// UISwitch *uiSwitch = [[UISwitch alloc] init];
|
||
|
// cell.accessoryView = uiSwitch;
|
||
|
// [uiSwitch addTarget:cell
|
||
|
// action:@selector(cellClick:)
|
||
|
// forControlEvents:UIControlEventValueChanged];
|
||
|
// baseModel *baseObj = self.dataSource[indexPath.row];
|
||
|
// uiSwitch.on = [baseObj.status boolValue];
|
||
|
//
|
||
|
//
|
||
|
// cell.block = ^(UISwitch *uiSwitch){
|
||
|
// baseObj.status = @(uiSwitch.on);
|
||
|
// baseModel *obj = weakSelf.dataSource[indexPath.row];
|
||
|
// NSMutableDictionary *parameters = obj.mj_keyValues;
|
||
|
// [cModel interface:weakSelf parameters:parameters
|
||
|
// method:@"PATCH" success:^(id responseObject) {
|
||
|
//
|
||
|
// } failure:^{
|
||
|
// uiSwitch.on = !uiSwitch.on;
|
||
|
// baseObj.status = @(uiSwitch.on);
|
||
|
// }];
|
||
|
// };
|
||
|
// }
|
||
|
// }
|
||
|
//
|
||
|
// if ([cModel.cStyle hasSuffix:@"Head"]){
|
||
|
// UIImageView *imageView = [[UIImageView alloc] initWithImage:[cModel getCellInputText:self]];
|
||
|
// imageView.frame = CGRectMake(0, 0,
|
||
|
// (54 - 14) * FIX_SCREEN,
|
||
|
// (54 - 14) * FIX_SCREEN);
|
||
|
// cell.accessoryView = imageView;
|
||
|
// }
|
||
|
// cell.textLabel.text = [cModel getCellTitleLabel];;
|
||
|
//
|
||
|
//
|
||
|
// id value = [cModel getCellInputText:self];
|
||
|
// if (value && [value isKindOfClass:[NSString class]]) {
|
||
|
// cell.detailTextLabel.text = value;
|
||
|
// }else{
|
||
|
// cell.detailTextLabel.text = [cModel getCellDetailTextLabel];
|
||
|
// }
|
||
|
//
|
||
|
// if ([self.vcName isEqualToString:@"语音提醒列表页面"]) {
|
||
|
// VoiceAlarm *obj = self.dataSource[indexPath.row];
|
||
|
// cell.textLabel.text = obj.text;
|
||
|
// cell.detailTextLabel.text = [VoiceAlarm getWeekDayStr:[obj week]];
|
||
|
// }else if ([self.vcName isEqualToString:@"免打扰模式列表页面"]){
|
||
|
// DisturbBan *obj = self.dataSource[indexPath.row];
|
||
|
// cell.textLabel.font = [UIFont systemFontOfSize:20];
|
||
|
// cell.textLabel.text = [NSString stringWithFormat:@"%@-%@",obj.starttime,obj.endedtime];
|
||
|
// cell.detailTextLabel.text = [VoiceAlarm getWeekDayStr:[obj week]];
|
||
|
// }
|
||
|
//
|
||
|
// if ([cell.accessoryView isKindOfClass:[UISwitch class]] &&
|
||
|
// self.dataSource.count > 0) {
|
||
|
// UISwitch *uiSwitch = (UISwitch *)cell.accessoryView;
|
||
|
// baseModel *baseObj = self.dataSource[indexPath.row];
|
||
|
// uiSwitch.on = [baseObj.status boolValue];
|
||
|
// }
|
||
|
//
|
||
|
// return cell;
|
||
|
// }else if ([cModel.cStyle hasPrefix:CStyleInput]) {
|
||
|
// TextFieldCell *cell = [tableView dequeueReusableCellWithIdentifier:@"TextFieldCell"];
|
||
|
// if (!cell) {
|
||
|
// cell = [[TextFieldCell alloc] initWithStyle:UITableViewCellStyleDefault
|
||
|
// reuseIdentifier:@"TextFieldCell"];
|
||
|
// cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
|
||
|
// if ([cModel.cStyle hasSuffix:@"Right"]) {
|
||
|
// cell.textField.textAlignment = NSTextAlignmentRight;
|
||
|
// }
|
||
|
// [cell initCellView:cModel];
|
||
|
// }
|
||
|
//
|
||
|
// if ([cModel.cName isEqualToString:Phone_103004]) {
|
||
|
// baseModel *obj = self.dataSource[indexPath.row];
|
||
|
// if (self.dataSource.count == 1) {
|
||
|
// cell.textLabel.text = @"SOS号码";
|
||
|
// }else{
|
||
|
// cell.textLabel.text = [NSString stringWithFormat:@"SOS号码 %zi",indexPath.row + 1];
|
||
|
// }
|
||
|
// cell.textField.text = obj.phone;
|
||
|
// }else{
|
||
|
// cell.textLabel.text = [cModel getCellTitleLabel];
|
||
|
// cell.textField.text = [cModel getCellInputText:self];
|
||
|
// }
|
||
|
// cell.textField.placeholder = [cModel getCellPlaceholder];
|
||
|
//
|
||
|
// if ([cModel.cName isEqualToString:@"location101030"] ||
|
||
|
// [cModel.cName isEqualToString:@"location101029"] ||
|
||
|
// [[cModel getCellParamsKey] isEqualToString:@"week"]) {
|
||
|
// cell.textField.enabled = NO;
|
||
|
// }
|
||
|
//
|
||
|
// cell.block = ^(NSString *text){
|
||
|
// if ([cModel.cName isEqualToString:@"adddevice100025"]) {
|
||
|
// [weakSelf setValue:text forKey:@"invitation"];
|
||
|
// }else if (weakSelf.dataSource.count > 0) {
|
||
|
// baseModel *obj = weakSelf.dataSource[indexPath.row];
|
||
|
// if ([[cModel getCellParamsKey] isEqualToString:@"phones"]) {
|
||
|
// obj.phone = text;
|
||
|
// }
|
||
|
// }else{
|
||
|
// [weakSelf.editObj setValue:text forKey:[cModel getCellParamsKey]];
|
||
|
// }
|
||
|
// };
|
||
|
// return cell;
|
||
|
// }else if ([cModel.cStyle isEqualToString:CStyleButton]) {
|
||
|
// BtnCell *cell = [tableView dequeueReusableCellWithIdentifier:@"BtnCell"];
|
||
|
// if (!cell) {
|
||
|
// cell = [[BtnCell alloc] initWithStyle:UITableViewCellStyleDefault
|
||
|
// reuseIdentifier:@"BtnCell"];
|
||
|
// }
|
||
|
// [cell initCellView:cModel];
|
||
|
// WEAKSELF
|
||
|
// cell.block = ^(UIButton *btn){
|
||
|
// [cModel actionWithViewController:weakSelf value:nil block:^(id responseObject) {}];
|
||
|
// };
|
||
|
// return cell;
|
||
|
// }else if([cModel.cStyle isEqualToString:CStyleHomeLocation]){
|
||
|
// HomeCellInfo *cell = [tableView dequeueReusableCellWithIdentifier:@"HomeCellInfo"];
|
||
|
// if (!cell) {
|
||
|
// cell = [[HomeCellInfo alloc] initWithStyle:UITableViewCellStyleValue1
|
||
|
// reuseIdentifier:@"HomeCellInfo"];
|
||
|
// cell.type = HomeCellInfoTypeDingWei;
|
||
|
// }
|
||
|
// NSDate *date = [NSDate dateWithTimeIntervalSince1970:[self.infoDevice.lastLocation.timestamp doubleValue]];
|
||
|
// CLLocation *location = [[CLLocation alloc] initWithLatitude:[[(Locate *)self.infoDevice.lastLocation lat] doubleValue]
|
||
|
// longitude:[[(Locate *)self.infoDevice.lastLocation lon] doubleValue]];
|
||
|
// cell.timelab.text = [myHelper getDateFormatWithStr:@"HH:mm" date:date];
|
||
|
// [cell setLocation:location];
|
||
|
// return cell;
|
||
|
// }else if ([cModel.cStyle isEqualToString:CStyleDeviceHeadName]){
|
||
|
// Device *device = self.infoDevice;
|
||
|
// if (self.dataSource.count > 0) {
|
||
|
// device = self.dataSource[indexPath.row];
|
||
|
// }
|
||
|
// messageHearderCell *cell = [tableView dequeueReusableCellWithIdentifier:@"messageHearderCell"];
|
||
|
// if (!cell) {
|
||
|
// cell = [[messageHearderCell alloc] initWithStyle:UITableViewCellStyleValue1
|
||
|
// reuseIdentifier:@"messageHearderCell"];
|
||
|
// cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
|
||
|
// }
|
||
|
// [cell.iconImg sd_setImageWithURL:[NSURL URLWithString:device.avator]
|
||
|
// placeholderImage:[myHelper getImageWithName:@"默认通讯录头像"]
|
||
|
// options:SDWebImageRetryFailed];
|
||
|
// cell.titleLab.text = device.name;
|
||
|
// cell.phonoeLab.text = device.phone;
|
||
|
// return cell;
|
||
|
// }else if ([cModel.cStyle isEqualToString:CStyleContact]){
|
||
|
// ContactCell *cell = [tableView dequeueReusableCellWithIdentifier:@"ContactCell"];
|
||
|
// if (!cell) {
|
||
|
// cell = [[ContactCell alloc] initWithStyle:UITableViewCellStyleValue1
|
||
|
// reuseIdentifier:@"ContactCell"];
|
||
|
// cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
|
||
|
// }
|
||
|
// Contacts *contact = self.dataSource[indexPath.row];
|
||
|
// if (indexPath.section == 0) {
|
||
|
// cell.label_Name.text = contact.name;
|
||
|
// if ([User currentUser].ownedDevices.count > 0) {
|
||
|
// [cell setType:ContactTypeManager];//当前用户是管理员
|
||
|
// }else{
|
||
|
// [cell setType:ContactTypeMember];//当前用户是成员
|
||
|
// }
|
||
|
// }else if (indexPath.section == 1) {
|
||
|
// contact = self.dataSource[indexPath.row + 1];
|
||
|
// cell.label_Name.text = contact.name;
|
||
|
// if (indexPath.row == 0 && [User currentUser].ownedDevices.count != 0) {
|
||
|
// [cell setType:ContactTypeManager];//当前用户是管理员
|
||
|
// }else{
|
||
|
// [cell setType:ContactTypeMember];//当前用户是成员
|
||
|
// }
|
||
|
// if ([contact.type integerValue] == 1) {
|
||
|
// [cell setType:ContactTypeMember];//当前用户是成员
|
||
|
// }else{
|
||
|
// [cell setType:ContactTypeWhiteContact];//当前用户是白名单
|
||
|
// }
|
||
|
// }
|
||
|
//
|
||
|
// cell.label_Phone.text = contact.phone;
|
||
|
// [cell.img_Head sd_setImageWithURL:[NSURL URLWithString:contact.avator]
|
||
|
// placeholderImage:[myHelper getImageWithName:@"默认通讯录头像"]
|
||
|
// options:SDWebImageRetryFailed];
|
||
|
//
|
||
|
//
|
||
|
// return cell;
|
||
|
// }else if ([cModel.cStyle isEqualToString:CStyleRail]){
|
||
|
// Rail *rail = self.dataSource[indexPath.row];
|
||
|
// RailCell *cell = [tableView dequeueReusableCellWithIdentifier:@"RailCell"];
|
||
|
// if (!cell) {
|
||
|
// cell = [[RailCell alloc] initWithStyle:UITableViewCellStyleSubtitle
|
||
|
// reuseIdentifier:@"RailCell"];
|
||
|
// cell.detailTextLabel.numberOfLines = 0;
|
||
|
// }
|
||
|
// cell.textLabel.text = rail.name;
|
||
|
// cell.detailTextLabel.text = rail.address;
|
||
|
// cell.label_radius.text = [NSString stringWithFormat:@"安全范围:%@米",rail.radius];
|
||
|
// return cell;
|
||
|
// }else if ([cModel.cStyle isEqualToString:CStyleDaily]){
|
||
|
// Daily *daily = self.dataSource[indexPath.row];
|
||
|
// DailyCell *cell = [tableView dequeueReusableCellWithIdentifier:@"DailyCell"];
|
||
|
// if (!cell) {
|
||
|
// cell = [[DailyCell alloc] initWithStyle:UITableViewCellStyleValue1
|
||
|
// reuseIdentifier:@"DailyCell"];
|
||
|
// cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
|
||
|
// cell.detailTextLabel.textColor = [UIColor lightGrayColor];
|
||
|
// }
|
||
|
// cell.textLabel.text = daily.date;
|
||
|
// cell.detailTextLabel.text = [NSString stringWithFormat:@"%@条",daily.amount];
|
||
|
// return cell;
|
||
|
// }else if ([cModel.cStyle isEqualToString:CStylePlayVoice]){
|
||
|
// PlayVoiceCell *cell = [tableView dequeueReusableCellWithIdentifier:@"PlayVoiceCell"];
|
||
|
// if (!cell) {
|
||
|
// cell = [[PlayVoiceCell alloc] initWithStyle:UITableViewCellStyleSubtitle
|
||
|
// reuseIdentifier:@"PlayVoiceCell"];
|
||
|
// cell.textLabel.text = [cModel getCellTitleLabel];
|
||
|
// [cell initCellView:cModel];
|
||
|
// cell.block = ^(id sender){
|
||
|
//
|
||
|
// };
|
||
|
// }
|
||
|
// cell.voicePath = [(VoiceAlarm *)self.editObj voicePath];
|
||
|
// if (!cell.voicePath) {
|
||
|
// cell.voicePath = [(VoiceAlarm *)self.originalObj voicePath];
|
||
|
// }
|
||
|
// cell.voiceUrl = [(VoiceAlarm *)self.editObj voiceURL];
|
||
|
// if (!cell.voiceUrl) {
|
||
|
// cell.voiceUrl = [(VoiceAlarm *)self.originalObj voiceURL];
|
||
|
// }
|
||
|
//
|
||
|
// if (cell.voicePath || cell.voiceUrl){
|
||
|
// UIButton *btn = (UIButton *)cell.accessoryView;
|
||
|
// btn.enabled = YES;
|
||
|
// [btn setTitle:@"播放" forState:UIControlStateNormal];
|
||
|
// [btn setImage:[myHelper getImageWithName:@"播放录音3"]
|
||
|
// forState:UIControlStateNormal];
|
||
|
// [btn layoutIfNeeded];
|
||
|
//
|
||
|
// //交换文字和图片的位置
|
||
|
// [btn setTitleEdgeInsets:UIEdgeInsetsMake(0, -btn.imageView.image.size.width,
|
||
|
// 0, btn.imageView.image.size.width)];
|
||
|
// [btn setImageEdgeInsets:UIEdgeInsetsMake(0, btn.titleLabel.bounds.size.width + 5,
|
||
|
// 0, -btn.titleLabel.bounds.size.width)];
|
||
|
// [btn setTitleColor:mainColor forState:UIControlStateNormal];
|
||
|
// btn.layer.borderColor = mainColor.CGColor;
|
||
|
// }
|
||
|
//
|
||
|
//
|
||
|
// return cell;
|
||
|
// }
|
||
|
// return nil;
|
||
|
//}
|
||
|
|
||
|
|
||
|
- (void)didReceiveMemoryWarning {
|
||
|
[super didReceiveMemoryWarning];
|
||
|
// Dispose of any resources that can be recreated.
|
||
|
}
|
||
|
|
||
|
- (BOOL)prefersStatusBarHidden {
|
||
|
return NO;
|
||
|
}
|
||
|
|
||
|
#pragma mark - DZNEmptyDataSetSource,DZNEmptyDataSetDelegate
|
||
|
- (void)emptyDataSet:(UIScrollView *)scrollView didTapView:(UIView *)view
|
||
|
{
|
||
|
[self emptyDataSetView];
|
||
|
}
|
||
|
|
||
|
- (void)emptyDataSet:(UIScrollView *)scrollView didTapButton:(UIButton *)button
|
||
|
{
|
||
|
[self emptyDataSetButton];
|
||
|
}
|
||
|
|
||
|
- (void)emptyDataSetButton
|
||
|
{
|
||
|
|
||
|
}
|
||
|
|
||
|
|
||
|
- (void)emptyDataSetView
|
||
|
{
|
||
|
|
||
|
}
|
||
|
|
||
|
//
|
||
|
//- (void)wavToAmr:(NSString *)path {
|
||
|
// //转格式
|
||
|
// if ([CJFileUtility fileExists:path]) {
|
||
|
// NSString *armPath = [CJFileUtility changeFileExt:path ext:@"amr"];
|
||
|
// [VoiceConverter wavToAmr:path amrSavePath:armPath];
|
||
|
// }
|
||
|
//}
|
||
|
//
|
||
|
////转换后删掉amr文件
|
||
|
//- (void)amrToWav:(NSString *)path {
|
||
|
// //转格式
|
||
|
// if ([CJFileUtility fileExists:path]) {
|
||
|
// NSString *wavPath = [CJFileUtility changeFileExt:path ext:@"wav"];
|
||
|
// [VoiceConverter amrToWav:path wavSavePath:wavPath];
|
||
|
// [CJFileUtility deleteFile:path];
|
||
|
// }
|
||
|
//}
|
||
|
|
||
|
/*
|
||
|
#pragma mark - Navigationfile:///Users/xTT/Desktop/xTT_Project/babyTravel/babyTravel/ViewController/Travel/TravelViewController.m: warning: Missing file: /Users/xTT/Desktop/xTT_Project/babyTravel/babyTravel/ViewController/Travel/TravelViewController.m is missing from working copy
|
||
|
|
||
|
|
||
|
// In a storyboard-based application, you will often want to do a little preparation before navigation
|
||
|
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
|
||
|
// Get the new view controller using [segue destinationViewController].
|
||
|
// Pass the selected object to the new view controller.file:///Users/xTT/Desktop/xTT_Project/babyTravel/babyTravel/ViewController/Login/LoginViewController.m: warning: Missing file: /Users/xTT/Desktop/xTT_Project/babyTravel/babyTravel/ViewController/Login/LoginViewController.m is missing from working copy
|
||
|
|
||
|
}
|
||
|
*/
|
||
|
|
||
|
@end
|