酷店

KDPForecastVC.m 3.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. //
  2. // KDPForecastVC.m
  3. // KuDianProject
  4. //
  5. // Created by 学丽 on 2019/7/8.
  6. // Copyright © 2019 KDP. All rights reserved.
  7. //
  8. #import "KDPForecastVC.h"
  9. #import "KDPForecastListCell.h"
  10. @interface KDPForecastVC ()<UITableViewDelegate,UITableViewDataSource>
  11. {
  12. UILabel *_orderNumMoneyLabel;
  13. }
  14. @property(nonatomic,strong)UITableView *forecastView;
  15. @end
  16. @implementation KDPForecastVC
  17. - (void)viewDidLoad {
  18. [super viewDidLoad];
  19. [self setNavUI];
  20. }
  21. -(void)setNavUI
  22. {
  23. self.view.backgroundColor=[UIColor whiteColor];
  24. [self.navBar addleftReturnButton:self selector:@selector(returnClickBtn)];
  25. self.navBar.navTitleLabel.text=@"预估收益";
  26. [self.view addSubview:self.forecastView];
  27. }
  28. -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
  29. {
  30. KDPForecastListCell *listC=[tableView dequeueReusableCellWithIdentifier:@"fore"];
  31. if (!listC) {
  32. listC=[[KDPForecastListCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"fore"];
  33. listC.selectionStyle=UITableViewCellSelectionStyleNone;
  34. }
  35. listC.accessoryType=UITableViewCellAccessoryDisclosureIndicator;
  36. return listC;
  37. }
  38. -(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
  39. {
  40. return 5;
  41. }
  42. -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
  43. {
  44. KDPForecastOrderListVC *orderV=[[KDPForecastOrderListVC alloc]init];
  45. [self.navigationController pushViewController:orderV animated:YES];
  46. }
  47. -(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
  48. {
  49. return 50;
  50. }
  51. -(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
  52. {
  53. return 1;
  54. }
  55. -(void)returnClickBtn
  56. {
  57. [self.navigationController popViewControllerAnimated:YES];
  58. }
  59. -(void)viewWillAppear:(BOOL)animated
  60. {
  61. [super viewWillAppear:animated];
  62. self.navigationController.navigationBar.hidden=YES;
  63. self.tabBarController.tabBar.hidden=YES;
  64. }
  65. -(void)viewWillDisappear:(BOOL)animated
  66. {
  67. [super viewWillDisappear:animated];
  68. self.tabBarController.tabBar.hidden=NO;
  69. }
  70. -(UITableView *)forecastView
  71. {
  72. if (!_forecastView) {
  73. _forecastView=[[UITableView alloc]initWithFrame:CGRectMake(0, KDNavBarHeight, SCREEN_WIDTH, self.view.height)];
  74. _forecastView.backgroundColor=[UIColor clearColor];
  75. _forecastView.separatorStyle=UITableViewCellSeparatorStyleNone;
  76. _forecastView.delegate=self;
  77. _forecastView.dataSource=self;
  78. [self addtabheader];
  79. }
  80. return _forecastView;
  81. }
  82. -(void)addtabheader
  83. {
  84. UIView *backV=[[UIView alloc]initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 47)];
  85. backV.backgroundColor=[UIColor clearColor];
  86. self.forecastView.tableHeaderView=backV;
  87. _orderNumMoneyLabel=[[UILabel alloc]initWithFrame:CGRectMake(15, 0, SCREEN_WIDTH-30, 46)];
  88. _orderNumMoneyLabel.text=@"预估订单:-- 收益:---元";
  89. _orderNumMoneyLabel.font=[UIFont systemFontOfSize:14];
  90. _orderNumMoneyLabel.textColor=[UIColor blackColor];
  91. [backV addSubview:_orderNumMoneyLabel];
  92. UIView *lineV=[[UIView alloc]initWithFrame:CGRectMake(10, 46, SCREEN_WIDTH-20, 1)];
  93. lineV.backgroundColor=[UIColor colorWithHexString:LineColor];
  94. [backV addSubview:lineV];
  95. }
  96. @end