add
This commit is contained in:
@@ -16,6 +16,8 @@
|
||||
#import "GiGaBaseAPiRequest.h"
|
||||
#import "GiGaUserManager.h"
|
||||
#import "UIImageView+WebCache.h"
|
||||
#import "GiGaUserInfoVC.h"
|
||||
#import "GIGaMaskTimeUseRecordVC.h"
|
||||
|
||||
@interface GiGaMeViewController ()
|
||||
@property (nonatomic,strong) GiGaUser *user;
|
||||
@@ -39,23 +41,43 @@
|
||||
self.tableView.estimatedSectionHeaderHeight = 0;
|
||||
self.tableView.bounces = NO;
|
||||
self.tableView.frame = CGRectMake(0, 1, KMainW, self.view.bounds.size.height - SAFE_NAV_HEIGHT);
|
||||
[self loadUserInfo];
|
||||
NC_ADD_TARGET_NAME_OBJECT(self, @selector(userAvatorUpDate), kUserAvatorUpdateNoti, nil) ;
|
||||
//[self loadUserInfo];
|
||||
GiGaUser *user = [[GiGaUserManager shareUser] getCurrentUser];
|
||||
self.user = user;
|
||||
NC_ADD_TARGET_NAME_OBJECT(self, @selector(userAvatorUpDate), kUserAvatorUpdateNoti, nil);
|
||||
NC_ADD_TARGET_NAME_OBJECT(self, @selector(usersNameUpDateNoti), kUserNameUpDateNoti, nil);
|
||||
|
||||
}
|
||||
|
||||
- (void)viewWillAppear:(BOOL)animated{
|
||||
[super viewWillAppear:animated];
|
||||
|
||||
}
|
||||
|
||||
-(void)dealloc{
|
||||
NC_REMOVE_NAME(self, kUserAvatorUpdateNoti, nil);
|
||||
NC_REMOVE_NAME(self, kUserNameUpDateNoti, nil);
|
||||
}
|
||||
|
||||
-(void)userAvatorUpDate{
|
||||
|
||||
GiGaUser *user = [[GiGaUserManager shareUser] getCurrentUser];
|
||||
self.user = user;
|
||||
if (user.headImgUrl && ![user.headImgUrl isKindOfClass:[NSNull class]] ) {
|
||||
GiGaMineUserViewCell *cell = [self.tableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0]];
|
||||
NSURL *url = [NSURL URLWithString:user.headImgUrl];
|
||||
[cell.userAvator sd_setImageWithURL:url];
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
-(void)usersNameUpDateNoti{
|
||||
GiGaUser *user = [[GiGaUserManager shareUser] getCurrentUser];
|
||||
self.user = user;
|
||||
if (user.nickName && ![user.nickName isEqualToString:@""] && ![user.nickName isKindOfClass:[NSNull class]]) {
|
||||
GiGaMineUserViewCell *cell = [self.tableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0]];
|
||||
cell.userName.text = user.nickName;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
-(void)loadUserInfo{
|
||||
@@ -120,7 +142,7 @@
|
||||
}
|
||||
|
||||
if(indexPath.section == 0){
|
||||
GiGaUserViewController *userVC= [[GiGaUserViewController alloc] init];
|
||||
GiGaUserInfoVC *userVC= [[GiGaUserInfoVC alloc] init];
|
||||
[self.navigationController pushViewController:userVC animated:YES];
|
||||
|
||||
}else{
|
||||
@@ -130,6 +152,9 @@
|
||||
[self.navigationController pushViewController:historyVC animated:YES];
|
||||
|
||||
}else if (indexPath.section == 1 && indexPath.row == 1){
|
||||
//使用记录
|
||||
GIGaMaskTimeUseRecordVC *historyVC= [[GIGaMaskTimeUseRecordVC alloc] init];
|
||||
[self.navigationController pushViewController:historyVC animated:YES];
|
||||
|
||||
}else{
|
||||
//系统设置
|
||||
|
||||
Reference in New Issue
Block a user