YMMyEarningsWithdrawalNotesView.m 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. //
  2. // YMMyEarningsWithdrawalNotesView.m
  3. // MSYOUPAI
  4. //
  5. // Created by YoMi on 2024/3/2.
  6. // Copyright © 2024 MS. All rights reserved.
  7. //
  8. #import "YMMyEarningsWithdrawalNotesView.h"
  9. #import "YMMyEarningsViewModel.h"
  10. @interface YMMyEarningsWithdrawalNotesView ()
  11. /// 我的收益VM
  12. @property (nonatomic, strong) YMMyEarningsViewModel *viewModel;
  13. /// 提现说明标题标签
  14. @property (nonatomic, strong) UILabel *withdrawalNotesTitleLb;
  15. /// 提现说明内容标签
  16. @property (nonatomic, strong) UILabel *withdrawalNotesContentLb;
  17. @end
  18. @implementation YMMyEarningsWithdrawalNotesView
  19. - (void)ym_setupViews{
  20. [self addSubview:self.withdrawalNotesTitleLb];
  21. [self addSubview:self.withdrawalNotesContentLb];
  22. [self setNeedsUpdateConstraints];
  23. [self updateConstraintsIfNeeded];
  24. }
  25. - (void)updateConstraints{
  26. [self.withdrawalNotesTitleLb mas_makeConstraints:^(MASConstraintMaker *make) {
  27. make.top.equalTo(self).offset(adapt(10));
  28. make.left.equalTo(self).offset(adapt(18));
  29. }];
  30. [self.withdrawalNotesContentLb mas_makeConstraints:^(MASConstraintMaker *make) {
  31. make.top.equalTo(self.withdrawalNotesTitleLb.mas_bottom).offset(adapt(12));
  32. make.left.equalTo(self).offset(adapt(12));
  33. make.right.equalTo(self).offset(adapt(-12));
  34. make.bottom.equalTo(self).offset(adapt(-100));
  35. }];
  36. [super updateConstraints];
  37. }
  38. - (void)ym_bindViewModel:(YMMyEarningsViewModel *)viewModel{
  39. if (!viewModel) {
  40. return;
  41. }
  42. _viewModel = viewModel;
  43. RAC(self.withdrawalNotesContentLb, attributedText) = RACObserve(self.viewModel, withdrawalNotes);
  44. }
  45. - (UILabel *)withdrawalNotesTitleLb{
  46. if (!_withdrawalNotesTitleLb) {
  47. _withdrawalNotesTitleLb = [[UILabel alloc]init];
  48. _withdrawalNotesTitleLb.font = LCFont(13);
  49. _withdrawalNotesTitleLb.textColor = HexColorFromRGB(0x161330);
  50. _withdrawalNotesTitleLb.textAlignment = NSTextAlignmentLeft;
  51. _withdrawalNotesTitleLb.text = @"提现说明";
  52. }
  53. return _withdrawalNotesTitleLb;
  54. }
  55. - (UILabel *)withdrawalNotesContentLb{
  56. if (!_withdrawalNotesContentLb) {
  57. _withdrawalNotesContentLb = [[UILabel alloc]init];
  58. _withdrawalNotesContentLb.font = LCFont(12);
  59. _withdrawalNotesContentLb.textColor = HexColorFromRGB(0xB4BDD9);
  60. _withdrawalNotesContentLb.textAlignment = NSTextAlignmentLeft;
  61. _withdrawalNotesContentLb.text = @"******";
  62. _withdrawalNotesContentLb.numberOfLines = 0;
  63. }
  64. return _withdrawalNotesContentLb;
  65. }
  66. @end