1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- //
- // YOUPAILZAvatarDressCell.m
- // VQU
- //
- // Created by CY on 2021/8/17.
- // Copyright © 2021 leo. All rights reserved.
- //
- #import "YOUPAILZAvatarDressCell.h"
- @interface YOUPAILZAvatarDressCell ()
- @property (nonatomic,weak)UIImageView *youpaippersonalityBoxImgV;
- @property (nonatomic,weak)UILabel *youpaipnameL;
- @property (nonatomic,weak)UILabel *youpaiptimerL;
- @property (nonatomic,weak)UIImageView *youpaipselectedImgV;
- @end
- @implementation YOUPAILZAvatarDressCell
- - (instancetype)initWithFrame:(CGRect)frame{
- if (self = [super initWithFrame:frame]) {
-
- [self youpaifinitUI];
- }
- return self;
- }
- - (void)youpaifinitUI{
- self.backgroundColor = HexColorFromRGB(0x1C1D23);
- self.layer.cornerRadius = ScaleSize(9.0f);
- self.clipsToBounds = YES;
- self.layer.borderColor = HexColorFromRGB(0xF4003F).CGColor;
-
- UIImageView *personalityBoxImgV = [[UIImageView alloc] init];
- [self.contentView addSubview:personalityBoxImgV];
- self.youpaippersonalityBoxImgV = personalityBoxImgV;
- [personalityBoxImgV mas_makeConstraints:^(MASConstraintMaker *make) {
- make.top.offset(ScaleSize(14.0f));
- make.centerX.equalTo(self.contentView);
- make.size.mas_offset(CGSizeMake(ScaleSize(65.0f), ScaleSize(65.0f)));
- }];
-
- UILabel *nameL = [[UILabel alloc] init];
- nameL.font = LCFont(ScaleSize(11.0f));
- nameL.textColor = [UIColor whiteColor];
- nameL.textAlignment = NSTextAlignmentCenter;
- [self.contentView addSubview:nameL];
- self.youpaipnameL = nameL;
- [nameL mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.offset(ScaleSize(12.0f));
- make.top.equalTo(personalityBoxImgV.mas_bottom).offset(ScaleSize(13.0f));
- make.right.offset(ScaleSize(-12.0f));
- }];
-
- UILabel *timerL = [[UILabel alloc] init];
- timerL.font = LCFont(ScaleSize(10.0f));
- timerL.textColor = HexColorFromRGB(0x9F9DA5);
- timerL.textAlignment = NSTextAlignmentCenter;
- [self.contentView addSubview:timerL];
- self.youpaiptimerL = timerL;
- [timerL mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.offset(ScaleSize(12.0f));
- make.top.equalTo(nameL.mas_bottom).offset(ScaleSize(4.0f));
- make.right.offset(ScaleSize(-12.0f));
- }];
-
- UIImageView *selectedImgV = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"vqu_images_ic_profile_dress_selected"]];
- selectedImgV.hidden = YES;
- [self.contentView addSubview:selectedImgV];
- self.youpaipselectedImgV = selectedImgV;
- [selectedImgV mas_makeConstraints:^(MASConstraintMaker *make) {
- make.right.top.offset(0.0f);
- make.size.mas_offset(CGSizeMake(ScaleSize(29.0f), ScaleSize(29.0f)));
- }];
- }
- -(void)youpaifreloadWithModel:(YOUPAILZDressModel *)model{
- self.youpaipnameL.text = model.youpaipname;
- self.youpaiptimerL.text = model.youpaipexpire;
- [self.youpaippersonalityBoxImgV sd_setImageWithURL:[LCTools getImageUrlWithAddress:model.youpaippreview_img]];
-
- if ([model.youpaipis_use isEqual:@"1"]) {
- self.youpaipselectedImgV.hidden = NO;
- self.layer.borderWidth = 1.5f;
- }else{
- self.youpaipselectedImgV.hidden = YES;
- self.layer.borderWidth = 0.0f;
- }
- }
- @end
|