YOUPAIZYUserZiLiaoBHNoDataCell.m 3.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. //
  2. // YOUPAIZYUserZiLiaoBHNoDataCell.m
  3. // VQU
  4. //
  5. // Created by 肖浩然的mac on 2021/7/16.
  6. // Copyright © 2021 leo. All rights reserved.
  7. //
  8. #import "YOUPAIZYUserZiLiaoBHNoDataCell.h"
  9. @implementation YOUPAIZYUserZiLiaoBHNoDataCell
  10. -(instancetype)initWithFrame:(CGRect)frame{
  11. if (self = [super initWithFrame:frame]) {
  12. [self youpaifsetSubView];
  13. }
  14. return self;
  15. }
  16. -(void)youpaifsetSubView{
  17. UIView *titleView = [UIView new];
  18. [self.contentView addSubview:titleView];
  19. [titleView mas_makeConstraints:^(MASConstraintMaker *make) {
  20. make.left.mas_equalTo(0);
  21. make.right.mas_equalTo(0);
  22. make.top.mas_equalTo(0);
  23. make.height.mas_equalTo(43);
  24. }];
  25. titleView.backgroundColor = LCBkgColor;
  26. self.youpaiptitleLabel = [[UILabel alloc] init];
  27. self.youpaiptitleLabel.font = LCBoldFont(14);
  28. [titleView addSubview:self.youpaiptitleLabel];
  29. [self.youpaiptitleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
  30. make.centerY.mas_equalTo(0);
  31. make.left.mas_equalTo(14);
  32. }];
  33. UIView *contentView = [UIView new];
  34. [self.contentView addSubview:contentView];
  35. [contentView mas_makeConstraints:^(MASConstraintMaker *make) {
  36. make.top.mas_equalTo(titleView.mas_bottom);
  37. make.left.mas_offset(0);
  38. make.right.mas_offset(0);
  39. make.bottom.mas_offset(0.f);
  40. }];
  41. contentView.backgroundColor = LCBkgColor;
  42. //分割线
  43. UIView *viewLine =[UIView new];
  44. [self addSubview:viewLine];
  45. [viewLine mas_makeConstraints:^(MASConstraintMaker *make) {
  46. make.left.mas_equalTo(14);
  47. make.right.mas_equalTo(-14);
  48. make.bottom.mas_equalTo(0);
  49. make.height.mas_equalTo(0.5f);
  50. }];
  51. viewLine.backgroundColor =HexColorFromRGB(0x28262D);
  52. UILabel *hintLabel = [UILabel new];
  53. [contentView addSubview:hintLabel];
  54. [hintLabel mas_makeConstraints:^(MASConstraintMaker *make) {
  55. make.centerX.mas_equalTo(0);
  56. make.top.mas_equalTo(0);
  57. }];
  58. hintLabel.text = @"还没有人庇护Ta";
  59. hintLabel.font = [UIFont systemFontOfSize:14];
  60. hintLabel.textColor = HexColorFromRGB(0x6C6B70);
  61. //庇护按钮
  62. _youpaipbihuBtn = [UIButton new];
  63. [contentView addSubview:_youpaipbihuBtn];
  64. [_youpaipbihuBtn mas_makeConstraints:^(MASConstraintMaker *make) {
  65. make.top.mas_equalTo(hintLabel.mas_bottom).offset(8);
  66. make.centerX.mas_equalTo(0);
  67. make.size.mas_equalTo(CGSizeMake(ScaleSize(77), 22));
  68. }];
  69. [_youpaipbihuBtn setBackgroundImage:[LCTools ColorImage:CGSizeMake(ScaleSize(77), 22) FromColors:@[ZYGradientOneColor,ZYGradientTwoColor] ByGradientType:1] forState:UIControlStateNormal];
  70. [_youpaipbihuBtn setTitle:@"我要庇护" forState:UIControlStateNormal];
  71. _youpaipbihuBtn.titleLabel.font = [UIFont systemFontOfSize:12];
  72. [_youpaipbihuBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
  73. _youpaipbihuBtn.layer.cornerRadius = 11;
  74. _youpaipbihuBtn.layer.masksToBounds = YES;
  75. [_youpaipbihuBtn addTarget:self action:@selector(youpaifbihuBtnClick) forControlEvents:UIControlEventTouchUpInside];
  76. }
  77. -(void)youpaifbihuBtnClick{
  78. if (self.youpaipdidClickBH) {
  79. self.youpaipdidClickBH();
  80. }
  81. }
  82. -(void)setYoupaipdataArr:(NSArray *)dataArr{
  83. _youpaipdataArr = dataArr;
  84. self.youpaiptitleLabel.attributedText = [LCTools setRichTextWithTitle:@"庇护" subTitle:[NSString stringWithFormat:@"(%lu人)",(unsigned long)self.youpaipdataArr.count] titleColor:[UIColor whiteColor] subTitleColor:HexColorFromRGB(0x9F9DA5) titleFontSize:14 subTitleFontSize:12];
  85. }
  86. @end