// // SPSBPurchasersDetailsImageDemandViewController.m // 我的社保 // // Created by shanp on 2021/5/18. // #import "SPSBPurchasersDetailsImageDemandViewController.h" #import "SPSBUIGeneralHeader.h" @interface SPSBPurchasersDetailsImageDemandViewController () { UIView *_contentView; } @end @implementation SPSBPurchasersDetailsImageDemandViewController - (void)viewDidLoad { [super viewDidLoad]; [self setupUI]; } #pragma mark - Action - (void)closeAction { [_contentView makeConstraints:^(JXHConstraintMaker *make) { make.top.update(0); }]; [UIView animateWithDuration:0.3 animations:^{ self.view.backgroundColor = spsb_000000_color(0.f); [self.view layoutSubviews]; } completion:^(BOOL finished) { [self dismissViewControllerAnimated:false completion:nil]; }]; } #pragma mark - Network Action #pragma mark - Overwrite - (void)showAnimation { [_contentView makeConstraints:^(JXHConstraintMaker *make) { make.top.update(-jxh_viewHeight(self->_contentView)); }]; [UIView animateWithDuration:0.3 animations:^{ self.view.backgroundColor = spsb_000000_color(SPSBPopupViewBackgroundAlpha); [self.view layoutSubviews]; }]; } - (void)setupAnimation { self.view.backgroundColor = spsb_000000_color(0.f); } #pragma mark - UI - (void)setupUI { _contentView = UIView.new; _contentView.backgroundColor = spsb_FFFFFF_color(1.f); [self.view addSubview:_contentView]; [_contentView makeConstraints:^(JXHConstraintMaker *make) { make.leading.and.trailing.equalTo(0); make.height.equalTo(480); make.top.equalTo(self.view.bottom); }]; //header UIView *headerView = spsb_createShotViewHeaderWithTitle(@"身份证照片要求", @selector(closeAction), self); [_contentView addSubview:headerView]; [headerView makeConstraints:^(JXHConstraintMaker *make) { make.top.and.leading.and.trailing.equalTo(0); }]; // UILabel *title = [UILabel convenienceWithFont:spsb_semiboldFont(15) text:@"拍摄实例如下:" textColor:spsb_333333_color()]; [_contentView addSubview:title]; [title makeConstraints:^(JXHConstraintMaker *make) { make.top.equalTo(headerView.bottom).offset(23); make.leading.equalTo(25); }]; UIImageView *imageView = [[UIImageView alloc] initWithImage:jxh_getImage(photo_tips)]; [_contentView addSubview:imageView]; [imageView makeConstraints:^(JXHConstraintMaker *make) { make.top.equalTo(title.bottom).offset(20); make.leading.equalTo(25); make.trailing.equalTo(-25); make.height.equalTo((jxh_screenWidth() - 50) * 0.31); }]; UILabel *tipsLabel = [UILabel convenienceWithFont:spsb_font(14) textColor:spsb_666666_color() limitWidth:jxh_screenWidth() - 50]; [tipsLabel setAttributedStringWithText:@"1. 请上传清晰彩色,完整的原件扫描件或照片\n2. 拍摄确保身份证边框完整、字体清晰、亮度均匀\n3. 身份证各项信息及头像清晰可见,容易识别\n4. 证件必须真实拍摄,不能使用复印件" lineSpacing:12]; [_contentView addSubview:tipsLabel]; [tipsLabel makeConstraints:^(JXHConstraintMaker *make) { make.top.equalTo(imageView.bottom).offset(30); make.leading.equalTo(25); make.trailing.equalTo(-25); }]; UIButton *button = [UIButton convenienceWithTarget:self action:@selector(closeAction)]; [self.view addSubview:button]; [button makeConstraints:^(JXHConstraintMaker *make) { make.leading.and.trailing.and.top.equalTo(0); make.bottom.equalTo(self->_contentView.top); }]; } @end