123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103 |
- //
- // XYRedPacketDetailGiftCell.m
- // Timi
- //
- // Created by gy on 2021/11/22.
- //
- #import "XYRedPacketDrawResultCell.h"
- @interface XYRedPacketDrawResultCell(){
-
- }
- @property (nonatomic, strong) UIImageView *avatarImgView;
- @property (nonatomic, strong) UILabel *userNameLab;
- @property (nonatomic, strong) UILabel *giftNameLab;
- @property (nonatomic, strong) UIImageView *giftImgView;
- @end
- @implementation XYRedPacketDrawResultCell
- - (void)reload:(YQLiveCoinGiftCoinModel *)info{
- [self.avatarImgView sd_setImageWithURL:UrlForString(info.image) placeholderImage:placeholderImage()];
- self.userNameLab.text = info.name;//#303133 //#FF4D79
- self.giftNameLab.text = info.giftPriceTypeName;
- [self.giftImgView sd_setImageWithURL:UrlForString(info.image_type) placeholderImage:placeholderImage()];
- if (info.select) {
- self.userNameLab.textColor = [UIColor colorWithHexString:@"#FF4D79" alpha:1];
- }else{
- self.userNameLab.textColor = [UIColor colorWithHexString:@"#303133" alpha:1];
- }
- }
- #pragma mark — lazy
- - (UIImageView *)avatarImgView{
- if (_avatarImgView == nil) {
- _avatarImgView = [[UIImageView alloc] init];
- _avatarImgView.contentMode = UIViewContentModeScaleAspectFill;
- [self.contentView addSubview:_avatarImgView];
- [_avatarImgView mas_makeConstraints:^(MASConstraintMaker *make) {
- make.centerY.equalTo(self.contentView.mas_centerY).offset(0);
- make.left.equalTo(self.contentView.mas_left).offset(16);
- make.width.offset(24);
- make.height.offset(24);
- }];
- kViewRadius(_avatarImgView, 12);
- }
- return _avatarImgView;
- }
- - (UILabel *)userNameLab{
- if (_userNameLab == nil) {
- _userNameLab = [[UILabel alloc] init];
- _userNameLab.text = @"";
- _userNameLab.textAlignment = NSTextAlignmentCenter;
- _userNameLab.textColor = [UIColor colorWithHexString:@"#303133" alpha:1];
- _userNameLab.font = [UIFont fontWithName:kPFSCFont size:12];
- [_userNameLab sizeToFit];
- [self.contentView addSubview:_userNameLab];
- [_userNameLab mas_makeConstraints:^(MASConstraintMaker *make) {
- make.centerY.equalTo(self.contentView.mas_centerY).offset(0);
- make.left.equalTo(self.avatarImgView.mas_right).offset(4);
- }];
- }
- return _userNameLab;
- }
- - (UILabel *)giftNameLab{
- if (_giftNameLab == nil) {
- _giftNameLab = [[UILabel alloc] init];
- _giftNameLab.text = @"";
- _giftNameLab.textAlignment = NSTextAlignmentCenter;
- _giftNameLab.textColor = [UIColor colorWithHexString:@"#FF4D79" alpha:1];
- _giftNameLab.font = [UIFont fontWithName:kPFSCFont size:8];
- [_giftNameLab sizeToFit];
- [self.contentView addSubview:_giftNameLab];
- [_giftNameLab mas_makeConstraints:^(MASConstraintMaker *make) {
- make.centerY.equalTo(self.contentView.mas_centerY).offset(0);
- make.right.equalTo(self.contentView.mas_right).offset(-44);
- }];
- }
- return _giftNameLab;
- }
- - (UIImageView *)giftImgView{
- if (_giftImgView == nil) {
- _giftImgView = [[UIImageView alloc] init];
- _giftImgView.contentMode = UIViewContentModeScaleAspectFill;
- _giftImgView.clipsToBounds = YES;
- [self.contentView addSubview:_giftImgView];
- [_giftImgView mas_makeConstraints:^(MASConstraintMaker *make) {
- make.centerY.equalTo(self.contentView.mas_centerY).offset(0);
- make.right.equalTo(self.contentView.mas_right).offset(-16);
- make.width.offset(24);
- make.height.offset(24);
- }];
- }
- return _giftImgView;
- }
- @end
|