SPSBSalaryPayViewController.m 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609
  1. //
  2. // SPSBSalaryPayViewController.m
  3. // 我的社保
  4. //
  5. // Created by shanp on 2021/6/21.
  6. //
  7. #import "SPSBSalaryPayViewController.h"
  8. #import "SPSBSalaryOrderModel.h"
  9. #import "SPSBUIGeneralHeader.h"
  10. #import "UIViewController+SPSBNetworkManager.h"
  11. #import "SPSBAppDifferenceProfile.h"
  12. #import "SPSBBusinessManager.h"
  13. #import "SPSBPurchasersModel.h"
  14. #import "SPSBBankDetailsViewController.h"
  15. @interface SPSBSalaryPayViewController () {
  16. SPSBPurchasersModel *_editPurchasers;
  17. }
  18. @end
  19. @implementation SPSBSalaryPayViewController
  20. - (void)viewDidLoad {
  21. [super viewDidLoad];
  22. }
  23. #pragma mark - Action
  24. #pragma mark - Network Action
  25. - (void)payAction {
  26. @weakify(self)
  27. [self networkUseMethod:SPSBNetworkMethodPOST loadingTips:@"正在支付" isLogin:true url:spsb_appUrl(SPSBUrlCreateSalaryOrder) urlParameters:nil parameters:^NSDictionary * _Nonnull{
  28. return @{@"order_no" : self->_spsb_data.spsb_order_no, @"pay_channel" : self.spsb_orderBase.spsb_chosePay == 0 ? SPSBAlipayChannel : SPSBWeChatPayChannel};
  29. } success:^NSString * _Nullable(NSError * _Nonnull error, id _Nullable data) {
  30. @strongify(self)
  31. SPSBPayArgumentData *payArgumentData = SPSBPayArgumentData.new;
  32. payArgumentData.spsb_purchasersId = self->_spsb_data.spsb_sbu_id;
  33. [self payActionWithOrderType:SPSBOrderTypeSalary serveyType:SPSBResultServeyTypeNo payData:data[@"data"] argumentData:payArgumentData];
  34. return nil;
  35. } failure:^NSString * _Nullable(NSError * _Nonnull error, id _Nullable data) {
  36. @strongify(self)
  37. if (self.spsb_orderBase.spsb_payFailure) {
  38. self.spsb_orderBase.spsb_payFailure(error);
  39. }
  40. return nil;
  41. }];
  42. }
  43. - (void)progressAction:(UIButton *)sender {
  44. UILabel *titleView = [self.spsb_contentView viewWithTag:spsb_headerViewLabelTag];
  45. titleView.text = @"返还状态";
  46. [self.spsb_bgScrollView setContentOffset:CGPointMake(jxh_screenWidth(), 0) animated:true];
  47. [sender removeFromSuperview];
  48. }
  49. - (void)tipsAction {
  50. @weakify(self)
  51. [self dismissContentViewCompletion:^{
  52. @strongify(self)
  53. SPSBBankDetailsViewController *vc = SPSBBankDetailsViewController.new;
  54. vc.spsb_purchasers = self->_editPurchasers;
  55. vc.spsb_isEdit = true;
  56. UIViewController *v = jxh_findPresentedViewControllerStartingFrom(spsb_keyWindow().rootViewController);
  57. if (v.navigationController) {
  58. [v.navigationController pushViewController:vc animated:true];
  59. }
  60. }];
  61. }
  62. #pragma mark - UI
  63. - (void)setupUI {
  64. [super setupUI];
  65. switch (_spsb_type) {
  66. case SPSBSalaryPayViewTypePaid:
  67. [self setOrderBaseWithOrderType:SPSBOrderTypeSalary totalFee:_spsb_data.spsb_total_fee.floatValue discountCount:0 orderNumber:0 showData:nil buttonType:SPSBOrderListPayButtonTypePay];
  68. [self createPayView];
  69. break;
  70. case SPSBSalaryPayViewTypeProgress:
  71. [self setOrderBaseWithOrderType:SPSBOrderTypeSalary totalFee:_spsb_data.spsb_total_fee.floatValue discountCount:0 orderNumber:0 showData:nil buttonType:SPSBOrderListPayButtonTypeNone];
  72. [self createProgressView];
  73. break;
  74. case SPSBSalaryPayViewTypeDetails:
  75. [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];
  76. if (_spsb_data.spsb_pay_status.integerValue == SPSBSalaryOrderStatusNotPay) {
  77. [self createPayView];
  78. } else {
  79. [self createProgressView];
  80. }
  81. break;
  82. default:
  83. break;
  84. }
  85. }
  86. - (void)createProgressView {
  87. [self setTitleView:self.spsb_showData ? @"社保流水订单详情" : @"返还状态"];
  88. if (self.spsb_showData) {
  89. [self.spsb_mScrollView makeConstraints:^(JXHConstraintMaker *make) {
  90. make.leading.and.top.and.bottom.equalTo(0);
  91. make.width.equalTo(jxh_screenWidth());
  92. make.height.equalTo(self.spsb_bgScrollView);
  93. }];
  94. [self addMessageViewWithStatusTitle:@"实付款" tips:@"用作流水记录,资金在到款后,将会于退还至参保人银行卡,请耐心等候,部分城市例如北京,可能分两笔返还,第一笔通过银行卡转账返还,第二笔通过退款返还。"];
  95. } else {
  96. [self.spsb_mScrollView makeConstraints:^(JXHConstraintMaker *make) {
  97. make.leading.and.top.and.bottom.equalTo(0);
  98. make.width.equalTo(0);
  99. make.height.equalTo(self.spsb_bgScrollView);
  100. }];
  101. }
  102. UIScrollView *progressView = [UIScrollView convenienceWithBackgroundColor:spsb_FFFFFF_color(1.f)];
  103. [self.spsb_bgScrollView addSubview:progressView];
  104. [progressView makeConstraints:^(JXHConstraintMaker *make) {
  105. make.top.and.bottom.and.trailing.equalTo(0);
  106. make.leading.equalTo(self.spsb_mScrollView.trailing);
  107. make.width.equalTo(jxh_screenWidth());
  108. make.height.equalTo(self.spsb_bgScrollView);
  109. }];
  110. [self addProgressViewWithPayView:progressView];
  111. if (self.spsb_showData) {
  112. UIButton *progressButton = [UIButton convenienceWithFont:spsb_font(17) target:self action:@selector(progressAction:)];
  113. [progressButton setTitle:@"查看费用返还进度" titleColor:spsb_3296FB_color() state:JXHButtonControlStateNormal];
  114. progressButton.backgroundColor = [UIColor whiteColor];
  115. [self.spsb_contentView addSubview:progressButton];
  116. [progressButton makeConstraints:^(JXHConstraintMaker *make) {
  117. make.bottom.equalTo(self.spsb_contentView.safebottom);
  118. make.leading.and.trailing.equalTo(0);
  119. make.height.equalTo(54);
  120. }];
  121. [progressButton createLineWithLocation:JXHLineLocationTop];
  122. }
  123. }
  124. - (void)addProgressViewWithPayView:(UIScrollView *)progressView {
  125. UIView *headerView = UIView.new;
  126. [progressView addSubview:headerView];
  127. NSString *bankCard;
  128. bool haveCustomer = false;
  129. for (SPSBPurchasersModel *purchasers in spsb_purchasersArray()) {
  130. if ([purchasers.spsb_id isEqualToString:_spsb_data.spsb_sbu_id]) {
  131. haveCustomer = true;
  132. _editPurchasers = purchasers;
  133. if (![purchasers.spsb_bank isEqualToString:@""] && ![purchasers.spsb_bank_code isEqualToString:@""]) {
  134. bankCard = [NSString stringWithFormat:@"%@(%@)", purchasers.spsb_bank, [purchasers.spsb_bank_code substringFromIndex:purchasers.spsb_bank_code.length - 4]];
  135. }
  136. break;
  137. }
  138. }
  139. NSInteger status = _spsb_data.spsb_pay_status.integerValue;
  140. UILabel *infoTitleLabel = [UILabel convenienceWithFont:spsb_font(14) textColor:spsb_999999_color() limitWidth:jxh_screenWidth() / 2];
  141. UILabel *infoContentLabel = [UILabel convenienceWithFont:spsb_font(14) textColor:spsb_666666_color() limitWidth:jxh_screenWidth() / 2];
  142. // if (1) {
  143. if (status == SPSBSalaryOrderStatusPaySuccessAndNotBack && !haveCustomer) {
  144. UIView *tipsView = UIView.new;
  145. tipsView.backgroundColor = spsb_FDF8EC_color();
  146. [progressView addSubview:tipsView];
  147. [tipsView makeConstraints:^(JXHConstraintMaker *make) {
  148. make.top.and.leading.and.trailing.equalTo(0);
  149. }];
  150. UILabel *tipsLabel = [UILabel convenienceWithFont:spsb_font(12) textColor:spsb_FF801A_color() limitWidth:jxh_screenWidth() - 30];
  151. [tipsLabel setAttributedStringWithText:@"该参保人已被删除啦,请联系客服重新加上并填写银行卡" lineSpacing:6];
  152. [tipsView addSubview:tipsLabel];
  153. [tipsLabel makeConstraints:^(JXHConstraintMaker *make) {
  154. make.top.and.leading.equalTo(15);
  155. make.bottom.equalTo(-15);
  156. make.trailing.equalTo(-15);
  157. }];
  158. [headerView makeConstraints:^(JXHConstraintMaker *make) {
  159. make.leading.and.trailing.equalTo(0);
  160. make.top.equalTo(tipsView.bottom);
  161. make.size.equalTo(CGSizeMake(jxh_screenWidth(), 80));
  162. }];
  163. [infoTitleLabel setAttributedStringWithText:@"收款姓名\n返还账户" lineSpacing:10 lines:0];
  164. [infoContentLabel setAttributedStringWithText:[NSString stringWithFormat:@"%@\n暂无", _spsb_data.spsb_uname] textAlignment:NSTextAlignmentRight lineSpacing:10 lineHeight:0 paragraphSpacing:0 lineBreakMode:NSLineBreakByTruncatingTail lines:0];
  165. } else if (status == SPSBSalaryOrderStatusPaySuccessAndNotBack && !bankCard) {
  166. // } else if (1) {
  167. UIView *tipsView = UIView.new;
  168. tipsView.backgroundColor = spsb_FDF8EC_color();
  169. [progressView addSubview:tipsView];
  170. [tipsView makeConstraints:^(JXHConstraintMaker *make) {
  171. make.top.and.leading.and.trailing.equalTo(0);
  172. }];
  173. UIButton *tipsButton = [UIButton convenienceWithFont:spsb_font(11) target:self action:@selector(tipsAction)];
  174. [tipsButton setTitle:@"立即添加" titleColor:spsb_FFFFFF_color(1.f) state:JXHButtonControlStateNormal];
  175. [tipsButton setLayerCornerRadius:2 clipToBounds:true];
  176. tipsButton.backgroundColor = spsb_FF801A_color();
  177. [tipsView addSubview:tipsButton];
  178. [tipsButton makeConstraints:^(JXHConstraintMaker *make) {
  179. make.trailing.equalTo(-15);
  180. make.centerY.equalTo(tipsView);
  181. make.size.equalTo(CGSizeMake(60, 26));
  182. }];
  183. UILabel *tipsLabel = [UILabel convenienceWithFont:spsb_font(12) textColor:spsb_FF801A_color() limitWidth:jxh_screenWidth() - 15 - 60 - 19 - 15];
  184. [tipsLabel setAttributedStringWithText:@"因该参保人未添加返还银行卡信息,将会影响费用返还进度,请及时添加" lineSpacing:6];
  185. [tipsView addSubview:tipsLabel];
  186. [tipsLabel makeConstraints:^(JXHConstraintMaker *make) {
  187. make.top.and.leading.equalTo(15);
  188. make.bottom.equalTo(-15);
  189. make.trailing.equalTo(tipsButton.leading).offset(-19);
  190. }];
  191. [headerView makeConstraints:^(JXHConstraintMaker *make) {
  192. make.leading.and.trailing.equalTo(0);
  193. make.top.equalTo(tipsView.bottom);
  194. make.size.equalTo(CGSizeMake(jxh_screenWidth(), 80));
  195. }];
  196. [infoTitleLabel setAttributedStringWithText:@"收款姓名\n返还账户" lineSpacing:10 lines:0];
  197. [infoContentLabel setAttributedStringWithText:[NSString stringWithFormat:@"%@\n暂无", _spsb_data.spsb_uname] textAlignment:NSTextAlignmentRight lineSpacing:10 lineHeight:0 paragraphSpacing:0 lineBreakMode:NSLineBreakByTruncatingTail lines:0];
  198. // } else if (1) {
  199. } else if (status == SPSBSalaryOrderStatusPaySuccessAndBackFail) {
  200. UIView *tipsView = UIView.new;
  201. tipsView.backgroundColor = spsb_FDF8EC_color();
  202. [progressView addSubview:tipsView];
  203. [tipsView makeConstraints:^(JXHConstraintMaker *make) {
  204. make.top.and.leading.and.trailing.equalTo(0);
  205. }];
  206. if (!haveCustomer) {
  207. UILabel *tipsLabel = [UILabel convenienceWithFont:spsb_font(12) textColor:spsb_FF801A_color() limitWidth:jxh_screenWidth() - 30];
  208. [tipsLabel setAttributedStringWithText:@"因该参保人的银行卡未添加或信息有误,请及时处理,否则会影响返还进度。" lineSpacing:6];
  209. [tipsView addSubview:tipsLabel];
  210. [tipsLabel makeConstraints:^(JXHConstraintMaker *make) {
  211. make.top.and.leading.equalTo(15);
  212. make.bottom.equalTo(-15);
  213. make.trailing.equalTo(-15);
  214. }];
  215. infoTitleLabel.text = @"收款姓名";
  216. infoContentLabel.text = _spsb_data.spsb_uname;
  217. infoContentLabel.textAlignment = NSTextAlignmentRight;
  218. } else {
  219. UIButton *tipsButton = [UIButton convenienceWithFont:spsb_font(11) target:self action:@selector(tipsAction)];
  220. [tipsButton setTitle:@"去处理" titleColor:spsb_FFFFFF_color(1.f) state:JXHButtonControlStateNormal];
  221. [tipsButton setLayerCornerRadius:2 clipToBounds:true];
  222. tipsButton.backgroundColor = spsb_FF801A_color();
  223. [tipsView addSubview:tipsButton];
  224. [tipsButton makeConstraints:^(JXHConstraintMaker *make) {
  225. make.trailing.equalTo(-15);
  226. make.centerY.equalTo(tipsView);
  227. make.size.equalTo(CGSizeMake(60, 26));
  228. }];
  229. UILabel *tipsLabel = [UILabel convenienceWithFont:spsb_font(12) textColor:spsb_FF801A_color() limitWidth:jxh_screenWidth() - 15 - 60 - 19 - 15];
  230. [tipsLabel setAttributedStringWithText:@"因该参保人的银行卡未添加或信息有误,请及时处理,否则会影响返还进度。" lineSpacing:6];
  231. [tipsView addSubview:tipsLabel];
  232. [tipsLabel makeConstraints:^(JXHConstraintMaker *make) {
  233. make.top.and.leading.equalTo(15);
  234. make.bottom.equalTo(-15);
  235. make.trailing.equalTo(tipsButton.leading).offset(-14);
  236. }];
  237. if (!bankCard) {
  238. infoTitleLabel.text = @"收款姓名";
  239. infoContentLabel.text = _spsb_data.spsb_uname;
  240. infoContentLabel.textAlignment = NSTextAlignmentRight;
  241. } else {
  242. [infoTitleLabel setAttributedStringWithText:@"收款姓名\n返还账户" lineSpacing:10 lines:0];
  243. [infoContentLabel setAttributedStringWithText:[NSString stringWithFormat:@"%@\n%@", _spsb_data.spsb_uname, bankCard] textAlignment:NSTextAlignmentRight lineSpacing:10 lineHeight:0 paragraphSpacing:0 lineBreakMode:NSLineBreakByTruncatingTail lines:0];
  244. }
  245. }
  246. [headerView makeConstraints:^(JXHConstraintMaker *make) {
  247. make.leading.and.trailing.equalTo(0);
  248. make.top.equalTo(tipsView.bottom);
  249. make.size.equalTo(CGSizeMake(jxh_screenWidth(), 80));
  250. }];
  251. } else if (!haveCustomer || !bankCard || status == SPSBSalaryOrderStatusReturnBack || status == SPSBSalaryOrderStatusRefund) {
  252. [headerView makeConstraints:^(JXHConstraintMaker *make) {
  253. make.top.and.leading.and.trailing.equalTo(0);
  254. make.size.equalTo(CGSizeMake(jxh_screenWidth(), 80));
  255. }];
  256. infoTitleLabel.text = @"收款姓名";
  257. infoContentLabel.text = _spsb_data.spsb_uname;
  258. infoContentLabel.textAlignment = NSTextAlignmentRight;
  259. } else {
  260. [headerView makeConstraints:^(JXHConstraintMaker *make) {
  261. make.top.and.leading.and.trailing.equalTo(0);
  262. make.size.equalTo(CGSizeMake(jxh_screenWidth(), 80));
  263. }];
  264. [infoTitleLabel setAttributedStringWithText:@"收款姓名\n返还账户" lineSpacing:10 lines:0];
  265. [infoContentLabel setAttributedStringWithText:[NSString stringWithFormat:@"%@\n%@", _spsb_data.spsb_uname, bankCard] textAlignment:NSTextAlignmentRight lineSpacing:10 lineHeight:0 paragraphSpacing:0 lineBreakMode:NSLineBreakByTruncatingTail lines:0];
  266. }
  267. UILabel *titleLabel = [UILabel convenienceWithFont:spsb_font(16) text:@"社保流水 (返还费用)" textColor:spsb_333333_color()];
  268. [headerView addSubview:titleLabel];
  269. [titleLabel makeConstraints:^(JXHConstraintMaker *make) {
  270. make.top.equalTo(22);
  271. make.leading.equalTo(15);
  272. }];
  273. UILabel *contentLabel = [UILabel convenienceWithFont:spsb_semiboldFont(16) text:[NSString stringWithFormat:@"+%.2f", _spsb_data.spsb_wage.floatValue] textColor:spsb_333333_color() textAlignment:NSTextAlignmentRight];
  274. [headerView addSubview:contentLabel];
  275. [contentLabel makeConstraints:^(JXHConstraintMaker *make) {
  276. make.centerY.equalTo(titleLabel);
  277. make.trailing.equalTo(-15);
  278. }];
  279. 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()];
  280. [headerView addSubview:titleLabel];
  281. [titleLabel makeConstraints:^(JXHConstraintMaker *make) {
  282. make.bottom.equalTo(-18);
  283. make.leading.equalTo(15);
  284. }];
  285. if (status == SPSBSalaryOrderStatusBack || status == SPSBSalaryOrderStatusReturnBack || status == SPSBSalaryOrderStatusRefund) {
  286. contentLabel = [UILabel convenienceWithFont:spsb_font(12) text:@"交易成功" textColor:spsb_3AB261_color() textAlignment:NSTextAlignmentRight];
  287. } else if (status == SPSBSalaryOrderStatusInTheRefund) {
  288. contentLabel = [UILabel convenienceWithFont:spsb_font(12) text:@"退款中" textColor:spsb_FF8D36_color() textAlignment:NSTextAlignmentRight];
  289. } else {
  290. contentLabel = [UILabel convenienceWithFont:spsb_font(12) text:@"等待处理" textColor:spsb_FF8D36_color() textAlignment:NSTextAlignmentRight];
  291. }
  292. [headerView addSubview:contentLabel];
  293. [contentLabel makeConstraints:^(JXHConstraintMaker *make) {
  294. make.centerY.equalTo(titleLabel);
  295. make.trailing.equalTo(-15);
  296. }];
  297. [headerView createLineWithLocation:JXHLineLocationBottom headOffset:15 footOffset:0];
  298. UIView *infoView = UIView.new;
  299. infoView.backgroundColor = [UIColor whiteColor];
  300. [progressView addSubview:infoView];
  301. [infoView makeConstraints:^(JXHConstraintMaker *make) {
  302. make.top.equalTo(headerView.bottom);
  303. make.leading.and.trailing.equalTo(0);
  304. }];
  305. [infoView addSubview:infoTitleLabel];
  306. [infoTitleLabel makeConstraints:^(JXHConstraintMaker *make) {
  307. make.top.equalTo(18);
  308. make.bottom.equalTo(-18);
  309. make.leading.equalTo(15);
  310. }];
  311. [infoView addSubview:infoContentLabel];
  312. [infoContentLabel makeConstraints:^(JXHConstraintMaker *make) {
  313. make.centerY.equalTo(infoTitleLabel);
  314. make.trailing.equalTo(-15);
  315. }];
  316. [infoView createLineWithLocation:JXHLineLocationBottom headOffset:15 footOffset:0];
  317. UIView *pView = UIView.new;
  318. pView.backgroundColor = [UIColor whiteColor];
  319. [progressView addSubview:pView];
  320. UILabel *statusLabel1 = [UILabel convenienceWithFont:spsb_font(15) text:@"付款成功" textColor:spsb_3296FB_color()];
  321. [pView addSubview:statusLabel1];
  322. [statusLabel1 makeConstraints:^(JXHConstraintMaker *make) {
  323. make.leading.equalTo(56);
  324. make.top.equalTo(32);
  325. }];
  326. UIImageView *first = [[UIImageView alloc] initWithImage:jxh_getImage(salary_done)];
  327. [pView addSubview:first];
  328. [first makeConstraints:^(JXHConstraintMaker *make) {
  329. make.size.equalTo(CGSizeMake(18, 18));
  330. make.centerY.equalTo(statusLabel1);
  331. make.leading.equalTo(22);
  332. }];
  333. UILabel *time = [UILabel convenienceWithFont:spsb_font(14) text:_spsb_data.spsba_showPayTime textColor:spsb_ADADAD_color()];
  334. [pView addSubview:time];
  335. [time makeConstraints:^(JXHConstraintMaker *make) {
  336. make.trailing.equalTo(-15);
  337. make.centerY.equalTo(first);
  338. }];
  339. UILabel *statusLabel2 = [UILabel convenienceWithFont:spsb_font(15) textColor:spsb_3296FB_color() limitWidth:jxh_screenWidth() - 115 - 56];
  340. [statusLabel2 setAttributedStringWithText:[NSString stringWithFormat:@"待专员处理 (%@)", _spsb_data.spsb_hf_remark] lineSpacing:4];
  341. [pView addSubview:statusLabel2];
  342. [statusLabel2 makeConstraints:^(JXHConstraintMaker *make) {
  343. make.leading.equalTo(56);
  344. make.trailing.equalTo(-115);
  345. make.top.equalTo(statusLabel1.bottom).offset(40);
  346. }];
  347. UIImageView *second = [[UIImageView alloc] initWithImage:jxh_getImage(salary_done)];
  348. [pView addSubview:second];
  349. [second makeConstraints:^(JXHConstraintMaker *make) {
  350. make.size.equalTo(CGSizeMake(18, 18));
  351. make.top.equalTo(statusLabel2.top).offset(-1);
  352. make.centerX.equalTo(first);
  353. }];
  354. UIImageView *firstLine = [[UIImageView alloc] initWithImage:jxh_getImage(salary_line)];
  355. [pView addSubview:firstLine];
  356. [firstLine makeConstraints:^(JXHConstraintMaker *make) {
  357. make.top.equalTo(first.bottom);
  358. make.bottom.equalTo(second.top);
  359. make.centerX.equalTo(first);
  360. }];
  361. time = [UILabel convenienceWithFont:spsb_font(14) text:_spsb_data.spsba_showPayTime textColor:spsb_ADADAD_color()];
  362. [pView addSubview:time];
  363. [time makeConstraints:^(JXHConstraintMaker *make) {
  364. make.trailing.equalTo(-15);
  365. make.centerY.equalTo(second);
  366. }];
  367. if (status == SPSBSalaryOrderStatusBack || status == SPSBSalaryOrderStatusReturnBack || status == SPSBSalaryOrderStatusRefund) {
  368. UILabel *statusLabel3 = [UILabel convenienceWithFont:spsb_font(15) text:@"专员已操作退还" textColor:spsb_3296FB_color()];
  369. [pView addSubview:statusLabel3];
  370. [statusLabel3 makeConstraints:^(JXHConstraintMaker *make) {
  371. make.leading.equalTo(56);
  372. make.top.equalTo(statusLabel2.bottom).offset(40);
  373. make.bottom.equalTo(-32);
  374. }];
  375. UIImageView *third = [[UIImageView alloc] initWithImage:jxh_getImage(salary_done)];
  376. [second addSubview:third];
  377. [third makeConstraints:^(JXHConstraintMaker *make) {
  378. make.size.equalTo(CGSizeMake(18, 18));
  379. make.centerY.equalTo(statusLabel3);
  380. make.centerX.equalTo(first);
  381. }];
  382. UIImageView *secondLine = [[UIImageView alloc] initWithImage:jxh_getImage(salary_line)];
  383. [pView addSubview:secondLine];
  384. [secondLine makeConstraints:^(JXHConstraintMaker *make) {
  385. make.top.equalTo(second.bottom);
  386. make.bottom.equalTo(third.top);
  387. make.centerX.equalTo(first);
  388. }];
  389. time = [UILabel convenienceWithFont:spsb_font(14) text:_spsb_data.spsba_showBackTime textColor:spsb_ADADAD_color()];
  390. [pView addSubview:time];
  391. [time makeConstraints:^(JXHConstraintMaker *make) {
  392. make.trailing.equalTo(-15);
  393. make.centerY.equalTo(third);
  394. }];
  395. [pView makeConstraints:^(JXHConstraintMaker *make) {
  396. make.top.equalTo(infoView.bottom);
  397. make.leading.and.trailing.equalTo(0);
  398. }];
  399. UIView *tipsView = UIView.new;
  400. tipsView.backgroundColor = [UIColor whiteColor];
  401. [progressView addSubview:tipsView];
  402. [tipsView makeConstraints:^(JXHConstraintMaker *make) {
  403. make.leading.and.trailing.equalTo(0);
  404. make.top.equalTo(pView.bottom);
  405. make.bottom.equalTo(0);
  406. }];
  407. UILabel *tipsLabel = [UILabel convenienceWithFont:spsb_font(14) textColor:spsb_999999_color() limitWidth:jxh_screenWidth() - 30];
  408. [tipsLabel setAttributedStringWithText:@"温馨提示:专员已操作退还社保流水费用,请您及时留意到账信息。" lineSpacing:7];
  409. [tipsView addSubview:tipsLabel];
  410. [tipsLabel makeConstraints:^(JXHConstraintMaker *make) {
  411. make.top.and.leading.equalTo(15);
  412. make.bottom.and.trailing.equalTo(-15);
  413. }];
  414. [tipsView createLineWithLocation:JXHLineLocationTop];
  415. } else if (status == SPSBSalaryOrderStatusInTheRefund) {
  416. UILabel *statusLabel3 = [UILabel convenienceWithFont:spsb_font(15) textColor:spsb_3296FB_color() limitWidth:jxh_screenWidth() - 115 - 56];
  417. [statusLabel3 setAttributedStringWithText:@"专员已操作退还(等待退款完成)" lineSpacing:4];
  418. [pView addSubview:statusLabel3];
  419. [statusLabel3 makeConstraints:^(JXHConstraintMaker *make) {
  420. make.leading.equalTo(56);
  421. make.top.equalTo(statusLabel2.bottom).offset(40);
  422. make.bottom.equalTo(-32);
  423. }];
  424. UIImageView *third = [[UIImageView alloc] initWithImage:jxh_getImage(salary_done)];
  425. [second addSubview:third];
  426. [third makeConstraints:^(JXHConstraintMaker *make) {
  427. make.size.equalTo(CGSizeMake(18, 18));
  428. make.centerY.equalTo(statusLabel3);
  429. make.centerX.equalTo(first);
  430. }];
  431. UIImageView *secondLine = [[UIImageView alloc] initWithImage:jxh_getImage(salary_line)];
  432. [pView addSubview:secondLine];
  433. [secondLine makeConstraints:^(JXHConstraintMaker *make) {
  434. make.top.equalTo(second.bottom);
  435. make.bottom.equalTo(third.top);
  436. make.centerX.equalTo(first);
  437. }];
  438. time = [UILabel convenienceWithFont:spsb_font(14) text:_spsb_data.spsba_showBackTime textColor:spsb_ADADAD_color()];
  439. [pView addSubview:time];
  440. [time makeConstraints:^(JXHConstraintMaker *make) {
  441. make.trailing.equalTo(-15);
  442. make.centerY.equalTo(third);
  443. }];
  444. [pView makeConstraints:^(JXHConstraintMaker *make) {
  445. make.top.equalTo(infoView.bottom);
  446. make.leading.and.trailing.equalTo(0);
  447. }];
  448. } else if (status == SPSBSalaryOrderStatusPaySuccessAndBackFail) {
  449. UILabel *statusLabel3 = [UILabel convenienceWithFont:spsb_font(15) text:@"返还失败" textColor:spsb_FF5E5E_color()];
  450. [pView addSubview:statusLabel3];
  451. [statusLabel3 makeConstraints:^(JXHConstraintMaker *make) {
  452. make.leading.equalTo(56);
  453. make.top.equalTo(statusLabel2.bottom).offset(40);
  454. make.bottom.equalTo(-32);
  455. }];
  456. UIImageView *third = [[UIImageView alloc] initWithImage:jxh_getImage(salary_failure)];
  457. [second addSubview:third];
  458. [third makeConstraints:^(JXHConstraintMaker *make) {
  459. make.size.equalTo(CGSizeMake(18, 18));
  460. make.centerY.equalTo(statusLabel3);
  461. make.centerX.equalTo(first);
  462. }];
  463. UIImageView *secondLine = [[UIImageView alloc] initWithImage:jxh_getImage(salary_line)];
  464. [pView addSubview:secondLine];
  465. [secondLine makeConstraints:^(JXHConstraintMaker *make) {
  466. make.top.equalTo(second.bottom);
  467. make.bottom.equalTo(third.top);
  468. make.centerX.equalTo(first);
  469. }];
  470. time = [UILabel convenienceWithFont:spsb_font(14) text:_spsb_data.spsba_showBackTime textColor:spsb_ADADAD_color()];
  471. [pView addSubview:time];
  472. [time makeConstraints:^(JXHConstraintMaker *make) {
  473. make.trailing.equalTo(-15);
  474. make.centerY.equalTo(third);
  475. }];
  476. [pView makeConstraints:^(JXHConstraintMaker *make) {
  477. make.top.equalTo(infoView.bottom);
  478. make.leading.and.trailing.equalTo(0);
  479. }];
  480. UIView *tipsView = UIView.new;
  481. tipsView.backgroundColor = [UIColor whiteColor];
  482. [progressView addSubview:tipsView];
  483. [tipsView makeConstraints:^(JXHConstraintMaker *make) {
  484. make.leading.and.trailing.equalTo(0);
  485. make.top.equalTo(pView.bottom);
  486. make.bottom.equalTo(0);
  487. }];
  488. UILabel *tipsLabel = [UILabel convenienceWithFont:spsb_font(14) textColor:spsb_999999_color() limitWidth:jxh_screenWidth() - 30];
  489. [tipsLabel setAttributedStringWithText:[NSString stringWithFormat:@"失败原因:%@", _spsb_data.spsb_fail_reason] lineSpacing:7];
  490. [tipsView addSubview:tipsLabel];
  491. [tipsLabel makeConstraints:^(JXHConstraintMaker *make) {
  492. make.top.and.leading.equalTo(15);
  493. make.bottom.and.trailing.equalTo(-15);
  494. }];
  495. [tipsView createLineWithLocation:JXHLineLocationTop];
  496. } else {
  497. UILabel *statusLabel3 = [UILabel convenienceWithFont:spsb_font(15) text:@"专员已操作退还" textColor:spsb_999999_color()];
  498. [pView addSubview:statusLabel3];
  499. [statusLabel3 makeConstraints:^(JXHConstraintMaker *make) {
  500. make.leading.equalTo(56);
  501. make.top.equalTo(statusLabel2.bottom).offset(40);
  502. make.bottom.equalTo(-32);
  503. }];
  504. UIImageView *third = [[UIImageView alloc] initWithImage:jxh_getImage(salary_undone)];
  505. [second addSubview:third];
  506. [third makeConstraints:^(JXHConstraintMaker *make) {
  507. make.size.equalTo(CGSizeMake(18, 18));
  508. make.centerY.equalTo(statusLabel3);
  509. make.centerX.equalTo(first);
  510. }];
  511. UIImageView *secondLine = [[UIImageView alloc] initWithImage:jxh_getImage(salary_dashed)];
  512. [pView addSubview:secondLine];
  513. [secondLine makeConstraints:^(JXHConstraintMaker *make) {
  514. make.top.equalTo(second.bottom);
  515. make.bottom.equalTo(third.top);
  516. make.centerX.equalTo(first);
  517. }];
  518. [pView makeConstraints:^(JXHConstraintMaker *make) {
  519. make.top.equalTo(infoView.bottom);
  520. make.leading.and.trailing.equalTo(0);
  521. make.bottom.equalTo(0);
  522. }];
  523. }
  524. }
  525. @end