// // YMAccountBalanceRechargeNotesView.m // MSYOUPAI // // Created by YoMi on 2024/3/6. // Copyright © 2024 MS. All rights reserved. // #import "YMAccountBalanceRechargeNotesView.h" #import "YMAccountBalanceViewModel.h" @interface YMAccountBalanceRechargeNotesView () /// 账号余额VM @property (nonatomic, strong) YMAccountBalanceViewModel *viewModel; /// 充值说明标签 @property (nonatomic, strong) YYLabel *rechargeNotesLb; @end @implementation YMAccountBalanceRechargeNotesView - (void)ym_setupViews{ [self addSubview:self.rechargeNotesLb]; [self setNeedsUpdateConstraints]; [self updateConstraintsIfNeeded]; } - (void)updateConstraints{ [self.rechargeNotesLb mas_makeConstraints:^(MASConstraintMaker *make) { make.top.equalTo(self).offset(adapt(10)); make.left.equalTo(self); make.right.equalTo(self); make.bottom.equalTo(self).offset(adapt(-10)); }]; [super updateConstraints]; } - (void)ym_bindViewModel:(YMAccountBalanceViewModel *)viewModel{ if (!viewModel) { return; } _viewModel = viewModel; RAC(self.rechargeNotesLb, attributedText) = RACObserve(self.viewModel, rechargeNotes); } - (YYLabel *)rechargeNotesLb{ if (!_rechargeNotesLb) { _rechargeNotesLb = [[YYLabel alloc]init]; _rechargeNotesLb.font = LCFont(11); _rechargeNotesLb.textColor = HexColorFromRGB(0x9b9b9b); _rechargeNotesLb.textAlignment = NSTextAlignmentLeft; _rechargeNotesLb.numberOfLines = 0; } return _rechargeNotesLb; } @end