JXServiceTopView.m 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. //
  2. // JXMyTopView.m
  3. // shiku_im
  4. //
  5. // Created by 123 on 2020/5/15.
  6. // Copyright © 2020 Reese. All rights reserved.
  7. //
  8. #import "JXServiceTopView.h"
  9. @interface JXServiceTopView()
  10. @property (weak, nonatomic) UIImageView *headIMG;
  11. @property (weak, nonatomic) UILabel *titeL;
  12. @property (weak, nonatomic) IBOutlet UIView *vipLeverL;
  13. @end
  14. @implementation JXServiceTopView
  15. +(instancetype)XIBJXServiceTopView{
  16. return [[NSBundle mainBundle]loadNibNamed:@"JXServiceTopView" owner:self options:nil].firstObject;
  17. }
  18. -(void)awakeFromNib{
  19. [super awakeFromNib];;
  20. UIView *navTitleView=[[UIView alloc]init];
  21. navTitleView.frame = CGRectMake(0,0,JX_SCREEN_WIDTH,JX_SCREEN_TOP);
  22. [self addSubview:navTitleView];
  23. UIButton *gabtn=[[UIButton alloc]initWithFrame:CGRectMake(0,JX_STATUSBAR_H,44,44)];
  24. [gabtn setImage:[UIImage imageNamed:@"goback"] forState:UIControlStateNormal];
  25. [navTitleView addSubview:gabtn];
  26. self.gobackBtn=gabtn;
  27. UILabel *navTitle=[[UILabel alloc]init];
  28. navTitle.frame = CGRectMake(60,JX_STATUSBAR_H,JX_SCREEN_WIDTH-120,44);
  29. navTitle.font=[UIFont systemFontOfSize:15 weight:UIFontWeightMedium];
  30. navTitle.textColor=[UIColor whiteColor];
  31. navTitle.text=@"我的客服";
  32. navTitle.textAlignment=NSTextAlignmentCenter;
  33. [navTitleView addSubview:navTitle];
  34. UIButton *feedBtn=[[UIButton alloc]init];
  35. feedBtn.frame = CGRectMake(JX_SCREEN_WIDTH-100,JX_STATUSBAR_H,85,44);
  36. feedBtn.titleLabel.font=[UIFont systemFontOfSize:15 weight:UIFontWeightMedium];
  37. [feedBtn setTitle:@"投诉建议" forState:UIControlStateNormal];
  38. feedBtn.contentHorizontalAlignment=UIControlContentHorizontalAlignmentRight;
  39. [navTitleView addSubview:feedBtn];
  40. [feedBtn addTarget:self action:@selector(feedbackBtn:) forControlEvents:UIControlEventTouchUpInside];
  41. UIView *headView=[[UIView alloc]init];
  42. headView.frame = CGRectMake(20,90,JX_SCREEN_WIDTH-40,90);
  43. headView.backgroundColor=[UIColor whiteColor];
  44. [self addSubview:headView];
  45. UIImageView *headIMG=[[UIImageView alloc]init];
  46. headIMG.frame = CGRectMake(10,10,70,70);
  47. headIMG.image=[UIImage imageNamed:@"组1"];
  48. [headView addSubview:headIMG];
  49. UILabel *titleL=[[UILabel alloc]init];
  50. titleL.frame = CGRectMake(CGRectGetMaxX(headIMG.frame)+9,20,JX_SCREEN_WIDTH/2,15);
  51. titleL.font=[UIFont systemFontOfSize:15 weight:UIFontWeightMedium];
  52. titleL.textColor=kRGBColor51;
  53. titleL.text=@"h12345";
  54. [headView addSubview:titleL];
  55. UILabel *contetL=[[UILabel alloc]init];
  56. contetL.frame = CGRectMake(CGRectGetMaxX(headIMG.frame)+9,CGRectGetMaxY(titleL.frame)+9,JX_SCREEN_WIDTH/2,13);
  57. contetL.font=[UIFont systemFontOfSize:13 weight:UIFontWeightMedium];
  58. contetL.textColor=kRGBColor151;
  59. contetL.text=@"欢迎来到客服中心";
  60. [headView addSubview:contetL];
  61. }
  62. - (void)feedbackBtn:(UIButton *)button{
  63. if (_topViewBlockBtn) {
  64. _topViewBlockBtn(button);
  65. }
  66. }
  67. @end