Browse Source

个人界面的优化

huangyp 6 years ago
parent
commit
16f28eb338
20 changed files with 444 additions and 8 deletions
  1. 18 4
      UU_Ent/UU_Ent.xcodeproj/project.pbxproj
  2. 0 0
      UU_Ent/UU_Ent/Modules/Mine/Child/Setting/Controllers/YRSettingVC.h
  3. 0 0
      UU_Ent/UU_Ent/Modules/Mine/Child/Setting/Controllers/YRSettingVC.m
  4. 134 4
      UU_Ent/UU_Ent/Modules/Mine/Main/Controllers/YRMineVC.m
  5. 23 0
      UU_Ent/UU_Ent/Supporting Files/Assets.xcassets/Resources/Mine/UU_newWoedit.imageset/Contents.json
  6. BIN
      UU_Ent/UU_Ent/Supporting Files/Assets.xcassets/Resources/Mine/UU_newWoedit.imageset/UU_newWoedit@1x.png
  7. BIN
      UU_Ent/UU_Ent/Supporting Files/Assets.xcassets/Resources/Mine/UU_newWoedit.imageset/UU_newWoedit@2x.png
  8. BIN
      UU_Ent/UU_Ent/Supporting Files/Assets.xcassets/Resources/Mine/UU_newWoedit.imageset/UU_newWoedit@3x.png
  9. 23 0
      UU_Ent/UU_Ent/Supporting Files/Assets.xcassets/Resources/Mine/UU_newbg4.imageset/Contents.json
  10. BIN
      UU_Ent/UU_Ent/Supporting Files/Assets.xcassets/Resources/Mine/UU_newbg4.imageset/UU_newbg4@1x.png
  11. BIN
      UU_Ent/UU_Ent/Supporting Files/Assets.xcassets/Resources/Mine/UU_newbg4.imageset/UU_newbg4@2x.png
  12. BIN
      UU_Ent/UU_Ent/Supporting Files/Assets.xcassets/Resources/Mine/UU_newbg4.imageset/UU_newbg4@3x.png
  13. 21 0
      UU_Ent/UU_Ent/Supporting Files/Assets.xcassets/Resources/Mine/uu_zhanwei_man.imageset/Contents.json
  14. BIN
      UU_Ent/UU_Ent/Supporting Files/Assets.xcassets/Resources/Mine/uu_zhanwei_man.imageset/uu_zhanwei_man.png
  15. 21 0
      UU_Ent/UU_Ent/Supporting Files/Assets.xcassets/Resources/Mine/uu_zhanwei_woman.imageset/Contents.json
  16. BIN
      UU_Ent/UU_Ent/Supporting Files/Assets.xcassets/Resources/Mine/uu_zhanwei_woman.imageset/uu_zhanwei_woman.png
  17. 1 0
      UU_Ent/UU_Ent/Supporting Files/defines/import.h
  18. 2 0
      UU_Ent/UU_Ent/Supporting Files/defines/macro.h
  19. 15 0
      UU_Ent/UU_Ent/Utils/UINavigation/UINavigationController+safe.h
  20. 186 0
      UU_Ent/UU_Ent/Utils/UINavigation/UINavigationController+safe.m

+ 18 - 4
UU_Ent/UU_Ent.xcodeproj/project.pbxproj

@@ -12,6 +12,7 @@
 		27029BD0227709CC00D53A94 /* UIButton+Layout.m in Sources */ = {isa = PBXBuildFile; fileRef = 27029BCE227709CC00D53A94 /* UIButton+Layout.m */; };
 		27029BD0227709CC00D53A94 /* UIButton+Layout.m in Sources */ = {isa = PBXBuildFile; fileRef = 27029BCE227709CC00D53A94 /* UIButton+Layout.m */; };
 		27029BD32277E16300D53A94 /* YRButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 27029BD22277E16300D53A94 /* YRButton.m */; };
 		27029BD32277E16300D53A94 /* YRButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 27029BD22277E16300D53A94 /* YRButton.m */; };
 		270E6C972282B72D008B12B9 /* YRSettingVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 270E6C962282B72D008B12B9 /* YRSettingVC.m */; };
 		270E6C972282B72D008B12B9 /* YRSettingVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 270E6C962282B72D008B12B9 /* YRSettingVC.m */; };
+		270E6C9B2282E6D0008B12B9 /* UINavigationController+safe.m in Sources */ = {isa = PBXBuildFile; fileRef = 270E6C9A2282E6D0008B12B9 /* UINavigationController+safe.m */; };
 		2710E65522801B7E0002A4B0 /* YRRegisterVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 2710E65422801B7E0002A4B0 /* YRRegisterVC.m */; };
 		2710E65522801B7E0002A4B0 /* YRRegisterVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 2710E65422801B7E0002A4B0 /* YRRegisterVC.m */; };
 		2710E65822801B930002A4B0 /* YRPwdLevelView.m in Sources */ = {isa = PBXBuildFile; fileRef = 2710E65722801B930002A4B0 /* YRPwdLevelView.m */; };
 		2710E65822801B930002A4B0 /* YRPwdLevelView.m in Sources */ = {isa = PBXBuildFile; fileRef = 2710E65722801B930002A4B0 /* YRPwdLevelView.m */; };
 		2710E65D22801E330002A4B0 /* LeftViewTF.m in Sources */ = {isa = PBXBuildFile; fileRef = 2710E65C22801E330002A4B0 /* LeftViewTF.m */; };
 		2710E65D22801E330002A4B0 /* LeftViewTF.m in Sources */ = {isa = PBXBuildFile; fileRef = 2710E65C22801E330002A4B0 /* LeftViewTF.m */; };
@@ -154,6 +155,8 @@
 		27029BD22277E16300D53A94 /* YRButton.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = YRButton.m; sourceTree = "<group>"; };
 		27029BD22277E16300D53A94 /* YRButton.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = YRButton.m; sourceTree = "<group>"; };
 		270E6C952282B72D008B12B9 /* YRSettingVC.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = YRSettingVC.h; sourceTree = "<group>"; };
 		270E6C952282B72D008B12B9 /* YRSettingVC.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = YRSettingVC.h; sourceTree = "<group>"; };
 		270E6C962282B72D008B12B9 /* YRSettingVC.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = YRSettingVC.m; sourceTree = "<group>"; };
 		270E6C962282B72D008B12B9 /* YRSettingVC.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = YRSettingVC.m; sourceTree = "<group>"; };
+		270E6C992282E6CF008B12B9 /* UINavigationController+safe.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UINavigationController+safe.h"; sourceTree = "<group>"; };
+		270E6C9A2282E6D0008B12B9 /* UINavigationController+safe.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UINavigationController+safe.m"; sourceTree = "<group>"; };
 		2710E65322801B7E0002A4B0 /* YRRegisterVC.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = YRRegisterVC.h; sourceTree = "<group>"; };
 		2710E65322801B7E0002A4B0 /* YRRegisterVC.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = YRRegisterVC.h; sourceTree = "<group>"; };
 		2710E65422801B7E0002A4B0 /* YRRegisterVC.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = YRRegisterVC.m; sourceTree = "<group>"; };
 		2710E65422801B7E0002A4B0 /* YRRegisterVC.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = YRRegisterVC.m; sourceTree = "<group>"; };
 		2710E65622801B930002A4B0 /* YRPwdLevelView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = YRPwdLevelView.h; path = UU_Ent/Modules/Login/Main/Views/YRPwdLevelView.h; sourceTree = SOURCE_ROOT; };
 		2710E65622801B930002A4B0 /* YRPwdLevelView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = YRPwdLevelView.h; path = UU_Ent/Modules/Login/Main/Views/YRPwdLevelView.h; sourceTree = SOURCE_ROOT; };
@@ -368,10 +371,7 @@
 		270E6C902282B6A5008B12B9 /* Child */ = {
 		270E6C902282B6A5008B12B9 /* Child */ = {
 			isa = PBXGroup;
 			isa = PBXGroup;
 			children = (
 			children = (
-				270E6C912282B6F5008B12B9 /* Controllers */,
-				270E6C922282B6FE008B12B9 /* Models */,
-				270E6C942282B70C008B12B9 /* Views */,
-				270E6C932282B705008B12B9 /* Others */,
+				270E6C982282D39E008B12B9 /* Setting */,
 			);
 			);
 			path = Child;
 			path = Child;
 			sourceTree = "<group>";
 			sourceTree = "<group>";
@@ -406,6 +406,17 @@
 			path = Views;
 			path = Views;
 			sourceTree = "<group>";
 			sourceTree = "<group>";
 		};
 		};
+		270E6C982282D39E008B12B9 /* Setting */ = {
+			isa = PBXGroup;
+			children = (
+				270E6C912282B6F5008B12B9 /* Controllers */,
+				270E6C922282B6FE008B12B9 /* Models */,
+				270E6C942282B70C008B12B9 /* Views */,
+				270E6C932282B705008B12B9 /* Others */,
+			);
+			path = Setting;
+			sourceTree = "<group>";
+		};
 		2710E65922801D760002A4B0 /* UITextField */ = {
 		2710E65922801D760002A4B0 /* UITextField */ = {
 			isa = PBXGroup;
 			isa = PBXGroup;
 			children = (
 			children = (
@@ -418,6 +429,8 @@
 		2710E65A22801D870002A4B0 /* UINavigation */ = {
 		2710E65A22801D870002A4B0 /* UINavigation */ = {
 			isa = PBXGroup;
 			isa = PBXGroup;
 			children = (
 			children = (
+				270E6C992282E6CF008B12B9 /* UINavigationController+safe.h */,
+				270E6C9A2282E6D0008B12B9 /* UINavigationController+safe.m */,
 				2710E65E22801ED10002A4B0 /* YRShowMessageFromNavi.h */,
 				2710E65E22801ED10002A4B0 /* YRShowMessageFromNavi.h */,
 				2710E65F22801ED10002A4B0 /* YRShowMessageFromNavi.m */,
 				2710E65F22801ED10002A4B0 /* YRShowMessageFromNavi.m */,
 			);
 			);
@@ -1424,6 +1437,7 @@
 				99B4252F22815E2900DAE304 /* YRAlertView.m in Sources */,
 				99B4252F22815E2900DAE304 /* YRAlertView.m in Sources */,
 				999F6510227E658E00329012 /* UIView+frame.m in Sources */,
 				999F6510227E658E00329012 /* UIView+frame.m in Sources */,
 				99C6FEC32276959B00C7070A /* YRWorkVC.m in Sources */,
 				99C6FEC32276959B00C7070A /* YRWorkVC.m in Sources */,
+				270E6C9B2282E6D0008B12B9 /* UINavigationController+safe.m in Sources */,
 				99F4A73D2277D1B8009AA6ED /* YRLoadImgCacheTool.m in Sources */,
 				99F4A73D2277D1B8009AA6ED /* YRLoadImgCacheTool.m in Sources */,
 				99C6FECE227697DA00C7070A /* YRContactVC.m in Sources */,
 				99C6FECE227697DA00C7070A /* YRContactVC.m in Sources */,
 				99C6FEC82276966600C7070A /* YRWebVC.m in Sources */,
 				99C6FEC82276966600C7070A /* YRWebVC.m in Sources */,

+ 0 - 0
UU_Ent/UU_Ent/Modules/Mine/Child/Controllers/YRSettingVC.h → UU_Ent/UU_Ent/Modules/Mine/Child/Setting/Controllers/YRSettingVC.h


+ 0 - 0
UU_Ent/UU_Ent/Modules/Mine/Child/Controllers/YRSettingVC.m → UU_Ent/UU_Ent/Modules/Mine/Child/Setting/Controllers/YRSettingVC.m


+ 134 - 4
UU_Ent/UU_Ent/Modules/Mine/Main/Controllers/YRMineVC.m

@@ -25,14 +25,11 @@
 - (void)viewDidLoad {
 - (void)viewDidLoad {
     [super viewDidLoad];
     [super viewDidLoad];
     // Do any additional setup after loading the view.
     // Do any additional setup after loading the view.
-    self.title = @"我";
     
     
     YRTabBar *tarbar = (YRTabBar *)self.tabBarController.tabBar;
     YRTabBar *tarbar = (YRTabBar *)self.tabBarController.tabBar;
     
     
     [tarbar hideBadgeOnItemIndex:2];
     [tarbar hideBadgeOnItemIndex:2];
     
     
-
-    [self getDataFromServer];
 }
 }
 
 
 
 
@@ -140,6 +137,89 @@
     
     
 }
 }
 
 
+-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
+    return 221+36;
+}
+
+-(CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{
+    return CGFLOAT_MIN;
+}
+
+-(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{
+    
+    UIView *header = [[UIView alloc]initWithFrame:CGRectMake(0, 0, self_width, 221+36)];
+    
+    UIImageView *bg = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, self_width, 221)];
+    bg.image = [UIImage imageNamed:@"UU_newbg4"];
+    [header addSubview:bg];
+    
+    UIImageView *iconView = [[UIImageView alloc]init];
+    iconView.layer.cornerRadius = 47;
+    iconView.layer.masksToBounds = YES;
+    iconView.layer.borderWidth = 3;
+    iconView.layer.borderColor = [UIColor whiteColor].CGColor;
+    [header addSubview:iconView];
+    [iconView mas_makeConstraints:^(MASConstraintMaker *make) {
+        
+        make.centerY.equalTo(bg.mas_bottom).offset(-11);
+        make.centerX.equalTo(header);
+        make.width.height.mas_equalTo(94);
+        
+    }];
+    
+    UILabel *nameLabel = [UILabel new];
+    nameLabel.textColor = [UIColor whiteColor];
+    nameLabel.font = BoldFont_SIZE(20);
+    nameLabel.textAlignment = NSTextAlignmentRight;
+    [header addSubview:nameLabel];
+    
+    UILabel *phoneLabel = [UILabel new];
+    phoneLabel.textColor = [UIColor whiteColor];
+    phoneLabel.font = FONT_SIZE(14);
+    [header addSubview:phoneLabel];
+    
+    UIButton *btn = [UIButton new];
+    [header addSubview:btn];
+    [phoneLabel mas_makeConstraints:^(MASConstraintMaker *make) {
+        
+        make.bottom.equalTo(iconView.mas_top).offset(-20);
+        make.centerX.equalTo(header);
+        make.height.width.greaterThanOrEqualTo(@0);
+        
+    }];
+    [nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
+        
+        make.centerY.equalTo(phoneLabel);
+        make.right.equalTo(phoneLabel.mas_left).offset(-14);
+        make.height.greaterThanOrEqualTo(@0);
+        make.left.equalTo(header);
+    }];
+    [btn mas_makeConstraints:^(MASConstraintMaker *make) {
+        
+        make.left.equalTo(phoneLabel.mas_right).offset(25);
+        make.centerY.equalTo(phoneLabel);
+        make.width.height.mas_equalTo(19);
+        
+    }];
+    
+    NSDictionary *accountDic = [[YRUserInfo shareManager].userInfo objectForKey:@"account"];
+    nameLabel.text = [accountDic objectForKey:@"realname"];
+    phoneLabel.text = u_account;
+    
+    iconView.image = [UIImage imageNamed:@"uu_zhanwei_man"];
+    
+    [btn setBackgroundImage:[UIImage imageNamed:@"UU_newWoedit"] forState:UIControlStateNormal];
+//    [btn addTarget:self action:@selector(editMyData) forControlEvents:UIControlEventTouchUpInside];
+    
+    return header;
+}
+
+-(UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section{
+    
+    return [UIView new];
+    
+}
+
 #pragma mark --- 设置页面
 #pragma mark --- 设置页面
 -(void)setUpUI
 -(void)setUpUI
 {
 {
@@ -150,6 +230,47 @@
         make.edges.equalTo(self.view);
         make.edges.equalTo(self.view);
         
         
     }];
     }];
+    
+    NSArray *homeConfigArr = [[YRUserInfo shareManager].userCompanyInfo objectForKey:@"homeConfigArray"];
+    
+    if (homeConfigArr.count == 0) {
+        
+        [self getDataFromServer];
+        
+    }else{
+        
+        for (id obj in homeConfigArr) {
+            
+            [self.dataArr addObject:[YRMineModel mj_objectWithKeyValues:obj]];
+            
+        }
+        
+        [self.tableView reloadData];
+    }
+    
+    UIButton *meBtn = [UIButton new];
+    meBtn.frame = CGRectMake(0, 5, 60, 30);
+    [meBtn setTitle:@"我" forState:UIControlStateNormal];
+    meBtn.titleLabel.font = FONT_SIZE(18);
+    [meBtn setBackgroundColor:[UIColor clearColor] forState:UIControlStateNormal];
+    meBtn.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft;
+    UIBarButtonItem *leftItem = [[UIBarButtonItem alloc]initWithCustomView: meBtn];
+    self.navigationItem.leftBarButtonItem = leftItem;
+}
+
+#pragma mark --- viewAction
+-(void)viewWillAppear:(BOOL)animated
+{
+    self.navigationController.navigationBar.subviews[0].alpha = 0.0f;
+    
+    [self.navigationController setNeedsNavigationBackground:0.0f];
+}
+
+-(void)viewWillDisappear:(BOOL)animated
+{
+    self.navigationController.navigationBar.subviews[0].alpha = 1.0f;
+    
+    [self.navigationController setNeedsNavigationBackground:1.0f];
 }
 }
 
 
 #pragma mark --- lazy
 #pragma mark --- lazy
@@ -157,12 +278,21 @@
     
     
     if (!_tableView) {
     if (!_tableView) {
         
         
-        _tableView = [[YRTableView alloc]initWithFrame:self.view.frame];
+        _tableView = [[YRTableView alloc]initWithFrame:self.view.frame style:UITableViewStyleGrouped];
         _tableView.delegate = self;
         _tableView.delegate = self;
         _tableView.dataSource = self;
         _tableView.dataSource = self;
         _tableView.tableHeaderView = [UIView new];
         _tableView.tableHeaderView = [UIView new];
         _tableView.tableFooterView = [UIView new];
         _tableView.tableFooterView = [UIView new];
+        _tableView.showsVerticalScrollIndicator = NO;
+        _tableView.showsHorizontalScrollIndicator = NO;
+        _tableView.backgroundColor = [UIColor whiteColor];
+        _tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
         
         
+        CGFloat height = 64;
+        if (statusXLately) {
+            height = 132;
+        }
+        _tableView.contentInset = UIEdgeInsetsMake(-height, 0, 0, 0);
     }
     }
     
     
     return _tableView;
     return _tableView;

+ 23 - 0
UU_Ent/UU_Ent/Supporting Files/Assets.xcassets/Resources/Mine/UU_newWoedit.imageset/Contents.json

@@ -0,0 +1,23 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "filename" : "UU_newWoedit@1x.png",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "UU_newWoedit@2x.png",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "UU_newWoedit@3x.png",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "version" : 1,
+    "author" : "xcode"
+  }
+}

BIN
UU_Ent/UU_Ent/Supporting Files/Assets.xcassets/Resources/Mine/UU_newWoedit.imageset/UU_newWoedit@1x.png


BIN
UU_Ent/UU_Ent/Supporting Files/Assets.xcassets/Resources/Mine/UU_newWoedit.imageset/UU_newWoedit@2x.png


BIN
UU_Ent/UU_Ent/Supporting Files/Assets.xcassets/Resources/Mine/UU_newWoedit.imageset/UU_newWoedit@3x.png


+ 23 - 0
UU_Ent/UU_Ent/Supporting Files/Assets.xcassets/Resources/Mine/UU_newbg4.imageset/Contents.json

@@ -0,0 +1,23 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "filename" : "UU_newbg4@1x.png",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "UU_newbg4@2x.png",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "UU_newbg4@3x.png",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "version" : 1,
+    "author" : "xcode"
+  }
+}

BIN
UU_Ent/UU_Ent/Supporting Files/Assets.xcassets/Resources/Mine/UU_newbg4.imageset/UU_newbg4@1x.png


BIN
UU_Ent/UU_Ent/Supporting Files/Assets.xcassets/Resources/Mine/UU_newbg4.imageset/UU_newbg4@2x.png


BIN
UU_Ent/UU_Ent/Supporting Files/Assets.xcassets/Resources/Mine/UU_newbg4.imageset/UU_newbg4@3x.png


+ 21 - 0
UU_Ent/UU_Ent/Supporting Files/Assets.xcassets/Resources/Mine/uu_zhanwei_man.imageset/Contents.json

@@ -0,0 +1,21 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "filename" : "uu_zhanwei_man.png",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "version" : 1,
+    "author" : "xcode"
+  }
+}

BIN
UU_Ent/UU_Ent/Supporting Files/Assets.xcassets/Resources/Mine/uu_zhanwei_man.imageset/uu_zhanwei_man.png


+ 21 - 0
UU_Ent/UU_Ent/Supporting Files/Assets.xcassets/Resources/Mine/uu_zhanwei_woman.imageset/Contents.json

@@ -0,0 +1,21 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "filename" : "uu_zhanwei_woman.png",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "version" : 1,
+    "author" : "xcode"
+  }
+}

BIN
UU_Ent/UU_Ent/Supporting Files/Assets.xcassets/Resources/Mine/uu_zhanwei_woman.imageset/uu_zhanwei_woman.png


+ 1 - 0
UU_Ent/UU_Ent/Supporting Files/defines/import.h

@@ -30,6 +30,7 @@
 #import "YRBaseNav.h"
 #import "YRBaseNav.h"
 #import "UIPopoverListView.h"
 #import "UIPopoverListView.h"
 #import "YRAlertView.h"
 #import "YRAlertView.h"
+#import "UINavigationController+safe.h"
 
 
 //第三方导入
 //第三方导入
 #import <GRPCClient/GRPCCall+Tests.h>
 #import <GRPCClient/GRPCCall+Tests.h>

+ 2 - 0
UU_Ent/UU_Ent/Supporting Files/defines/macro.h

@@ -38,9 +38,11 @@
 //系统版本
 //系统版本
 #define iOS11Early [[[UIDevice currentDevice] systemVersion] floatValue] < 11.0
 #define iOS11Early [[[UIDevice currentDevice] systemVersion] floatValue] < 11.0
 #define statusXLately [[UIApplication sharedApplication] statusBarFrame].size.height == 44
 #define statusXLately [[UIApplication sharedApplication] statusBarFrame].size.height == 44
+#define iOS11Lately  [[[UIDevice currentDevice] systemVersion] floatValue] >= 11.0
 
 
 //字体
 //字体
 #define FONT_SIZE(size) [UIFont systemFontOfSize:size]
 #define FONT_SIZE(size) [UIFont systemFontOfSize:size]
+#define BoldFont_SIZE(size) [UIFont boldSystemFontOfSize:size]
 
 
 //格式化字符串
 //格式化字符串
 #define FORMAT(fmt, ...) [NSString stringWithFormat:(fmt), ##__VA_ARGS__]
 #define FORMAT(fmt, ...) [NSString stringWithFormat:(fmt), ##__VA_ARGS__]

+ 15 - 0
UU_Ent/UU_Ent/Utils/UINavigation/UINavigationController+safe.h

@@ -0,0 +1,15 @@
+//
+//  UINavigationController+safe.h
+//  shiku_im
+//
+//  Created by ime on 2017/7/4.
+//
+//
+
+#import <UIKit/UIKit.h>
+
+@interface UINavigationController (safe)<UINavigationControllerDelegate>
+
+- (void)setNeedsNavigationBackground:(CGFloat)alpha;
+
+@end

+ 186 - 0
UU_Ent/UU_Ent/Utils/UINavigation/UINavigationController+safe.m

@@ -0,0 +1,186 @@
+//
+//  UINavigationController+safe.m
+//  shiku_im
+//
+//  Created by ime on 2017/7/4.
+//
+//
+
+#import "UINavigationController+safe.h"
+#import <objc/runtime.h>
+
+static char const *const ObjectTagKey = "objectTagKey";
+
+@interface UINavigationController()
+
+@property(readwrite, getter = isViewTransitionInProgress) BOOL viewTransitionInProgress;
+
+@end
+@implementation UINavigationController (safe)
+
+
+- (void)setViewTransitionInProgress:(BOOL)property {
+    
+    NSNumber *number = [NSNumber numberWithBool:property];
+    
+    objc_setAssociatedObject(self, ObjectTagKey, number , OBJC_ASSOCIATION_RETAIN);
+    
+}
+
+- (BOOL)isViewTransitionInProgress {
+    
+    NSNumber *number = objc_getAssociatedObject(self, ObjectTagKey);
+    
+    return   [number boolValue];
+    
+}
+
+
+
+- (NSArray *)safePopToRootViewControllerAnimated:(BOOL)animated {
+    
+    if(self.viewTransitionInProgress)   return    nil;
+    
+    if(animated) {
+        
+        self.viewTransitionInProgress = YES;
+        
+    }
+    
+    
+    return  [self  safePopToRootViewControllerAnimated:animated];
+    
+}
+
+
+- (void)setNeedsNavigationBackground:(CGFloat)alpha {
+   
+    UIView *barBackgroundView = [[self.navigationBar subviews] objectAtIndex:0];
+    UIImageView *backgroundImageView = [[barBackgroundView subviews] objectAtIndex:0];
+    if (self.navigationBar.isTranslucent && iOS11Lately) {
+        if (backgroundImageView != nil && backgroundImageView.image != nil) {
+            barBackgroundView.alpha = alpha;
+        } else {
+            UIView *backgroundEffectView = [[barBackgroundView subviews] objectAtIndex:1];
+            if (backgroundEffectView != nil) {
+                backgroundEffectView.alpha = alpha;
+            }
+        }
+    } else {
+        
+        barBackgroundView.alpha = alpha;
+        
+    }
+    
+    self.navigationBar.clipsToBounds = alpha == 0.0;
+}
+
+
+
+- (NSArray *)safePopToViewController:(UIViewController *)viewController animated:(BOOL)animated {
+    
+    if(self.viewTransitionInProgress)  return  nil;
+    
+    if(animated) {
+        
+        self.viewTransitionInProgress = YES;
+        
+    }
+    
+    return [self   safePopToViewController:viewController animated:animated];
+    
+}
+
+- (UIViewController *)safePopViewControllerAnimated:(BOOL)animated {
+    
+    if(self.viewTransitionInProgress)     return    nil;
+    
+    if(animated) {
+        
+        self.viewTransitionInProgress = YES;
+        
+    }
+    
+    
+    return  [self  safePopViewControllerAnimated:animated];
+    
+}
+
+- (void)safePushViewController:(UIViewController *)viewController animated:(BOOL)animated {
+   
+    
+     if(self.isViewTransitionInProgress ==  NO) {
+        
+        
+        [self  safePushViewController:viewController animated:animated];
+        
+        if(animated) {
+            
+                self.viewTransitionInProgress = YES;
+
+            
+        }
+        
+     }
+}
+
+
+
+- (void)safeDidShowViewController:(UIViewController *)viewController animated:(BOOL)animated {
+    
+    [self  safeDidShowViewController:viewController animated:animated];
+    
+    self.viewTransitionInProgress = NO;
+    
+}
+
+
+- (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated {
+    
+    
+    id topc = navigationController.topViewController.transitionCoordinator;
+    
+    [topc notifyWhenInteractionEndsUsingBlock:^(id context) {
+        
+        self.viewTransitionInProgress = NO;
+        
+        
+        self.interactivePopGestureRecognizer.delegate = (id)viewController;
+        
+        [self.interactivePopGestureRecognizer setEnabled:YES];
+        
+    }];
+    
+    
+    if(navigationController.delegate != self) {
+        
+        [navigationController.delegate navigationController:navigationController
+         
+                                     willShowViewController:viewController
+         
+                                                   animated:animated];
+        
+    }
+    
+}
+
++ (void)load {
+    
+    static dispatch_once_t onceToken;
+    dispatch_once(&onceToken, ^{
+        
+        method_exchangeImplementations(class_getInstanceMethod(self,@selector(pushViewController:animated:)),class_getInstanceMethod(self,@selector(safePushViewController:animated:)));
+
+        method_exchangeImplementations(class_getInstanceMethod(self,@selector(didShowViewController:animated:)),class_getInstanceMethod(self,@selector(safeDidShowViewController:animated:)));
+//        method_exchangeImplementations(class_getInstanceMethod(self,@selector(popViewControllerAnimated:)),class_getInstanceMethod(self,@selector(safePopViewControllerAnimated:)));
+        
+//        method_exchangeImplementations(class_getInstanceMethod(self,@selector(popToRootViewControllerAnimated:)),class_getInstanceMethod(self,@selector(safePopToRootViewControllerAnimated:)));
+        
+//        method_exchangeImplementations(class_getInstanceMethod(self,@selector(popToViewController:animated:)),class_getInstanceMethod(self,@selector(safePopToViewController:animated:)));
+        
+    });
+    
+}
+
+
+@end