time 6 жил өмнө
parent
commit
332f956715
38 өөрчлөгдсөн 1541 нэмэгдсэн , 169 устгасан
  1. 6 3
      UU_Ent/Podfile
  2. 82 0
      UU_Ent/UU_Ent.xcodeproj/project.pbxproj
  3. 22 31
      UU_Ent/UU_Ent/Modules/App/AppDelegate.m
  4. 8 7
      UU_Ent/UU_Ent/Modules/Base/YRBaseNav.m
  5. 2 0
      UU_Ent/UU_Ent/Modules/Base/YRBaseVC.h
  6. 45 1
      UU_Ent/UU_Ent/Modules/Base/YRBaseVC.m
  7. 30 0
      UU_Ent/UU_Ent/Modules/Contacts/Main/Controllers/YRContactVC.m
  8. 17 0
      UU_Ent/UU_Ent/Modules/Home/Main/Controllers/YRHomeVC.h
  9. 154 0
      UU_Ent/UU_Ent/Modules/Home/Main/Controllers/YRHomeVC.m
  10. 17 0
      UU_Ent/UU_Ent/Modules/Home/Main/Views/YRHomeScheHeader.h
  11. 265 0
      UU_Ent/UU_Ent/Modules/Home/Main/Views/YRHomeScheHeader.m
  12. 1 6
      UU_Ent/UU_Ent/Modules/Loading/Main/Controllers/YRLoadingVC.m
  13. 3 1
      UU_Ent/UU_Ent/Modules/Loading/Main/Views/YRCountDownView.m
  14. 33 3
      UU_Ent/UU_Ent/Modules/Login/Main/Controllers/YRLoginVC.m
  15. 2 17
      UU_Ent/UU_Ent/Modules/Login/Main/Others/YRLoginManager.m
  16. 25 13
      UU_Ent/UU_Ent/Modules/Main/Main/Controllers/YRMainVC.m
  17. 74 8
      UU_Ent/UU_Ent/Modules/Main/Main/Views/YRTabBar.m
  18. 17 0
      UU_Ent/UU_Ent/Modules/Main/Main/Views/YRTabbarView.h
  19. 21 0
      UU_Ent/UU_Ent/Modules/Main/Main/Views/YRTabbarView.m
  20. 31 12
      UU_Ent/UU_Ent/Modules/Message/Main/Controllers/YRMsgVC.m
  21. 16 5
      UU_Ent/UU_Ent/Modules/Mine/Main/Controllers/YRMineVC.m
  22. 10 9
      UU_Ent/UU_Ent/Modules/Mine/Main/Others/YRUserInfo.h
  23. 23 1
      UU_Ent/UU_Ent/Modules/Mine/Main/Others/YRUserInfo.m
  24. 131 17
      UU_Ent/UU_Ent/Modules/Web/Main/YRWebVC.m
  25. 5 0
      UU_Ent/UU_Ent/Modules/Work/Main/Controllers/YRWorkVC.h
  26. 43 19
      UU_Ent/UU_Ent/Modules/Work/Main/Controllers/YRWorkVC.m
  27. 6 0
      UU_Ent/UU_Ent/Supporting Files/Assets.xcassets/Resources/Backicon/Contents.json
  28. 23 0
      UU_Ent/UU_Ent/Supporting Files/Assets.xcassets/Resources/Backicon/uu_back_icon.imageset/Contents.json
  29. BIN
      UU_Ent/UU_Ent/Supporting Files/Assets.xcassets/Resources/Backicon/uu_back_icon.imageset/uu_back_icon.png
  30. BIN
      UU_Ent/UU_Ent/Supporting Files/Assets.xcassets/Resources/Backicon/uu_back_icon.imageset/uu_back_icon@2x.png
  31. BIN
      UU_Ent/UU_Ent/Supporting Files/Assets.xcassets/Resources/Backicon/uu_back_icon.imageset/uu_back_icon@3x.png
  32. 5 7
      UU_Ent/UU_Ent/Supporting Files/Info.plist
  33. 3 1
      UU_Ent/UU_Ent/Supporting Files/defines/common.h
  34. 4 2
      UU_Ent/UU_Ent/Utils/UIButton/UIButton+block.m
  35. 1 1
      UU_Ent/UU_Ent/Utils/UIColor/UIColor+HexColor.m
  36. 1 5
      UU_Ent/UU_Ent/Utils/UIPopoverListView/UIPopoverListView.m
  37. 50 0
      UU_Ent/UU_Ent/Utils/WebView/YRWebView.h
  38. 365 0
      UU_Ent/UU_Ent/Utils/WebView/YRWebView.m

+ 6 - 3
UU_Ent/Podfile

@@ -4,9 +4,9 @@
 target 'UU_Ent' do
   # Uncomment the next line if you're using Swift or would like to use dynamic frameworks
   # use_frameworks!
-
-  # Pods for UU_Ent
-  
+    
+    # Pods for UU_Ent
+    
     pod 'UU_Ent', :path => '.'
     pod 'Masonry' 
     pod 'MJExtension'
@@ -17,6 +17,9 @@ target 'UU_Ent' do
     pod 'MBProgressHUD'
     pod 'AFNetworking'
     pod 'DZNEmptyDataSet'
+    pod 'MMDrawerController', '~> 0.5.7'
+    pod 'NSDate+TimeAgo'
+    pod 'JTCalendar', '~> 2.0'
     
   target 'UU_EntTests' do
     inherit! :search_paths

+ 82 - 0
UU_Ent/UU_Ent.xcodeproj/project.pbxproj

@@ -30,11 +30,15 @@
 		991C14762282D89C0080B54A /* publi.txt in Resources */ = {isa = PBXBuildFile; fileRef = 991C14732282D89C0080B54A /* publi.txt */; };
 		991C14792282EFFC0080B54A /* UIButton+Extersion.m in Sources */ = {isa = PBXBuildFile; fileRef = 991C14782282EFFC0080B54A /* UIButton+Extersion.m */; };
 		991C147C2282F0520080B54A /* UIButton+block.m in Sources */ = {isa = PBXBuildFile; fileRef = 991C147A2282F0510080B54A /* UIButton+block.m */; };
+		993F84462330693600E01145 /* YRHomeVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 993F84452330693600E01145 /* YRHomeVC.m */; };
+		993F8449233074B600E01145 /* YRTabbarView.m in Sources */ = {isa = PBXBuildFile; fileRef = 993F8448233074B600E01145 /* YRTabbarView.m */; };
+		993F844C2330D36D00E01145 /* YRHomeScheHeader.m in Sources */ = {isa = PBXBuildFile; fileRef = 993F844B2330D36D00E01145 /* YRHomeScheHeader.m */; };
 		9948171422783494007C7CEA /* msg_route.json in Resources */ = {isa = PBXBuildFile; fileRef = 9948171322783494007C7CEA /* msg_route.json */; };
 		9948171722785013007C7CEA /* YRWorkTabCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 9948171622785013007C7CEA /* YRWorkTabCell.m */; };
 		9948171A22785044007C7CEA /* YRWorkCollCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 9948171922785044007C7CEA /* YRWorkCollCell.m */; };
 		994AC5492283CEE0006FE026 /* YRNavHeaderView.m in Sources */ = {isa = PBXBuildFile; fileRef = 994AC5482283CEE0006FE026 /* YRNavHeaderView.m */; };
 		994AC54C2283FEDC006FE026 /* UINavigationController+alpha.m in Sources */ = {isa = PBXBuildFile; fileRef = 994AC54B2283FEDC006FE026 /* UINavigationController+alpha.m */; };
+		9979E8EC230E87BB00516C77 /* YRWebView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9979E8EB230E87BB00516C77 /* YRWebView.m */; };
 		999F6510227E658E00329012 /* UIView+frame.m in Sources */ = {isa = PBXBuildFile; fileRef = 999F650F227E658E00329012 /* UIView+frame.m */; };
 		999F6513227E664C00329012 /* UIImageView+userId.m in Sources */ = {isa = PBXBuildFile; fileRef = 999F6512227E664C00329012 /* UIImageView+userId.m */; };
 		999F6516227E688600329012 /* UIView+selector.m in Sources */ = {isa = PBXBuildFile; fileRef = 999F6515227E688600329012 /* UIView+selector.m */; };
@@ -204,6 +208,12 @@
 		991C14782282EFFC0080B54A /* UIButton+Extersion.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIButton+Extersion.m"; sourceTree = "<group>"; };
 		991C147A2282F0510080B54A /* UIButton+block.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIButton+block.m"; sourceTree = "<group>"; };
 		991C147B2282F0510080B54A /* UIButton+block.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIButton+block.h"; sourceTree = "<group>"; };
+		993F84442330693600E01145 /* YRHomeVC.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = YRHomeVC.h; sourceTree = "<group>"; };
+		993F84452330693600E01145 /* YRHomeVC.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = YRHomeVC.m; sourceTree = "<group>"; };
+		993F8447233074B600E01145 /* YRTabbarView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = YRTabbarView.h; sourceTree = "<group>"; };
+		993F8448233074B600E01145 /* YRTabbarView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = YRTabbarView.m; sourceTree = "<group>"; };
+		993F844A2330D36D00E01145 /* YRHomeScheHeader.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = YRHomeScheHeader.h; sourceTree = "<group>"; };
+		993F844B2330D36D00E01145 /* YRHomeScheHeader.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = YRHomeScheHeader.m; sourceTree = "<group>"; };
 		994817112278281F007C7CEA /* macro.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = macro.h; sourceTree = "<group>"; };
 		994817122278290A007C7CEA /* import.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = import.h; sourceTree = "<group>"; };
 		9948171322783494007C7CEA /* msg_route.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = msg_route.json; sourceTree = "<group>"; };
@@ -215,6 +225,8 @@
 		994AC5482283CEE0006FE026 /* YRNavHeaderView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = YRNavHeaderView.m; sourceTree = "<group>"; };
 		994AC54A2283FEDC006FE026 /* UINavigationController+alpha.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "UINavigationController+alpha.h"; sourceTree = "<group>"; };
 		994AC54B2283FEDC006FE026 /* UINavigationController+alpha.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "UINavigationController+alpha.m"; sourceTree = "<group>"; };
+		9979E8EA230E87BB00516C77 /* YRWebView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = YRWebView.h; sourceTree = "<group>"; };
+		9979E8EB230E87BB00516C77 /* YRWebView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = YRWebView.m; sourceTree = "<group>"; };
 		999F650E227E658E00329012 /* UIView+frame.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "UIView+frame.h"; sourceTree = "<group>"; };
 		999F650F227E658E00329012 /* UIView+frame.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "UIView+frame.m"; sourceTree = "<group>"; };
 		999F6511227E664C00329012 /* UIImageView+userId.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "UIImageView+userId.h"; sourceTree = "<group>"; };
@@ -578,6 +590,66 @@
 			path = "NSString+secri";
 			sourceTree = "<group>";
 		};
+		993F843E2330691A00E01145 /* Home */ = {
+			isa = PBXGroup;
+			children = (
+				993F843F2330691A00E01145 /* Main */,
+			);
+			path = Home;
+			sourceTree = "<group>";
+		};
+		993F843F2330691A00E01145 /* Main */ = {
+			isa = PBXGroup;
+			children = (
+				993F84402330691A00E01145 /* Others */,
+				993F84412330691A00E01145 /* Models */,
+				993F84422330691A00E01145 /* Controllers */,
+				993F84432330691A00E01145 /* Views */,
+			);
+			path = Main;
+			sourceTree = "<group>";
+		};
+		993F84402330691A00E01145 /* Others */ = {
+			isa = PBXGroup;
+			children = (
+			);
+			path = Others;
+			sourceTree = "<group>";
+		};
+		993F84412330691A00E01145 /* Models */ = {
+			isa = PBXGroup;
+			children = (
+			);
+			path = Models;
+			sourceTree = "<group>";
+		};
+		993F84422330691A00E01145 /* Controllers */ = {
+			isa = PBXGroup;
+			children = (
+				993F84442330693600E01145 /* YRHomeVC.h */,
+				993F84452330693600E01145 /* YRHomeVC.m */,
+			);
+			path = Controllers;
+			sourceTree = "<group>";
+		};
+		993F84432330691A00E01145 /* Views */ = {
+			isa = PBXGroup;
+			children = (
+				993F844A2330D36D00E01145 /* YRHomeScheHeader.h */,
+				993F844B2330D36D00E01145 /* YRHomeScheHeader.m */,
+			);
+			path = Views;
+			sourceTree = "<group>";
+		};
+		9979E8E9230E87AE00516C77 /* WebView */ = {
+			isa = PBXGroup;
+			children = (
+				9979E8EA230E87BB00516C77 /* YRWebView.h */,
+				9979E8EB230E87BB00516C77 /* YRWebView.m */,
+			);
+			path = WebView;
+			sourceTree = "<group>";
+		};
 		999F650C227E656B00329012 /* UIView */ = {
 			isa = PBXGroup;
 			children = (
@@ -727,6 +799,7 @@
 		99C6FE7B22768EC000C7070A /* Modules */ = {
 			isa = PBXGroup;
 			children = (
+				993F843E2330691A00E01145 /* Home */,
 				99F4A7352277CFDD009AA6ED /* Loading */,
 				99C6FE8522768EC000C7070A /* Base */,
 				99C6FE7C22768EC000C7070A /* App */,
@@ -834,6 +907,7 @@
 		99C6FE8D22768EC000C7070A /* Utils */ = {
 			isa = PBXGroup;
 			children = (
+				9979E8E9230E87AE00516C77 /* WebView */,
 				99F3F30522A61ED40061CB23 /* Network */,
 				991C14652282D8100080B54A /* encode */,
 				2710E66B2281744C0002A4B0 /* UIPopoverListView */,
@@ -941,6 +1015,8 @@
 			children = (
 				99C6FECF2276982F00C7070A /* YRTabBar.h */,
 				99C6FED02276982F00C7070A /* YRTabBar.m */,
+				993F8447233074B600E01145 /* YRTabbarView.h */,
+				993F8448233074B600E01145 /* YRTabbarView.m */,
 			);
 			path = Views;
 			sourceTree = "<group>";
@@ -1529,12 +1605,14 @@
 				"${SRCROOT}/Pods/Target Support Files/Pods-UU_Ent/Pods-UU_Ent-resources.sh",
 				"${PODS_ROOT}/IQKeyboardManager/IQKeyboardManager/Resources/IQKeyboardManager.bundle",
 				"${PODS_ROOT}/MJRefresh/MJRefresh/MJRefresh.bundle",
+				"${PODS_ROOT}/NSDate+TimeAgo/NSDateTimeAgo.bundle",
 				"${PODS_CONFIGURATION_BUILD_DIR}/gRPC/gRPCCertificates.bundle",
 			);
 			name = "[CP] Copy Pods Resources";
 			outputPaths = (
 				"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/IQKeyboardManager.bundle",
 				"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/MJRefresh.bundle",
+				"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/NSDateTimeAgo.bundle",
 				"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/gRPCCertificates.bundle",
 			);
 			runOnlyForDeploymentPostprocessing = 0;
@@ -1580,11 +1658,14 @@
 				99C16340227FD24E002ED79D /* YRWorkConModel.m in Sources */,
 				99C0146522964BEB0057D7B2 /* NSString+device.m in Sources */,
 				99C6FF262276FAE000C7070A /* YRMsgMainModel.m in Sources */,
+				993F84462330693600E01145 /* YRHomeVC.m in Sources */,
 				2710E66522815DCF0002A4B0 /* YRMineCell.m in Sources */,
 				99F4A7462277D503009AA6ED /* YRAdView.m in Sources */,
 				99C6FE9222768EC000C7070A /* main.m in Sources */,
 				99C6FE99227690F800C7070A /* YRBaseNav.m in Sources */,
+				993F844C2330D36D00E01145 /* YRHomeScheHeader.m in Sources */,
 				99C6FE96227690BE00C7070A /* YRBaseVC.m in Sources */,
+				9979E8EC230E87BB00516C77 /* YRWebView.m in Sources */,
 				2710E65522801B7E0002A4B0 /* YRRegisterVC.m in Sources */,
 				991C147C2282F0520080B54A /* UIButton+block.m in Sources */,
 				99C6FF172276D13500C7070A /* YRUserInfo.m in Sources */,
@@ -1608,6 +1689,7 @@
 				99B06C7322CDA1A800D21A36 /* YRDocuModel.m in Sources */,
 				99F4A7402277D2DF009AA6ED /* YRLoadingVC.m in Sources */,
 				99F3F30822A61F010061CB23 /* YRNetworkManager.m in Sources */,
+				993F8449233074B600E01145 /* YRTabbarView.m in Sources */,
 				99C6FE8F22768EC000C7070A /* AppDelegate.m in Sources */,
 				999F6516227E688600329012 /* UIView+selector.m in Sources */,
 				999F651E227E6A6000329012 /* NSString+regular.m in Sources */,

+ 22 - 31
UU_Ent/UU_Ent/Modules/App/AppDelegate.m

@@ -53,24 +53,9 @@
             [YRAlertView showWithTitle:@"UU互联" content:errorStr sureTitle:@"确定" cancelTitle:@"" click:^(NSInteger index) {
 
                 [UIView animateWithDuration:0.3f animations:^{
-                   
-                    YRLoginVC *loginVC = [[YRLoginVC alloc]init];
-                    
-                    self.window.rootViewController = loginVC;
-                    
-                    loginVC.completed = ^(BOOL success) {
-                        
-                        YRMainVC *mainVC = [[YRMainVC alloc]init];
-                        
-                        [UIView animateWithDuration:0.3f animations:^{
-                            
-                            self.window.rootViewController = mainVC;
-                            
-                        }];
-                        
-                        
-                    };
-                    
+                 
+                    [self changeToUserLoginVC];
+                 
                 }];
 
 
@@ -83,8 +68,26 @@
         
     }else{
     
+        [self changeToUserLoginVC];
+        
+    }
+    
+    [self.window makeKeyAndVisible];
+    //加载动画结束后
+    [YRAdView startLoad].loadCompleted = ^{
+        
+        
+        
+    };
+    
+}
+
+-(void)changeToUserLoginVC{
+    
     YRLoginVC *loginVC = [[YRLoginVC alloc]init];
     
+    self.window.rootViewController = loginVC;
+    
     loginVC.completed = ^(BOOL success) {
         
         YRMainVC *mainVC = [[YRMainVC alloc]init];
@@ -99,17 +102,6 @@
     };
     
     
-    self.window.rootViewController = loginVC;
-    
-    }
-    
-    [self.window makeKeyAndVisible];
-    //加载动画结束后
-    [YRAdView startLoad].loadCompleted = ^{
-        
-        
-        
-    };
     
 }
 
@@ -118,7 +110,7 @@
  */
 -(void)initializeData{
     
-    [YRUserInfo shareManager].masChanged = YES;
+   
     
 }
 
@@ -155,7 +147,6 @@
     // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
 }
 
-
 - (void)applicationWillTerminate:(UIApplication *)application {
     // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
 }

+ 8 - 7
UU_Ent/UU_Ent/Modules/Base/YRBaseNav.m

@@ -7,7 +7,7 @@
 //
 
 #import "YRBaseNav.h"
-
+#import "YRWorkVC.h"
 @interface YRBaseNav ()
 
 @end
@@ -25,11 +25,14 @@
 -(void)setNavigationBar{
     
     self.navigationBar.tintColor = [UIColor whiteColor];
+    [self.navigationBar setBackIndicatorImage:[[UIImage imageNamed:@"uu_back_icon"] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]];
+    [self.navigationBar setBackIndicatorTransitionMaskImage:[[UIImage imageNamed:@"uu_back_icon"] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]];
     
+    [[UIBarButtonItem appearance] setBackButtonTitlePositionAdjustment:UIOffsetMake(-MIN(SCREEN_WIDTH, SCREEN_HEIGHT), -2) forBarMetrics:UIBarMetricsDefault];
+   
 }
 
 
-
 -(void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated{
     
     if (self.childViewControllers.count > 0) {
@@ -38,18 +41,16 @@
         
         if ([self.childViewControllers[0] isKindOfClass:NSClassFromString(@"YRWorkVC")]) {
             
-            [YRUserInfo shareManager].isSubWork = YES;
+            YRWorkVC *workVC = (YRWorkVC *)self.childViewControllers[0];
+            
+            workVC.isOnChildVC = YES;
             
         }
         
     }
     
-    
     [super pushViewController:viewController animated:animated];
     
 }
 
-
-
-
 @end

+ 2 - 0
UU_Ent/UU_Ent/Modules/Base/YRBaseVC.h

@@ -16,6 +16,8 @@ NS_ASSUME_NONNULL_BEGIN
 
 -(void)setUpUI;
 
+-(void)backAction;
+
 @end
 
 NS_ASSUME_NONNULL_END

+ 45 - 1
UU_Ent/UU_Ent/Modules/Base/YRBaseVC.m

@@ -14,6 +14,7 @@
 
 @implementation YRBaseVC
 
+
 - (void)viewDidLoad {
     [super viewDidLoad];
     // Do any additional setup after loading the view.
@@ -21,6 +22,7 @@
     //处理present的页面
     [self present];
     [self setUpUI];
+   
 }
 
 
@@ -28,14 +30,39 @@
 
 -(void)present{
     
+    
     if (self.presentingViewController) {
-        
+    
         UIBarButtonItem *leftItem = [[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemStop target:self action:@selector(backAction)];
         
         leftItem.tintColor = [UIColor blueColor];
         
         self.navigationItem.leftBarButtonItems = @[leftItem];
         
+    }else if(self.navigationController.childViewControllers.count > 1){
+        
+        
+//        UIButton *backButton = [UIButton buttonWithType:UIButtonTypeSystem];
+//        backButton.frame = CGRectMake(0, 5, 22, 22);
+//        CGFloat imageY = 0;
+//        if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 11.0) {
+//            imageY = 5;
+//        }
+//        UIImageView *image = [[UIImageView alloc]initWithFrame:CGRectMake(0, imageY, 22, 22)];
+//        image.image = [UIImage imageNamed:@"uu_back_icon"];
+//        image.tintColor = [UIColor whiteColor];
+//        [backButton addSubview:image];
+//        [backButton addTarget:self action:@selector(backAction) forControlEvents:UIControlEventTouchUpInside];
+//
+//        UIBarButtonItem *backItem = [[UIBarButtonItem alloc]initWithCustomView:backButton];
+//
+//        backItem.tintColor = [UIColor whiteColor];
+//
+//        self.navigationItem.leftBarButtonItems = @[backItem];
+//
+//        self.navigationController.interactivePopGestureRecognizer.enabled = YES;
+//        self.navigationController.interactivePopGestureRecognizer.delegate = nil;
+        
     }
     
 }
@@ -44,8 +71,19 @@
     
     if (self.presentingViewController) {
         
+        if (self.navigationController.childViewControllers.count > 1) {
+            
+            [self.navigationController popViewControllerAnimated:YES];
+            
+        }else{
+        
         [self dismissViewControllerAnimated:YES completion:nil];
         
+        }
+    }else{
+        
+        [self.navigationController popViewControllerAnimated:YES];
+        
     }
     
 }
@@ -65,4 +103,10 @@
 
 -(void)setValue:(id)value forUndefinedKey:(NSString *)key{}
 
+-(void)dealloc{
+    
+    DLog(@"%@被释放了",self.class);
+    
+}
+
 @end

+ 30 - 0
UU_Ent/UU_Ent/Modules/Contacts/Main/Controllers/YRContactVC.m

@@ -14,10 +14,40 @@
 
 @implementation YRContactVC
 
+- (instancetype)init
+{
+    self = [super init];
+    if (self) {
+        
+        [self addNotification];
+        
+    }
+    return self;
+}
+
 - (void)viewDidLoad {
     [super viewDidLoad];
     // Do any additional setup after loading the view.
     self.title = @"联系人";
 }
 
+-(void)addNotification{
+    
+     //切换账套
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(loadData) name:kYRUserMasterChangedNotification object:nil];
+    
+}
+
+-(void)loadData{
+    
+    DLog(@"这里是通讯录的数据刷新");
+    
+}
+
+-(void)dealloc{
+     //切换账套
+    [[NSNotificationCenter defaultCenter] removeObserver:self name:kYRUserMasterChangedNotification object:nil];
+    
+}
+
 @end

+ 17 - 0
UU_Ent/UU_Ent/Modules/Home/Main/Controllers/YRHomeVC.h

@@ -0,0 +1,17 @@
+//
+//  YRHomeVC.h
+//  UU_Ent
+//
+//  Created by liujl on 2019/9/17.
+//  Copyright © 2019 UAS. All rights reserved.
+//
+
+#import "YRBaseVC.h"
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface YRHomeVC : YRBaseVC
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 154 - 0
UU_Ent/UU_Ent/Modules/Home/Main/Controllers/YRHomeVC.m

@@ -0,0 +1,154 @@
+//
+//  YRHomeVC.m
+//  UU_Ent
+//
+//  Created by liujl on 2019/9/17.
+//  Copyright © 2019 UAS. All rights reserved.
+//
+
+#import "YRHomeVC.h"
+#import "YRHomeScheHeader.h"
+@interface YRHomeVC ()<UITableViewDelegate,UITableViewDataSource>
+
+@property(strong,nonatomic)YRTableView *tableView;
+
+@property(strong,nonatomic)NSMutableArray *dataArr;
+
+@end
+
+@implementation YRHomeVC
+
+- (void)viewDidLoad {
+    [super viewDidLoad];
+    // Do any additional setup after loading the view.
+    
+    
+}
+
+-(void)setUpUI{
+    
+    self.navigationController.navigationBar.hidden = YES;
+    
+    [self.view addSubview:self.tableView];
+    
+}
+
+
+#pragma mark - delegate && dataSource
+
+-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
+    
+    return self.dataArr.count;
+    
+}
+
+-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
+    
+    return 2;
+    
+}
+
+-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
+    
+    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"YRUITableViewCellReid"];
+    
+    if (!cell) {
+        
+        cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"YRUITableViewCellReid"];
+        cell.selectionStyle = UITableViewCellSelectionStyleNone;
+    }
+    
+    
+    return cell;
+}
+
+
+-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
+    
+    if (indexPath.section == 0) {
+        
+        return 40;
+        
+    }
+    
+    return 66;
+    
+}
+
+-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
+    
+    if (section == 0) {
+        
+        return 330;
+        
+    }else{
+        
+        return 10;
+        
+    }
+    
+}
+
+-(CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{
+    
+    return CGFLOAT_MIN;
+    
+}
+
+-(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{
+    
+    if (section == 0) {
+        
+        return [YRHomeScheHeader new];
+        
+    }
+    
+    return [UIView new];
+    
+}
+
+-(UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section{
+    
+    return [UIView new];
+    
+}
+
+-(YRTableView *)tableView{
+    
+    if (!_tableView) {
+        
+        _tableView = [[YRTableView alloc]initWithFrame:self.view.frame style:UITableViewStyleGrouped];
+        _tableView.delegate = self;
+        _tableView.dataSource = self;
+        _tableView.autoNoDataSet = NO;
+        _tableView.showsVerticalScrollIndicator = NO;
+        CGFloat height = [UIApplication sharedApplication].statusBarFrame.size.height;
+        _tableView.contentInset =  UIEdgeInsetsMake(-height, 0, 0, 0);
+        
+    }
+    
+    return _tableView;
+}
+
+-(NSMutableArray *)dataArr{
+    
+    if (!_dataArr) {
+        
+        _dataArr = [[NSMutableArray alloc]init];
+        [_dataArr addObject:@""];
+        [_dataArr addObject:@""];
+        [_dataArr addObject:@""];
+        [_dataArr addObject:@""];
+        
+    }
+    
+    return _dataArr;
+}
+
+-(void)dealloc{
+    //切换账套
+    [[NSNotificationCenter defaultCenter] removeObserver:self name:kYRUserMasterChangedNotification object:nil];
+    
+}
+
+@end

+ 17 - 0
UU_Ent/UU_Ent/Modules/Home/Main/Views/YRHomeScheHeader.h

@@ -0,0 +1,17 @@
+//
+//  YRHomeScheHeader.h
+//  UU_Ent
+//
+//  Created by liujl on 2019/9/17.
+//  Copyright © 2019 UAS. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface YRHomeScheHeader : UIView
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 265 - 0
UU_Ent/UU_Ent/Modules/Home/Main/Views/YRHomeScheHeader.m

@@ -0,0 +1,265 @@
+//
+//  YRHomeScheHeader.m
+//  UU_Ent
+//
+//  Created by liujl on 2019/9/17.
+//  Copyright © 2019 UAS. All rights reserved.
+//
+
+#import "YRHomeScheHeader.h"
+#import <JTCalendar.h>
+
+@interface YRHomeScheHeader()<JTCalendarDelegate>{
+    
+    NSMutableDictionary *_eventsByDate;
+    
+    NSDate *_dateSelected;
+}
+
+
+@property (strong, nonatomic) JTCalendarMenuView *calendarMenuView;
+@property (strong, nonatomic) JTHorizontalCalendarView *calendarContentView;
+
+@property (strong, nonatomic) JTCalendarManager *calendarManager;
+
+
+@end
+
+@implementation YRHomeScheHeader
+
+- (instancetype)init
+{
+    self = [super init];
+    if (self) {
+        
+        [self createUI];
+        
+    }
+    return self;
+}
+
+-(void)createUI{
+    
+    self.backgroundColor = [UIColor whiteColor];
+    
+    UIView *topView = [UIView new];
+    
+    topView.backgroundColor = [UIColor lightTextColor];
+    
+    [self addSubview:topView];
+    
+    [topView mas_makeConstraints:^(MASConstraintMaker *make) {
+       
+        make.top.left.right.equalTo(self);
+        make.height.mas_equalTo(20);
+        
+    }];
+    
+    self.calendarMenuView = [JTCalendarMenuView new];
+    [self addSubview:self.calendarMenuView];
+    
+    [self.calendarMenuView mas_makeConstraints:^(MASConstraintMaker *make) {
+       
+        make.top.equalTo(topView.mas_bottom);
+        make.left.right.equalTo(self);
+        make.height.mas_equalTo(40);
+        
+    }];
+    
+    self.calendarContentView = [JTHorizontalCalendarView new];
+    self.calendarContentView.backgroundColor = [UIColor whiteColor];
+    [self addSubview:self.calendarContentView];
+    
+    [self.calendarContentView mas_makeConstraints:^(MASConstraintMaker *make) {
+       
+        make.top.equalTo(self.calendarMenuView.mas_bottom);
+        make.left.right.bottom.equalTo(self);
+        
+    }];
+    
+    self.calendarManager = [JTCalendarManager new];
+    self.calendarManager.delegate = self;
+    
+    self.calendarMenuView.contentRatio = .75;
+    self.calendarManager.settings.weekDayFormat = JTCalendarWeekDayFormatSingle;
+    self.calendarManager.dateHelper.calendar.locale = [NSLocale localeWithLocaleIdentifier:@"zh_Hans"];
+    
+    [self.calendarManager setMenuView:self.calendarMenuView];
+    [self.calendarManager setContentView:self.calendarContentView];
+    [self.calendarManager setDate:[NSDate date]];
+    
+}
+
+
+#pragma mark - CalendarManager delegate
+
+// Exemple of implementation of prepareDayView method
+// Used to customize the appearance of dayView
+- (void)calendar:(JTCalendarManager *)calendar prepareDayView:(JTCalendarDayView *)dayView
+{
+    dayView.hidden = NO;
+    
+    // Other month
+    if([dayView isFromAnotherMonth]){
+        dayView.hidden = YES;
+    }
+    // Today
+    else if([_calendarManager.dateHelper date:[NSDate date] isTheSameDayThan:dayView.date]){
+        dayView.circleView.hidden = NO;
+        dayView.circleView.backgroundColor = [UIColor blueColor];
+        dayView.dotView.backgroundColor = [UIColor whiteColor];
+        dayView.textLabel.textColor = [UIColor whiteColor];
+    }
+    // Selected date
+    else if(_dateSelected && [_calendarManager.dateHelper date:_dateSelected isTheSameDayThan:dayView.date]){
+        dayView.circleView.hidden = NO;
+        dayView.circleView.backgroundColor = [UIColor redColor];
+        dayView.dotView.backgroundColor = [UIColor yellowColor];
+        dayView.textLabel.textColor = [UIColor whiteColor];
+    }
+    // Another day of the current month
+    else{
+        dayView.circleView.hidden = YES;
+        dayView.dotView.backgroundColor = [UIColor redColor];
+        dayView.textLabel.textColor = [UIColor blackColor];
+    }
+    
+    if([self haveEventForDay:dayView.date]){
+        dayView.dotView.hidden = NO;
+    }
+    else{
+        dayView.dotView.hidden = NO;
+    }
+}
+
+- (void)calendar:(JTCalendarManager *)calendar didTouchDayView:(JTCalendarDayView *)dayView
+{
+    _dateSelected = dayView.date;
+    
+    // Animation for the circleView
+    dayView.circleView.transform = CGAffineTransformScale(CGAffineTransformIdentity, 0.1, 0.1);
+    [UIView transitionWithView:dayView
+                      duration:.3
+                       options:0
+                    animations:^{
+                        dayView.circleView.transform = CGAffineTransformIdentity;
+                        [_calendarManager reload];
+                    } completion:nil];
+    
+    
+    // Don't change page in week mode because block the selection of days in first and last weeks of the month
+    if(_calendarManager.settings.weekModeEnabled){
+        return;
+    }
+    
+    // Load the previous or next page if touch a day from another month
+    
+    if(![_calendarManager.dateHelper date:_calendarContentView.date isTheSameMonthThan:dayView.date]){
+        if([_calendarContentView.date compare:dayView.date] == NSOrderedAscending){
+            [_calendarContentView loadNextPageWithAnimation];
+        }
+        else{
+            [_calendarContentView loadPreviousPageWithAnimation];
+        }
+    }
+}
+
+#pragma mark - Views customization
+
+- (UIView *)calendarBuildMenuItemView:(JTCalendarManager *)calendar
+{
+    UILabel *label = [UILabel new];
+    
+    label.textAlignment = NSTextAlignmentCenter;
+    label.font = [UIFont fontWithName:@"Avenir-Medium" size:12];
+    
+    return label;
+}
+
+- (void)calendar:(JTCalendarManager *)calendar prepareMenuItemView:(UILabel *)menuItemView date:(NSDate *)date
+{
+    static NSDateFormatter *dateFormatter;
+    if(!dateFormatter){
+        dateFormatter = [NSDateFormatter new];
+        dateFormatter.dateFormat = @"MMMM yyyy";
+        
+        dateFormatter.locale = _calendarManager.dateHelper.calendar.locale;
+        dateFormatter.timeZone = _calendarManager.dateHelper.calendar.timeZone;
+    }
+    
+    menuItemView.text = [dateFormatter stringFromDate:date];
+}
+
+- (UIView<JTCalendarWeekDay> *)calendarBuildWeekDayView:(JTCalendarManager *)calendar
+{
+    JTCalendarWeekDayView *view = [JTCalendarWeekDayView new];
+    
+    for(UILabel *label in view.dayViews){
+        label.textColor = [UIColor blackColor];
+        label.font = [UIFont fontWithName:@"Avenir-Light" size:14];
+    }
+    
+    return view;
+}
+
+- (UIView<JTCalendarDay> *)calendarBuildDayView:(JTCalendarManager *)calendar
+{
+    JTCalendarDayView *view = [JTCalendarDayView new];
+    
+    view.textLabel.font = [UIFont fontWithName:@"Avenir-Light" size:14];
+    
+    view.circleRatio = .8;
+    view.dotRatio = 1. / .9;
+    
+    return view;
+}
+
+#pragma mark - Fake data
+
+// Used only to have a key for _eventsByDate
+- (NSDateFormatter *)dateFormatter
+{
+    static NSDateFormatter *dateFormatter;
+    if(!dateFormatter){
+        dateFormatter = [NSDateFormatter new];
+        dateFormatter.dateFormat = @"dd-MM-yyyy";
+    }
+    
+    return dateFormatter;
+}
+
+- (BOOL)haveEventForDay:(NSDate *)date
+{
+    NSString *key = [[self dateFormatter] stringFromDate:date];
+    
+    NSMutableArray *arr = _eventsByDate[key];
+    
+    if(arr && [arr count] > 0){
+        return YES;
+    }
+    
+    return NO;
+    
+}
+
+- (void)createRandomEvents
+{
+    _eventsByDate = [NSMutableDictionary new];
+    
+    for(int i = 0; i < 30; ++i){
+        // Generate 30 random dates between now and 60 days later
+        NSDate *randomDate = [NSDate dateWithTimeInterval:(rand() % (3600 * 24 * 60)) sinceDate:[NSDate date]];
+        
+        // Use the date as key for eventsByDate
+        NSString *key = [[self dateFormatter] stringFromDate:randomDate];
+        
+        if(!_eventsByDate[key]){
+            _eventsByDate[key] = [NSMutableArray new];
+        }
+        
+        [_eventsByDate[key] addObject:randomDate];
+    }
+}
+
+
+@end

+ 1 - 6
UU_Ent/UU_Ent/Modules/Loading/Main/Controllers/YRLoadingVC.m

@@ -95,7 +95,6 @@
             });
             
             
-            
         }else if(imageArr.count == 1){
             
            
@@ -142,7 +141,6 @@
             
             [self.view addSubview:countView];
             
-            
         }
         
     
@@ -150,9 +148,6 @@
 }
 
 
-
-
-
 - (void)didReceiveMemoryWarning {
     [super didReceiveMemoryWarning];
     // Dispose of any resources that can be recreated.
@@ -162,7 +157,7 @@
 
 -(void)dealloc{
     
-
+    
     
 }
 

+ 3 - 1
UU_Ent/UU_Ent/Modules/Loading/Main/Views/YRCountDownView.m

@@ -111,8 +111,10 @@
     
     [self.timer invalidate];
     self.timer = nil;
+    [self removeFromSuperview];
+    @weakify(self)
     if (self.completed) {
-        
+        @strongify(self)
         self.completed();
         
     }

+ 33 - 3
UU_Ent/UU_Ent/Modules/Login/Main/Controllers/YRLoginVC.m

@@ -11,7 +11,7 @@
 #import "YRRegisterVC.h"
 #import "YRLoginManager.h"
 #import "YRMainVC.h"
-
+#import "YRWebVC.h"
 @interface YRLoginVC ()<UITextFieldDelegate,UIPopoverListViewDelegate,UIPopoverListViewDataSource>
 @property (nonatomic,strong) UIScrollView *scrollView;
 @property (nonatomic,strong) UITextField *passwordTF;
@@ -23,6 +23,17 @@
 
 @implementation YRLoginVC
 
+- (instancetype)init
+{
+    self = [super init];
+    if (self) {
+        
+        [self regesterNotification];
+        
+    }
+    return self;
+}
+
 - (void)viewDidLoad {
     [super viewDidLoad];
     // Do any additional setup after loading the view.
@@ -30,6 +41,12 @@
 }
 
 
+-(void)regesterNotification{
+    
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(shouldShowAdview) name:@"YRLoadAdViewHadBeenClicked" object:nil];
+    
+}
+
 #pragma mark --- 登录操作
 -(void)loginAction
 {
@@ -292,7 +309,6 @@
     _phoneTF.text = [NSString encodeSeciWithStr:FORMAT(@"%@",[[NSUserDefaults standardUserDefaults] objectForKey:@"userAccount"])];
     
     
-    
     _passwordTF = [[UITextField alloc] initWithFrame:CGRectMake(CGRectGetMaxX(password.frame)+14, 0, self_width-90, 50)];
     _passwordTF.delegate = self;
     _passwordTF.autocorrectionType = UITextAutocorrectionTypeNo;
@@ -324,7 +340,21 @@
     [self.scrollView addSubview:registerBtn];
     [registerBtn addTarget:self action:@selector(registerAction) forControlEvents:UIControlEventTouchUpInside];
     
-//    [self loginAction];
+
+}
+
+//显示广告页
+-(void)shouldShowAdview{
+    
+    YRWebVC *webVC = [YRWebVC new];
+    
+    webVC.url = @"https://sso.ubtob.com/register/enterpriseRegistration?inviteUserUU=1000001353&inviteSpaceUU=10050002&invitationTime=20190426";
+    
+    YRBaseNav *nav = [[YRBaseNav alloc]initWithRootViewController:webVC];
+    
+    [self presentViewController:nav animated:YES completion:nil];
+    
+    
 }
 
 #pragma mark --- lazy

+ 2 - 17
UU_Ent/UU_Ent/Modules/Login/Main/Others/YRLoginManager.m

@@ -34,16 +34,7 @@
     }
     //登录管理平台
     [self userLoginWithPhone:phone passWord:pwd success:^(AccountSigninResponse * _Nullable response) {
-        //只有一家公司,不用再选择账套
-        if (response.companyArray.count == 1) {
-            
-            if (success) {
-                
-                success();
-                
-            }
-            
-        }else{
+        
             //登录公司
             [self companyLoginWithCompanyInfo:[YRUserInfo shareManager].lastCompanyInfo success:^(SwitchCompanyResponse * _Nullable response) {
                 
@@ -70,8 +61,7 @@
                 }
                 
             }];
-            
-        }
+        
         
     } failure:^(AccountSigninResponse * _Nullable response, NSError * _Nullable error) {
         
@@ -121,8 +111,6 @@
         
         if (response.responseHeader.success) {
             
-            [YRUserInfo shareManager].masChanged = YES;
-            
             NSDictionary *resDic = response.mj_keyValues;
             
             [YRUserInfo shareManager].token = response.authedToken.token;
@@ -184,8 +172,6 @@
         
         if (response.responseHeader.success) {
             
-            [YRUserInfo shareManager].masChanged = YES;
-            
             NSDictionary *resDic = response.mj_keyValues;
             
             [YRUserInfo shareManager].token = response.authedToken.token;
@@ -256,7 +242,6 @@
             
         }
         
-        
     }];
     
     call.requestHeaders[@"authentication"] = [YRUserInfo shareManager].token;

+ 25 - 13
UU_Ent/UU_Ent/Modules/Main/Main/Controllers/YRMainVC.m

@@ -11,8 +11,10 @@
 #import "YRBaseNav.h"
 #import "YRMsgVC.h"
 #import "YRContactVC.h"
+#import "YRHomeVC.h"
 #import "YRWorkVC.h"
 #import "YRMineVC.h"
+
 @interface YRMainVC ()<UITabBarDelegate,UITabBarControllerDelegate>
 
 @property(strong,nonatomic)NSMutableArray<UIView *> *tarArr;
@@ -29,6 +31,8 @@
     
     [self addChildControllers];
     
+    self.selectedIndex = 2;
+    
 }
 
 -(void)setTarbar{
@@ -48,16 +52,17 @@
 
 -(void)addChildControllers{
     
-    YRMsgVC *msgVc = [YRMsgVC new];
-    YRContactVC *conVc = [YRContactVC new];
-    YRWorkVC *workVc = [YRWorkVC new];
-    YRMineVC *mineVc = [YRMineVC new];
+    YRMsgVC *msgVC = [YRMsgVC new];
+    YRContactVC *conVC = [YRContactVC new];
+    YRHomeVC *homeVC = [YRHomeVC new];
+    YRWorkVC *workVC = [YRWorkVC new];
+    YRMineVC *mineVC = [YRMineVC new];
     
-    [self subVcWith:msgVc title:@"消息" normalImgTitle:@"UU_TabMes_nor" selImgTitle:@"UU_TabMes_select"];
-    [self subVcWith:conVc title:@"联系人" normalImgTitle:@"UU_TabContact_nor" selImgTitle:@"UU_TabContact_select"];
-    [self subVcWith:workVc title:@"工作" normalImgTitle:@"UU_TabWork_nor" selImgTitle:@"UU_TabWork_select"];
-    [self subVcWith:mineVc title:@"我" normalImgTitle:@"UU_TabMe_nor" selImgTitle:@"UU_TabMe_select"];
-   
+    [self subVcWith:msgVC title:@"消息" normalImgTitle:@"UU_TabMes_nor" selImgTitle:@"UU_TabMes_select"];
+    [self subVcWith:conVC title:@"联系人" normalImgTitle:@"UU_TabContact_nor" selImgTitle:@"UU_TabContact_select"];
+    [self subVcWith:homeVC title:@"首页" normalImgTitle:@"UU_TabMes_nor" selImgTitle:@"UU_TabContact_select"];
+    [self subVcWith:workVC title:@"工作" normalImgTitle:@"UU_TabWork_nor" selImgTitle:@"UU_TabWork_select"];
+    [self subVcWith:mineVC title:@"我" normalImgTitle:@"UU_TabMe_nor" selImgTitle:@"UU_TabMe_select"];
     
 }
 
@@ -70,8 +75,8 @@
     vc.tabBarItem.title = title;
     vc.tabBarItem.image = norImg;
     vc.tabBarItem.selectedImage = selImg;
-   
-     YRBaseNav *basNav = [[YRBaseNav alloc]initWithRootViewController:vc];
+    
+    YRBaseNav *basNav = [[YRBaseNav alloc]initWithRootViewController:vc];
     [self addChildViewController:basNav];
     
     
@@ -79,7 +84,6 @@
 
 -(void)tabBar:(UITabBar *)tabBar didSelectItem:(UITabBarItem *)item{
     
-   
     
     if (self.tarArr == nil || self.tarArr.count != self.tabBar.items.count) {
         
@@ -111,9 +115,17 @@
         
     }
     
+    float startScale = 0.5f;
+    
+    if (index == self.tabBar.items.count/2) {
+        
+        startScale = 0.66f;
+        
+    }
+    
     //缩放动画
     CABasicAnimation *anima = [CABasicAnimation animationWithKeyPath:@"transform.scale"];
-    anima.fromValue = [NSNumber numberWithFloat:0.5f];
+    anima.fromValue = [NSNumber numberWithFloat:startScale];
     anima.toValue = [NSNumber numberWithFloat:1.0f];
     anima.duration = 0.3f;
     anima.repeatCount = 1;

+ 74 - 8
UU_Ent/UU_Ent/Modules/Main/Main/Views/YRTabBar.m

@@ -7,14 +7,11 @@
 //
 
 #import "YRTabBar.h"
-
+#import "YRTabbarView.h"
 @interface YRTabBar ()
 
 @property(strong,nonatomic)NSMutableArray<UILabel *> *labArr;
 
-@property(assign,atomic)BOOL isExist;
-
-
 @end
 
 @implementation YRTabBar
@@ -29,8 +26,8 @@
 
 -(void)addRemindView{
     
-    if (self.isExist) return;
-    self.isExist = YES;
+    if (self.labArr.count == self.items.count) return;
+    [self.labArr removeAllObjects];
     
     NSInteger index = 0;
     
@@ -66,6 +63,27 @@
                         
                     }else{
                         
+                        if (index == self.items.count/2) {
+                            //隐藏原有的图片
+                            viewOne.hidden = YES;
+                            
+                            YRTabbarView *centerView = [[YRTabbarView alloc]initWithFrame:CGRectMake(0, -20, 50, 50)];
+                            
+                            centerView.x = view.width/2-centerView.width/2;
+                            
+                            centerView.layer.cornerRadius = 25;
+                            
+                            centerView.layer.masksToBounds = YES;
+                            
+                            centerView.backgroundColor = HexColor(@"#4682CB");
+                            
+                            [view addSubview:centerView];
+                            
+                            centerView.userInteractionEnabled = NO;
+                            
+                            
+                        }else{
+                        
                         label.layer.cornerRadius = 5;
                         label.layer.masksToBounds = YES;
                         
@@ -79,6 +97,8 @@
                             
                         }];
                         
+                        }
+                        
                     }
                     index++;
                     label.hidden = YES;
@@ -96,7 +116,7 @@
 
 - (void)showBadgeOnItemIndex:(int)index{
 
-    if (index >= self.items.count) return;
+    if (index >= self.labArr.count || index >= self.items.count) return;
     
     self.labArr[index].hidden = NO;
     
@@ -104,7 +124,7 @@
 
 - (void)hideBadgeOnItemIndex:(int)index{
     
-    if (index >= self.items.count) return;
+    if (index >= self.labArr.count || index >= self.items.count) return;
     
     self.labArr[index].hidden = YES;
     
@@ -150,4 +170,50 @@
     return _labArr;
 }
 
+
+////处理超过视图边距的点击
+-(UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event{
+    
+    UIView *view = [super hitTest:point withEvent:event];
+    
+    if (view == nil) {
+        
+        for (UIView *subView in self.subviews) {
+            
+            CGPoint pointHit = [subView convertPoint:point fromView:self];
+            
+            if (CGRectContainsPoint(subView.bounds, pointHit)) {
+                
+                return subView;
+                
+            }
+            
+            
+        }
+        
+        for (UIView *subView in self.subviews) {
+            
+            CGPoint pointHit = [subView convertPoint:point fromView:self];
+            
+            for (UIView *imaView in subView.subviews) {
+                
+               pointHit = [imaView convertPoint:pointHit fromView:subView];
+                
+                if (CGRectContainsPoint(imaView.bounds, pointHit)) {
+                    
+                    return subView;
+                    
+                }
+                
+            }
+            
+        }
+        
+        
+    }
+    
+    return view;
+    
+}
+
 @end

+ 17 - 0
UU_Ent/UU_Ent/Modules/Main/Main/Views/YRTabbarView.h

@@ -0,0 +1,17 @@
+//
+//  YRTabbarView.h
+//  UU_Ent
+//
+//  Created by liujl on 2019/9/17.
+//  Copyright © 2019 UAS. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface YRTabbarView : UIButton
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 21 - 0
UU_Ent/UU_Ent/Modules/Main/Main/Views/YRTabbarView.m

@@ -0,0 +1,21 @@
+//
+//  YRTabbarView.m
+//  UU_Ent
+//
+//  Created by liujl on 2019/9/17.
+//  Copyright © 2019 UAS. All rights reserved.
+//
+
+#import "YRTabbarView.h"
+
+@implementation YRTabbarView
+
+-(void)drawRect:(CGRect)rect{
+    
+    [@"U" drawInRect:CGRectMake(rect.size.width/2-11, 8, 30, 30) withAttributes:@{NSForegroundColorAttributeName:[UIColor whiteColor], NSFontAttributeName:[UIFont systemFontOfSize:30]}];
+    
+}
+
+
+
+@end

+ 31 - 12
UU_Ent/UU_Ent/Modules/Message/Main/Controllers/YRMsgVC.m

@@ -40,6 +40,17 @@
 
 @implementation YRMsgVC
 
+- (instancetype)init
+{
+    self = [super init];
+    if (self) {
+        
+        [self regesterNotification];
+        
+    }
+    return self;
+}
+
 - (void)viewDidLoad {
     [super viewDidLoad];
     // Do any additional setup after loading the view.
@@ -50,8 +61,6 @@
     
     [super viewWillAppear:animated];
     
-    [self loadData];
-    
     [self setNavigationBarBackgroundImageWithAppear:YES];
     
 }
@@ -62,8 +71,6 @@
     
     [self setNavigationBar];
     
-    [self regesterNotification];
-    
     [self.view addSubview:self.tableView];
     [self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
        
@@ -73,6 +80,8 @@
     
     
     [self setUpHeaderView];
+    
+    [self loadData];
 
 }
 
@@ -88,6 +97,8 @@
     
 }
 
+
+
 -(void)setNavigationBarBackgroundImageWithAppear:(BOOL)appear{
     
     if (appear) {
@@ -190,6 +201,9 @@
     
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(shouldShowAdview) name:@"YRLoadAdViewHadBeenClicked" object:nil];
     
+    //切换账套
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(loadData) name:kYRUserMasterChangedNotification object:nil];
+    
 }
 
 -(void)shouldShowAdview{
@@ -206,7 +220,8 @@
 
 -(void)loadData{
     
-    if ([YRUserInfo shareManager].masChanged) {
+    
+        DLog(@"这里是消息的数据刷新");
         
         NSDictionary *comDic = [YRUserInfo shareManager].userCompanyInfo;
         
@@ -222,7 +237,7 @@
                     
                     if ([model.code isEqualToString:FORMAT(@"%@",unDic[@"code"])]) {
                         
-                        model.remindCount = [unDic[@"count"] integerValue]+arc4random_uniform(20);
+                        model.remindCount = [unDic[@"count"] integerValue]+arc4random_uniform(100);
                         
                     }
                     
@@ -239,8 +254,7 @@
         [self getDataFromServer];
         
         }
-        
-    }
+    
     
 }
 
@@ -303,7 +317,7 @@
               
               if ([model.code isEqualToString:msgUn.code]) {
                   
-                  model.remindCount = msgUn.count+arc4random_uniform(20);
+                  model.remindCount = msgUn.count+arc4random_uniform(100);
                   
               }
               
@@ -461,8 +475,6 @@
                 self.headerView.hidden = YES;
                 self.rigBtn.userInteractionEnabled = YES;
                 
-                
-                
             }];
             
             
@@ -497,12 +509,13 @@
         _tableView = [[YRTableView alloc]initWithFrame:self.view.frame];
         _tableView.delegate = self;
         _tableView.dataSource = self;
+        _tableView.autoNoDataSet = NO;
         _tableView.tableHeaderView = [UIView new];
         _tableView.tableFooterView = [UIView new];
         @weakify(self)
         _tableView.mj_header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{
             @strongify(self)
-                       
+            
             [self getDataFromServer];
             
         }];
@@ -523,4 +536,10 @@
     return _dataArr;
 }
 
+-(void)dealloc{
+     //切换账套
+    [[NSNotificationCenter defaultCenter] removeObserver:self name:kYRUserMasterChangedNotification object:nil];
+    
+}
+
 @end

+ 16 - 5
UU_Ent/UU_Ent/Modules/Mine/Main/Controllers/YRMineVC.m

@@ -117,6 +117,7 @@
         }
         
         else{
+            
             YRBaseVC *VC = (YRBaseVC *)[[NSClassFromString(model.desVC) alloc]init];
             
             if (!VC) {//出现异常
@@ -296,16 +297,19 @@
 
 -(void)loginCompanyAction:(NSDictionary *)dic
 {
-    [MBProgressHUD showHUDAddedTo:self.view animated:YES];
+    [MBProgressHUD showHUDAddedTo:self.tabBarController.view animated:YES];
     
     [YRLoginManager companyLoginWithCompanyInfo:dic success:^(SwitchCompanyResponse * _Nullable response) {
         
-        [MBProgressHUD hideHUDForView:self.view animated:YES];
+        [MBProgressHUD hideHUDForView:self.tabBarController.view animated:YES];
         
         [self.tableView reloadData];
+         //切换账套成功
+        [[NSNotificationCenter defaultCenter] postNotificationName:kYRUserMasterChangedNotification object:nil];
         
     } failure:^(SwitchCompanyResponse * _Nullable response, NSError * _Nullable error) {
         
+        [MBProgressHUD hideHUDForView:self.tabBarController.view animated:YES];
         //提示错误信息
         [YRShowMessageFromNavi showDropViewWithMessage:response.responseHeader.message ToNavi:self.navigationController withColor:nil];
     }];
@@ -334,7 +338,6 @@
     }else{
         
         NSDictionary *dic = @{
-                              @"androidWidget":@"",
                               @"androidWidget":@"",
                               @"icon":@"icon_setting",
                               @"id_p":@2,
@@ -366,23 +369,25 @@
     
     [self.navigationController.navigationBar setTitleTextAttributes:@{NSForegroundColorAttributeName : [UIColor whiteColor],NSFontAttributeName:[UIFont boldSystemFontOfSize:17.0]}];
     
-    
 }
 
 #pragma mark --- viewAction
 -(void)viewWillAppear:(BOOL)animated
 {
-    
+    [super viewWillAppear:animated];
     [self.navigationController.navigationBar setBackgroundImage:[UIImage imageNamed:@""] forBarMetrics: UIBarMetricsDefault];
     
     self.navigationController.navigationBar.subviews[0].alpha = 0.0f;
     
     [self.navigationController setNeedsNavigationBackground:0.0f];
+    
 }
 
 -(void)viewWillDisappear:(BOOL)animated
 {
     
+    [super viewWillDisappear:animated];
+    
     if (statusXLately) {
         
         [self.navigationController.navigationBar setBackgroundImage:[UIImage imageNamed:@"U_newNarbgX"] forBarMetrics:UIBarMetricsDefault];
@@ -396,6 +401,7 @@
     self.navigationController.navigationBar.subviews[0].alpha = 1.0f;
     
     [self.navigationController setNeedsNavigationBackground:1.0f];
+    
 }
 
 #pragma mark --- lazy
@@ -414,10 +420,15 @@
         _tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
         
         CGFloat height = 64+36;
+        
         if (statusXLately) {
+            
             height = 132;
+            
         }
+        
         _tableView.contentInset = UIEdgeInsetsMake(-height, 0, 0, 0);
+        
     }
     
     return _tableView;

+ 10 - 9
UU_Ent/UU_Ent/Modules/Mine/Main/Others/YRUserInfo.h

@@ -14,6 +14,11 @@ NS_ASSUME_NONNULL_BEGIN
 
 +(instancetype)shareManager;
 
+
+/**
+ ip
+ */
+@property(copy,nonatomic)NSString *urlIp;
 /**
  token
  */
@@ -38,6 +43,11 @@ NS_ASSUME_NONNULL_BEGIN
  当前正在登录中的公司信息
  */
 @property(strong,nonatomic)NSDictionary *currCompanyInfo;
+
+/**
+ 是否为管理员
+ */
+@property(assign,nonatomic)BOOL isAdmin;
 /**
  最后登录的公司信息
  */
@@ -49,11 +59,6 @@ NS_ASSUME_NONNULL_BEGIN
  */
 @property(assign,nonatomic,getter=isAutoLogin)BOOL autoLogin;
 
-/**
- 是否切换账套
- */
-@property(assign,nonatomic)BOOL masChanged;
-
 /**
  是否在大陆以及港澳地区,在范围内加载高德地图,不在范围内加载谷歌地图
  */
@@ -64,10 +69,6 @@ NS_ASSUME_NONNULL_BEGIN
  */
 @property(assign,nonatomic)CGFloat scale;
 
-/**
- 当前页面是否是工作的子页面
- */
-@property(assign,nonatomic)BOOL isSubWork;
 
 @end
 

+ 23 - 1
UU_Ent/UU_Ent/Modules/Mine/Main/Others/YRUserInfo.m

@@ -38,7 +38,11 @@
 
 -(NSString *)token{
     
-    return [[NSUserDefaults standardUserDefaults] objectForKey:@"UUUserInfoToken"];
+    NSString *tokenStr = [[NSUserDefaults standardUserDefaults] objectForKey:@"UUUserInfoToken"];
+    
+    tokenStr = tokenStr?:@"";
+    
+    return tokenStr;
     
 }
 #pragma mark - 最后登录的公司信息
@@ -70,4 +74,22 @@
     
 }
 
+#pragma mark - 当前公司使用的ip
+-(void)setUrlIp:(NSString *)urlIp{
+    
+    urlIp = urlIp?:@"";
+    
+    [[NSUserDefaults standardUserDefaults] setObject:urlIp forKey:@"ipAndPort"];
+    
+}
+
+-(NSString *)urlIp{
+    
+    NSString *ipStr = [[NSUserDefaults standardUserDefaults] objectForKey:@"ipAndPort"];
+    
+    ipStr = [NSString stringWithFormat:@"%@",ipStr?:@""];
+    
+    return ipStr;
+}
+
 @end

+ 131 - 17
UU_Ent/UU_Ent/Modules/Web/Main/YRWebVC.m

@@ -7,13 +7,14 @@
 //
 
 #import "YRWebVC.h"
+#import "YRWebView.h"
 #import <JavaScriptCore/JavaScriptCore.h>
 #import <WebKit/WebKit.h>
-@interface YRWebVC ()<WKUIDelegate,WKNavigationDelegate,WKScriptMessageHandler,UINavigationControllerDelegate>
+@interface YRWebVC ()<WKUIDelegate,WKNavigationDelegate,WKScriptMessageHandler,UIGestureRecognizerDelegate>
 
-@property(strong,nonatomic)WKWebView *webView;
-@property(nonatomic,strong)JSContext *context;
-@property(nonatomic,strong)WKUserContentController *userContentController;
+@property(strong,nonatomic)UIProgressView *progress;
+
+@property(strong,nonatomic)YRWebView *webView;
 
 @end
 
@@ -27,40 +28,64 @@
 
 -(void)setUpUI{
     
+//    self.url = @"http://10.1.80.96:3000/homepage";
+    
     //创建配置对象
     WKWebViewConfiguration *webConfig = [[WKWebViewConfiguration alloc]init];
-    
+
     //为配置对象设置偏好设置
     WKPreferences *preferences = [[WKPreferences alloc]init];
     webConfig.preferences = preferences;
-    
+
     //允许js和native交互
     preferences.javaScriptEnabled = YES;
-    
+
     WKUserContentController *userContent = [[WKUserContentController alloc]init];
-    //监听相应的事件
+
+    [userContent addScriptMessageHandler:self name:@"event"];
+    
+     //监听相应的事件
     webConfig.userContentController = userContent;
-    self.userContentController = userContent;
     
-    self.webView = [[WKWebView alloc]initWithFrame:CGRectMake(0, 64, self.view.frame.size.width, self.view.frame.size.height) configuration:webConfig];
+    self.webView = [[YRWebView alloc]initWithFrame:CGRectMake(0, 64, self.view.frame.size.width, self.view.frame.size.height) configuration:webConfig];
+
+    self.webView.url = self.url;
     
     [self.view addSubview:self.webView];
-    
+
     [self.webView mas_makeConstraints:^(MASConstraintMaker *make) {
-       
+
         make.edges.equalTo(self.view);
-        
+
     }];
-    
+
     self.webView.navigationDelegate = self;
-    
-    
+
     NSURL *url = [NSURL URLWithString:self.url];
     
     NSURLRequest *request = [NSURLRequest requestWithURL:url];
     
     [self.webView loadRequest:request];
     
+    self.progress = [UIProgressView new];
+    
+    self.progress.trackTintColor = self.view.backgroundColor;
+    
+    self.progress.progressTintColor = [UIColor orangeColor];
+   
+    [self.view addSubview:self.progress];
+    
+    [self.progress mas_makeConstraints:^(MASConstraintMaker *make) {
+     
+        make.top.left.right.equalTo(self.view);
+        make.height.mas_equalTo(2);
+
+    }];
+    
+    [self.webView addObserver:self forKeyPath:@"estimatedProgress" options:NSKeyValueObservingOptionNew context:nil];
+
+    self.webView.allowsBackForwardNavigationGestures = NO;
+    
     
 }
 
@@ -77,18 +102,107 @@
 //接受js发送的消息
 -(void)userContentController:(WKUserContentController *)userContentController didReceiveScriptMessage:(WKScriptMessage *)message{
     
+    
     if ([message.name isEqualToString:@"event"]) {
         
+    
+    }
         
+    
+    
+}
+
+- (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated{
+    
+    
+    
+}
+- (void)navigationController:(UINavigationController *)navigationController didShowViewController:(UIViewController *)viewController animated:(BOOL)animated{
+    
+    
+    
+}
+
+- (void)webView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction decisionHandler:(void (^)(WKNavigationActionPolicy))decisionHandler{
+    
+    decisionHandler(WKNavigationActionPolicyAllow);
+    
+}
+
+-(void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary<NSKeyValueChangeKey,id> *)change context:(void *)context{
+    
+    if ([keyPath isEqualToString:@"estimatedProgress"]) {
+        
+        self.progress.progress = self.webView.estimatedProgress;
+        if (self.webView.estimatedProgress >= 1.0f) {
+            [UIView animateWithDuration:0.3f animations:^{
+                self.progress.alpha = 0.0f;
+                self.progress.progress = 0.0f;
+            }];
+        }else{
+            
+            self.progress.alpha = 1.0;
+            
+        }
+        
+    }
+    
+    if ([keyPath isEqualToString:@"URL"]) {
+        
+        NSLog(@"%@",change);
+        
+        
+    }
+    
+}
+
+-(void)viewDidDisappear:(BOOL)animated{
+    
+    [super viewDidDisappear:animated];
+    
+    [self removeAllScriptMsgHandle];
+    
+    
+}
+
+
+-(void)removeAllScriptMsgHandle{
+    
+    [self.webView.configuration.userContentController removeScriptMessageHandlerForName:@"event"];
+   
+}
+
+-(void)backAction{
+    
+    if (self.webView.canGoBack) {
+        
+        [self.webView goBack];
         
+    }else{
+        
+        [super backAction];
         
     }
     
+}
+
+-(void)webView:(WKWebView *)webView didStartProvisionalNavigation:(WKNavigation *)navigation{
+    
+    
+    
+}
+
+-(void)webView:(WKWebView *)webView commitPreviewingViewController:(UIViewController *)previewingViewController{
+    
+    
+    
 }
 
 -(void)dealloc{
     
-    [self.userContentController removeScriptMessageHandlerForName:@"event"];
+    [self.webView.configuration.userContentController removeScriptMessageHandlerForName:@"event"];
+    
+    [self.webView removeObserver:self forKeyPath:@"estimatedProgress"];
     
 }
 

+ 5 - 0
UU_Ent/UU_Ent/Modules/Work/Main/Controllers/YRWorkVC.h

@@ -12,6 +12,11 @@ NS_ASSUME_NONNULL_BEGIN
 
 @interface YRWorkVC : YRBaseVC
 
+/**
+ 当前显示的是否是该控制器的子控制器
+ */
+@property(assign,nonatomic)BOOL isOnChildVC;
+
 @end
 
 NS_ASSUME_NONNULL_END

+ 43 - 19
UU_Ent/UU_Ent/Modules/Work/Main/Controllers/YRWorkVC.m

@@ -27,6 +27,17 @@
 
 @implementation YRWorkVC
 
+- (instancetype)init
+{
+    self = [super init];
+    if (self) {
+        
+        [self addNotification];
+        
+    }
+    return self;
+}
+
 - (void)viewDidLoad {
     [super viewDidLoad];
     // Do any additional setup after loading the view.
@@ -138,14 +149,24 @@
     
     self.tableView.tableFooterView = footerView;
 
+    [self loadData];
+    
+}
+
+
+-(void)addNotification{
+    
+    //切换账套
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(loadData) name:kYRUserMasterChangedNotification object:nil];
     
 }
 
+
 -(void)viewWillAppear:(BOOL)animated{
     [super viewWillAppear:animated];
    
     //适应子页侧滑返回效果
-    if ([YRUserInfo shareManager].isSubWork) {
+    if (self.isOnChildVC) {
         
         [self.navigationController setNavigationBarHidden:YES animated:YES];
         
@@ -155,14 +176,13 @@
         
     }
     
-    [self loadData];
     
 }
 
 -(void)viewDidAppear:(BOOL)animated{
     [super viewDidAppear:animated];
     
-    [YRUserInfo shareManager].isSubWork = NO;
+    self.isOnChildVC = NO;
     self.navigationController.navigationBar.subviews[0].alpha = 1;
     
 }
@@ -180,31 +200,29 @@
 
 -(void)loadData{
     
+    DLog(@"这里是工作的数据刷新");
     
-    if ([YRUserInfo shareManager].masChanged) {
-        
-        NSString *title = [NSString stringWithFormat:@"%@",[YRUserInfo shareManager].lastCompanyInfo[@"name"]];
-        
-        title = title.length != 0?title:@"工作";
-        
-        self.titleLabel.text = title;
+    NSString *title = [NSString stringWithFormat:@"%@",[YRUserInfo shareManager].lastCompanyInfo[@"name"]];
+    
+    title = title.length != 0?title:@"工作";
+    
+    self.titleLabel.text = title;
         
-        NSDictionary *comDic = [YRUserInfo shareManager].userCompanyInfo;
+    NSDictionary *comDic = [YRUserInfo shareManager].userCompanyInfo;
         
-        if (comDic) {
+    if (comDic) {
             
-            self.dataArr = [YRWorkConModel mj_objectArrayWithKeyValuesArray:comDic[@"appGroupConfigArray"]];
+        self.dataArr = [YRWorkConModel mj_objectArrayWithKeyValuesArray:comDic[@"appGroupConfigArray"]];
             
-            [self.tableView reloadData];
+        [self.tableView reloadData];
             
-        }else{
+         }else{
         
         [self loadDataFromServer];
         
-        }
-        
     }
     
+    
 }
 
 -(void)loadDataFromServer{
@@ -379,13 +397,12 @@
         }];
         
     }else{
+        
         //防止在某些机型上出现白条
         self.remindView.alpha = 0;
         
     }
     
-    
-    
 }
 
 #pragma mark - lazy
@@ -400,6 +417,7 @@
         _tableView.bounces = YES;
         _tableView.layer.cornerRadius = 8;
         _tableView.layer.masksToBounds = YES;
+        _tableView.autoNoDataSet = NO;
         _tableView.showsVerticalScrollIndicator = NO;
         _tableView.backgroundColor = [UIColor clearColor];
         _tableView.estimatedRowHeight = 0;
@@ -420,4 +438,10 @@
     return _dataArr;
 }
 
+-(void)dealloc{
+     //切换账套
+    [[NSNotificationCenter defaultCenter] removeObserver:self name:kYRUserMasterChangedNotification object:nil];
+    
+}
+
 @end

+ 6 - 0
UU_Ent/UU_Ent/Supporting Files/Assets.xcassets/Resources/Backicon/Contents.json

@@ -0,0 +1,6 @@
+{
+  "info" : {
+    "version" : 1,
+    "author" : "xcode"
+  }
+}

+ 23 - 0
UU_Ent/UU_Ent/Supporting Files/Assets.xcassets/Resources/Backicon/uu_back_icon.imageset/Contents.json

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

BIN
UU_Ent/UU_Ent/Supporting Files/Assets.xcassets/Resources/Backicon/uu_back_icon.imageset/uu_back_icon.png


BIN
UU_Ent/UU_Ent/Supporting Files/Assets.xcassets/Resources/Backicon/uu_back_icon.imageset/uu_back_icon@2x.png


BIN
UU_Ent/UU_Ent/Supporting Files/Assets.xcassets/Resources/Backicon/uu_back_icon.imageset/uu_back_icon@3x.png


+ 5 - 7
UU_Ent/UU_Ent/Supporting Files/Info.plist

@@ -2,11 +2,6 @@
 <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
 <plist version="1.0">
 <dict>
-	<key>NSAppTransportSecurity</key>
-	<dict>
-		<key>NSAllowsArbitraryLoads</key>
-		<true/>
-	</dict>
 	<key>CFBundleDevelopmentRegion</key>
 	<string>$(DEVELOPMENT_LANGUAGE)</string>
 	<key>CFBundleDisplayName</key>
@@ -31,6 +26,11 @@
 	<string>1</string>
 	<key>LSRequiresIPhoneOS</key>
 	<true/>
+	<key>NSAppTransportSecurity</key>
+	<dict>
+		<key>NSAllowsArbitraryLoads</key>
+		<true/>
+	</dict>
 	<key>UIRequiredDeviceCapabilities</key>
 	<array>
 		<string>armv7</string>
@@ -38,8 +38,6 @@
 	<key>UISupportedInterfaceOrientations</key>
 	<array>
 		<string>UIInterfaceOrientationPortrait</string>
-		<string>UIInterfaceOrientationLandscapeLeft</string>
-		<string>UIInterfaceOrientationLandscapeRight</string>
 	</array>
 	<key>UISupportedInterfaceOrientations~ipad</key>
 	<array>

+ 3 - 1
UU_Ent/UU_Ent/Supporting Files/defines/common.h

@@ -12,7 +12,9 @@
 
 //GRPC服务器
 static NSString * const kHostAddress = @"uu-api-test.usoftchina.com:9620";
-
+//网络状态改变
 static NSString *const kAFReachabilityChangedNotification = @"AFNetworkReachabilityChangedNotification";
+//切换账套
+static NSString *const kYRUserMasterChangedNotification = @"YRUserMasterChangedNotification";
 
 #endif /* common_h */

+ 4 - 2
UU_Ent/UU_Ent/Utils/UIButton/UIButton+block.m

@@ -20,10 +20,12 @@
     }
     if (backColor) {
         button.backgroundColor = backColor;
-    }if (size) {
+    }
+    if (size) {
         button.titleLabel.font = FONT_SIZE(size);
        
-    }if (radius) {
+    }
+    if (radius) {
         button.layer.cornerRadius = radius;
         button.layer.masksToBounds = YES;
     }

+ 1 - 1
UU_Ent/UU_Ent/Utils/UIColor/UIColor+HexColor.m

@@ -67,7 +67,7 @@
 	[[NSScanner scannerWithString:blue] scanHexInt:&colorValueB];
 	[[NSScanner scannerWithString:alpha] scanHexInt:&colorValueA];
 	
-
+    
 	return [UIColor colorWithRed:((colorValueR)&0xFF)/255.0 
 					green:((colorValueG)&0xFF)/255.0 
 					 blue:((colorValueB)&0xFF)/255.0 

+ 1 - 5
UU_Ent/UU_Ent/Utils/UIPopoverListView/UIPopoverListView.m

@@ -77,7 +77,6 @@ UIView *popDetailView;
     _titleView.textAlignment = NSTextAlignmentCenter;
     _titleView.textColor = [UIColor whiteColor];
     CGFloat xWidth = self.bounds.size.width;
-    _titleView.lineBreakMode = NSLineBreakByCharWrapping;
     _titleView.frame = CGRectMake(0, 0, xWidth, 32.0f);
     [self addSubview:_titleView];
     
@@ -96,7 +95,6 @@ UIView *popDetailView;
     _overlayView = [[UIControl alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
     _overlayView.backgroundColor = [UIColor colorWithRed:.16 green:.17 blue:.21 alpha:.8];
     
-    
     if (self.isCannotClickBackGround) {
         [_overlayView addTarget:self
                          action:@selector(dismiss)
@@ -120,7 +118,6 @@ UIView *popDetailView;
     _titleView.textAlignment = NSTextAlignmentCenter;
     _titleView.textColor = [UIColor whiteColor];
     CGFloat xWidth = self.bounds.size.width;
-    _titleView.lineBreakMode = NSLineBreakByCharWrapping;
     _titleView.frame = CGRectMake(0, 0, xWidth, 32.0f);
     [self addSubview:_titleView];
     //view
@@ -162,7 +159,6 @@ UIView *popDetailView;
     _titleView.textAlignment = NSTextAlignmentCenter;
     _titleView.textColor = [UIColor whiteColor];
     CGFloat xWidth = self.bounds.size.width;
-    _titleView.lineBreakMode = NSLineBreakByCharWrapping;
     _titleView.frame = CGRectMake(0, 0, xWidth, 32.0f);
     [self addSubview:_titleView];
     //view
@@ -224,8 +220,8 @@ UIView *popDetailView;
     _titleView.textAlignment = NSTextAlignmentCenter;
     _titleView.textColor = [UIColor whiteColor];
     CGFloat xWidth = self.bounds.size.width;
-    _titleView.lineBreakMode = NSLineBreakByCharWrapping;
     _titleView.frame = CGRectMake(0, 0, xWidth, 32.0f);
+   
     [self addSubview:_titleView];
     
     //tableview

+ 50 - 0
UU_Ent/UU_Ent/Utils/WebView/YRWebView.h

@@ -0,0 +1,50 @@
+//
+//  YRWebView.h
+//  UU_Ent
+//
+//  Created by liujl on 2019/8/22.
+//  Copyright © 2019 UAS. All rights reserved.
+//
+
+#import <WebKit/WebKit.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+
+@class YRWebView;
+
+
+
+@protocol YRWebViewDelegate <NSObject>
+
+
+
+// 0 成功  1 完成   2 失败
+
+- (void)webViewLoadState:(NSInteger)state;
+
+
+
+@optional
+
+- (void)panableWebView:(YRWebView *)webView panPopGesture:(UIPanGestureRecognizer *)pan;
+
+
+
+@end
+
+@interface YRWebView : WKWebView
+
+
+@property(nonatomic, weak) id <YRWebViewDelegate> panDelegate;
+
+@property(nonatomic, assign) BOOL enablePanGesture;
+
+@property(copy,nonatomic)NSString *url;
+
+- (void)goBack;
+
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 365 - 0
UU_Ent/UU_Ent/Utils/WebView/YRWebView.m

@@ -0,0 +1,365 @@
+//
+//  YRWebView.m
+//  UU_Ent
+//
+//  Created by liujl on 2019/8/22.
+//  Copyright © 2019 UAS. All rights reserved.
+//
+
+#import "YRWebView.h"
+
+@interface YRWebView()<WKNavigationDelegate>
+
+@property (nonatomic, strong) UIGestureRecognizer* popGesture;
+
+@property (nonatomic, weak) id <WKNavigationDelegate> originDelegate;
+
+@property (nonatomic, strong)UIImageView *historyView;
+
+@property (nonatomic, strong) NSMutableArray *historyStack;
+
+@property (nonatomic, assign) CGFloat panStartX;
+
+/**
+ 用来判断是返回还是
+ */
+@property (nonatomic, strong) NSMutableArray<NSString *> *urlStack;
+
+@end
+
+@implementation YRWebView
+
+- (instancetype)initWithFrame:(CGRect)frame configuration:(WKWebViewConfiguration *)configuration{
+    
+    self = [super initWithFrame:frame configuration:configuration];
+    
+    if (self) {
+        
+        [self defualtSet];
+        
+    }
+    
+    return self;
+}
+
+-(void)defualtSet{
+    
+    self.popGesture = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(panGesture:)];
+    
+    [self addGestureRecognizer:self.popGesture];
+    
+    [super setNavigationDelegate:self];
+    
+    [YRWebView addShadowToView:self];
+    
+    [self addObserver:self forKeyPath:@"URL" options:NSKeyValueObservingOptionInitial | NSKeyValueObservingOptionNew | NSKeyValueObservingOptionOld context:nil];
+    
+}
+
+
++ (UIImage *)screenshotOfView:(UIView *)view {
+    
+    UIGraphicsBeginImageContextWithOptions(view.frame.size, YES, 0.0);
+    
+    
+    
+    if ([view respondsToSelector:@selector(drawViewHierarchyInRect:afterScreenUpdates:)]) {
+        
+        [view drawViewHierarchyInRect:view.bounds afterScreenUpdates:YES];
+        
+    }
+    
+    else{
+        
+        [view.layer renderInContext:UIGraphicsGetCurrentContext()];
+        
+    }
+    
+    UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
+    
+    UIGraphicsEndImageContext();
+    
+    return image;
+    
+}
+
+
+
++ (void)addShadowToView:(UIView *)view{
+    
+    CALayer *layer = view.layer;
+    
+    UIBezierPath *path = [UIBezierPath bezierPathWithRect:layer.bounds];
+    
+    layer.shadowPath = path.CGPath;
+    
+    layer.shadowColor = [UIColor blackColor].CGColor;
+    
+    layer.shadowOffset = CGSizeZero;
+    
+    layer.shadowOpacity = 0.4f;
+    
+    layer.shadowRadius = 8.0f;
+    
+}
+
+
+
+- (void)setDelegate:(id<WKNavigationDelegate>)delegate{
+    
+    self.originDelegate = delegate;
+    
+}
+
+
+
+- (id<WKNavigationDelegate>)delegate{
+    
+    return self.originDelegate;
+    
+}
+
+
+
+- (void)goBack{
+    
+    [super goBack];
+    
+    [self.historyStack removeLastObject];
+    [self.urlStack removeLastObject];
+    
+}
+
+
+
+- (void)setEnablePanGesture:(BOOL)enablePanGesture{
+    
+    self.popGesture.enabled = enablePanGesture;
+    
+}
+
+
+
+- (BOOL)enablePanGesture{
+    
+    return self.popGesture.enabled;
+    
+}
+
+
+
+- (NSMutableArray *)historyStack {
+    
+    if (!_historyStack) {
+        
+        _historyStack = [NSMutableArray array];
+        
+    }
+    
+    return _historyStack;
+    
+}
+
+
+
+- (UIImageView *)historyView{
+    
+    if (!_historyView) {
+        
+        if (self.superview) {
+            
+            _historyView = [[UIImageView alloc] initWithFrame:self.bounds];
+            
+            [self.superview insertSubview:_historyView belowSubview:self];
+            
+        }
+        
+    }
+    
+    
+    
+    return _historyView;
+    
+}
+
+- (void)dealloc {
+    
+    
+    [self removeObserver:self forKeyPath:@"URL"];
+    
+    if (self.historyView) {
+        
+        [self.historyView removeFromSuperview];
+        
+        self.historyView = nil;
+        
+    }
+    
+}
+
+
+
+- (void)layoutSubviews {
+    
+    [super layoutSubviews];
+    
+    self.historyView.frame = self.bounds;
+    
+}
+
+#pragma mark === gesture===
+
+- (void)panGesture:(UIPanGestureRecognizer *)sender{
+    
+    if (![self canGoBack] || self.historyStack.count == 0) {
+        
+        if (self.panDelegate && [self.panDelegate respondsToSelector:@selector(panableWebView:panPopGesture:)]) {
+            
+            [self.panDelegate panableWebView:self panPopGesture:sender];
+            
+        }
+        
+        
+        
+        return;
+        
+    }
+    
+    
+    
+    CGPoint point = [sender translationInView:self];
+    
+    if (sender.state == UIGestureRecognizerStateBegan) {
+        
+        _panStartX = point.x;
+        
+    }
+    
+    else if (sender.state == UIGestureRecognizerStateChanged){
+        
+        CGFloat deltaX = point.x - _panStartX;
+        
+        if (deltaX > 0) {
+            
+            if ([self canGoBack]) {
+                
+                assert(self.historyStack.count > 0);
+                
+                NSDictionary *history = self.historyStack.lastObject;
+                
+                self.historyView.image = [history objectForKey:@"preview"];
+                
+                self.x = deltaX;
+                
+                self.historyView.x = -self.width / 2.0f + deltaX / 2.0f;
+                
+            }
+            
+        }
+        
+    }
+    
+    else if (sender.state == UIGestureRecognizerStateEnded){
+        
+        CGFloat deltaX = point.x - _panStartX;
+        
+        CGFloat duration = .5f;
+        
+        if ([self canGoBack]) {
+            
+            if (deltaX > self.width / 4.0f) {
+                
+                [UIView animateWithDuration:(1.0f - deltaX / self.width) * duration animations:^{
+                    
+                    
+                    self.x = self.width;
+                    
+                    self.historyView.x = 0;
+                    
+                    [self goBack];
+                    
+                    
+                } completion:^(BOOL finished) {
+                    
+                    self.x = 0;
+                    
+                    [self.historyView removeFromSuperview];
+                    
+                    self.historyView = nil;
+                    
+                    
+                    
+                }];
+                
+            }
+            
+            else{
+                
+                [UIView animateWithDuration:(deltaX/self.bounds.size.width)*duration animations:^{
+                    
+                    CGRect rc = self.frame;
+                    
+                    rc.origin.x = 0;
+                    
+                    self.frame = rc;
+                    
+                    rc.origin.x = -self.bounds.size.width/2.0f;
+                    
+                    self.historyView.frame = rc;
+                    
+                } completion:^(BOOL finished) {
+                    
+                    
+                    
+                }];
+                
+            }
+            
+        }
+        
+    }
+    
+}
+
+
+-(void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary<NSKeyValueChangeKey,id> *)change context:(void *)context{
+    
+    if ([keyPath isEqualToString:@"URL"]) {
+        
+        NSString *newUrl = [NSString stringWithFormat:@"%@",change[@"new"]];
+        //执行的是跳入新页面的操作
+         if (![self.urlStack containsObject:newUrl] && [newUrl containsString:@"http"]) {
+                
+               [self.urlStack addObject:newUrl];
+                
+        }
+        
+    }
+    
+}
+
+
+
+-(void)setUrl:(NSString *)url{
+    
+    _url = url;
+    
+    [self.urlStack addObject:url];
+    
+    
+}
+
+-(NSMutableArray<NSString *> *)urlStack{
+    
+    if (!_urlStack) {
+        
+        _urlStack = [NSMutableArray new];
+        
+    }
+    
+    return _urlStack;
+}
+
+
+
+@end