JXtopShowVIew.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. //
  2. // JXtopShowVIew.h
  3. // shiku_im
  4. //
  5. // Created by 123 on 2020/5/21.
  6. // Copyright © 2020 Reese. All rights reserved.
  7. //
  8. #import <UIKit/UIKit.h>
  9. #import "JLSelectModel.h"
  10. typedef void(^JxGuanXinBlockBtn)(UIButton *btn);
  11. @interface JXtopShowVIew : UIView
  12. @property (nonatomic,strong) JLSelectItemModel *selectItemModel;
  13. +(instancetype)xibJXtopShowVIew;
  14. @property (weak, nonatomic) IBOutlet UIButton *caizongBtn;
  15. @property (weak, nonatomic) IBOutlet UIButton *tebieBtn;
  16. @property (nonatomic,strong) NSMutableArray *dataArr;
  17. @property (weak, nonatomic) IBOutlet UIView *xiaLineView;
  18. @property (nonatomic,copy) JxGuanXinBlockBtn jxGuanXinBlockBtn;
  19. @property (weak, nonatomic) IBOutlet UIButton *tebieGuanXin;
  20. @end
  21. /**
  22. -(void)setDataArr:(NSMutableArray *)dataArr{
  23. _dataArr=dataArr;
  24. NSArray * titles1=@[@"全部",@"食品饮料",@"进口食品",@"美容化妆",@"母婴玩具"];
  25. CGFloat titBtnX =10;
  26. for(int i =0; i <titles1.count; i++){
  27. UIButton *titBtn = [UIButton buttonWithType:UIButtonTypeCustom];
  28. titBtn.titleLabel.font= [UIFont systemFontOfSize:15 weight:UIFontWeightMedium];
  29. [titBtn setTitleColor:kRGBColor51 forState:UIControlStateNormal];
  30. [titBtn setTitle:titles1[i] forState:UIControlStateNormal];
  31. titBtn.backgroundColor=[UIColor whiteColor];
  32. titBtn.layer.cornerRadius=10;
  33. titBtn.layer.masksToBounds=YES;
  34. titBtn.tag=i;
  35. CGSize titleSize=[self titleBtnWight:titles1[i] and:titBtn];
  36. CGFloat titBtnW = titleSize.width+0;
  37. titBtn.frame=CGRectMake(titBtnX, 3, titBtnW, 24);
  38. titBtnX += titBtnW + 10;
  39. [_topScorllView addSubview:titBtn];
  40. }
  41. _topScorllView.contentSize=CGSizeMake(10+titles1.count*((JX_SCREEN_WIDTH -100)/5 + 25), 0);
  42. }
  43. UIView *topView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, self.qiuIMG.frame.size.width, self.qiuIMG.frame.size.height)];
  44. [_topViewSubView addSubview:topView];
  45. UILabel *qiShuL=[[UILabel alloc]init];
  46. qiShuL.text=@"117期";
  47. qiShuL.textColor=kRGBColor51;
  48. qiShuL.font=[UIFont systemFontOfSize:14 weight:UIFontWeightMedium];
  49. [topView addSubview:qiShuL];
  50. self.qishuL=qiShuL;
  51. [qiShuL mas_makeConstraints:^(MASConstraintMaker *make) {
  52. make.centerY.mas_equalTo(topView.mas_centerY);
  53. make.left.mas_equalTo(10);
  54. }];
  55. UILabel *hezhiLL=[[UILabel alloc]init];
  56. hezhiLL.text=@" ";
  57. hezhiLL.textColor=kRGBColor51;
  58. hezhiLL.font=[UIFont systemFontOfSize:14 weight:UIFontWeightMedium];
  59. [topView addSubview:hezhiLL];
  60. [hezhiLL mas_makeConstraints:^(MASConstraintMaker *make) {
  61. make.centerY.mas_equalTo(topView.mas_centerY);
  62. make.right.mas_equalTo(-8);
  63. }];
  64. UIView *qiuIMG=[[UIView alloc]init];
  65. hezhiLL.text=@" ";
  66. hezhiLL.backgroundColor=[UIColor cyanColor];
  67. hezhiLL.font=[UIFont systemFontOfSize:14 weight:UIFontWeightMedium];
  68. [topView addSubview:hezhiLL];
  69. [hezhiLL mas_makeConstraints:^(MASConstraintMaker *make) {
  70. make.centerY.mas_equalTo(topView.mas_centerY);
  71. make.right.mas_equalTo(-8);
  72. }];
  73. */