123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- //
- // YMIncomeBreakdownListSectionView.m
- // MSYOUPAI
- //
- // Created by YoMi on 2024/3/3.
- // Copyright © 2024 MS. All rights reserved.
- //
- #import "YMIncomeBreakdownListSectionView.h"
- #import "YMIncomeBreakdownListPointsAndEarningsSectionViewModel.h"
- @interface YMIncomeBreakdownListSectionView ()
- /// 收支明细-分组VM
- @property (nonatomic, strong) YMIncomeBreakdownListPointsAndEarningsSectionViewModel *viewModel;
- /// 基础视图
- @property (nonatomic, strong) UIView *baseView;
- /// 功能标签
- @property (nonatomic, strong) UILabel *sectionTitleLb;
- @end
- @implementation YMIncomeBreakdownListSectionView
- - (void)ym_setupViews{
- self.contentView.backgroundColor = UIColor.clearColor;
- [self.contentView addSubview:self.baseView];
- [self.baseView addSubview:self.sectionTitleLb];
- [self setNeedsUpdateConstraints];
- [self updateConstraintsIfNeeded];
- }
- - (void)updateConstraints{
-
- [self.baseView mas_makeConstraints:^(MASConstraintMaker *make) {
- make.top.equalTo(self.contentView);
- make.left.equalTo(self.contentView);
- make.right.equalTo(self.contentView);
- make.bottom.equalTo(self.contentView);
- }];
-
- [self.sectionTitleLb mas_makeConstraints:^(MASConstraintMaker *make) {
- make.centerY.equalTo(self.baseView.mas_centerY);
- make.left.equalTo(self.baseView).offset(adapt(15));
- }];
- [super updateConstraints];
- }
- - (void)ym_bindViewModel:(YMIncomeBreakdownListPointsAndEarningsSectionViewModel *)viewModel{
- if (!viewModel) {
- return;
- }
-
- _viewModel = viewModel;
-
- self.sectionTitleLb.text = self.viewModel.sectionTitle;
- }
- - (UIView *)baseView{
- if (!_baseView) {
- _baseView = [[UIView alloc]init];
- _baseView.backgroundColor = UIColor.whiteColor;
- }
- return _baseView;
- }
- - (UILabel *)sectionTitleLb{
- if (!_sectionTitleLb) {
- _sectionTitleLb = [[UILabel alloc]init];
- _sectionTitleLb.font = LCFont(11);
- _sectionTitleLb.textColor = HexColorFromRGB(0x9c9c9c);
- _sectionTitleLb.textAlignment = NSTextAlignmentLeft;
- _sectionTitleLb.text = @"******";
- }
- return _sectionTitleLb;
- }
- @end
|