websocket and user center
This commit is contained in:
@@ -8,6 +8,10 @@
|
||||
|
||||
#import "GiGaMeViewController.h"
|
||||
#import "GiGaUserViewController.h"
|
||||
#import "GiGaMineUserViewCell.h"
|
||||
#import "GiGaMineInfoViewCell.h"
|
||||
#import "GiSysSettingsVC.h"
|
||||
#import "GiMaskTimeHistoryVC.h"
|
||||
|
||||
@interface GiGaMeViewController ()
|
||||
|
||||
@@ -17,21 +21,105 @@
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
self.title = @"我的";
|
||||
|
||||
[self addNavTitile:@"我的"];
|
||||
// Do any additional setup after loading the view.
|
||||
[self.view addSubview:self.tableView];
|
||||
self.tableView.delegate = self;
|
||||
self.tableView.dataSource = self;
|
||||
self.tableView.backgroundColor = [UIColor lightGrayColor];
|
||||
self.tableView.separatorStyle = UITableViewCellSelectionStyleNone;
|
||||
self.tableView.sectionFooterHeight = 0;
|
||||
self.tableView.estimatedSectionFooterHeight= 0;
|
||||
self.tableView.estimatedSectionHeaderHeight = 0;
|
||||
|
||||
}
|
||||
|
||||
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
|
||||
return 2;
|
||||
}
|
||||
|
||||
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
|
||||
|
||||
if (section == 0){
|
||||
return 1;
|
||||
}
|
||||
return 2;
|
||||
}
|
||||
|
||||
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
|
||||
if(indexPath.section ==0){
|
||||
GiGaMineUserViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"GiGaMineUserViewCell"];
|
||||
if(!cell){
|
||||
cell = [[[NSBundle mainBundle] loadNibNamed:@"GiGaMineUserViewCell" owner:self options:nil] lastObject];
|
||||
|
||||
}
|
||||
return cell;
|
||||
}
|
||||
GiGaMineInfoViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"GiGaMineInfoViewCell"];
|
||||
if(!cell){
|
||||
cell = [[[NSBundle mainBundle] loadNibNamed:@"GiGaMineInfoViewCell" owner:self options:nil] lastObject];
|
||||
|
||||
}
|
||||
|
||||
[cell loadCellData:indexPath];
|
||||
return cell;
|
||||
|
||||
}
|
||||
|
||||
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
|
||||
if(indexPath.section == 1){
|
||||
[tableView deselectRowAtIndexPath:indexPath animated:YES];
|
||||
}
|
||||
|
||||
if(indexPath.section == 0){
|
||||
GiGaUserViewController *userVC= [[GiGaUserViewController alloc] init];
|
||||
[self.navigationController pushViewController:userVC animated:YES];
|
||||
|
||||
}else{
|
||||
if (indexPath.section == 1 && indexPath.row == 0 ){
|
||||
//历史记录
|
||||
GiMaskTimeHistoryVC *historyVC= [[GiMaskTimeHistoryVC alloc] init];
|
||||
[self.navigationController pushViewController:historyVC animated:YES];
|
||||
|
||||
}else{
|
||||
//系统设置
|
||||
GiSysSettingsVC*settingsVC= [[GiSysSettingsVC alloc] init];
|
||||
[self.navigationController pushViewController:settingsVC animated:YES];
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
|
||||
if(indexPath.section==0){
|
||||
return 180;
|
||||
|
||||
}else {
|
||||
return 54;
|
||||
}
|
||||
}
|
||||
|
||||
- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{
|
||||
return 0.1;
|
||||
}
|
||||
|
||||
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
|
||||
if (section == 1){
|
||||
return 20;
|
||||
}
|
||||
return 0.1;
|
||||
}
|
||||
|
||||
|
||||
- (void)didReceiveMemoryWarning {
|
||||
[super didReceiveMemoryWarning];
|
||||
// Dispose of any resources that can be recreated.
|
||||
}
|
||||
|
||||
- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
|
||||
{
|
||||
GiGaUserViewController *userVC= [[GiGaUserViewController alloc] init];
|
||||
[self.navigationController pushViewController:userVC animated:YES];
|
||||
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user