PayRecoderListViewController.m 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. //
  2. // PayRecoderListViewController.m
  3. // 隐私保护
  4. //
  5. // Created by APPLE on 2023/8/29.
  6. //
  7. #import "PayRecoderListViewController.h"
  8. #import "BuyRecoderListCell.h"
  9. #import "PayRecoderDetailViewController.h"
  10. @interface PayRecoderListViewController ()<UITableViewDelegate,UITableViewDataSource,BuyRecoderListCellDelegate>
  11. @property (nonatomic, strong, nullable) UITableView *tableView;
  12. @property (nonatomic, strong, nullable) NSMutableArray *tableDataSource;
  13. @end
  14. @implementation PayRecoderListViewController
  15. @synthesize tableDataSource;
  16. - (void)viewDidLoad {
  17. [super viewDidLoad];
  18. // Do any additional setup after loading the view.
  19. [self drawAnyView];
  20. }
  21. - (void)drawAnyView{
  22. [self.view setBackgroundColor:HWF5F7FAColor];
  23. [self.toolBar setHidden:YES];
  24. [self.navigationBar setHidden:YES];
  25. [self.navBarBGView setHidden:NO];
  26. [self.titleLabel setText:NSLocalizedString(@"buy_vip_buy_recoder_title",nil)];
  27. [self.view addSubview:self.tableView];
  28. [self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
  29. make.left.mas_equalTo(0);
  30. make.right.mas_equalTo(0);
  31. make.bottom.mas_equalTo(0);
  32. make.top.equalTo(self.navBarBGView.mas_bottom).offset(4);
  33. }];
  34. }
  35. /*
  36. #pragma mark - Navigation
  37. // In a storyboard-based application, you will often want to do a little preparation before navigation
  38. - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
  39. // Get the new view controller using [segue destinationViewController].
  40. // Pass the selected object to the new view controller.
  41. }
  42. */
  43. #pragma mark - 懒加载
  44. - (UITableView *)tableView{
  45. if (!_tableView) {
  46. _tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_W, SCREEN_H - TABBARHEIGHT) style:UITableViewStyleGrouped];
  47. _tableView.delegate = self;
  48. _tableView.dataSource = self;
  49. _tableView.showsVerticalScrollIndicator = NO;
  50. _tableView.showsHorizontalScrollIndicator = NO;
  51. _tableView.contentInset = UIEdgeInsetsMake(-20, 0, 0, 0);
  52. [_tableView setSeparatorStyle:(UITableViewCellSeparatorStyleNone)];
  53. [_tableView setSeparatorColor:[UIColor clearColor]];
  54. [_tableView setBackgroundColor:[UIColor clearColor]];
  55. [_tableView setTableFooterView:[UIView new]];
  56. [_tableView setBounces:YES];
  57. if (@available(iOS 15.0, *)) {
  58. _tableView.sectionHeaderTopPadding = 0;
  59. }
  60. }
  61. return _tableView;
  62. }
  63. #pragma mark - 列表委托
  64. - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
  65. return 1;
  66. }
  67. - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
  68. // return tableDataSource.count;
  69. /*测试*/
  70. return 8;
  71. }
  72. - (BuyRecoderListCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
  73. NSInteger row = indexPath.row;
  74. static NSString *identifier = @"BuyRecoderListCell";
  75. BuyRecoderListCell * cell = [tableView dequeueReusableCellWithIdentifier:identifier];
  76. cell.selectionStyle = UITableViewCellSelectionStyleNone;
  77. if (!cell){
  78. cell = [[BuyRecoderListCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:identifier];
  79. cell.delegate = self;
  80. [cell setSelectionStyle:UITableViewCellSelectionStyleNone];
  81. [cell setBackgroundColor:[UIColor clearColor]];
  82. [cell setAccessoryType:(UITableViewCellAccessoryNone)];
  83. }
  84. return cell;
  85. }
  86. - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
  87. return 203;
  88. }
  89. - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
  90. [tableView deselectRowAtIndexPath:indexPath animated:YES];
  91. NSInteger row = indexPath.row;
  92. }
  93. #pragma mark - 订单回调委托
  94. - (void)buyRecoderListCellOrderDetailBtnClick{
  95. /*订单详情*/
  96. PayRecoderDetailViewController *nextVC = [[PayRecoderDetailViewController alloc] init];
  97. [self.navigationController pushViewController:nextVC animated:YES];
  98. }
  99. @end