活动改造

This commit is contained in:
liyuhua
2023-11-15 16:49:59 +08:00
parent 56103bb220
commit 90eab408d0
6 changed files with 262 additions and 13 deletions

View File

@@ -0,0 +1,52 @@
//
// PIRoomActivityWebCell.m
// YuMi
//
// Created by duoban on 2023/11/15.
//
#import "PIRoomActivityWebCell.h"
@interface PIRoomActivityWebCell()
@property(nonatomic,strong) NetImageView *bgImageView;
@end
@implementation PIRoomActivityWebCell
-(instancetype)initWithFrame:(CGRect)frame{
self = [super initWithFrame:frame];
if(self){
[self installUI];
[self installConstraints];
}
return self;
}
-(void)installUI{
self.contentView.backgroundColor = [UIColor clearColor];
self.backgroundColor = [UIColor clearColor];
[self.contentView addSubview:self.bgImageView];
}
-(void)installConstraints{
[self.bgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(self.contentView);
}];
}
-(void)setPi_isChoose:(BOOL)pi_isChoose{
_pi_isChoose = pi_isChoose;
_bgImageView.layer.borderWidth = _pi_isChoose ? 2 : 0;
}
-(void)setInfoModel:(ActivityInfoModel *)infoModel{
_infoModel = infoModel;
_bgImageView.imageUrl = _infoModel.bannerPic;
}
#pragma mark -
- (NetImageView *)bgImageView{
if(!_bgImageView){
NetImageConfig *config = [[NetImageConfig alloc]init]; config.placeHolder = [UIImageConstant defalutBannerPlaceholder];
_bgImageView = [[NetImageView alloc]initWithConfig:config];
_bgImageView.contentMode = UIViewContentModeScaleAspectFit;
_bgImageView.layer.cornerRadius = kGetScaleWidth(4);
_bgImageView.layer.masksToBounds = YES;
_bgImageView.layer.borderWidth = 0;
_bgImageView.layer.borderColor = UIColorFromRGB(0x9168FA).CGColor;
}
return _bgImageView;
}
@end