| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200 |
- //
- // MerchantBaseEnrollContentView.m
- // merchant
- //
- // Created by qitewei on 2025/8/18.
- //
- #import "MerchantBaseEnrollContentView.h"
- #import "UIView+Extention.h"
- @implementation MerchantBaseEnrollContentView
- - (instancetype)initWithFrame:(CGRect)frame
- {
- self = [super initWithFrame:frame];
- if (self) {
- self.backgroundColor = UIColor.clearColor;
- [self addGradientLayerWithColors:@[
- [UIColor colorWithHexString:@"#ECF4FF"],
- [UIColor colorWithHexString:@"#ffffff"],
- ] direction:GradientLayerDirection_V
- frame:CGRectMake(12, 0, frame.size.width-24, frame.size.height)
- roundingCorners:UIRectCornerAllCorners
- cornerRadii:16];
-
-
- // 添加标题
- [self addSubview:self.titleLabel];
-
- // 添加scrollView
- [self addSubview:self.scrollView];
- [self addSubview:self.nextButton];
- [self.scrollView addSubview:self.contentView];
-
- // 标题
- [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
- make.top.mas_offset(kRealValue(30));
- make.centerX.mas_offset(0);
- }];
-
- // ScrollView
- [self.scrollView mas_makeConstraints:^(MASConstraintMaker *make) {
- make.centerX.equalTo(self);
- make.width.mas_equalTo(self.width-24);
- make.bottom.equalTo(self.nextButton.mas_top).mas_offset(-kRealValue(20));
- make.top.equalTo(self.titleLabel.mas_bottom).offset(kRealValue(10));
- }];
-
- [self.contentView mas_makeConstraints:^(MASConstraintMaker *make) {
- make.edges.equalTo(self.scrollView);
- make.width.equalTo(self.scrollView);
- }];
-
- // 提交按钮
- [self.nextButton mas_makeConstraints:^(MASConstraintMaker *make) {
- make.centerX.mas_offset(0);
- make.size.mas_equalTo(self.nextButton.size);
- make.bottom.mas_offset(kRealValue(-20));
- }];
-
- }
- return self;
- }
- - (void)nextButtonTapped:(UIButton *)sender {
- [self goNext];
- }
- - (void)goNext {
- if (self.delegate && [self.delegate respondsToSelector:@selector(onMerchantEnrollGotoNextButtonClick)]) {
- [self.delegate onMerchantEnrollGotoNextButtonClick];
- }
- }
- - (UIView *)listView {
- return self;
- }
- - (void)setCurrentStep:(MerchantEnrollStep)currentStep {
- _currentStep = currentStep;
- switch (currentStep) {
- case MerchantEnrollStepGuide:
- self.titleLabel.text = ASLocalizedString(@"商家入驻");
- [self.nextButton setTitle:ASLocalizedString(@"立即入驻") forState:UIControlStateNormal];
- break;
- case MerchantEnrollStepCheckList:
- self.titleLabel.text = ASLocalizedString(@"提交材料清单");
- [self.nextButton setTitle:ASLocalizedString(@"已准备好以上资料,立即入驻") forState:UIControlStateNormal];
- break;
- case MerchantEnrollStepStoreInfo:
- _titleLabel.text = ASLocalizedString(@"店铺信息");
- [_nextButton setTitle:ASLocalizedString(@"下一步") forState:UIControlStateNormal];
- break;
- case MerchantEnrollStepBusinessLicense:
- _titleLabel.text = ASLocalizedString(@"营业执照");
- [_nextButton setTitle:ASLocalizedString(@"下一步") forState:UIControlStateNormal];
- break;
- case MerchantEnrollStepLegalInfo:
- _titleLabel.text = ASLocalizedString(@"法人信息");
- [_nextButton setTitle:ASLocalizedString(@"下一步") forState:UIControlStateNormal];
- break;
- case MerchantEnrollStepBank:
- _titleLabel.text = ASLocalizedString(@"银行卡账户信息");
- [_nextButton setTitle:ASLocalizedString(@"下一步") forState:UIControlStateNormal];
- break;
- case MerchantEnrollStepSetAdmin:
- _titleLabel.text = ASLocalizedString(@"设置管理员");
- [_nextButton setTitle:ASLocalizedString(@"下一步") forState:UIControlStateNormal];
- break;
- case MerchantEnrollStepPay:
- _titleLabel.text = ASLocalizedString(@"支付保证金");
- [_nextButton setTitle:ASLocalizedString(@"已完成支付,下一步") forState:UIControlStateNormal];
- break;
- case MerchantEnrollStepWatingForReview:
-
- break;
- case MerchantEnrollStepReviewFail:
-
- break;
- case MerchantEnrollStepComplete:
-
- break;
- }
- }
- - (UILabel *)titleLabel {
- if (!_titleLabel) {
- _titleLabel = [[UILabel alloc] init];
- _titleLabel.font = [UIFont systemFontOfSize:18 weight:UIFontWeightMedium];
- _titleLabel.textColor = UIColor.blackColor;
- _titleLabel.text = ASLocalizedString(@"店铺信息");
- }
- return _titleLabel;
- }
- - (UIScrollView *)scrollView {
- if (!_scrollView) {
- UIScrollView *scrollView = [[UIScrollView alloc] init];
- scrollView.showsVerticalScrollIndicator = NO;
- scrollView.showsHorizontalScrollIndicator = NO;
- scrollView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
- scrollView.backgroundColor = UIColor.clearColor;
- _scrollView = scrollView;
- }
- return _scrollView;
- }
- - (UIView *)contentView {
- if (!_contentView) {
- UIView *contentView = [[UIView alloc] init];
- contentView.backgroundColor = [UIColor clearColor];
- _contentView = contentView;
- }
- return _contentView;
- }
- - (UIButton *)nextButton {
- if (!_nextButton) {
- UIButton *nextButton = [UIButton buttonWithType:UIButtonTypeCustom];
- nextButton.size = CGSizeMake(kRealValue(351), kRealValue(50));
- [nextButton setTitle:ASLocalizedString(@"下一步") forState:UIControlStateNormal];
- [nextButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
- nextButton.titleLabel.font = [UIFont systemFontOfSize:18 weight:UIFontWeightMedium];
- nextButton.backgroundColor = [UIColor colorWithHexString:@"#1A65FF"];
- [nextButton addTarget:self action:@selector(nextButtonTapped:) forControlEvents:UIControlEventTouchUpInside];
-
- _nextButton = nextButton;
- [nextButton configShadow:kRealValue(25)
- shadowColor:[UIColor colorWithHexString:@"#1A65FF"]
- size:nextButton.size];
- }
- return _nextButton;
- }
- - (NetHttpsManager *)netManager {
- if (!_netManager) {
- _netManager = [NetHttpsManager manager];
- }
- return _netManager;
- }
- - (UIViewController *)viewController {
- return (UIViewController *)self.delegate;
- }
- - (NSDictionary *)getMerchantEnrollParameters {
- return @{};
- }
- @end
|