shareRecordViewController.m 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. //
  2. // shareRecordViewController.m
  3. // 双子星云手机
  4. //
  5. // Created by xd h on 2024/5/14.
  6. //
  7. #import "shareRecordViewController.h"
  8. #import "shareRecordTableViewCell.h"
  9. @interface shareRecordViewController ()<UITableViewDelegate,UITableViewDataSource,DZNEmptyDataSetSource, DZNEmptyDataSetDelegate>
  10. {
  11. }
  12. @property (nonatomic, strong) UITableView *tableView;
  13. @end
  14. @implementation shareRecordViewController
  15. - (void)viewDidLoad {
  16. [super viewDidLoad];
  17. // Do any additional setup after loading the view.
  18. [self.toolBar setHidden:YES];
  19. [self.navigationBar setHidden:YES];
  20. [self.navBarBGView setHidden:NO];
  21. self.navBarBGView.backgroundColor = [UIColor whiteColor];
  22. [self.view setBackgroundColor:[UIColor hwColor:@"#F5F7FA"]];
  23. self.titleLabel.text = NSLocalizedString(@"my_set_no_share",nil);
  24. [self drawAnyView];
  25. }
  26. - (void)drawAnyView{
  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(-(60 + safeArea));
  32. make.top.equalTo(self.navBarBGView.mas_bottom).offset(10.f);
  33. }];
  34. }
  35. #pragma mark - 懒加载
  36. - (UITableView *)tableView{
  37. if (!_tableView) {
  38. _tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_W, SCREEN_H - TABBARHEIGHT) style:UITableViewStylePlain];
  39. _tableView.delegate = self;
  40. _tableView.dataSource = self;
  41. _tableView.showsVerticalScrollIndicator = NO;
  42. _tableView.showsHorizontalScrollIndicator = NO;
  43. // _tableView.contentInset = UIEdgeInsetsMake(-H_STATE_BAR, 0, 0, 0);
  44. [_tableView setSeparatorStyle:(UITableViewCellSeparatorStyleNone)];
  45. [_tableView setSeparatorColor:[UIColor clearColor]];
  46. [_tableView setBackgroundColor:[UIColor clearColor]];
  47. [_tableView setTableFooterView:[UIView new]];
  48. [_tableView setBounces:YES];
  49. if (@available(iOS 15.0, *)) {
  50. _tableView.sectionHeaderTopPadding = 0;
  51. }
  52. //空数据引入第三方开源处理
  53. _tableView.emptyDataSetSource = self;
  54. _tableView.emptyDataSetDelegate = self;
  55. }
  56. return _tableView;
  57. }
  58. #pragma mark - 列表委托
  59. - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
  60. return 1;
  61. }
  62. - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
  63. return 2;
  64. }
  65. - (shareRecordTableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
  66. __block NSInteger row = indexPath.row;
  67. static NSString *identifier = @"shareRecordTableViewCell";
  68. shareRecordTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:identifier];
  69. cell.selectionStyle = UITableViewCellSelectionStyleNone;
  70. if (!cell){
  71. cell = [[shareRecordTableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:identifier];
  72. [cell setSelectionStyle:UITableViewCellSelectionStyleNone];
  73. [cell setBackgroundColor:[UIColor clearColor]];
  74. [cell setAccessoryType:(UITableViewCellAccessoryNone)];
  75. }
  76. // if(row < _curCouldPhoneFileListMod.data.list.count){
  77. // couldPhoneFileModel* fileModel = _curCouldPhoneFileListMod.data.list[row];
  78. // cell.curFileModel = fileModel;
  79. //
  80. // KWeakSelf
  81. // cell.didClickSwitch = ^(BOOL SwitchOn) {
  82. // if([weakSelf userCheckFileModel:fileModel withShowTip:YES]){
  83. // [weakSelf userCheckFilePreviewByRow:row];
  84. // }
  85. // };
  86. // }
  87. return cell;
  88. }
  89. - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
  90. return 70;
  91. }
  92. #pragma mark 空数据
  93. - (UIImage *)imageForEmptyDataSet:(UIScrollView *)scrollView {
  94. NSString *imageName = @"uploadFile_noData";
  95. return [UIImage imageNamed:imageName];
  96. }
  97. - (NSAttributedString *)titleForEmptyDataSet:(UIScrollView *)scrollView {
  98. NSString *text = NSLocalizedString(@"File_download_file_no_data",nil);
  99. NSDictionary *attributes = @{NSFontAttributeName: [UIFont systemFontOfSize:16.0f],
  100. NSForegroundColorAttributeName: HW999999Color};
  101. return [[NSAttributedString alloc] initWithString:text attributes:attributes];
  102. }
  103. //调整图片位置
  104. - (CGFloat)verticalOffsetForEmptyDataSet:(UIScrollView *)scrollView {
  105. return -150;
  106. }
  107. @end