// // MerchantEnrollCheckListView.m // merchant // // Created by qitewei on 2025/8/14. // Copyright © 2025 xfg. All rights reserved. // #import "MerchantEnrollCheckListView.h" #import "UIView+Extention.h" @implementation MerchantEnrollCheckListView - (instancetype)initWithFrame:(CGRect)frame { self = [super initWithFrame:frame]; if (self) { [self setupUI]; [self setupConstraints]; } return self; } - (void)setupUI { // 添加清单容器 [self.contentView addSubview:self.checkListContainerView]; [self setupCheckListViews]; } - (void)setupCheckListViews { [self.checkListContainerView addSubview:self.storeInfoView]; [self.checkListContainerView addSubview:self.businessLicenseView]; [self.checkListContainerView addSubview:self.legalInfoView]; [self.checkListContainerView addSubview:self.bankInfoView]; [self.checkListContainerView addSubview:self.adminInfoView]; // 步骤1:店铺信息 [self setupCheckListItemView:self.storeInfoView stepIcon:@"icon_store_step_1" stepNumber:@"1" stepTitle:ASLocalizedString(@"店铺信息:") stepDesc:ASLocalizedString(@"店铺名称\n店铺LOGO\n经营类别\n店铺地址(非必填)")]; // 步骤2:营业执照 [self setupCheckListItemView:self.businessLicenseView stepIcon:@"icon_store_step_2" stepNumber:@"2" stepTitle:ASLocalizedString(@"营业执照:") stepDesc:ASLocalizedString(@"公司名称\n统一社会信用代码\n营业执照扫描件")]; // 步骤3:法人信息 [self setupCheckListItemView:self.legalInfoView stepIcon:@"icon_store_step_3" stepNumber:@"3" stepTitle:ASLocalizedString(@"法人信息:") stepDesc:ASLocalizedString(@"法人姓名\n法人身份证号\n法人身份正反面")]; // 步骤4:银行卡账户 [self setupCheckListItemView:self.bankInfoView stepIcon:@"icon_store_step_4" stepNumber:@"4" stepTitle:ASLocalizedString(@"银行卡账户:") stepDesc:ASLocalizedString(@"银行卡姓名\n银行卡号\n开户银行\n银行卡正反面照片")]; // 步骤5:管理员信息 [self setupCheckListItemView:self.adminInfoView stepIcon:@"icon_store_step_5" stepNumber:@"5" stepTitle:ASLocalizedString(@"管理员信息:") stepDesc:ASLocalizedString(@"管理员姓名\n管理员电话")]; } - (void)setupCheckListItemView:(UIView *)itemView stepIcon:(NSString *)iconName stepNumber:(NSString *)stepNumber stepTitle:(NSString *)stepTitle stepDesc:(NSString *)stepDesc { // 步骤图标 UIImageView *iconImageView = [[UIImageView alloc] init]; iconImageView.image = [UIImage imageNamed:iconName]; [itemView addSubview:iconImageView]; // 步骤标题 UILabel *titleLabel = [[UILabel alloc] init]; titleLabel.text = stepTitle; titleLabel.font = [UIFont systemFontOfSize:14 weight:UIFontWeightMedium]; titleLabel.textColor = [UIColor blackColor]; [itemView addSubview:titleLabel]; // 步骤描述 UILabel *descLabel = [[UILabel alloc] init]; descLabel.text = stepDesc; descLabel.font = [UIFont systemFontOfSize:12 weight:UIFontWeightRegular]; descLabel.textColor = [UIColor colorWithHexString:@"#777777"]; descLabel.numberOfLines = 0; [itemView addSubview:descLabel]; // 设置约束 [iconImageView mas_makeConstraints:^(MASConstraintMaker *make) { make.left.equalTo(itemView).offset(kRealValue(52)); make.top.equalTo(itemView).offset(kRealValue(20)); make.width.height.equalTo(@(kRealValue(16))); }]; [titleLabel mas_makeConstraints:^(MASConstraintMaker *make) { make.left.equalTo(iconImageView.mas_right).offset(kRealValue(16)); make.top.equalTo(itemView).offset(kRealValue(20)); }]; [descLabel mas_makeConstraints:^(MASConstraintMaker *make) { make.left.equalTo(titleLabel); make.right.equalTo(itemView).offset(-kRealValue(24)); make.top.equalTo(titleLabel.mas_bottom).offset(kRealValue(8)); make.bottom.equalTo(itemView).offset(-kRealValue(20)); }]; } - (void)setupConstraints { // 清单容器 [self.checkListContainerView mas_makeConstraints:^(MASConstraintMaker *make) { make.left.right.equalTo(self.contentView); make.top.mas_offset(0); make.bottom.mas_offset(0); }]; // 清单项视图 [self.storeInfoView mas_makeConstraints:^(MASConstraintMaker *make) { make.left.right.top.equalTo(self.checkListContainerView); }]; [self.businessLicenseView mas_makeConstraints:^(MASConstraintMaker *make) { make.left.right.equalTo(self.checkListContainerView); make.top.equalTo(self.storeInfoView.mas_bottom); }]; [self.legalInfoView mas_makeConstraints:^(MASConstraintMaker *make) { make.left.right.equalTo(self.checkListContainerView); make.top.equalTo(self.businessLicenseView.mas_bottom); }]; [self.bankInfoView mas_makeConstraints:^(MASConstraintMaker *make) { make.left.right.equalTo(self.checkListContainerView); make.top.equalTo(self.legalInfoView.mas_bottom); }]; [self.adminInfoView mas_makeConstraints:^(MASConstraintMaker *make) { make.left.right.equalTo(self.checkListContainerView); make.top.equalTo(self.bankInfoView.mas_bottom); make.bottom.equalTo(self.checkListContainerView); }]; } #pragma mark - Actions #pragma mark - Lazy Loading - (UIView *)checkListContainerView { if (!_checkListContainerView) { UIView *checkListContainerView = [[UIView alloc] init]; checkListContainerView.backgroundColor = [UIColor clearColor]; _checkListContainerView = checkListContainerView; } return _checkListContainerView; } - (UIView *)storeInfoView { if (!_storeInfoView) { UIView *storeInfoView = [[UIView alloc] init]; storeInfoView.backgroundColor = [UIColor clearColor]; _storeInfoView = storeInfoView; } return _storeInfoView; } - (UIView *)businessLicenseView { if (!_businessLicenseView) { UIView *businessLicenseView = [[UIView alloc] init]; businessLicenseView.backgroundColor = [UIColor clearColor]; _businessLicenseView = businessLicenseView; } return _businessLicenseView; } - (UIView *)legalInfoView { if (!_legalInfoView) { UIView *legalInfoView = [[UIView alloc] init]; legalInfoView.backgroundColor = [UIColor clearColor]; _legalInfoView = legalInfoView; } return _legalInfoView; } - (UIView *)bankInfoView { if (!_bankInfoView) { UIView *bankInfoView = [[UIView alloc] init]; bankInfoView.backgroundColor = [UIColor clearColor]; _bankInfoView = bankInfoView; } return _bankInfoView; } - (UIView *)adminInfoView { if (!_adminInfoView) { UIView *adminInfoView = [[UIView alloc] init]; adminInfoView.backgroundColor = [UIColor clearColor]; _adminInfoView = adminInfoView; } return _adminInfoView; } @end