JXXinRenLookVc.m 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. //
  2. // JXXinRenLookVc.m
  3. // shiku_im
  4. //
  5. // Created by 123 on 2020/5/25.
  6. // Copyright © 2020 Reese. All rights reserved.
  7. //
  8. #import "JXXinRenLookVc.h"
  9. #import "JXXinRenLookCell.h"
  10. #import "JXXinRenLookDetialVc.h"
  11. @interface JXXinRenLookVc ()<UITableViewDelegate,UITableViewDataSource>
  12. @property (nonatomic,weak) UITableView *tableView;
  13. @property (nonatomic,strong) NSMutableArray *dataArr;
  14. @end
  15. @implementation JXXinRenLookVc
  16. - (id)init
  17. {
  18. self = [super init];
  19. if (self) {
  20. [self defineNavBar:@"新人必看" andRinghtBtnImg:@""];
  21. }
  22. return self;
  23. }
  24. - (void)viewDidLoad {
  25. [super viewDidLoad];
  26. self.view.backgroundColor=kRGBColor246;
  27. // Do any additional setup after loading the view.
  28. self.navigationItem.title=@"新人必看";
  29. _dataArr=[NSMutableArray array];
  30. NSArray *dictArr=@[@{@"title":@"玩转即信",@"subtitle":@"教您如何快速玩转即信",@"icon":@"xinrenIcon1"},
  31. @{@"title":@"吉利介绍",@"subtitle":@"教您如何识别黑平台",@"icon":@"xinrenIcon3"},
  32. @{@"title":@"代理介绍",@"subtitle":@"人生道路,快人一步",@"icon":@"xinrenIcon2"}];
  33. [_dataArr addObjectsFromArray:dictArr];
  34. UITableView *tableView=[[UITableView alloc]initWithFrame:CGRectMake(0, JX_SCREEN_TOP, JX_SCREEN_WIDTH, JX_SCREEN_HEIGHT-JX_SCREEN_TOP) style:UITableViewStylePlain];
  35. tableView.delegate=self;
  36. tableView.dataSource=self;
  37. tableView.separatorStyle=UITableViewCellSeparatorStyleNone;
  38. tableView.tableFooterView=[UIView new];
  39. [self.view addSubview:tableView];
  40. self.tableView=tableView;
  41. }
  42. -(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
  43. return 175;
  44. }
  45. -(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
  46. return _dataArr.count;
  47. }
  48. -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
  49. JXXinRenLookCell *cell=[JXXinRenLookCell cellWithTableView:tableView];
  50. NSDictionary *dict=_dataArr[indexPath.row];
  51. cell.dictData=dict;
  52. return cell;
  53. }
  54. - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
  55. NSDictionary *dict=_dataArr[indexPath.row];
  56. if ([dict[@"title"] isEqualToString:@"玩转即信"]) {
  57. JXXinRenLookDetialVc *vc=[JXXinRenLookDetialVc new];
  58. [g_navigation pushViewController:vc animated:YES];
  59. }
  60. }
  61. @end