MerchantEnrollCheckListView.m 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  1. //
  2. // MerchantEnrollCheckListView.m
  3. // merchant
  4. //
  5. // Created by qitewei on 2025/8/14.
  6. // Copyright © 2025 xfg. All rights reserved.
  7. //
  8. #import "MerchantEnrollCheckListView.h"
  9. #import "UIView+Extention.h"
  10. @implementation MerchantEnrollCheckListView
  11. - (instancetype)initWithFrame:(CGRect)frame
  12. {
  13. self = [super initWithFrame:frame];
  14. if (self) {
  15. [self setupUI];
  16. [self setupConstraints];
  17. }
  18. return self;
  19. }
  20. - (void)setupUI {
  21. // 添加清单容器
  22. [self.contentView addSubview:self.checkListContainerView];
  23. [self setupCheckListViews];
  24. }
  25. - (void)setupCheckListViews {
  26. [self.checkListContainerView addSubview:self.storeInfoView];
  27. [self.checkListContainerView addSubview:self.businessLicenseView];
  28. [self.checkListContainerView addSubview:self.legalInfoView];
  29. [self.checkListContainerView addSubview:self.bankInfoView];
  30. [self.checkListContainerView addSubview:self.adminInfoView];
  31. // 步骤1:店铺信息
  32. [self setupCheckListItemView:self.storeInfoView
  33. stepIcon:@"icon_store_step_1"
  34. stepNumber:@"1"
  35. stepTitle:ASLocalizedString(@"店铺信息:")
  36. stepDesc:ASLocalizedString(@"店铺名称\n店铺LOGO\n经营类别\n店铺地址(非必填)")];
  37. // 步骤2:营业执照
  38. [self setupCheckListItemView:self.businessLicenseView
  39. stepIcon:@"icon_store_step_2"
  40. stepNumber:@"2"
  41. stepTitle:ASLocalizedString(@"营业执照:")
  42. stepDesc:ASLocalizedString(@"公司名称\n统一社会信用代码\n营业执照扫描件")];
  43. // 步骤3:法人信息
  44. [self setupCheckListItemView:self.legalInfoView
  45. stepIcon:@"icon_store_step_3"
  46. stepNumber:@"3"
  47. stepTitle:ASLocalizedString(@"法人信息:")
  48. stepDesc:ASLocalizedString(@"法人姓名\n法人身份证号\n法人身份正反面")];
  49. // 步骤4:银行卡账户
  50. [self setupCheckListItemView:self.bankInfoView
  51. stepIcon:@"icon_store_step_4"
  52. stepNumber:@"4"
  53. stepTitle:ASLocalizedString(@"银行卡账户:")
  54. stepDesc:ASLocalizedString(@"银行卡姓名\n银行卡号\n开户银行\n银行卡正反面照片")];
  55. // 步骤5:管理员信息
  56. [self setupCheckListItemView:self.adminInfoView
  57. stepIcon:@"icon_store_step_5"
  58. stepNumber:@"5"
  59. stepTitle:ASLocalizedString(@"管理员信息:")
  60. stepDesc:ASLocalizedString(@"管理员姓名\n管理员电话")];
  61. }
  62. - (void)setupCheckListItemView:(UIView *)itemView
  63. stepIcon:(NSString *)iconName
  64. stepNumber:(NSString *)stepNumber
  65. stepTitle:(NSString *)stepTitle
  66. stepDesc:(NSString *)stepDesc {
  67. // 步骤图标
  68. UIImageView *iconImageView = [[UIImageView alloc] init];
  69. iconImageView.image = [UIImage imageNamed:iconName];
  70. [itemView addSubview:iconImageView];
  71. // 步骤标题
  72. UILabel *titleLabel = [[UILabel alloc] init];
  73. titleLabel.text = stepTitle;
  74. titleLabel.font = [UIFont systemFontOfSize:14 weight:UIFontWeightMedium];
  75. titleLabel.textColor = [UIColor blackColor];
  76. [itemView addSubview:titleLabel];
  77. // 步骤描述
  78. UILabel *descLabel = [[UILabel alloc] init];
  79. descLabel.text = stepDesc;
  80. descLabel.font = [UIFont systemFontOfSize:12 weight:UIFontWeightRegular];
  81. descLabel.textColor = [UIColor colorWithHexString:@"#777777"];
  82. descLabel.numberOfLines = 0;
  83. [itemView addSubview:descLabel];
  84. // 设置约束
  85. [iconImageView mas_makeConstraints:^(MASConstraintMaker *make) {
  86. make.left.equalTo(itemView).offset(kRealValue(52));
  87. make.top.equalTo(itemView).offset(kRealValue(20));
  88. make.width.height.equalTo(@(kRealValue(16)));
  89. }];
  90. [titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
  91. make.left.equalTo(iconImageView.mas_right).offset(kRealValue(16));
  92. make.top.equalTo(itemView).offset(kRealValue(20));
  93. }];
  94. [descLabel mas_makeConstraints:^(MASConstraintMaker *make) {
  95. make.left.equalTo(titleLabel);
  96. make.right.equalTo(itemView).offset(-kRealValue(24));
  97. make.top.equalTo(titleLabel.mas_bottom).offset(kRealValue(8));
  98. make.bottom.equalTo(itemView).offset(-kRealValue(20));
  99. }];
  100. }
  101. - (void)setupConstraints {
  102. // 清单容器
  103. [self.checkListContainerView mas_makeConstraints:^(MASConstraintMaker *make) {
  104. make.left.right.equalTo(self.contentView);
  105. make.top.mas_offset(0);
  106. make.bottom.mas_offset(0);
  107. }];
  108. // 清单项视图
  109. [self.storeInfoView mas_makeConstraints:^(MASConstraintMaker *make) {
  110. make.left.right.top.equalTo(self.checkListContainerView);
  111. }];
  112. [self.businessLicenseView mas_makeConstraints:^(MASConstraintMaker *make) {
  113. make.left.right.equalTo(self.checkListContainerView);
  114. make.top.equalTo(self.storeInfoView.mas_bottom);
  115. }];
  116. [self.legalInfoView mas_makeConstraints:^(MASConstraintMaker *make) {
  117. make.left.right.equalTo(self.checkListContainerView);
  118. make.top.equalTo(self.businessLicenseView.mas_bottom);
  119. }];
  120. [self.bankInfoView mas_makeConstraints:^(MASConstraintMaker *make) {
  121. make.left.right.equalTo(self.checkListContainerView);
  122. make.top.equalTo(self.legalInfoView.mas_bottom);
  123. }];
  124. [self.adminInfoView mas_makeConstraints:^(MASConstraintMaker *make) {
  125. make.left.right.equalTo(self.checkListContainerView);
  126. make.top.equalTo(self.bankInfoView.mas_bottom);
  127. make.bottom.equalTo(self.checkListContainerView);
  128. }];
  129. }
  130. #pragma mark - Actions
  131. #pragma mark - Lazy Loading
  132. - (UIView *)checkListContainerView {
  133. if (!_checkListContainerView) {
  134. UIView *checkListContainerView = [[UIView alloc] init];
  135. checkListContainerView.backgroundColor = [UIColor clearColor];
  136. _checkListContainerView = checkListContainerView;
  137. }
  138. return _checkListContainerView;
  139. }
  140. - (UIView *)storeInfoView {
  141. if (!_storeInfoView) {
  142. UIView *storeInfoView = [[UIView alloc] init];
  143. storeInfoView.backgroundColor = [UIColor clearColor];
  144. _storeInfoView = storeInfoView;
  145. }
  146. return _storeInfoView;
  147. }
  148. - (UIView *)businessLicenseView {
  149. if (!_businessLicenseView) {
  150. UIView *businessLicenseView = [[UIView alloc] init];
  151. businessLicenseView.backgroundColor = [UIColor clearColor];
  152. _businessLicenseView = businessLicenseView;
  153. }
  154. return _businessLicenseView;
  155. }
  156. - (UIView *)legalInfoView {
  157. if (!_legalInfoView) {
  158. UIView *legalInfoView = [[UIView alloc] init];
  159. legalInfoView.backgroundColor = [UIColor clearColor];
  160. _legalInfoView = legalInfoView;
  161. }
  162. return _legalInfoView;
  163. }
  164. - (UIView *)bankInfoView {
  165. if (!_bankInfoView) {
  166. UIView *bankInfoView = [[UIView alloc] init];
  167. bankInfoView.backgroundColor = [UIColor clearColor];
  168. _bankInfoView = bankInfoView;
  169. }
  170. return _bankInfoView;
  171. }
  172. - (UIView *)adminInfoView {
  173. if (!_adminInfoView) {
  174. UIView *adminInfoView = [[UIView alloc] init];
  175. adminInfoView.backgroundColor = [UIColor clearColor];
  176. _adminInfoView = adminInfoView;
  177. }
  178. return _adminInfoView;
  179. }
  180. @end