ClassToExamineVC.m 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. //
  2. // ClassToExamineVC.m
  3. // yunbaolive
  4. //
  5. // Created by ybRRR on 2020/10/27.
  6. // Copyright © 2020 cat. All rights reserved.
  7. //
  8. #import "ClassToExamineVC.h"
  9. #import <YYText/YYLabel.h>
  10. #import <YYText/NSAttributedString+YYText.h>
  11. #import "ClassificationVC.h"
  12. @interface ClassToExamineVC ()
  13. @end
  14. @implementation ClassToExamineVC
  15. - (UIStatusBarStyle)preferredStatusBarStyle {
  16. if (@available(iOS 13.0,*)) {
  17. return UIStatusBarStyleDarkContent;
  18. }
  19. return UIStatusBarStyleDefault;
  20. }
  21. - (void)viewDidLoad {
  22. [super viewDidLoad];
  23. self.titleL.text = YZMsg(@"经营类目设置");
  24. self.view.backgroundColor =UIColor.whiteColor;// RGB(250, 250, 250);
  25. self.subNavi.backgroundColor = UIColor.whiteColor;
  26. self.titleL.textColor = UIColor.blackColor;
  27. [self.leftBtn setImage:[UIImage imageNamed:@"pub_back_black"] forState:0];
  28. self.naviLine.hidden = NO;
  29. self.naviLine.backgroundColor = RGB(245, 245, 245);
  30. UIImageView *statusImg = [[UIImageView alloc]init];
  31. statusImg.frame = CGRectMake(0, 150, 80, 80);
  32. statusImg.centerX = self.view.centerX;
  33. [self.view addSubview:statusImg];
  34. NSString *infosStr;
  35. if ([self.statusStr isEqual:@"0"]) {
  36. infosStr = YZMsg(@"管理员正在飞速审核中~");
  37. statusImg.image = [UIImage imageNamed:@"审核中"];
  38. }else{
  39. infosStr = YZMsg(@"您的审核没有通过,请重新提交");
  40. statusImg.image = [UIImage imageNamed:@"审核失败"];
  41. infosStr = [infosStr stringByAppendingFormat:@":%@",_reasonStr];
  42. }
  43. YYLabel *lb = [[YYLabel alloc]init];
  44. lb.font = [UIFont systemFontOfSize:14];
  45. lb.text = infosStr;
  46. lb.numberOfLines = 0;
  47. lb.preferredMaxLayoutWidth = _window_width-30;
  48. lb.textAlignment = NSTextAlignmentCenter;
  49. [self.view addSubview:lb];
  50. [lb mas_makeConstraints:^(MASConstraintMaker *make) {
  51. make.top.equalTo(statusImg.mas_bottom).offset(10);
  52. make.centerX.equalTo(statusImg);
  53. make.width.lessThanOrEqualTo(self.view.mas_width).offset(-30);
  54. }];
  55. NSMutableAttributedString *textAtt = [[NSMutableAttributedString alloc]initWithString:[NSString stringWithFormat:@"%@",infosStr]];
  56. [textAtt addAttribute:NSForegroundColorAttributeName value:[UIColor blackColor] range:textAtt.yy_rangeOfAll];//RGB_COLOR(@"#323232", 1)
  57. [textAtt addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:14] range:NSMakeRange(0,textAtt.length)];
  58. if ([self.statusStr isEqual:@"2"]) {
  59. NSRange clickRange = [[textAtt string]rangeOfString:YZMsg(@"重新提交")];
  60. [textAtt yy_setTextHighlightRange:clickRange color:RGB_COLOR(@"#168EF4", 1) backgroundColor:[UIColor clearColor] tapAction:^(UIView * _Nonnull containerView, NSAttributedString * _Nonnull text, NSRange range, CGRect rect) {
  61. ClassificationVC *classVc = [[ClassificationVC alloc]init];
  62. classVc.fromwhere = @"examine";
  63. [[YBBaseAppDelegate sharedAppDelegate]pushViewController:classVc animated:YES];
  64. }];
  65. }
  66. lb.attributedText = textAtt;
  67. }
  68. @end