Files
peko-ios/YuMi/Modules/YMMine/View/SubViews/XPMineAccountView.m
2024-06-07 17:10:07 +08:00

108 lines
2.8 KiB
Objective-C

//
// YMMineAccountView.m
// YUMI
//
// Created by YUMI on 2022/7/22.
//
#import "XPMineAccountView.h"
#import <Masonry/Masonry.h>
#import "DJDKMIMOMColor.h"
@interface XPMineAccountView ()
@property (nonatomic, strong) UIImageView *bgImageView;
@property (nonatomic, strong) UILabel *coinLabel;
@property (nonatomic, strong) UILabel *descLabel;
@property(nonatomic,strong) UIImageView *arrowView;
@end
@implementation XPMineAccountView
- (instancetype)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
[self initSubViews];
[self initSubViewConstraints];
}
return self;
}
#pragma mark - Private Method
- (void)initSubViews {
[self addSubview:self.bgImageView];
[self addSubview:self.coinLabel];
[self addSubview:self.descLabel];
[self addSubview:self.arrowView];
}
- (void)initSubViewConstraints {
[self.bgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.mas_equalTo(0);
}];
[self.coinLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(16);
make.leading.mas_equalTo(14);
make.trailing.mas_equalTo(0);
make.height.mas_equalTo(14);
}];
[self.descLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.leading.mas_equalTo(self.coinLabel);
make.top.mas_equalTo(36);
make.height.mas_equalTo(8);
}];
[self.arrowView mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.mas_equalTo(5);
make.height.mas_equalTo(7);
make.leading.equalTo(self.descLabel.mas_trailing).mas_offset(2);
make.centerY.equalTo(self.descLabel);
}];
}
- (void)setDiamonds:(NSString *)diamonds {
}
#pragma mark - Getters And Setters
- (UIImageView *)bgImageView {
if (!_bgImageView) {
_bgImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"mine_head_account_bg"]];
_bgImageView.contentMode = UIViewContentModeScaleAspectFit;
}
return _bgImageView;
}
- (UILabel *)descLabel {
if (!_descLabel) {
_descLabel = [[UILabel alloc] init];
_descLabel.font = [UIFont systemFontOfSize:8 weight:UIFontWeightMedium];
_descLabel.textColor = UIColorFromRGB(0xA4B8C1);
_descLabel.text = YMLocalizedString(@"XPMineAccountView1");
}
return _descLabel;
}
- (UILabel *)coinLabel {
if (!_coinLabel) {
_coinLabel = [[UILabel alloc] init];
_coinLabel.text = YMLocalizedString(@"XPIncomeRecordVC1");
_coinLabel.font = [UIFont systemFontOfSize:14 weight:UIFontWeightMedium];
_coinLabel.textColor = UIColorFromRGB(0x121552);
}
return _coinLabel;
}
- (UIImageView *)arrowView{
if(!_arrowView){
_arrowView = [UIImageView new];
_arrowView.image = [kImage(@"ms_mine_purse_arrow") ms_SetImageForRTL];
}
return _arrowView;
}
@end