|
@@ -25,14 +25,11 @@
|
|
|
- (void)viewDidLoad {
|
|
- (void)viewDidLoad {
|
|
|
[super viewDidLoad];
|
|
[super viewDidLoad];
|
|
|
// Do any additional setup after loading the view.
|
|
// Do any additional setup after loading the view.
|
|
|
- self.title = @"我";
|
|
|
|
|
|
|
|
|
|
YRTabBar *tarbar = (YRTabBar *)self.tabBarController.tabBar;
|
|
YRTabBar *tarbar = (YRTabBar *)self.tabBarController.tabBar;
|
|
|
|
|
|
|
|
[tarbar hideBadgeOnItemIndex:2];
|
|
[tarbar hideBadgeOnItemIndex:2];
|
|
|
|
|
|
|
|
-
|
|
|
|
|
- [self getDataFromServer];
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@@ -140,6 +137,89 @@
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
|
|
|
|
|
+ return 221+36;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+-(CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{
|
|
|
|
|
+ return CGFLOAT_MIN;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+-(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{
|
|
|
|
|
+
|
|
|
|
|
+ UIView *header = [[UIView alloc]initWithFrame:CGRectMake(0, 0, self_width, 221+36)];
|
|
|
|
|
+
|
|
|
|
|
+ UIImageView *bg = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, self_width, 221)];
|
|
|
|
|
+ bg.image = [UIImage imageNamed:@"UU_newbg4"];
|
|
|
|
|
+ [header addSubview:bg];
|
|
|
|
|
+
|
|
|
|
|
+ UIImageView *iconView = [[UIImageView alloc]init];
|
|
|
|
|
+ iconView.layer.cornerRadius = 47;
|
|
|
|
|
+ iconView.layer.masksToBounds = YES;
|
|
|
|
|
+ iconView.layer.borderWidth = 3;
|
|
|
|
|
+ iconView.layer.borderColor = [UIColor whiteColor].CGColor;
|
|
|
|
|
+ [header addSubview:iconView];
|
|
|
|
|
+ [iconView mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
|
+
|
|
|
|
|
+ make.centerY.equalTo(bg.mas_bottom).offset(-11);
|
|
|
|
|
+ make.centerX.equalTo(header);
|
|
|
|
|
+ make.width.height.mas_equalTo(94);
|
|
|
|
|
+
|
|
|
|
|
+ }];
|
|
|
|
|
+
|
|
|
|
|
+ UILabel *nameLabel = [UILabel new];
|
|
|
|
|
+ nameLabel.textColor = [UIColor whiteColor];
|
|
|
|
|
+ nameLabel.font = BoldFont_SIZE(20);
|
|
|
|
|
+ nameLabel.textAlignment = NSTextAlignmentRight;
|
|
|
|
|
+ [header addSubview:nameLabel];
|
|
|
|
|
+
|
|
|
|
|
+ UILabel *phoneLabel = [UILabel new];
|
|
|
|
|
+ phoneLabel.textColor = [UIColor whiteColor];
|
|
|
|
|
+ phoneLabel.font = FONT_SIZE(14);
|
|
|
|
|
+ [header addSubview:phoneLabel];
|
|
|
|
|
+
|
|
|
|
|
+ UIButton *btn = [UIButton new];
|
|
|
|
|
+ [header addSubview:btn];
|
|
|
|
|
+ [phoneLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
|
+
|
|
|
|
|
+ make.bottom.equalTo(iconView.mas_top).offset(-20);
|
|
|
|
|
+ make.centerX.equalTo(header);
|
|
|
|
|
+ make.height.width.greaterThanOrEqualTo(@0);
|
|
|
|
|
+
|
|
|
|
|
+ }];
|
|
|
|
|
+ [nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
|
+
|
|
|
|
|
+ make.centerY.equalTo(phoneLabel);
|
|
|
|
|
+ make.right.equalTo(phoneLabel.mas_left).offset(-14);
|
|
|
|
|
+ make.height.greaterThanOrEqualTo(@0);
|
|
|
|
|
+ make.left.equalTo(header);
|
|
|
|
|
+ }];
|
|
|
|
|
+ [btn mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
|
+
|
|
|
|
|
+ make.left.equalTo(phoneLabel.mas_right).offset(25);
|
|
|
|
|
+ make.centerY.equalTo(phoneLabel);
|
|
|
|
|
+ make.width.height.mas_equalTo(19);
|
|
|
|
|
+
|
|
|
|
|
+ }];
|
|
|
|
|
+
|
|
|
|
|
+ NSDictionary *accountDic = [[YRUserInfo shareManager].userInfo objectForKey:@"account"];
|
|
|
|
|
+ nameLabel.text = [accountDic objectForKey:@"realname"];
|
|
|
|
|
+ phoneLabel.text = u_account;
|
|
|
|
|
+
|
|
|
|
|
+ iconView.image = [UIImage imageNamed:@"uu_zhanwei_man"];
|
|
|
|
|
+
|
|
|
|
|
+ [btn setBackgroundImage:[UIImage imageNamed:@"UU_newWoedit"] forState:UIControlStateNormal];
|
|
|
|
|
+// [btn addTarget:self action:@selector(editMyData) forControlEvents:UIControlEventTouchUpInside];
|
|
|
|
|
+
|
|
|
|
|
+ return header;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+-(UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section{
|
|
|
|
|
+
|
|
|
|
|
+ return [UIView new];
|
|
|
|
|
+
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
#pragma mark --- 设置页面
|
|
#pragma mark --- 设置页面
|
|
|
-(void)setUpUI
|
|
-(void)setUpUI
|
|
|
{
|
|
{
|
|
@@ -150,6 +230,47 @@
|
|
|
make.edges.equalTo(self.view);
|
|
make.edges.equalTo(self.view);
|
|
|
|
|
|
|
|
}];
|
|
}];
|
|
|
|
|
+
|
|
|
|
|
+ NSArray *homeConfigArr = [[YRUserInfo shareManager].userCompanyInfo objectForKey:@"homeConfigArray"];
|
|
|
|
|
+
|
|
|
|
|
+ if (homeConfigArr.count == 0) {
|
|
|
|
|
+
|
|
|
|
|
+ [self getDataFromServer];
|
|
|
|
|
+
|
|
|
|
|
+ }else{
|
|
|
|
|
+
|
|
|
|
|
+ for (id obj in homeConfigArr) {
|
|
|
|
|
+
|
|
|
|
|
+ [self.dataArr addObject:[YRMineModel mj_objectWithKeyValues:obj]];
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ [self.tableView reloadData];
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ UIButton *meBtn = [UIButton new];
|
|
|
|
|
+ meBtn.frame = CGRectMake(0, 5, 60, 30);
|
|
|
|
|
+ [meBtn setTitle:@"我" forState:UIControlStateNormal];
|
|
|
|
|
+ meBtn.titleLabel.font = FONT_SIZE(18);
|
|
|
|
|
+ [meBtn setBackgroundColor:[UIColor clearColor] forState:UIControlStateNormal];
|
|
|
|
|
+ meBtn.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft;
|
|
|
|
|
+ UIBarButtonItem *leftItem = [[UIBarButtonItem alloc]initWithCustomView: meBtn];
|
|
|
|
|
+ self.navigationItem.leftBarButtonItem = leftItem;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+#pragma mark --- viewAction
|
|
|
|
|
+-(void)viewWillAppear:(BOOL)animated
|
|
|
|
|
+{
|
|
|
|
|
+ self.navigationController.navigationBar.subviews[0].alpha = 0.0f;
|
|
|
|
|
+
|
|
|
|
|
+ [self.navigationController setNeedsNavigationBackground:0.0f];
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+-(void)viewWillDisappear:(BOOL)animated
|
|
|
|
|
+{
|
|
|
|
|
+ self.navigationController.navigationBar.subviews[0].alpha = 1.0f;
|
|
|
|
|
+
|
|
|
|
|
+ [self.navigationController setNeedsNavigationBackground:1.0f];
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
#pragma mark --- lazy
|
|
#pragma mark --- lazy
|
|
@@ -157,12 +278,21 @@
|
|
|
|
|
|
|
|
if (!_tableView) {
|
|
if (!_tableView) {
|
|
|
|
|
|
|
|
- _tableView = [[YRTableView alloc]initWithFrame:self.view.frame];
|
|
|
|
|
|
|
+ _tableView = [[YRTableView alloc]initWithFrame:self.view.frame style:UITableViewStyleGrouped];
|
|
|
_tableView.delegate = self;
|
|
_tableView.delegate = self;
|
|
|
_tableView.dataSource = self;
|
|
_tableView.dataSource = self;
|
|
|
_tableView.tableHeaderView = [UIView new];
|
|
_tableView.tableHeaderView = [UIView new];
|
|
|
_tableView.tableFooterView = [UIView new];
|
|
_tableView.tableFooterView = [UIView new];
|
|
|
|
|
+ _tableView.showsVerticalScrollIndicator = NO;
|
|
|
|
|
+ _tableView.showsHorizontalScrollIndicator = NO;
|
|
|
|
|
+ _tableView.backgroundColor = [UIColor whiteColor];
|
|
|
|
|
+ _tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
|
|
|
|
|
|
|
|
|
|
+ CGFloat height = 64;
|
|
|
|
|
+ if (statusXLately) {
|
|
|
|
|
+ height = 132;
|
|
|
|
|
+ }
|
|
|
|
|
+ _tableView.contentInset = UIEdgeInsetsMake(-height, 0, 0, 0);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
return _tableView;
|
|
return _tableView;
|