123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101 |
- //
- // ASCheckoutPaymentCell.m
- // Asteria
- //
- // Created by xingyu on 2024/5/8.
- //
- #import "ASCheckoutPaymentCell.h"
- @interface ASCheckoutPaymentCell()
- @property (nonatomic, strong) UIView *bgView;
- @property (nonatomic, strong) UILabel *titleLab;
- @property (nonatomic, strong) UIImageView *selectImageView;
- @end
- @implementation ASCheckoutPaymentCell
- - (void)awakeFromNib {
- [super awakeFromNib];
- // Initialization code
- }
- - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
- [super setSelected:selected animated:animated];
- // Configure the view for the selected state
- }
- - (void)setupSubviewS{ //height 200
- self.backgroundColor = [UIColor colorWithHexString:@"#F8F8F8"];
- [self.contentView addSubview:self.bgView];
- [self.bgView addSubview:self.titleLab];
- [self.bgView addSubview:self.selectImageView];
-
-
- [self.bgView mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.top.mas_equalTo(10);
- make.right.mas_equalTo(-10);
- make.bottom.mas_equalTo(0);
- }];
- [self.titleLab mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.mas_equalTo(10);
- make.top.mas_equalTo(20);
- make.height.mas_equalTo(20);
- make.right.mas_equalTo(-100);
- make.bottom.mas_equalTo(-20);
- }];
-
- [self.selectImageView mas_makeConstraints:^(MASConstraintMaker *make) {
- make.centerY.equalTo(self.bgView);
- make.width.height.mas_equalTo(24);
- make.right.mas_equalTo(-12);
- }];
-
- }
- - (void)configData:(id)Data{
- ASCheckoutPaymentModel *model = (ASCheckoutPaymentModel *)Data;
- self.titleLab.text = model.title;
-
- if (model.isSelect) {
- _selectImageView.image = [UIImage imageNamed:@"base_radio_select"];
- } else {
- _selectImageView.image = [UIImage imageNamed:@"base_radio_unselect"];
- }
- }
- -(UIView *)bgView{
- if(!_bgView){
- _bgView = [[UIView alloc]init];
- _bgView.backgroundColor = [UIColor colorWithHexString:@"#FFFFFF"];
- _bgView.layer.cornerRadius = 4;
- _bgView.clipsToBounds = YES;
- }
- return _bgView;
- }
- -(UILabel *)titleLab{
- if(!_titleLab){
- _titleLab = [[UILabel alloc]init];
- _titleLab.text = @"";
- _titleLab.textColor = [UIColor colorWithHexString:@"#000000"];
- _titleLab.adjustsFontSizeToFitWidth = YES;
- _titleLab.font = [UIFont fontWithName:Rob_Bold size:16];
- }
- return _titleLab;
- }
- - (UIImageView *)selectImageView{
- if(!_selectImageView){
- _selectImageView = [[UIImageView alloc] init];
- _selectImageView.image = [UIImage imageNamed:@"base_radio_unselect"];
- }
- return _selectImageView;
- }
- @end
|