// // SPSBSalaryPayViewController.m // 我的社保 // // Created by shanp on 2021/6/21. // #import "SPSBSalaryPayViewController.h" #import "SPSBSalaryOrderModel.h" #import "SPSBUIGeneralHeader.h" #import "UIViewController+SPSBNetworkManager.h" #import "SPSBAppDifferenceProfile.h" #import "SPSBBusinessManager.h" #import "SPSBPurchasersModel.h" #import "SPSBBankDetailsViewController.h" @interface SPSBSalaryPayViewController () { SPSBPurchasersModel *_editPurchasers; } @end @implementation SPSBSalaryPayViewController - (void)viewDidLoad { [super viewDidLoad]; } #pragma mark - Action #pragma mark - Network Action - (void)payAction { @weakify(self) [self networkUseMethod:SPSBNetworkMethodPOST loadingTips:@"正在支付" isLogin:true url:spsb_appUrl(SPSBUrlCreateSalaryOrder) urlParameters:nil parameters:^NSDictionary * _Nonnull{ return @{@"order_no" : self->_spsb_data.spsb_order_no, @"pay_channel" : self.spsb_orderBase.spsb_chosePay == 0 ? SPSBAlipayChannel : SPSBWeChatPayChannel}; } success:^NSString * _Nullable(NSError * _Nonnull error, id _Nullable data) { @strongify(self) SPSBPayArgumentData *payArgumentData = SPSBPayArgumentData.new; payArgumentData.spsb_purchasersId = self->_spsb_data.spsb_sbu_id; [self payActionWithOrderType:SPSBOrderTypeSalary serveyType:SPSBResultServeyTypeNo payData:data[@"data"] argumentData:payArgumentData]; return nil; } failure:^NSString * _Nullable(NSError * _Nonnull error, id _Nullable data) { @strongify(self) if (self.spsb_orderBase.spsb_payFailure) { self.spsb_orderBase.spsb_payFailure(error); } return nil; }]; } - (void)progressAction:(UIButton *)sender { UILabel *titleView = [self.spsb_contentView viewWithTag:spsb_headerViewLabelTag]; titleView.text = @"返还状态"; [self.spsb_bgScrollView setContentOffset:CGPointMake(jxh_screenWidth(), 0) animated:true]; [sender removeFromSuperview]; } - (void)tipsAction { @weakify(self) [self dismissContentViewCompletion:^{ @strongify(self) SPSBBankDetailsViewController *vc = SPSBBankDetailsViewController.new; vc.spsb_purchasers = self->_editPurchasers; vc.spsb_isEdit = true; UIViewController *v = jxh_findPresentedViewControllerStartingFrom(spsb_keyWindow().rootViewController); if (v.navigationController) { [v.navigationController pushViewController:vc animated:true]; } }]; } #pragma mark - UI - (void)setupUI { [super setupUI]; switch (_spsb_type) { case SPSBSalaryPayViewTypePaid: [self setOrderBaseWithOrderType:SPSBOrderTypeSalary totalFee:_spsb_data.spsb_total_fee.floatValue discountCount:0 orderNumber:0 showData:nil buttonType:SPSBOrderListPayButtonTypePay]; [self createPayView]; break; case SPSBSalaryPayViewTypeProgress: [self setOrderBaseWithOrderType:SPSBOrderTypeSalary totalFee:_spsb_data.spsb_total_fee.floatValue discountCount:0 orderNumber:0 showData:nil buttonType:SPSBOrderListPayButtonTypeNone]; [self createProgressView]; break; case SPSBSalaryPayViewTypeDetails: [self setOrderBaseWithOrderType:SPSBOrderTypeSalary totalFee:_spsb_data.spsb_total_fee.floatValue discountCount:0 orderNumber:0 showData:_spsb_data.spsba_details buttonType:_spsb_data.spsb_pay_status.integerValue == SPSBSalaryOrderStatusNotPay ? SPSBOrderListPayButtonTypePay : SPSBOrderListPayButtonTypeNone]; if (_spsb_data.spsb_pay_status.integerValue == SPSBSalaryOrderStatusNotPay) { [self createPayView]; } else { [self createProgressView]; } break; default: break; } } - (void)createProgressView { [self setTitleView:self.spsb_showData ? @"社保流水订单详情" : @"返还状态"]; if (self.spsb_showData) { [self.spsb_mScrollView makeConstraints:^(JXHConstraintMaker *make) { make.leading.and.top.and.bottom.equalTo(0); make.width.equalTo(jxh_screenWidth()); make.height.equalTo(self.spsb_bgScrollView); }]; [self addMessageViewWithStatusTitle:@"实付款" tips:@"用作流水记录,资金在到款后,将会于退还至参保人银行卡,请耐心等候,部分城市例如北京,可能分两笔返还,第一笔通过银行卡转账返还,第二笔通过退款返还。"]; } else { [self.spsb_mScrollView makeConstraints:^(JXHConstraintMaker *make) { make.leading.and.top.and.bottom.equalTo(0); make.width.equalTo(0); make.height.equalTo(self.spsb_bgScrollView); }]; } UIScrollView *progressView = [UIScrollView convenienceWithBackgroundColor:spsb_FFFFFF_color(1.f)]; [self.spsb_bgScrollView addSubview:progressView]; [progressView makeConstraints:^(JXHConstraintMaker *make) { make.top.and.bottom.and.trailing.equalTo(0); make.leading.equalTo(self.spsb_mScrollView.trailing); make.width.equalTo(jxh_screenWidth()); make.height.equalTo(self.spsb_bgScrollView); }]; [self addProgressViewWithPayView:progressView]; if (self.spsb_showData) { UIButton *progressButton = [UIButton convenienceWithFont:spsb_font(17) target:self action:@selector(progressAction:)]; [progressButton setTitle:@"查看费用返还进度" titleColor:spsb_3296FB_color() state:JXHButtonControlStateNormal]; progressButton.backgroundColor = [UIColor whiteColor]; [self.spsb_contentView addSubview:progressButton]; [progressButton makeConstraints:^(JXHConstraintMaker *make) { make.bottom.equalTo(self.spsb_contentView.safebottom); make.leading.and.trailing.equalTo(0); make.height.equalTo(54); }]; [progressButton createLineWithLocation:JXHLineLocationTop]; } } - (void)addProgressViewWithPayView:(UIScrollView *)progressView { UIView *headerView = UIView.new; [progressView addSubview:headerView]; NSString *bankCard; bool haveCustomer = false; for (SPSBPurchasersModel *purchasers in spsb_purchasersArray()) { if ([purchasers.spsb_id isEqualToString:_spsb_data.spsb_sbu_id]) { haveCustomer = true; _editPurchasers = purchasers; if (![purchasers.spsb_bank isEqualToString:@""] && ![purchasers.spsb_bank_code isEqualToString:@""]) { bankCard = [NSString stringWithFormat:@"%@(%@)", purchasers.spsb_bank, [purchasers.spsb_bank_code substringFromIndex:purchasers.spsb_bank_code.length - 4]]; } break; } } NSInteger status = _spsb_data.spsb_pay_status.integerValue; UILabel *infoTitleLabel = [UILabel convenienceWithFont:spsb_font(14) textColor:spsb_999999_color() limitWidth:jxh_screenWidth() / 2]; UILabel *infoContentLabel = [UILabel convenienceWithFont:spsb_font(14) textColor:spsb_666666_color() limitWidth:jxh_screenWidth() / 2]; // if (1) { if (status == SPSBSalaryOrderStatusPaySuccessAndNotBack && !haveCustomer) { UIView *tipsView = UIView.new; tipsView.backgroundColor = spsb_FDF8EC_color(); [progressView addSubview:tipsView]; [tipsView makeConstraints:^(JXHConstraintMaker *make) { make.top.and.leading.and.trailing.equalTo(0); }]; UILabel *tipsLabel = [UILabel convenienceWithFont:spsb_font(12) textColor:spsb_FF801A_color() limitWidth:jxh_screenWidth() - 30]; [tipsLabel setAttributedStringWithText:@"该参保人已被删除啦,请联系客服重新加上并填写银行卡" lineSpacing:6]; [tipsView addSubview:tipsLabel]; [tipsLabel makeConstraints:^(JXHConstraintMaker *make) { make.top.and.leading.equalTo(15); make.bottom.equalTo(-15); make.trailing.equalTo(-15); }]; [headerView makeConstraints:^(JXHConstraintMaker *make) { make.leading.and.trailing.equalTo(0); make.top.equalTo(tipsView.bottom); make.size.equalTo(CGSizeMake(jxh_screenWidth(), 80)); }]; [infoTitleLabel setAttributedStringWithText:@"收款姓名\n返还账户" lineSpacing:10 lines:0]; [infoContentLabel setAttributedStringWithText:[NSString stringWithFormat:@"%@\n暂无", _spsb_data.spsb_uname] textAlignment:NSTextAlignmentRight lineSpacing:10 lineHeight:0 paragraphSpacing:0 lineBreakMode:NSLineBreakByTruncatingTail lines:0]; } else if (status == SPSBSalaryOrderStatusPaySuccessAndNotBack && !bankCard) { // } else if (1) { UIView *tipsView = UIView.new; tipsView.backgroundColor = spsb_FDF8EC_color(); [progressView addSubview:tipsView]; [tipsView makeConstraints:^(JXHConstraintMaker *make) { make.top.and.leading.and.trailing.equalTo(0); }]; UIButton *tipsButton = [UIButton convenienceWithFont:spsb_font(11) target:self action:@selector(tipsAction)]; [tipsButton setTitle:@"立即添加" titleColor:spsb_FFFFFF_color(1.f) state:JXHButtonControlStateNormal]; [tipsButton setLayerCornerRadius:2 clipToBounds:true]; tipsButton.backgroundColor = spsb_FF801A_color(); [tipsView addSubview:tipsButton]; [tipsButton makeConstraints:^(JXHConstraintMaker *make) { make.trailing.equalTo(-15); make.centerY.equalTo(tipsView); make.size.equalTo(CGSizeMake(60, 26)); }]; UILabel *tipsLabel = [UILabel convenienceWithFont:spsb_font(12) textColor:spsb_FF801A_color() limitWidth:jxh_screenWidth() - 15 - 60 - 19 - 15]; [tipsLabel setAttributedStringWithText:@"因该参保人未添加返还银行卡信息,将会影响费用返还进度,请及时添加" lineSpacing:6]; [tipsView addSubview:tipsLabel]; [tipsLabel makeConstraints:^(JXHConstraintMaker *make) { make.top.and.leading.equalTo(15); make.bottom.equalTo(-15); make.trailing.equalTo(tipsButton.leading).offset(-19); }]; [headerView makeConstraints:^(JXHConstraintMaker *make) { make.leading.and.trailing.equalTo(0); make.top.equalTo(tipsView.bottom); make.size.equalTo(CGSizeMake(jxh_screenWidth(), 80)); }]; [infoTitleLabel setAttributedStringWithText:@"收款姓名\n返还账户" lineSpacing:10 lines:0]; [infoContentLabel setAttributedStringWithText:[NSString stringWithFormat:@"%@\n暂无", _spsb_data.spsb_uname] textAlignment:NSTextAlignmentRight lineSpacing:10 lineHeight:0 paragraphSpacing:0 lineBreakMode:NSLineBreakByTruncatingTail lines:0]; // } else if (1) { } else if (status == SPSBSalaryOrderStatusPaySuccessAndBackFail) { UIView *tipsView = UIView.new; tipsView.backgroundColor = spsb_FDF8EC_color(); [progressView addSubview:tipsView]; [tipsView makeConstraints:^(JXHConstraintMaker *make) { make.top.and.leading.and.trailing.equalTo(0); }]; if (!haveCustomer) { UILabel *tipsLabel = [UILabel convenienceWithFont:spsb_font(12) textColor:spsb_FF801A_color() limitWidth:jxh_screenWidth() - 30]; [tipsLabel setAttributedStringWithText:@"因该参保人的银行卡未添加或信息有误,请及时处理,否则会影响返还进度。" lineSpacing:6]; [tipsView addSubview:tipsLabel]; [tipsLabel makeConstraints:^(JXHConstraintMaker *make) { make.top.and.leading.equalTo(15); make.bottom.equalTo(-15); make.trailing.equalTo(-15); }]; infoTitleLabel.text = @"收款姓名"; infoContentLabel.text = _spsb_data.spsb_uname; infoContentLabel.textAlignment = NSTextAlignmentRight; } else { UIButton *tipsButton = [UIButton convenienceWithFont:spsb_font(11) target:self action:@selector(tipsAction)]; [tipsButton setTitle:@"去处理" titleColor:spsb_FFFFFF_color(1.f) state:JXHButtonControlStateNormal]; [tipsButton setLayerCornerRadius:2 clipToBounds:true]; tipsButton.backgroundColor = spsb_FF801A_color(); [tipsView addSubview:tipsButton]; [tipsButton makeConstraints:^(JXHConstraintMaker *make) { make.trailing.equalTo(-15); make.centerY.equalTo(tipsView); make.size.equalTo(CGSizeMake(60, 26)); }]; UILabel *tipsLabel = [UILabel convenienceWithFont:spsb_font(12) textColor:spsb_FF801A_color() limitWidth:jxh_screenWidth() - 15 - 60 - 19 - 15]; [tipsLabel setAttributedStringWithText:@"因该参保人的银行卡未添加或信息有误,请及时处理,否则会影响返还进度。" lineSpacing:6]; [tipsView addSubview:tipsLabel]; [tipsLabel makeConstraints:^(JXHConstraintMaker *make) { make.top.and.leading.equalTo(15); make.bottom.equalTo(-15); make.trailing.equalTo(tipsButton.leading).offset(-14); }]; if (!bankCard) { infoTitleLabel.text = @"收款姓名"; infoContentLabel.text = _spsb_data.spsb_uname; infoContentLabel.textAlignment = NSTextAlignmentRight; } else { [infoTitleLabel setAttributedStringWithText:@"收款姓名\n返还账户" lineSpacing:10 lines:0]; [infoContentLabel setAttributedStringWithText:[NSString stringWithFormat:@"%@\n%@", _spsb_data.spsb_uname, bankCard] textAlignment:NSTextAlignmentRight lineSpacing:10 lineHeight:0 paragraphSpacing:0 lineBreakMode:NSLineBreakByTruncatingTail lines:0]; } } [headerView makeConstraints:^(JXHConstraintMaker *make) { make.leading.and.trailing.equalTo(0); make.top.equalTo(tipsView.bottom); make.size.equalTo(CGSizeMake(jxh_screenWidth(), 80)); }]; } else if (!haveCustomer || !bankCard || status == SPSBSalaryOrderStatusReturnBack || status == SPSBSalaryOrderStatusRefund) { [headerView makeConstraints:^(JXHConstraintMaker *make) { make.top.and.leading.and.trailing.equalTo(0); make.size.equalTo(CGSizeMake(jxh_screenWidth(), 80)); }]; infoTitleLabel.text = @"收款姓名"; infoContentLabel.text = _spsb_data.spsb_uname; infoContentLabel.textAlignment = NSTextAlignmentRight; } else { [headerView makeConstraints:^(JXHConstraintMaker *make) { make.top.and.leading.and.trailing.equalTo(0); make.size.equalTo(CGSizeMake(jxh_screenWidth(), 80)); }]; [infoTitleLabel setAttributedStringWithText:@"收款姓名\n返还账户" lineSpacing:10 lines:0]; [infoContentLabel setAttributedStringWithText:[NSString stringWithFormat:@"%@\n%@", _spsb_data.spsb_uname, bankCard] textAlignment:NSTextAlignmentRight lineSpacing:10 lineHeight:0 paragraphSpacing:0 lineBreakMode:NSLineBreakByTruncatingTail lines:0]; } UILabel *titleLabel = [UILabel convenienceWithFont:spsb_font(16) text:@"社保流水 (返还费用)" textColor:spsb_333333_color()]; [headerView addSubview:titleLabel]; [titleLabel makeConstraints:^(JXHConstraintMaker *make) { make.top.equalTo(22); make.leading.equalTo(15); }]; UILabel *contentLabel = [UILabel convenienceWithFont:spsb_semiboldFont(16) text:[NSString stringWithFormat:@"+%.2f", _spsb_data.spsb_wage.floatValue] textColor:spsb_333333_color() textAlignment:NSTextAlignmentRight]; [headerView addSubview:contentLabel]; [contentLabel makeConstraints:^(JXHConstraintMaker *make) { make.centerY.equalTo(titleLabel); make.trailing.equalTo(-15); }]; titleLabel = [UILabel convenienceWithFont:spsb_font(12) text:_spsb_data.spsb_pay_time.length > 16 ? [_spsb_data.spsb_pay_time substringToIndex:16] : _spsb_data.spsb_pay_time textColor:spsb_999999_color()]; [headerView addSubview:titleLabel]; [titleLabel makeConstraints:^(JXHConstraintMaker *make) { make.bottom.equalTo(-18); make.leading.equalTo(15); }]; if (status == SPSBSalaryOrderStatusBack || status == SPSBSalaryOrderStatusReturnBack || status == SPSBSalaryOrderStatusRefund) { contentLabel = [UILabel convenienceWithFont:spsb_font(12) text:@"交易成功" textColor:spsb_3AB261_color() textAlignment:NSTextAlignmentRight]; } else if (status == SPSBSalaryOrderStatusInTheRefund) { contentLabel = [UILabel convenienceWithFont:spsb_font(12) text:@"退款中" textColor:spsb_FF8D36_color() textAlignment:NSTextAlignmentRight]; } else { contentLabel = [UILabel convenienceWithFont:spsb_font(12) text:@"等待处理" textColor:spsb_FF8D36_color() textAlignment:NSTextAlignmentRight]; } [headerView addSubview:contentLabel]; [contentLabel makeConstraints:^(JXHConstraintMaker *make) { make.centerY.equalTo(titleLabel); make.trailing.equalTo(-15); }]; [headerView createLineWithLocation:JXHLineLocationBottom headOffset:15 footOffset:0]; UIView *infoView = UIView.new; infoView.backgroundColor = [UIColor whiteColor]; [progressView addSubview:infoView]; [infoView makeConstraints:^(JXHConstraintMaker *make) { make.top.equalTo(headerView.bottom); make.leading.and.trailing.equalTo(0); }]; [infoView addSubview:infoTitleLabel]; [infoTitleLabel makeConstraints:^(JXHConstraintMaker *make) { make.top.equalTo(18); make.bottom.equalTo(-18); make.leading.equalTo(15); }]; [infoView addSubview:infoContentLabel]; [infoContentLabel makeConstraints:^(JXHConstraintMaker *make) { make.centerY.equalTo(infoTitleLabel); make.trailing.equalTo(-15); }]; [infoView createLineWithLocation:JXHLineLocationBottom headOffset:15 footOffset:0]; UIView *pView = UIView.new; pView.backgroundColor = [UIColor whiteColor]; [progressView addSubview:pView]; UILabel *statusLabel1 = [UILabel convenienceWithFont:spsb_font(15) text:@"付款成功" textColor:spsb_3296FB_color()]; [pView addSubview:statusLabel1]; [statusLabel1 makeConstraints:^(JXHConstraintMaker *make) { make.leading.equalTo(56); make.top.equalTo(32); }]; UIImageView *first = [[UIImageView alloc] initWithImage:jxh_getImage(salary_done)]; [pView addSubview:first]; [first makeConstraints:^(JXHConstraintMaker *make) { make.size.equalTo(CGSizeMake(18, 18)); make.centerY.equalTo(statusLabel1); make.leading.equalTo(22); }]; UILabel *time = [UILabel convenienceWithFont:spsb_font(14) text:_spsb_data.spsba_showPayTime textColor:spsb_ADADAD_color()]; [pView addSubview:time]; [time makeConstraints:^(JXHConstraintMaker *make) { make.trailing.equalTo(-15); make.centerY.equalTo(first); }]; UILabel *statusLabel2 = [UILabel convenienceWithFont:spsb_font(15) textColor:spsb_3296FB_color() limitWidth:jxh_screenWidth() - 115 - 56]; [statusLabel2 setAttributedStringWithText:[NSString stringWithFormat:@"待专员处理 (%@)", _spsb_data.spsb_hf_remark] lineSpacing:4]; [pView addSubview:statusLabel2]; [statusLabel2 makeConstraints:^(JXHConstraintMaker *make) { make.leading.equalTo(56); make.trailing.equalTo(-115); make.top.equalTo(statusLabel1.bottom).offset(40); }]; UIImageView *second = [[UIImageView alloc] initWithImage:jxh_getImage(salary_done)]; [pView addSubview:second]; [second makeConstraints:^(JXHConstraintMaker *make) { make.size.equalTo(CGSizeMake(18, 18)); make.top.equalTo(statusLabel2.top).offset(-1); make.centerX.equalTo(first); }]; UIImageView *firstLine = [[UIImageView alloc] initWithImage:jxh_getImage(salary_line)]; [pView addSubview:firstLine]; [firstLine makeConstraints:^(JXHConstraintMaker *make) { make.top.equalTo(first.bottom); make.bottom.equalTo(second.top); make.centerX.equalTo(first); }]; time = [UILabel convenienceWithFont:spsb_font(14) text:_spsb_data.spsba_showPayTime textColor:spsb_ADADAD_color()]; [pView addSubview:time]; [time makeConstraints:^(JXHConstraintMaker *make) { make.trailing.equalTo(-15); make.centerY.equalTo(second); }]; if (status == SPSBSalaryOrderStatusBack || status == SPSBSalaryOrderStatusReturnBack || status == SPSBSalaryOrderStatusRefund) { UILabel *statusLabel3 = [UILabel convenienceWithFont:spsb_font(15) text:@"专员已操作退还" textColor:spsb_3296FB_color()]; [pView addSubview:statusLabel3]; [statusLabel3 makeConstraints:^(JXHConstraintMaker *make) { make.leading.equalTo(56); make.top.equalTo(statusLabel2.bottom).offset(40); make.bottom.equalTo(-32); }]; UIImageView *third = [[UIImageView alloc] initWithImage:jxh_getImage(salary_done)]; [second addSubview:third]; [third makeConstraints:^(JXHConstraintMaker *make) { make.size.equalTo(CGSizeMake(18, 18)); make.centerY.equalTo(statusLabel3); make.centerX.equalTo(first); }]; UIImageView *secondLine = [[UIImageView alloc] initWithImage:jxh_getImage(salary_line)]; [pView addSubview:secondLine]; [secondLine makeConstraints:^(JXHConstraintMaker *make) { make.top.equalTo(second.bottom); make.bottom.equalTo(third.top); make.centerX.equalTo(first); }]; time = [UILabel convenienceWithFont:spsb_font(14) text:_spsb_data.spsba_showBackTime textColor:spsb_ADADAD_color()]; [pView addSubview:time]; [time makeConstraints:^(JXHConstraintMaker *make) { make.trailing.equalTo(-15); make.centerY.equalTo(third); }]; [pView makeConstraints:^(JXHConstraintMaker *make) { make.top.equalTo(infoView.bottom); make.leading.and.trailing.equalTo(0); }]; UIView *tipsView = UIView.new; tipsView.backgroundColor = [UIColor whiteColor]; [progressView addSubview:tipsView]; [tipsView makeConstraints:^(JXHConstraintMaker *make) { make.leading.and.trailing.equalTo(0); make.top.equalTo(pView.bottom); make.bottom.equalTo(0); }]; UILabel *tipsLabel = [UILabel convenienceWithFont:spsb_font(14) textColor:spsb_999999_color() limitWidth:jxh_screenWidth() - 30]; [tipsLabel setAttributedStringWithText:@"温馨提示:专员已操作退还社保流水费用,请您及时留意到账信息。" lineSpacing:7]; [tipsView addSubview:tipsLabel]; [tipsLabel makeConstraints:^(JXHConstraintMaker *make) { make.top.and.leading.equalTo(15); make.bottom.and.trailing.equalTo(-15); }]; [tipsView createLineWithLocation:JXHLineLocationTop]; } else if (status == SPSBSalaryOrderStatusInTheRefund) { UILabel *statusLabel3 = [UILabel convenienceWithFont:spsb_font(15) textColor:spsb_3296FB_color() limitWidth:jxh_screenWidth() - 115 - 56]; [statusLabel3 setAttributedStringWithText:@"专员已操作退还(等待退款完成)" lineSpacing:4]; [pView addSubview:statusLabel3]; [statusLabel3 makeConstraints:^(JXHConstraintMaker *make) { make.leading.equalTo(56); make.top.equalTo(statusLabel2.bottom).offset(40); make.bottom.equalTo(-32); }]; UIImageView *third = [[UIImageView alloc] initWithImage:jxh_getImage(salary_done)]; [second addSubview:third]; [third makeConstraints:^(JXHConstraintMaker *make) { make.size.equalTo(CGSizeMake(18, 18)); make.centerY.equalTo(statusLabel3); make.centerX.equalTo(first); }]; UIImageView *secondLine = [[UIImageView alloc] initWithImage:jxh_getImage(salary_line)]; [pView addSubview:secondLine]; [secondLine makeConstraints:^(JXHConstraintMaker *make) { make.top.equalTo(second.bottom); make.bottom.equalTo(third.top); make.centerX.equalTo(first); }]; time = [UILabel convenienceWithFont:spsb_font(14) text:_spsb_data.spsba_showBackTime textColor:spsb_ADADAD_color()]; [pView addSubview:time]; [time makeConstraints:^(JXHConstraintMaker *make) { make.trailing.equalTo(-15); make.centerY.equalTo(third); }]; [pView makeConstraints:^(JXHConstraintMaker *make) { make.top.equalTo(infoView.bottom); make.leading.and.trailing.equalTo(0); }]; } else if (status == SPSBSalaryOrderStatusPaySuccessAndBackFail) { UILabel *statusLabel3 = [UILabel convenienceWithFont:spsb_font(15) text:@"返还失败" textColor:spsb_FF5E5E_color()]; [pView addSubview:statusLabel3]; [statusLabel3 makeConstraints:^(JXHConstraintMaker *make) { make.leading.equalTo(56); make.top.equalTo(statusLabel2.bottom).offset(40); make.bottom.equalTo(-32); }]; UIImageView *third = [[UIImageView alloc] initWithImage:jxh_getImage(salary_failure)]; [second addSubview:third]; [third makeConstraints:^(JXHConstraintMaker *make) { make.size.equalTo(CGSizeMake(18, 18)); make.centerY.equalTo(statusLabel3); make.centerX.equalTo(first); }]; UIImageView *secondLine = [[UIImageView alloc] initWithImage:jxh_getImage(salary_line)]; [pView addSubview:secondLine]; [secondLine makeConstraints:^(JXHConstraintMaker *make) { make.top.equalTo(second.bottom); make.bottom.equalTo(third.top); make.centerX.equalTo(first); }]; time = [UILabel convenienceWithFont:spsb_font(14) text:_spsb_data.spsba_showBackTime textColor:spsb_ADADAD_color()]; [pView addSubview:time]; [time makeConstraints:^(JXHConstraintMaker *make) { make.trailing.equalTo(-15); make.centerY.equalTo(third); }]; [pView makeConstraints:^(JXHConstraintMaker *make) { make.top.equalTo(infoView.bottom); make.leading.and.trailing.equalTo(0); }]; UIView *tipsView = UIView.new; tipsView.backgroundColor = [UIColor whiteColor]; [progressView addSubview:tipsView]; [tipsView makeConstraints:^(JXHConstraintMaker *make) { make.leading.and.trailing.equalTo(0); make.top.equalTo(pView.bottom); make.bottom.equalTo(0); }]; UILabel *tipsLabel = [UILabel convenienceWithFont:spsb_font(14) textColor:spsb_999999_color() limitWidth:jxh_screenWidth() - 30]; [tipsLabel setAttributedStringWithText:[NSString stringWithFormat:@"失败原因:%@", _spsb_data.spsb_fail_reason] lineSpacing:7]; [tipsView addSubview:tipsLabel]; [tipsLabel makeConstraints:^(JXHConstraintMaker *make) { make.top.and.leading.equalTo(15); make.bottom.and.trailing.equalTo(-15); }]; [tipsView createLineWithLocation:JXHLineLocationTop]; } else { UILabel *statusLabel3 = [UILabel convenienceWithFont:spsb_font(15) text:@"专员已操作退还" textColor:spsb_999999_color()]; [pView addSubview:statusLabel3]; [statusLabel3 makeConstraints:^(JXHConstraintMaker *make) { make.leading.equalTo(56); make.top.equalTo(statusLabel2.bottom).offset(40); make.bottom.equalTo(-32); }]; UIImageView *third = [[UIImageView alloc] initWithImage:jxh_getImage(salary_undone)]; [second addSubview:third]; [third makeConstraints:^(JXHConstraintMaker *make) { make.size.equalTo(CGSizeMake(18, 18)); make.centerY.equalTo(statusLabel3); make.centerX.equalTo(first); }]; UIImageView *secondLine = [[UIImageView alloc] initWithImage:jxh_getImage(salary_dashed)]; [pView addSubview:secondLine]; [secondLine makeConstraints:^(JXHConstraintMaker *make) { make.top.equalTo(second.bottom); make.bottom.equalTo(third.top); make.centerX.equalTo(first); }]; [pView makeConstraints:^(JXHConstraintMaker *make) { make.top.equalTo(infoView.bottom); make.leading.and.trailing.equalTo(0); make.bottom.equalTo(0); }]; } } @end