time 6 жил өмнө
parent
commit
dc6d583492

+ 2 - 0
UU_Ent/Podfile

@@ -10,6 +10,8 @@ target 'UU_Ent' do
     pod 'UU_Ent', :path => '.'
     pod 'Masonry'
     pod 'MJExtension'
+    pod 'MJRefresh'
+    pod 'ReactiveObjC'
     pod 'SDWebImage'
     pod 'IQKeyboardManager'
     pod 'MBProgressHUD'

+ 14 - 2
UU_Ent/UU_Ent.xcodeproj/project.pbxproj

@@ -20,6 +20,8 @@
 		999F6516227E688600329012 /* UIView+selector.m in Sources */ = {isa = PBXBuildFile; fileRef = 999F6515227E688600329012 /* UIView+selector.m */; };
 		999F651A227E697D00329012 /* UILabel+vertical.m in Sources */ = {isa = PBXBuildFile; fileRef = 999F6519227E697D00329012 /* UILabel+vertical.m */; };
 		999F651E227E6A6000329012 /* NSString+regular.m in Sources */ = {isa = PBXBuildFile; fileRef = 999F651D227E6A6000329012 /* NSString+regular.m */; };
+		99C16340227FD24E002ED79D /* YRWorkConModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 99C1633F227FD24E002ED79D /* YRWorkConModel.m */; };
+		99C16342227FDE64002ED79D /* work_route.json in Resources */ = {isa = PBXBuildFile; fileRef = 99C16341227FDE64002ED79D /* work_route.json */; };
 		99C6FE6122768B5C00C7070A /* UU_EntTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 99C6FE6022768B5C00C7070A /* UU_EntTests.m */; };
 		99C6FE6C22768B5C00C7070A /* UU_EntUITests.m in Sources */ = {isa = PBXBuildFile; fileRef = 99C6FE6B22768B5C00C7070A /* UU_EntUITests.m */; };
 		99C6FE8F22768EC000C7070A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 99C6FE7E22768EC000C7070A /* AppDelegate.m */; };
@@ -158,6 +160,9 @@
 		999F6519227E697D00329012 /* UILabel+vertical.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "UILabel+vertical.m"; sourceTree = "<group>"; };
 		999F651C227E6A6000329012 /* NSString+regular.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "NSString+regular.h"; sourceTree = "<group>"; };
 		999F651D227E6A6000329012 /* NSString+regular.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "NSString+regular.m"; sourceTree = "<group>"; };
+		99C1633E227FD24E002ED79D /* YRWorkConModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = YRWorkConModel.h; sourceTree = "<group>"; };
+		99C1633F227FD24E002ED79D /* YRWorkConModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = YRWorkConModel.m; sourceTree = "<group>"; };
+		99C16341227FDE64002ED79D /* work_route.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = work_route.json; sourceTree = "<group>"; };
 		99C6FE4422768B5B00C7070A /* UU_Ent.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = UU_Ent.app; sourceTree = BUILT_PRODUCTS_DIR; };
 		99C6FE5C22768B5C00C7070A /* UU_EntTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = UU_EntTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
 		99C6FE6022768B5C00C7070A /* UU_EntTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = UU_EntTests.m; sourceTree = "<group>"; };
@@ -715,6 +720,7 @@
 		99C6FEAD2276942900C7070A /* Others */ = {
 			isa = PBXGroup;
 			children = (
+				99C16341227FDE64002ED79D /* work_route.json */,
 			);
 			path = Others;
 			sourceTree = "<group>";
@@ -722,6 +728,8 @@
 		99C6FEAE2276942900C7070A /* Models */ = {
 			isa = PBXGroup;
 			children = (
+				99C1633E227FD24E002ED79D /* YRWorkConModel.h */,
+				99C1633F227FD24E002ED79D /* YRWorkConModel.m */,
 			);
 			path = Models;
 			sourceTree = "<group>";
@@ -1095,6 +1103,7 @@
 			isa = PBXResourcesBuildPhase;
 			buildActionMask = 2147483647;
 			files = (
+				99C16342227FDE64002ED79D /* work_route.json in Resources */,
 				99F4A8432277D845009AA6ED /* loading26.png in Resources */,
 				99F4A8172277D845009AA6ED /* loading46.png in Resources */,
 				99F4A83A2277D845009AA6ED /* loading0.png in Resources */,
@@ -1223,18 +1232,20 @@
 			files = (
 			);
 			inputPaths = (
-				"${PODS_ROOT}/Target Support Files/Pods-UU_Ent/Pods-UU_Ent-resources.sh",
+				"${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_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}/gRPCCertificates.bundle",
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 			shellPath = /bin/sh;
-			shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-UU_Ent/Pods-UU_Ent-resources.sh\"\n";
+			shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-UU_Ent/Pods-UU_Ent-resources.sh\"\n";
 			showEnvVarsInLog = 0;
 		};
 		A2F6040888740937A057571A /* [CP] Check Pods Manifest.lock */ = {
@@ -1266,6 +1277,7 @@
 				27029BD0227709CC00D53A94 /* UIButton+Layout.m in Sources */,
 				99C6FF232276E4C000C7070A /* YRMsgMainCell.m in Sources */,
 				99C6FECB227696CA00C7070A /* YRMsgVC.m in Sources */,
+				99C16340227FD24E002ED79D /* YRWorkConModel.m in Sources */,
 				99C6FF262276FAE000C7070A /* YRMsgMainModel.m in Sources */,
 				99F4A7462277D503009AA6ED /* YRAdView.m in Sources */,
 				99C6FE9222768EC000C7070A /* main.m in Sources */,

+ 13 - 2
UU_Ent/UU_Ent/Modules/App/AppDelegate.m

@@ -22,6 +22,8 @@
     
     [self configKeyboardManager];
     
+    [self initializeData];
+    
     YRLoginVC *loginVC = [[YRLoginVC alloc]init];
     
     loginVC.completed = ^(BOOL success) {
@@ -31,7 +33,7 @@
         [UIView animateWithDuration:0.3f animations:^{
             
             self.window.rootViewController = mainVC;
-            DLog(@"这里是切换到主页");
+           
         }];
         
         
@@ -47,13 +49,22 @@
     //加载动画结束后
     [YRAdView startLoad].loadCompleted = ^{
         
-        DLog(@"现在动画结束了");
+       
         
     };
     
     return YES;
 }
 
+/**
+ 初始化必要的数据
+ */
+-(void)initializeData{
+    
+    [YRUserInfo shareManager].masChanged = YES;
+    
+}
+
 #pragma mark - 配置键盘
 -(void)configKeyboardManager{
     

+ 6 - 0
UU_Ent/UU_Ent/Modules/Base/YRBaseNav.m

@@ -29,6 +29,12 @@
         
         viewController.hidesBottomBarWhenPushed = YES;
         
+        if ([self.childViewControllers[0] isKindOfClass:NSClassFromString(@"YRWorkVC")]) {
+            
+            [YRUserInfo shareManager].isSubWork = YES;
+            
+        }
+        
     }
     
     

+ 1 - 1
UU_Ent/UU_Ent/Modules/Login/Main/Controllers/YRLoginVC.m

@@ -51,7 +51,7 @@
     [client signinWithRequest:request handler:^(AccountSigninResponse * _Nullable response, NSError * _Nullable error) {
         
         [MBProgressHUD hideHUDForView:self.view animated:YES];
-        
+        [YRUserInfo shareManager].masChanged = YES;
         if (!error) {
             
             NSDictionary *resDic = response.mj_keyValues;

+ 2 - 1
UU_Ent/UU_Ent/Modules/Main/Main/Controllers/YRMainVC.m

@@ -104,7 +104,7 @@
         if (item == self.tabBar.items[i]) {
             
             index = i;
-            
+            break;
         }
         
     }
@@ -117,6 +117,7 @@
     anima.repeatCount = 1;
     [self.tarArr[index].layer addAnimation:anima forKey:@"scaleAnimation"];
     
+   
     
 }
 

+ 6 - 0
UU_Ent/UU_Ent/Modules/Main/Main/Views/YRTabBar.h

@@ -12,6 +12,12 @@ NS_ASSUME_NONNULL_BEGIN
 
 @interface YRTabBar : UITabBar
 
+@property(assign,nonatomic)NSInteger remindCount;
+
+- (void)showBadgeOnItemIndex:(int)index;
+
+- (void)hideBadgeOnItemIndex:(int)index; 
+
 @end
 
 NS_ASSUME_NONNULL_END

+ 138 - 0
UU_Ent/UU_Ent/Modules/Main/Main/Views/YRTabBar.m

@@ -8,8 +8,146 @@
 
 #import "YRTabBar.h"
 
+@interface YRTabBar ()
+
+@property(strong,nonatomic)NSMutableArray<UILabel *> *labArr;
+
+@property(assign,atomic)BOOL isExist;
+
+
+@end
+
 @implementation YRTabBar
 
 
+-(void)layoutSubviews{
+    
+    [super layoutSubviews];
+    
+    [self addRemindView];
+    
+}
+
+-(void)addRemindView{
+    
+    if (self.isExist) return;
+    self.isExist = YES;
+    
+    NSInteger index = 0;
+    
+    for (UIView *view in self.subviews) {
+        if ([view isKindOfClass:NSClassFromString(@"UITabBarButton")]) {
+            
+            for (UIView *viewOne in view.subviews) {
+                
+                if ([viewOne isKindOfClass:NSClassFromString(@"UITabBarSwappableImageView")]) {
+                    
+                    UILabel *label = [UILabel new];
+                    label.backgroundColor = [UIColor redColor];
+                    if (index == 0) {
+                        
+                        
+                        label.layer.cornerRadius = 8;
+                        label.layer.masksToBounds = YES;
+                        
+                        label.textColor = [UIColor whiteColor];
+                        
+                        label.font = [UIFont systemFontOfSize:8];
+                        
+                        label.textAlignment = NSTextAlignmentCenter;
+                        
+                        [viewOne addSubview:label];
+                        
+                        [label mas_makeConstraints:^(MASConstraintMaker *make) {
+                            
+                            make.top.equalTo(viewOne).offset(-6);
+                            make.right.equalTo(viewOne).offset(10);
+                            make.width.height.mas_equalTo(16);
+                            
+                        }];
+                        
+                    }else{
+                        
+                        label.layer.cornerRadius = 5;
+                        label.layer.masksToBounds = YES;
+                        
+                        [viewOne addSubview:label];
+                        
+                        [label mas_makeConstraints:^(MASConstraintMaker *make) {
+                            
+                            make.top.equalTo(viewOne).offset(-5);
+                            make.right.equalTo(viewOne).offset(5);
+                            make.width.height.mas_equalTo(10);
+                            
+                        }];
+                        
+                    }
+                    index++;
+                    label.hidden = YES;
+                    [self.labArr addObject:label];
+                }
+                
+            }
+            
+        }
+        
+        
+    }
+    
+}
+
+- (void)showBadgeOnItemIndex:(int)index{
+
+    if (index >= self.items.count) return;
+    
+    self.labArr[index].hidden = NO;
+    
+}
+
+- (void)hideBadgeOnItemIndex:(int)index{
+    
+    if (index >= self.items.count) return;
+    
+    self.labArr[index].hidden = YES;
+    
+}
+
+
+-(void)setRemindCount:(NSInteger)remindCount{
+    
+    if (remindCount > 0) {
+        
+         self.labArr[0].hidden = NO;
+        
+        if (remindCount > 99) {
+            
+            self.labArr[0].font = [UIFont systemFontOfSize:7];
+            self.labArr[0].text = @"99+";
+            
+        }else{
+            
+            self.labArr[0].font = [UIFont systemFontOfSize:8];
+            self.labArr[0].text = [NSString stringWithFormat:@"%ld",(long)remindCount];
+        }
+        
+    }else{
+        
+         self.labArr[0].hidden = YES;
+        
+    }
+    
+    
+}
+
+-(NSMutableArray *)labArr{
+    
+    if (!_labArr) {
+        
+        _labArr = [NSMutableArray new];
+        
+    }
+    
+    return _labArr;
+}
 
 @end

+ 40 - 34
UU_Ent/UU_Ent/Modules/Message/Main/Controllers/YRMsgVC.m

@@ -12,6 +12,7 @@
 #import "YRMsgMainModel.h"
 #import "YRMsgMainCell.h"
 #import "YRWebVC.h"
+#import "YRTabBar.h"
 @interface YRMsgVC ()<UITableViewDelegate,UITableViewDataSource>
 
 @property(strong,nonatomic)YRTableView *tableView;
@@ -28,6 +29,19 @@
     
 }
 
+-(void)viewWillAppear:(BOOL)animated{
+    
+    [super viewWillAppear:animated];
+    
+    if ([YRUserInfo shareManager].masChanged) {
+        
+         [self getDataFromServer];
+        
+        
+    }
+    
+}
+
 -(void)setUpUI{
     
     self.title = @"消息";
@@ -38,8 +52,6 @@
         
     }];
     
-    [self getDataFromServer];
-    
 }
 
 
@@ -53,14 +65,14 @@
     GetMessageConfigRequest *request = [GetMessageConfigRequest message];
     
     GRPCProtoCall *call = [client RPCTogetConfigWithRequest:request handler:^(GetMessageConfigResponse * _Nullable response, NSError * _Nullable error) {
-        
+        [self.tableView.mj_header endRefreshing];
         if (!error) {//请求成功
             
             NSDictionary *dict = response.mj_keyValues;
             
             self.dataArr = [YRMsgMainModel mj_objectArrayWithKeyValuesArray:dict[@"configArray"]];
             
-            [self matchDestineVc];
+            [self calculteRemindCount];
             
             [self.tableView reloadData];
             
@@ -78,36 +90,7 @@
     
 }
 
-/**
- 匹配模型对应跳转的控制器
- */
--(void)matchDestineVc{
-    
-    NSString *path = [[NSBundle mainBundle]pathForResource:@"msg_route" ofType:@"json"];
-    
-    NSData *data = [[NSData alloc]initWithContentsOfFile:path];
-    
-    NSError *error = nil;
-    
-    NSDictionary *routeDic = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableLeaves error:&error];
-    
-    NSArray *routeArr = routeDic[@"data"];
-    
-    for (YRMsgMainModel *model in self.dataArr) {
-        
-        for (NSDictionary *dic in routeArr) {
-            
-            if ([model.code isEqualToString:dic[@"code"]]) {
-                
-                model.desVC = dic[@"desVc"];
-                
-            }
-            
-        }
-        
-    }
-    
-}
+
 
 #pragma mark - delegate && dataSource
 
@@ -181,6 +164,22 @@
     
 }
 
+#pragma mark - 计数
+
+-(void)calculteRemindCount{
+    
+    YRTabBar *tabbar = (YRTabBar *)self.tabBarController.tabBar;
+    
+    NSUInteger remind = 0;
+    
+    for (YRMsgMainModel *model in self.dataArr) {
+        
+        remind += model.remindCount;
+        
+    }
+    
+    tabbar.remindCount = remind;
+}
 
 -(YRTableView *)tableView{
     
@@ -191,6 +190,13 @@
         _tableView.dataSource = self;
         _tableView.tableHeaderView = [UIView new];
         _tableView.tableFooterView = [UIView new];
+        @weakify(self)
+        _tableView.mj_header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{
+            @strongify(self)
+                       
+            [self getDataFromServer];
+            
+        }];
         
     }
  

+ 5 - 0
UU_Ent/UU_Ent/Modules/Message/Main/Models/YRMsgMainModel.h

@@ -66,6 +66,11 @@ NS_ASSUME_NONNULL_BEGIN
  */
 @property(copy,nonatomic)NSString *webURL;
 
+/**
+ 提醒条数
+ */
+@property(assign,nonatomic)NSUInteger remindCount;
+
 @end
 
 NS_ASSUME_NONNULL_END

+ 31 - 0
UU_Ent/UU_Ent/Modules/Message/Main/Models/YRMsgMainModel.m

@@ -10,4 +10,35 @@
 
 @implementation YRMsgMainModel
 
+/**
+ 匹配目标控制器
+ */
+-(void)setCode:(NSString *)code{
+    
+    _code = code;
+    
+    NSString *path = [[NSBundle mainBundle]pathForResource:@"msg_route" ofType:@"json"];
+    
+    NSData *data = [[NSData alloc]initWithContentsOfFile:path];
+    
+    NSError *error = nil;
+    
+    NSDictionary *routeDic = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableLeaves error:&error];
+    
+    NSArray *routeArr = routeDic[@"data"];
+    
+        
+        for (NSDictionary *dic in routeArr) {
+            
+            if ([_code isEqualToString:dic[@"code"]]) {
+                
+                self.desVC = dic[@"desVc"];
+                
+            }
+            
+        }
+    
+    
+}
+
 @end

+ 42 - 1
UU_Ent/UU_Ent/Modules/Message/Main/Views/YRMsgMainCell.m

@@ -12,10 +12,14 @@
 
 @property(strong,nonatomic)UIImageView *iconView;
 
+@property(strong,nonatomic)UILabel *remindLabel;
+
 @property(strong,nonatomic)UILabel *titleLabel;
 
 @property(strong,nonatomic)UILabel *subTitLabel;
 
+
+
 @end
 
 @implementation YRMsgMainCell
@@ -35,6 +39,7 @@
 -(void)setUpUI{
     
     [self.contentView addSubview:self.iconView];
+    [self.iconView addSubview:self.remindLabel];
     [self.contentView addSubview:self.titleLabel];
     [self.contentView addSubview:self.subTitLabel];
     
@@ -47,6 +52,14 @@
         
     }];
     
+    [self.remindLabel mas_makeConstraints:^(MASConstraintMaker *make) {
+       
+        make.top.equalTo(self.iconView).offset(-8);
+        make.right.equalTo(self.iconView).offset(8);
+        make.width.height.mas_equalTo(16);
+        
+    }];
+    
     [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
         make.top.equalTo(self.contentView).offset(14);
         make.left.equalTo(self.iconView.mas_right).offset(10);
@@ -67,10 +80,21 @@
 
 -(void)setModel:(YRMsgMainModel *)model{
     
+    _model = model;
+    
     self.iconView.image = [UIImage imageNamed:model.icon];
     self.titleLabel.text = model.name;
     self.subTitLabel.text = @"这是副标题";
-    
+    if (model.remindCount > 0) {
+        
+        self.remindLabel.hidden = NO;
+        self.remindLabel.text = [NSString stringWithFormat:@"%ld",(long)model.remindCount];
+        
+    }else{
+        
+        self.remindLabel.hidden = YES;
+        
+    }
 }
 
 #pragma mark - lazy
@@ -86,6 +110,23 @@
     return _iconView;
 }
 
+-(UILabel *)remindLabel{
+    
+    if (!_remindLabel) {
+        
+        _remindLabel = [UILabel new];
+        _remindLabel.font = [UIFont systemFontOfSize:9];
+        _remindLabel.textAlignment = NSTextAlignmentCenter;
+        _remindLabel.textColor = [UIColor whiteColor];
+        _remindLabel.backgroundColor = [UIColor redColor];
+        _remindLabel.layer.cornerRadius = 8;
+        _remindLabel.layer.masksToBounds = YES;
+        
+    }
+    
+    return _remindLabel;
+}
+
 -(UILabel *)titleLabel{
     
     if (!_titleLabel) {

+ 5 - 0
UU_Ent/UU_Ent/Modules/Mine/Main/Others/YRUserInfo.h

@@ -39,6 +39,11 @@ NS_ASSUME_NONNULL_BEGIN
  */
 @property(assign,nonatomic)CGFloat scale;
 
+/**
+ 当前页面是否是工作的子页面
+ */
+@property(assign,nonatomic)BOOL isSubWork;
+
 @end
 
 NS_ASSUME_NONNULL_END

+ 77 - 5
UU_Ent/UU_Ent/Modules/Work/Main/Controllers/YRWorkVC.m

@@ -7,13 +7,14 @@
 //
 
 #import "YRWorkVC.h"
+#import "YRWebVC.h"
 #import <UU_Ent/App.pbrpc.h>
 #import "YRWorkTabCell.h"
 @interface YRWorkVC ()<UITableViewDelegate,UITableViewDataSource>
 
 @property(strong,nonatomic)YRTableView *tableView;
 
-@property(strong,nonatomic)NSMutableArray *dataArr;
+@property(strong,nonatomic)NSMutableArray<YRWorkConModel *> *dataArr;
 
 @property(strong,nonatomic)UILabel *titleLabel;
 
@@ -127,13 +128,43 @@
 
 -(void)viewWillAppear:(BOOL)animated{
     [super viewWillAppear:animated];
+   
+  
+    if ([YRUserInfo shareManager].isSubWork) {
+        
+        [self.navigationController setNavigationBarHidden:YES animated:YES];
+        
+    }else{
+        
+        self.navigationController.navigationBar.hidden = YES;
+        
+    }
     
-    if ([YRUserInfo shareManager]) {
+    if ([YRUserInfo shareManager].masChanged) {
         
         [self loadDataFromServer];
         
     }
     
+    
+    
+}
+
+-(void)viewDidAppear:(BOOL)animated{
+    [super viewDidAppear:animated];
+    
+    [YRUserInfo shareManager].isSubWork = NO;
+    self.navigationController.navigationBar.subviews[0].alpha = 1;
+    
+}
+
+-(void)viewWillDisappear:(BOOL)animated{
+    [super viewWillDisappear:animated];
+    
+    self.navigationController.navigationBar.hidden = NO;
+    
+    [self.navigationController setNavigationBarHidden:NO animated:NO];
+    
 }
 
 #pragma mark - 网络请求
@@ -151,7 +182,9 @@
             
             NSDictionary *dict = response.mj_keyValues;
             
-            DLog(@"%@",dict);
+            self.dataArr = [YRWorkConModel mj_objectArrayWithKeyValuesArray:dict[@"configArray"]];
+            
+            [self.tableView reloadData];
             
         }else{//请求失败
             
@@ -209,8 +242,7 @@
 
 -(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
     
-    
-    return (int)((float)(self.dataArr.count/4.0) + 0.99) * 80 + 32;
+    return (int)((float)(self.dataArr[indexPath.section].appConArr.count/4.0) + 0.99) * 80 + 32;
     
 }
 
@@ -238,11 +270,51 @@
         
     }
     
+    @weakify(self)
+    cell.didSelected = ^(YRWorkAppModel * _Nonnull model) {
+      @strongify(self)
+        [self pushVcWithModel:model];
+        
+    };
+    
+    if (indexPath.section < self.dataArr.count) {
+        
+        cell.conModel = self.dataArr[indexPath.section];
+        
+    }
     
     return cell;
     
 }
 
+-(void)pushVcWithModel:(YRWorkAppModel *)model{
+    
+    if (model.viewType == 0) {//原生
+        
+        YRBaseVC *VC = (YRBaseVC *)[[NSClassFromString(model.desVC) alloc]init];
+        
+        if (!VC) {//出现异常
+            
+            VC = [YRBaseVC new];
+            
+        }
+        
+        VC.title = model.name;
+        
+        [self.navigationController pushViewController:VC animated:YES];
+        
+    }else{//网页
+        
+        YRWebVC *webVC = [[YRWebVC alloc]init];
+        
+        webVC.url = model.webURL;
+        
+        [self.navigationController pushViewController:webVC animated:YES];
+        
+    }
+    
+}
+
 #pragma mark -scrollDelegate
 
 -(void)scrollViewDidScroll:(UIScrollView *)scrollView{

+ 97 - 0
UU_Ent/UU_Ent/Modules/Work/Main/Models/YRWorkConModel.h

@@ -0,0 +1,97 @@
+//
+//  YRWorkConModel.h
+//  UU_Ent
+//
+//  Created by liujl on 2019/5/6.
+//  Copyright © 2019 UAS. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+NS_ASSUME_NONNULL_BEGIN
+@class YRWorkAppModel;
+/**
+ 工作组信息模型
+ */
+@interface YRWorkConModel : NSObject
+
+/**
+ 应用
+ */
+@property(strong,nonatomic)NSMutableArray<YRWorkAppModel *> *appConArr;
+
+/**
+ 初始化
+ */
+@property(assign,nonatomic)NSUInteger initialized;
+
+/**
+ 应用总数
+ */
+@property(assign,nonatomic)NSUInteger appConfigArray_Count;
+
+/**
+ 名称
+ */
+@property(copy,nonatomic)NSString *name;
+
+@end
+
+/**
+ 配置模型
+ {
+ androidWidget = "/main/notice";
+ icon = "icon_notice";
+ "id_p" = 1;
+ initialized = 1;
+ iosWidget = noticeAnnouncement;
+ name = "\U901a\U77e5\U516c\U544a";
+ viewType = 0;
+ webURL = "";
+ }
+ */
+@interface YRWorkAppModel : NSObject
+
+/**
+ 安卓平台跳转
+ */
+@property(copy,nonatomic)NSString *androidWidget;
+
+/**
+ 图标
+ */
+@property(copy,nonatomic)NSString *icon;
+
+/**
+ 类型编码
+ */
+@property(assign,nonatomic)NSUInteger id_p;
+
+
+/**
+ iOS平台跳转
+ */
+@property(copy,nonatomic)NSString *iosWidget;
+
+/**
+ 名称
+ */
+@property(copy,nonatomic)NSString *name;
+
+/**
+ 跳转的判断,0为原生,1为网页
+ */
+@property(assign,nonatomic)NSUInteger viewType;
+
+/**
+ 跳转的控制器
+ */
+@property(copy,nonatomic)NSString *desVC;
+/**
+ 网页地址
+ */
+@property(copy,nonatomic)NSString *webURL;
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 62 - 0
UU_Ent/UU_Ent/Modules/Work/Main/Models/YRWorkConModel.m

@@ -0,0 +1,62 @@
+//
+//  YRWorkConModel.m
+//  UU_Ent
+//
+//  Created by liujl on 2019/5/6.
+//  Copyright © 2019 UAS. All rights reserved.
+//
+
+#import "YRWorkConModel.h"
+
+@implementation YRWorkConModel
+
++(NSDictionary *)mj_objectClassInArray{
+    
+    return @{@"appConArr":@"YRWorkAppModel"};
+    
+}
+
++(NSDictionary *)mj_replacedKeyFromPropertyName{
+    
+    return @{@"appConArr":@"appConfigArray"};
+    
+}
+
+-(void)setAppConArr:(NSMutableArray<YRWorkAppModel *> *)appConArr{
+    
+    _appConArr = appConArr;
+    //此处加载目标控制器
+    NSString *path = [[NSBundle mainBundle]pathForResource:@"work_route" ofType:@"json"];
+    
+    NSData *data = [[NSData alloc]initWithContentsOfFile:path];
+    
+    NSError *error = nil;
+    
+    NSDictionary *routeDic = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableLeaves error:&error];
+    
+    NSArray *routeArr = routeDic[@"data"];
+    
+    for (YRWorkAppModel *model in _appConArr) {
+        
+        for (NSDictionary *dic in routeArr) {
+            
+            if ([[NSString stringWithFormat:@"%lu",(unsigned long)model.id_p] isEqualToString:dic[@"id"]]) {
+                
+                model.desVC = dic[@"desVc"];
+                
+            }
+            
+        }
+        
+    }
+
+    
+    
+}
+
+@end
+
+
+@implementation YRWorkAppModel
+
+@end

+ 19 - 0
UU_Ent/UU_Ent/Modules/Work/Main/Others/work_route.json

@@ -0,0 +1,19 @@
+{
+    "version":"1",
+    "data":[
+        {"title":"通知公告",
+            "id":"1",
+            "desVc": "YRBaseVC",
+            "code":"uas.notice",
+            "desc":"通知公告",
+        },
+        {"title":"邀请注册",
+            "id":"2",
+            "desVc": "YRWebVC",
+            "code":"uas.invitationToRegister",
+            "desc":"邀请注册",
+        },
+    ]
+    
+}
+

+ 5 - 1
UU_Ent/UU_Ent/Modules/Work/Main/Views/YRWorkCollCell.h

@@ -7,11 +7,15 @@
 //
 
 #import <UIKit/UIKit.h>
-
+#import "YRWorkConModel.h"
 NS_ASSUME_NONNULL_BEGIN
 
 @interface YRWorkCollCell : UICollectionViewCell
 
+@property(strong,nonatomic)YRWorkAppModel *model;
+
+@property(copy,nonatomic)void(^selectedBlock)(YRWorkAppModel *model);
+
 @end
 
 NS_ASSUME_NONNULL_END

+ 43 - 35
UU_Ent/UU_Ent/Modules/Work/Main/Views/YRWorkCollCell.m

@@ -60,41 +60,41 @@
         
     }];
     
-    self.borderArr = [NSMutableArray array];
-    
-    UIView *topView = [UIView new];
-    topView.backgroundColor = HexColor(@"#DBDCDD");
-    
-    UIView *leftView = [UIView new];
-    leftView.backgroundColor = HexColor(@"#DBDCDD");
-    
-    UIView *bottomView = [UIView new];
-    bottomView.backgroundColor = HexColor(@"#DBDCDD");
-    
-    UIView *rightView = [UIView new];
-    rightView.backgroundColor = HexColor(@"#DBDCDD");
-    
-    [self.borderArr addObjectsFromArray:@[topView,leftView,bottomView,rightView]];
-    [self.contentView addSubview:topView];
-    [self.contentView addSubview:leftView];
-    [self.contentView addSubview:bottomView];
-    [self.contentView addSubview:rightView];
-    [topView mas_makeConstraints:^(MASConstraintMaker *make) {
-        make.top.left.right.equalTo(self.contentView);
-        make.height.mas_equalTo(0.3);
-    }];
-    [leftView mas_makeConstraints:^(MASConstraintMaker *make) {
-        make.top.left.bottom.equalTo(self.contentView);
-        make.width.mas_equalTo(0.3);
-    }];
-    [bottomView mas_makeConstraints:^(MASConstraintMaker *make) {
-        make.left.bottom.right.equalTo(self.contentView);
-        make.height.mas_equalTo(0.3);
-    }];
-    [rightView mas_makeConstraints:^(MASConstraintMaker *make) {
-        make.top.right.bottom.equalTo(self.contentView);
-        make.width.mas_equalTo(0.3);
-    }];
+//    self.borderArr = [NSMutableArray array];
+//    
+//    UIView *topView = [UIView new];
+//    topView.backgroundColor = HexColor(@"#DBDCDD");
+//    
+//    UIView *leftView = [UIView new];
+//    leftView.backgroundColor = HexColor(@"#DBDCDD");
+//    
+//    UIView *bottomView = [UIView new];
+//    bottomView.backgroundColor = HexColor(@"#DBDCDD");
+//    
+//    UIView *rightView = [UIView new];
+//    rightView.backgroundColor = HexColor(@"#DBDCDD");
+//    
+//    [self.borderArr addObjectsFromArray:@[topView,leftView,bottomView,rightView]];
+//    [self.contentView addSubview:topView];
+//    [self.contentView addSubview:leftView];
+//    [self.contentView addSubview:bottomView];
+//    [self.contentView addSubview:rightView];
+//    [topView mas_makeConstraints:^(MASConstraintMaker *make) {
+//        make.top.left.right.equalTo(self.contentView);
+//        make.height.mas_equalTo(0.3);
+//    }];
+//    [leftView mas_makeConstraints:^(MASConstraintMaker *make) {
+//        make.top.left.bottom.equalTo(self.contentView);
+//        make.width.mas_equalTo(0.3);
+//    }];
+//    [bottomView mas_makeConstraints:^(MASConstraintMaker *make) {
+//        make.left.bottom.right.equalTo(self.contentView);
+//        make.height.mas_equalTo(0.3);
+//    }];
+//    [rightView mas_makeConstraints:^(MASConstraintMaker *make) {
+//        make.top.right.bottom.equalTo(self.contentView);
+//        make.width.mas_equalTo(0.3);
+//    }];
     
 }
 
@@ -108,6 +108,14 @@
     }
 }
 
+-(void)setModel:(YRWorkAppModel *)model{
+    
+    _model = model;
+    self.iconView.image = [UIImage imageNamed:model.icon];
+    self.titleLabel.text = model.name;
+    
+}
+
 -(void)selectedOrNot{
     
     //    self.model.isSelected = !self.model.isSelected;

+ 5 - 1
UU_Ent/UU_Ent/Modules/Work/Main/Views/YRWorkTabCell.h

@@ -7,11 +7,15 @@
 //
 
 #import <UIKit/UIKit.h>
-
+#import "YRWorkConModel.h"
 NS_ASSUME_NONNULL_BEGIN
 
 @interface YRWorkTabCell : UITableViewCell
 
+@property(strong,nonatomic)YRWorkConModel *conModel;
+
+@property(copy,nonatomic)void(^didSelected)(YRWorkAppModel *model);
+
 @end
 
 NS_ASSUME_NONNULL_END

+ 23 - 3
UU_Ent/UU_Ent/Modules/Work/Main/Views/YRWorkTabCell.m

@@ -78,6 +78,17 @@
 }
 
 
+-(void)setConModel:(YRWorkConModel *)conModel{
+    
+    _conModel = conModel;
+    
+    _titleLabel.text = conModel.name;
+    
+    [self.collView reloadData];
+    
+}
+
+
 
 -(NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView{
     
@@ -88,13 +99,17 @@
 -(NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section{
     
     
-    return 3;
+    return self.conModel.appConArr.count;
     
 }
 
 -(void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath{
     
-   
+    if (self.didSelected) {
+        
+        self.didSelected(self.conModel.appConArr[indexPath.row]);
+        
+    }
     
 }
 
@@ -103,7 +118,12 @@
     
     YRWorkCollCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"YRWorkCollCellReid" forIndexPath:indexPath];
     
-   
+    
+    if (indexPath.row < self.conModel.appConArr.count) {
+        
+        cell.model = self.conModel.appConArr[indexPath.row];
+        
+    }
     
     return cell;
     

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

@@ -28,6 +28,7 @@
 #import <MJExtension/MJExtension.h>
 #import <IQKeyboardManager/IQKeyboardManager.h>
 #import <MBProgressHUD/MBProgressHUD.h>
-
+#import <MJRefresh/MJRefresh.h>
+#import <ReactiveObjC/ReactiveObjC.h>
 
 #endif /* import_h */