1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- //
- // YOUPAILZChatRoomBlockCell.m
- // VQU
- //
- // Created by CY on 2021/11/10.
- // Copyright © 2021 MS. All rights reserved.
- //
- #import "YOUPAILZChatRoomBlockCell.h"
- #import "YOUPAILZAvatarView.h"
- @interface YOUPAILZChatRoomBlockCell()
- @property (nonatomic, weak) YOUPAILZAvatarView *youpaipavatarView; // 头像
- @property (nonatomic, weak) UILabel *youpaipnicknameL; // 昵称
- @property (nonatomic, weak) UILabel *youpaiptimeL; // 剩余限制时间
- @property (nonatomic, weak) UIImageView *youpaipselectedImgV;
- @end
- @implementation YOUPAILZChatRoomBlockCell
- - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
- if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
- self.selectionStyle = UITableViewCellSelectionStyleNone;
- self.backgroundColor = [UIColor clearColor];
- [self youpaifinitUI];
- }
- return self;
- }
- - (void)youpaifinitUI{
- YOUPAILZAvatarView *youpaipavatarView = [YOUPAILZAvatarView youpaifavatarViewWithFrame:CGRectMake(0, 0, 40, 40) avatarURL:nil personalityBoxURL:nil];
- [self.contentView addSubview:youpaipavatarView];
- self.youpaipavatarView = youpaipavatarView;
- [youpaipavatarView mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.offset(14.0f);
- make.centerY.equalTo(self.contentView.mas_centerY);
- make.size.mas_offset(CGSizeMake(40.0f, 40.0f));
- }];
-
- UILabel *youpaipnicknameL = [[UILabel alloc] init];
- youpaipnicknameL.font = LCBoldFont(14.0f);
- youpaipnicknameL.textColor = [UIColor whiteColor];
- [self.contentView addSubview:youpaipnicknameL];
- self.youpaipnicknameL = youpaipnicknameL;
- [youpaipnicknameL mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.equalTo(youpaipavatarView.mas_right).offset(8.0f);
- make.top.offset(18.0f);
- }];
-
- UILabel *youpaiptimeL = [[UILabel alloc] init];
- youpaiptimeL.font = LCFont(10.0f);
- youpaiptimeL.textColor = HexColorFromRGB(0x9F9DA5);
- [self.contentView addSubview:youpaiptimeL];
- self.youpaiptimeL = youpaiptimeL;
- [youpaiptimeL mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.equalTo(youpaipavatarView.mas_right).offset(8.0f);
- make.bottom.offset(-18.0f);
- }];
-
- UIImageView *selectedImgV = [[UIImageView alloc] init];
- [self.contentView addSubview:selectedImgV];
- self.youpaipselectedImgV = selectedImgV;
- [selectedImgV mas_makeConstraints:^(MASConstraintMaker *make) {
- make.centerY.equalTo(self.contentView.mas_centerY);
- make.right.offset(-14.0f);
- make.size.mas_offset(CGSizeMake(15.0f, 15.0f));
- }];
-
- [self.contentView addLineWithColor:HexColorFromRGB(0x4F4B5B) lineRect:CGRectMake(14.0f, 67.5f, KScreenWidth - 28.0f, 0.5f)];
- }
- -(void)youpaifreloadWithModel:(YOUPAILZChatRoomBlockModel *)model{
- self.youpaipavatarView.youpaipavatarURL = [LCTools getImageUrlWithAddress:model.youpaipavatar];
- self.youpaipnicknameL.text = model.youpaipnickname;
- self.youpaiptimeL.text = model.youpaipdes;
- self.youpaipselectedImgV.image = model.youpaipisSelected ? [UIImage imageNamed:@"vqu_images_chatroom_black_s"] : [UIImage imageNamed:@"vqu_images_chatroom_black_n"];
- }
- @end
|