// // JXXinRenLookVc.m // shiku_im // // Created by 123 on 2020/5/25. // Copyright © 2020 Reese. All rights reserved. // #import "JXXinRenLookVc.h" #import "JXXinRenLookCell.h" #import "JXXinRenLookDetialVc.h" @interface JXXinRenLookVc () @property (nonatomic,weak) UITableView *tableView; @property (nonatomic,strong) NSMutableArray *dataArr; @end @implementation JXXinRenLookVc - (id)init { self = [super init]; if (self) { [self defineNavBar:@"新人必看" andRinghtBtnImg:@""]; } return self; } - (void)viewDidLoad { [super viewDidLoad]; self.view.backgroundColor=kRGBColor246; // Do any additional setup after loading the view. self.navigationItem.title=@"新人必看"; _dataArr=[NSMutableArray array]; NSArray *dictArr=@[@{@"title":@"玩转即信",@"subtitle":@"教您如何快速玩转即信",@"icon":@"xinrenIcon1"}, @{@"title":@"吉利介绍",@"subtitle":@"教您如何识别黑平台",@"icon":@"xinrenIcon3"}, @{@"title":@"代理介绍",@"subtitle":@"人生道路,快人一步",@"icon":@"xinrenIcon2"}]; [_dataArr addObjectsFromArray:dictArr]; UITableView *tableView=[[UITableView alloc]initWithFrame:CGRectMake(0, JX_SCREEN_TOP, JX_SCREEN_WIDTH, JX_SCREEN_HEIGHT-JX_SCREEN_TOP) style:UITableViewStylePlain]; tableView.delegate=self; tableView.dataSource=self; tableView.separatorStyle=UITableViewCellSeparatorStyleNone; tableView.tableFooterView=[UIView new]; [self.view addSubview:tableView]; self.tableView=tableView; } -(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{ return 175; } -(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{ return _dataArr.count; } -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ JXXinRenLookCell *cell=[JXXinRenLookCell cellWithTableView:tableView]; NSDictionary *dict=_dataArr[indexPath.row]; cell.dictData=dict; return cell; } - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{ NSDictionary *dict=_dataArr[indexPath.row]; if ([dict[@"title"] isEqualToString:@"玩转即信"]) { JXXinRenLookDetialVc *vc=[JXXinRenLookDetialVc new]; [g_navigation pushViewController:vc animated:YES]; } } @end