feat: 完成 代充页面修改 | 开屏 & 首页banner 支持 svga
This commit is contained in:
@@ -19,7 +19,7 @@ static const CGFloat kBannerHeight = 82.5f;
|
||||
static const CGFloat kBannerTopMargin = 80.0f;
|
||||
static const CGFloat kAvatarSize = 43.0f;
|
||||
static const CGFloat kAnimationDuration = 0.25f;
|
||||
static const CGFloat kDisplayDuration = 2.5f;
|
||||
static const CGFloat kDisplayDuration = 2.0f;
|
||||
static const CGFloat kRoomTransitionDelay = 2.0f;
|
||||
|
||||
@interface LuckyGiftWinningBannerViewModel : PIBaseModel
|
||||
@@ -56,6 +56,7 @@ static const CGFloat kRoomTransitionDelay = 2.0f;
|
||||
@property (nonatomic, strong) LuckyGiftWinningBannerViewModel *model;
|
||||
@property (nonatomic, strong) UIImageView *backgroundImageView;
|
||||
@property (nonatomic, strong) UIImageView *ballImageView;
|
||||
@property (nonatomic, strong) UIImageView *bigBallImageView;
|
||||
@property (nonatomic, strong) NetImageView *avatarImageView;
|
||||
@property (nonatomic, strong) UILabel *giftNameLabel;
|
||||
@property (nonatomic, strong) UILabel *timesLabel;
|
||||
@@ -135,7 +136,14 @@ exitCurrentRoom:(void(^)(void))exit {
|
||||
self.avatarImageView.imageUrl = model.avatar;
|
||||
self.giftNameLabel.text = [model giftName];
|
||||
self.timesLabel.text = model.times;
|
||||
self.coinsLabel.text = [NSString formatNumberToKOrM:model.coins];
|
||||
self.coinsLabel.text = model.coins;
|
||||
|
||||
if (self.coinsLabel.text.integerValue > 9999) {
|
||||
self.bigBallImageView.hidden = NO;
|
||||
} else {
|
||||
self.ballImageView.hidden = NO;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
- (instancetype)initWithFrame:(CGRect)frame {
|
||||
@@ -176,6 +184,12 @@ exitCurrentRoom:(void(^)(void))exit {
|
||||
make.edges.mas_equalTo(self);
|
||||
}];
|
||||
|
||||
[self addSubview:self.bigBallImageView];
|
||||
[self.bigBallImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerY.trailing.mas_equalTo(self);
|
||||
make.width.height.mas_equalTo(kGetScaleWidth(91));
|
||||
}];
|
||||
|
||||
[self addSubview:self.ballImageView];
|
||||
[self.ballImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.trailing.bottom.top.mas_equalTo(self);
|
||||
@@ -227,7 +241,7 @@ exitCurrentRoom:(void(^)(void))exit {
|
||||
make.centerX.mas_equalTo(self.ballImageView);
|
||||
make.top.mas_equalTo(self).offset(kGetScaleWidth(18));
|
||||
make.height.mas_equalTo(kGetScaleWidth(28));
|
||||
make.width.mas_equalTo(self.ballImageView);
|
||||
make.width.mas_lessThanOrEqualTo(self.bigBallImageView).multipliedBy(0.8);
|
||||
}];
|
||||
|
||||
UILabel *titleLabel_4 = [UILabel labelInitWithText:YMLocalizedString(@"Combo_5") font:kFontSemibold(14) textColor:[UIColor whiteColor]];
|
||||
@@ -251,10 +265,20 @@ exitCurrentRoom:(void(^)(void))exit {
|
||||
if (!_ballImageView) {
|
||||
_ballImageView = [[UIImageView alloc] initWithImage:kImage(@"luck_gift_flag_ball")];
|
||||
_ballImageView.contentMode = UIViewContentModeScaleAspectFill;
|
||||
_ballImageView.hidden = YES;
|
||||
}
|
||||
return _ballImageView;
|
||||
}
|
||||
|
||||
- (UIImageView *)bigBallImageView {
|
||||
if (!_bigBallImageView) {
|
||||
_bigBallImageView = [[UIImageView alloc] initWithImage:kImage(@"luck_gift_flag_ball_BIG")];
|
||||
_bigBallImageView.contentMode = UIViewContentModeScaleAspectFill;
|
||||
_bigBallImageView.hidden = YES;
|
||||
}
|
||||
return _bigBallImageView;
|
||||
}
|
||||
|
||||
- (NetImageView *)avatarImageView {
|
||||
if (!_avatarImageView) {
|
||||
NetImageConfig * config = [[NetImageConfig alloc]init];
|
||||
@@ -270,14 +294,14 @@ exitCurrentRoom:(void(^)(void))exit {
|
||||
|
||||
- (UILabel *)giftNameLabel {
|
||||
if (!_giftNameLabel) {
|
||||
_giftNameLabel = [UILabel labelInitWithText:@"Gift" font:kFontSemibold(14) textColor:UIColorFromRGB(0xffe375)];
|
||||
_giftNameLabel = [UILabel labelInitWithText:@"" font:kFontSemibold(14) textColor:UIColorFromRGB(0xffe375)];
|
||||
}
|
||||
return _giftNameLabel;
|
||||
}
|
||||
|
||||
- (UILabel *)coinsLabel {
|
||||
if (!_coinsLabel) {
|
||||
_coinsLabel = [UILabel labelInitWithText:@"14K" font:kFontSemibold(20) textColor:UIColorFromRGB(0xffe375)];
|
||||
_coinsLabel = [UILabel labelInitWithText:@"" font:kFontSemibold(20) textColor:UIColorFromRGB(0xffe375)];
|
||||
_coinsLabel.adjustsFontSizeToFitWidth = YES;
|
||||
_coinsLabel.minimumScaleFactor = 0.5;
|
||||
_coinsLabel.textAlignment = NSTextAlignmentCenter;
|
||||
@@ -287,7 +311,7 @@ exitCurrentRoom:(void(^)(void))exit {
|
||||
|
||||
- (UILabel *)timesLabel {
|
||||
if (!_timesLabel) {
|
||||
_timesLabel = [UILabel labelInitWithText:@"913" font:kFontSemibold(14) textColor:UIColorFromRGB(0xffe375)];
|
||||
_timesLabel = [UILabel labelInitWithText:@"" font:kFontSemibold(14) textColor:UIColorFromRGB(0xffe375)];
|
||||
}
|
||||
return _timesLabel;
|
||||
}
|
||||
|
Reference in New Issue
Block a user