// // YOUPAILZVipPrivilegeCell.m // VQU // // Created by CY on 2021/8/21. // Copyright © 2021 MS. All rights reserved. // #import "YOUPAILZVipPrivilegeCell.h" @interface YOUPAILZVipPrivilegeCell () @property (nonatomic, weak) UIImageView *youpaipiconImgV; @property (nonatomic, weak) UILabel *youpaiptitleL; @property (nonatomic, weak) UILabel *youpaipdetailL; @end @implementation YOUPAILZVipPrivilegeCell - (instancetype)initWithFrame:(CGRect)frame{ if (self = [super initWithFrame:frame]) { [self youpaifinitUI]; } return self; } - (void)youpaifinitUI{ UIImageView *iconImgV = [[UIImageView alloc] init]; iconImgV.contentMode = UIViewContentModeScaleAspectFill; [self.contentView addSubview:iconImgV]; self.youpaipiconImgV = iconImgV; [iconImgV mas_makeConstraints:^(MASConstraintMaker *make) { make.top.offset(ScaleSize(5.0f)); make.centerX.equalTo(self.contentView.mas_centerX); make.size.mas_offset(CGSizeMake(ScaleSize(34.0f), ScaleSize(34.0f))); }]; UILabel *titleL = [[UILabel alloc] init]; titleL.textColor = HexColorFromRGB(0x8A8990); titleL.font = LCFont13; titleL.textAlignment = NSTextAlignmentCenter; [self.contentView addSubview:titleL]; self.youpaiptitleL = titleL; [titleL mas_makeConstraints:^(MASConstraintMaker *make) { make.left.right.offset(0.0f); make.top.equalTo(iconImgV.mas_bottom).offset(ScaleSize(10.0f)); }]; UILabel *detailL = [[UILabel alloc] init]; detailL.textColor = [[UIColor whiteColor] colorWithAlphaComponent:0.65f]; detailL.font = LCFont(11.0f); detailL.textAlignment = NSTextAlignmentCenter; detailL.numberOfLines = 0; [self.contentView addSubview:detailL]; self.youpaipdetailL = detailL; [detailL mas_makeConstraints:^(MASConstraintMaker *make) { make.left.right.offset(0.0f); make.top.equalTo(titleL.mas_bottom).offset(ScaleSize(10.0f)); }]; } - (void)youpaifreloadWithModel:(YOUPAILZVipPrivilegeModel *)model{ [self.youpaipiconImgV sd_setImageWithURL:[LCTools getImageUrlWithAddress:model.youpaipimg]]; if (model.youpaipis_has) { self.youpaiptitleL.textColor = HexColorFromRGB(0xFDCC88); }else{ self.youpaiptitleL.textColor = HexColorFromRGB(0x8A8990); } self.youpaiptitleL.text = model.youpaipname; self.youpaipdetailL.text = [NSString stringWithFormat:@"%@",model.youpaipdes]; } @end