123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- //
- // YMAccountBalanceRechargeNotesView.m
- // MSYOUPAI
- //
- // Created by YoMi on 2024/3/6.
- // Copyright © 2024 MS. All rights reserved.
- //
- #import "YMAccountBalanceRechargeNotesView.h"
- #import "YMAccountBalanceViewModel.h"
- @interface YMAccountBalanceRechargeNotesView ()<UIGestureRecognizerDelegate>
- /// 账号余额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
|