// // YOUPAILZSessionListGuideView.m // MSYOUPAI // // Created by CY on 2022/3/23. // Copyright © 2022 MS. All rights reserved. // #import "YOUPAILZSessionListGuideView.h" #import "NIMKitUtil.h" @implementation YOUPAILZSessionListGuideView - (instancetype)initWithFrame:(CGRect)frame{ if (self = [super initWithFrame:frame]) { [self youpaifinitUI]; } return self; } - (void)youpaifinitUI{ UIView *bgV = [[UIView alloc] initWithFrame:CGRectMake(6.0f, 54.0f + 100.0f + StatusBarHeight + 5.0f, KScreenWidth - 12.0f, 64.0f)]; bgV.backgroundColor = [UIColor whiteColor]; bgV.layer.cornerRadius = 10.0f; bgV.clipsToBounds = YES; [self addSubview:bgV]; UIImageView *avatarImgV = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"vqu_images_im_service"]]; [bgV addSubview:avatarImgV]; [avatarImgV mas_makeConstraints:^(MASConstraintMaker *make) { make.size.mas_offset(CGSizeMake(58, 58)); make.centerY.equalTo(bgV); make.left.offset(9); }]; UILabel *nameLabel = [[UILabel alloc] init]; nameLabel.textColor = LZ273145Color; nameLabel.font = [UIFont systemFontOfSize:15.f]; nameLabel.text = @"官方客服"; [bgV addSubview:nameLabel]; [nameLabel mas_makeConstraints:^(MASConstraintMaker *make) { make.left.equalTo(avatarImgV.mas_right).offset(15.0f); make.top.offset(10.0f); }]; UILabel *timeLabel = [[UILabel alloc] initWithFrame:CGRectZero]; timeLabel.font = [UIFont systemFontOfSize:11.f]; timeLabel.textColor = LZA3AABEColor; timeLabel.text = [NIMKitUtil showTime:[[NSDate date] timeIntervalSince1970] showDetail:NO];; [bgV addSubview:timeLabel]; [timeLabel mas_makeConstraints:^(MASConstraintMaker *make) { make.right.offset(-9.0f); make.top.offset(10.0f); }]; UIImageView *officialImgV = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"vqu_images_anchor_official"]]; [bgV addSubview:officialImgV]; [officialImgV mas_makeConstraints:^(MASConstraintMaker *make) { make.left.equalTo(avatarImgV.mas_right).offset(15.0f); make.bottom.offset(-10.0f); make.size.mas_offset(CGSizeMake(26.0f, 15.0f)); }]; UILabel *messageLabel = [[UILabel alloc] initWithFrame:CGRectZero]; messageLabel.font = [UIFont systemFontOfSize:12.f]; messageLabel.textColor = LZA3AABEColor; messageLabel.text = @"教你如何玩转相语欢颜"; [bgV addSubview:messageLabel]; [messageLabel mas_makeConstraints:^(MASConstraintMaker *make) { make.bottom.offset(-10.0f); make.left.equalTo(officialImgV.mas_right).offset(4.0f); }]; UIImageView *tipImgV = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"vqu_images_im_tip_1"]]; [self addSubview: tipImgV]; [tipImgV mas_makeConstraints:^(MASConstraintMaker *make) { make.top.equalTo(bgV.mas_bottom).offset(5.0f); make.left.offset(6.0f); make.size.mas_offset(CGSizeMake(229.0f, 45.0f)); }]; UILabel *tipL = [[UILabel alloc] init]; tipL.textColor = [UIColor whiteColor]; tipL.font = LCFont(14.0f); tipL.text = @"10秒新手福利教程,现金秒到账"; [tipImgV addSubview:tipL]; [tipL mas_makeConstraints:^(MASConstraintMaker *make) { make.bottom.offset(-12.5f); make.centerX.equalTo(tipImgV); }]; } @end