YOUPAILZSessionListGuideView.m 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. //
  2. // YOUPAILZSessionListGuideView.m
  3. // MSYOUPAI
  4. //
  5. // Created by CY on 2022/3/23.
  6. // Copyright © 2022 MS. All rights reserved.
  7. //
  8. #import "YOUPAILZSessionListGuideView.h"
  9. #import "NIMKitUtil.h"
  10. @implementation YOUPAILZSessionListGuideView
  11. - (instancetype)initWithFrame:(CGRect)frame{
  12. if (self = [super initWithFrame:frame]) {
  13. [self youpaifinitUI];
  14. }
  15. return self;
  16. }
  17. - (void)youpaifinitUI{
  18. UIView *bgV = [[UIView alloc] initWithFrame:CGRectMake(6.0f, 54.0f + 100.0f + StatusBarHeight + 5.0f, KScreenWidth - 12.0f, 64.0f)];
  19. bgV.backgroundColor = [UIColor whiteColor];
  20. bgV.layer.cornerRadius = 10.0f;
  21. bgV.clipsToBounds = YES;
  22. [self addSubview:bgV];
  23. UIImageView *avatarImgV = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"vqu_images_im_service"]];
  24. [bgV addSubview:avatarImgV];
  25. [avatarImgV mas_makeConstraints:^(MASConstraintMaker *make) {
  26. make.size.mas_offset(CGSizeMake(58, 58));
  27. make.centerY.equalTo(bgV);
  28. make.left.offset(9);
  29. }];
  30. UILabel *nameLabel = [[UILabel alloc] init];
  31. nameLabel.textColor = LZ273145Color;
  32. nameLabel.font = [UIFont systemFontOfSize:15.f];
  33. nameLabel.text = @"官方客服";
  34. [bgV addSubview:nameLabel];
  35. [nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
  36. make.left.equalTo(avatarImgV.mas_right).offset(15.0f);
  37. make.top.offset(10.0f);
  38. }];
  39. UILabel *timeLabel = [[UILabel alloc] initWithFrame:CGRectZero];
  40. timeLabel.font = [UIFont systemFontOfSize:11.f];
  41. timeLabel.textColor = LZA3AABEColor;
  42. timeLabel.text = [NIMKitUtil showTime:[[NSDate date] timeIntervalSince1970] showDetail:NO];;
  43. [bgV addSubview:timeLabel];
  44. [timeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
  45. make.right.offset(-9.0f);
  46. make.top.offset(10.0f);
  47. }];
  48. UIImageView *officialImgV = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"vqu_images_anchor_official"]];
  49. [bgV addSubview:officialImgV];
  50. [officialImgV mas_makeConstraints:^(MASConstraintMaker *make) {
  51. make.left.equalTo(avatarImgV.mas_right).offset(15.0f);
  52. make.bottom.offset(-10.0f);
  53. make.size.mas_offset(CGSizeMake(26.0f, 15.0f));
  54. }];
  55. UILabel *messageLabel = [[UILabel alloc] initWithFrame:CGRectZero];
  56. messageLabel.font = [UIFont systemFontOfSize:12.f];
  57. messageLabel.textColor = LZA3AABEColor;
  58. messageLabel.text = @"教你如何玩转相语欢颜";
  59. [bgV addSubview:messageLabel];
  60. [messageLabel mas_makeConstraints:^(MASConstraintMaker *make) {
  61. make.bottom.offset(-10.0f);
  62. make.left.equalTo(officialImgV.mas_right).offset(4.0f);
  63. }];
  64. UIImageView *tipImgV = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"vqu_images_im_tip_1"]];
  65. [self addSubview: tipImgV];
  66. [tipImgV mas_makeConstraints:^(MASConstraintMaker *make) {
  67. make.top.equalTo(bgV.mas_bottom).offset(5.0f);
  68. make.left.offset(6.0f);
  69. make.size.mas_offset(CGSizeMake(229.0f, 45.0f));
  70. }];
  71. UILabel *tipL = [[UILabel alloc] init];
  72. tipL.textColor = [UIColor whiteColor];
  73. tipL.font = LCFont(14.0f);
  74. tipL.text = @"10秒新手福利教程,现金秒到账";
  75. [tipImgV addSubview:tipL];
  76. [tipL mas_makeConstraints:^(MASConstraintMaker *make) {
  77. make.bottom.offset(-12.5f);
  78. make.centerX.equalTo(tipImgV);
  79. }];
  80. }
  81. @end