YMBindWithdrawalAccountWarmTipsView.m 2.9 KB

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