HF_Q лет назад: 4
Родитель
Сommit
db89eca3d7
23 измененных файлов с 638 добавлено и 1445 удалено
  1. 0 6
      smartRhino.xcodeproj/project.pbxproj
  2. BIN
      smartRhino.xcworkspace/xcuserdata/niuzhen.xcuserdatad/UserInterfaceState.xcuserstate
  3. 6 2
      smartRhino/Project/Base/SubClass/Controller/SearchBaseVC.h
  4. 281 153
      smartRhino/Project/Base/SubClass/Controller/SearchBaseVC.m
  5. 0 1
      smartRhino/Project/Base/SubClass/TabBarController/TabBarController.m
  6. 1 1
      smartRhino/Project/Base/SubClass/TabBarController/WorkFlowTabbarController.m
  7. 12 38
      smartRhino/Project/VCModel/ChatMessage/Controller/ChatMsgListVC.m
  8. 0 3
      smartRhino/Project/VCModel/Home/OtherHomeVC/MyTDTopic/VC/MyTDTopicDetailVC.m
  9. 3 3
      smartRhino/Project/VCModel/Home/VC/BookStore/View/BookAllLookCell.xib
  10. 10 10
      smartRhino/Project/VCModel/Home/VC/BookStore/View/BookHomeCell.m
  11. 6 6
      smartRhino/Project/VCModel/Home/VC/BookStore/View/BookHomeSubNumCell.xib
  12. 0 17
      smartRhino/Project/VCModel/Home/VC/HomeViewController.h
  13. 0 1005
      smartRhino/Project/VCModel/Home/VC/HomeViewController.m
  14. 71 7
      smartRhino/Project/VCModel/Home/VC/IndexViewController.m
  15. 93 13
      smartRhino/Project/VCModel/Source/Controller/SourceHomeVC.m
  16. 0 1
      smartRhino/Project/VCModel/WorkFlow/AgreeApprovalViewControllerSub.m
  17. 0 1
      smartRhino/Project/VCModel/WorkFlow/NextApprovalViewController.m
  18. 25 25
      smartRhino/Project/VCModel/WorkFlow/WorkFlowController.m
  19. 5 17
      smartRhino/Project/VCModel/WorkFlow/WorkNumberModel.h
  20. 3 13
      smartRhino/Project/VCModel/WorkFlow/WorkNumberModel.m
  21. 58 59
      smartRhino/Project/VCModel/common/Controller/CommonToolVC.m
  22. 60 60
      smartRhino/Project/VCModel/common/Controller/CommonWorkVC.m
  23. 4 4
      smartRhino/Project/VCModel/common/View/CommonListCell.m

+ 0 - 6
smartRhino.xcodeproj/project.pbxproj

@@ -576,7 +576,6 @@
 		C7D6B9D7235D7D7600770E7C /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C7D6B9D6235D7D7600770E7C /* Assets.xcassets */; };
 		C7D6B9DA235D7D7600770E7C /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C7D6B9D8235D7D7600770E7C /* LaunchScreen.storyboard */; };
 		C7D6B9DD235D7D7600770E7C /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = C7D6B9DC235D7D7600770E7C /* main.m */; };
-		C7D6BB38235DA18A00770E7C /* HomeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C7D6B9F8235DA18700770E7C /* HomeViewController.m */; };
 		C7D6BB3A235DA18A00770E7C /* MyChanelCollectionViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = C7D6B9FD235DA18700770E7C /* MyChanelCollectionViewCell.xib */; };
 		C7D6BB3B235DA18A00770E7C /* MyChanelCollectionViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = C7D6B9FF235DA18700770E7C /* MyChanelCollectionViewCell.m */; };
 		C7D6BB3C235DA18A00770E7C /* MyChanelCollectionReusableViewTop.xib in Resources */ = {isa = PBXBuildFile; fileRef = C7D6BA00235DA18700770E7C /* MyChanelCollectionReusableViewTop.xib */; };
@@ -2382,7 +2381,6 @@
 		C7D6B9DB235D7D7600770E7C /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
 		C7D6B9DC235D7D7600770E7C /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
 		C7D6B9E3235DA18600770E7C /* AppConfig.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppConfig.h; sourceTree = "<group>"; };
-		C7D6B9F8235DA18700770E7C /* HomeViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HomeViewController.m; sourceTree = "<group>"; };
 		C7D6B9FD235DA18700770E7C /* MyChanelCollectionViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MyChanelCollectionViewCell.xib; sourceTree = "<group>"; };
 		C7D6B9FE235DA18700770E7C /* MyChanelCollectionReusableViewTop.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MyChanelCollectionReusableViewTop.h; sourceTree = "<group>"; };
 		C7D6B9FF235DA18700770E7C /* MyChanelCollectionViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MyChanelCollectionViewCell.m; sourceTree = "<group>"; };
@@ -2421,7 +2419,6 @@
 		C7D6BA2B235DA18700770E7C /* HomeTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HomeTableViewCell.m; sourceTree = "<group>"; };
 		C7D6BA2C235DA18700770E7C /* HorizonScroll.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HorizonScroll.m; sourceTree = "<group>"; };
 		C7D6BA2E235DA18700770E7C /* HomeTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HomeTableViewCell.h; sourceTree = "<group>"; };
-		C7D6BA2F235DA18700770E7C /* HomeViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HomeViewController.h; sourceTree = "<group>"; };
 		C7D6BAD7235DA18800770E7C /* SmartRhino-Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "SmartRhino-Prefix.pch"; sourceTree = "<group>"; };
 		C7D6BADA235DA18900770E7C /* H5ViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = H5ViewController.m; sourceTree = "<group>"; };
 		C7D6BADC235DA18900770E7C /* TDFileStorage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TDFileStorage.m; sourceTree = "<group>"; };
@@ -5743,8 +5740,6 @@
 				C768AFB023796C0C00E0A066 /* IgnoreHeaderTouchTableView.m */,
 				C7D6BA15235DA18700770E7C /* HomeDetailController.h */,
 				C7D6BA11235DA18700770E7C /* HomeDetailController.m */,
-				C7D6BA2F235DA18700770E7C /* HomeViewController.h */,
-				C7D6B9F8235DA18700770E7C /* HomeViewController.m */,
 				EB44409424A1F5D200B2E212 /* IndexViewController.h */,
 				EB44409524A1F5D200B2E212 /* IndexViewController.m */,
 				324F17F2239E57010025CAE7 /* HomeTestViewController.h */,
@@ -9782,7 +9777,6 @@
 				EB568FC5239B47A3000827B0 /* ChatResultVC.m in Sources */,
 				C76FD29C238506E100E858F6 /* NodesModel.m in Sources */,
 				EB415146246BD1CB00030371 /* BookHomeModel.m in Sources */,
-				C7D6BB38235DA18A00770E7C /* HomeViewController.m in Sources */,
 				EB44409A24A1FF7400B2E212 /* HomeRecommendVC.m in Sources */,
 				C7D6BCB1235DA1CE00770E7C /* AccountAndSecurityViewController.m in Sources */,
 				C77E218323ADF55F009A230C /* SelectedTimeModel.m in Sources */,

BIN
smartRhino.xcworkspace/xcuserdata/niuzhen.xcuserdatad/UserInterfaceState.xcuserstate


+ 6 - 2
smartRhino/Project/Base/SubClass/Controller/SearchBaseVC.h

@@ -6,18 +6,22 @@
 //  Copyright © 2020 tederen. All rights reserved.
 //
 
-#import "BaseViewController.h"
+//#import "BaseViewController.h"
 
 NS_ASSUME_NONNULL_BEGIN
 
 
-@interface SearchBaseVC : BaseViewController
+@interface SearchBaseVC : UIViewController
 @property (strong, nonatomic) UICollectionView  * collectionView;
 @property (strong, nonatomic) UITableView  * tableView;
 @property (nonatomic, copy) NSString * searchText;
 @property (strong, nonatomic) UIView  * noDataView;
 @property (nonatomic, strong) UILabel * noDataL;
 @property (strong, nonatomic) UIButton  * cancelBtn;
+@property (nonatomic, assign) BOOL        IsAddUser;
+@property (copy, nonatomic) void(^cancelBlock)(void);
+@property (copy, nonatomic) void(^searchBlock)(NSString * text);
+
 @property (nonatomic, assign) HistorySearchType historySearchType;
 @end
 

+ 281 - 153
smartRhino/Project/Base/SubClass/Controller/SearchBaseVC.m

@@ -8,19 +8,126 @@
 
 #import "SearchBaseVC.h"
 #import "SearchCell.h"
+#import "DrawerView.h"
+#import "InfoSearchView.h"
+#import "TabBarController.h"
 
-@interface SearchBaseVC ()<UISearchBarDelegate,UICollectionViewDelegate,UICollectionViewDataSource>
-@property (strong, nonatomic) UISearchBar  * searchBar;
-@property (strong, nonatomic) UIView  * searchV;
-@property (strong, nonatomic) UIButton  * backBtn;
-@property (strong, nonatomic) UIView  * navBarV;
+@interface SearchBaseVC ()<UISearchBarDelegate,UICollectionViewDelegate,UICollectionViewDataSource,InfoSearchViewDelegate>
+//@property (strong, nonatomic) UISearchBar  * searchBar;
+//@property (strong, nonatomic) UIView  * searchV;
+//@property (strong, nonatomic) UIButton  * backBtn;
+//@property (strong, nonatomic) UIButton  * menuBtn;
+//@property (strong, nonatomic) UIView  * navBarV;
 @property (strong, nonatomic) UILabel  * lineL;
 @property (nonatomic, strong) NSMutableArray * dataDistoryArray;
+@property (strong,nonatomic) DrawerView      *drawerView;
+@property (nonatomic, strong) InfoSearchView *topNavSearch;
 
 
 @end
 
 @implementation SearchBaseVC
+- (InfoSearchView *)topNavSearch {
+    if (!_topNavSearch) {
+        _topNavSearch = [[InfoSearchView alloc] initWithFrame:CGRectMake(0, (IS_IPHONEX?40:20), kGXScreenWidth, 45) type:InfoSearchViewTypeDefault];
+        _topNavSearch.delegate = self;
+        WS(weakSelf);
+        _topNavSearch.backBlock = ^{
+            if (weakSelf.collectionView.isHidden) {
+                weakSelf.collectionView.hidden = NO;
+                weakSelf.noDataView.hidden = YES;
+                weakSelf.tableView.hidden = YES;
+            }else{
+                [weakSelf.navigationController popViewControllerAnimated:YES];
+            }
+        };
+        _topNavSearch.cancelBlock = ^{
+            if (weakSelf.cancelBlock) {
+                weakSelf.cancelBlock();
+            }
+            weakSelf.collectionView.hidden = NO;
+            weakSelf.noDataView.hidden = YES;
+            weakSelf.tableView.hidden = YES;
+        };
+//            self.topNavSearch.backBlock = ^{
+//                if (weakSelf.cancelBtn.isHidden) {
+//                    [weakSelf.navigationController popViewControllerAnimated:YES];
+//                }else{
+//                    weakSelf.collectionView.hidden = NO;
+//                    weakSelf.noDataView.hidden = YES;
+//                    weakSelf.tableView.hidden = YES;
+//        //            [weakSelf upCanCelBtnConstraits];
+//                }
+//            };
+//            self.topNavSearch.cancelBlock = ^{
+//        //        weakSelf.searchBar.text = @"";
+//                weakSelf.collectionView.hidden = NO;
+//                weakSelf.noDataView.hidden = YES;
+//                weakSelf.tableView.hidden = YES;
+//        //        [weakSelf upCanCelBtnConstraits];
+//            };
+        _topNavSearch.menuBlock = ^{
+            [weakSelf.view endEditing:YES];
+            [[UtilsTools getWindow] addSubview:weakSelf.drawerView];
+            weakSelf.drawerView.SelectDrawerBlock = ^(NSIndexPath * _Nonnull indexPath) {
+                if (![weakSelf.tabBarController isKindOfClass:[TabBarController class]]) {
+                    [TabBarController sharedTabBarController].tabBar.hidden = NO;
+                    [weakSelf.tabBarController.navigationController popViewControllerAnimated:NO];
+                }
+                if ([weakSelf.navigationController.viewControllers count] > 1) {
+                    [weakSelf.navigationController popToRootViewControllerAnimated:NO];
+                }
+                switch (indexPath.section) {
+                    case 0:
+                    {
+                        [[TabBarController sharedTabBarController] setSelectedIndex:indexPath.row];
+                    }
+                        break;
+                    case 1:
+                    {
+                        switch (indexPath.row) {
+                            case 0:
+                            {
+                                [[TabBarController sharedTabBarController] setSelectedIndex:2];
+                            }
+                                break;
+                            case 1:
+                            {
+                                [[TabBarController sharedTabBarController] setSelectedIndex:2];
+                            }
+                                break;
+                            default:
+                            {
+                                [[TabBarController sharedTabBarController] setSelectedIndex:3];
+                            }
+                                break;
+                        }
+                        dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
+                            [[NSNotificationCenter defaultCenter] postNotificationName:DRAWERPUSHVC object:nil userInfo:@{VCINDEX:@(indexPath.row)}];
+                        });
+                    }
+                        break;
+                    default:
+                    {
+                        [[TabBarController sharedTabBarController] setSelectedIndex:3];
+                        dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
+                            [[NSNotificationCenter defaultCenter] postNotificationName:DRAWERPUSHVC object:nil userInfo:@{VCINDEX:@(4 + indexPath.row)}];
+                        });
+                    }
+                        break;
+                }
+            };
+            weakSelf.drawerView.frame = CGRectMake(0,0, SCREEN_WIDTH, SCREEN_HEIGHT);// - kNavigationHeight
+        };
+    }
+    return _topNavSearch;
+}
+-(DrawerView *)drawerView{
+    if(!_drawerView){
+        _drawerView = [[DrawerView alloc] init];
+    }
+    return _drawerView;
+}
 - (UIView *)noDataView
 {
     if (!_noDataView) {
@@ -48,14 +155,22 @@
     }
     return _cancelBtn;
 }
-- (UIButton *)backBtn
-{
-    if (!_backBtn) {
-        _backBtn = [UIButton new];
-        [_backBtn setImage:IMG(@"back_black_icon") forState:UIControlStateNormal];
-    }
-    return _backBtn;
-}
+//- (UIButton *)backBtn
+//{
+//    if (!_backBtn) {
+//        _backBtn = [UIButton new];
+//        [_backBtn setImage:IMG(@"back_black_icon") forState:UIControlStateNormal];
+//    }
+//    return _backBtn;
+//}
+//- (UIButton *)menuBtn
+//{
+//    if (!_menuBtn) {
+//        _menuBtn = [UIButton new];
+//        [_menuBtn setImage:IMG(@"back_black_icon") forState:UIControlStateNormal];
+//    }
+//    return _menuBtn;
+//}
 - (UILabel *)lineL
 {
     if (!_lineL) {
@@ -64,21 +179,21 @@
     }
     return _lineL;
 }
-- (UIView *)navBarV
-{
-    if (!_navBarV) {
-        _navBarV = [UIView new];
-        _navBarV.backgroundColor = [UIColor whiteColor];
-    }
-    return _navBarV;
-}
-- (UISearchBar *)searchBar
-{
-    if (!_searchBar) {
-        _searchBar = [UISearchBar new];
-    }
-    return _searchBar;
-}
+//- (UIView *)navBarV
+//{
+//    if (!_navBarV) {
+//        _navBarV = [UIView new];
+//        _navBarV.backgroundColor = [UIColor whiteColor];
+//    }
+//    return _navBarV;
+//}
+//- (UISearchBar *)searchBar
+//{
+//    if (!_searchBar) {
+//        _searchBar = [UISearchBar new];
+//    }
+//    return _searchBar;
+//}
 - (UICollectionView *)collectionView
 {
     if (!_collectionView) {
@@ -111,60 +226,65 @@
     [self.collectionView registerClass:[UICollectionReusableView class] forSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:@"headReusableView"];
     self.collectionView.backgroundColor = [UIColor whiteColor];
     self.view.backgroundColor = RGB(255, 255, 255);
-    WS(weakSelf);
-    [self.backBtn setAction:^{
-        if (weakSelf.cancelBtn.isHidden) {
-            [weakSelf.navigationController popViewControllerAnimated:YES];
-        }else{
-            weakSelf.collectionView.hidden = NO;
-            weakSelf.noDataView.hidden = YES;
-            weakSelf.tableView.hidden = YES;
-            [weakSelf upCanCelBtnConstraits];
-        }
-    }];
-    [self.cancelBtn setAction:^{
-        weakSelf.searchBar.text = @"";
-        weakSelf.collectionView.hidden = NO;
-        weakSelf.noDataView.hidden = YES;
-        weakSelf.tableView.hidden = YES;
-        [weakSelf upCanCelBtnConstraits];
-    }];
-    [self.searchBar becomeFirstResponder];
+//    [self.cancelBtn setAction:^{
+//        weakSelf.searchBar.text = @"";
+//        weakSelf.collectionView.hidden = NO;
+//        weakSelf.noDataView.hidden = YES;
+//        weakSelf.tableView.hidden = YES;
+//        [weakSelf upCanCelBtnConstraits];
+//    }];
+//    [self.searchBar becomeFirstResponder];
 }
 - (void)setCusView
 {
-    [self.view addSubview:self.navBarV];
-    [self.navBarV mas_makeConstraints:^(MASConstraintMaker *make) {
-        make.top.left.right.mas_equalTo(self.view);
-        make.height.offset(IS_IPHONEX ? 84:64);
-    }];
-    [self.navBarV addSubview:self.backBtn];
-    [self.backBtn mas_makeConstraints:^(MASConstraintMaker *make) {
-        make.left.bottom.mas_equalTo(self.navBarV);
-        make.size.mas_offset(CGSizeMake(50, 44));
-    }];
-    [self.navBarV addSubview:self.cancelBtn];
-    [self upCanCelBtnConstraits];
-    [self.navBarV addSubview:self.searchBar];
-    [self.searchBar mas_makeConstraints:^(MASConstraintMaker *make) {
-        make.left.mas_equalTo(self.backBtn.mas_right);
-        make.centerY.mas_equalTo(self.backBtn);
-        make.height.mas_offset(32);
-        make.right.mas_equalTo(self.cancelBtn.mas_left).offset(-15);
-    }];
-    [self.navBarV addSubview:self.lineL];
+//    [self.view addSubview:self.navBarV];
+//    [self.navBarV mas_makeConstraints:^(MASConstraintMaker *make) {
+//        make.top.left.right.mas_equalTo(self.view);
+//        make.height.offset(IS_IPHONEX ? 84:64);
+//    }];
+//    [self.navBarV addSubview:self.backBtn];
+//    [self.backBtn mas_makeConstraints:^(MASConstraintMaker *make) {
+//        make.left.bottom.mas_equalTo(self.navBarV);
+//        make.size.mas_offset(CGSizeMake(50, 44));
+//    }];
+//    [self.navBarV addSubview:self.menuBtn];
+//    [self.menuBtn mas_makeConstraints:^(MASConstraintMaker *make) {
+//        make.bottom.mas_equalTo(self.navBarV);
+//        make.left.mas_equalTo(self.backBtn.mas_right);
+//        make.size.mas_offset(CGSizeMake(50, 44));
+//    }];
+//    [self.navBarV addSubview:self.cancelBtn];
+//    [self upCanCelBtnConstraits];
+//    [self.navBarV addSubview:self.searchBar];
+//    [self.searchBar mas_makeConstraints:^(MASConstraintMaker *make) {
+//        make.left.mas_equalTo(self.backBtn.mas_right);
+//        make.centerY.mas_equalTo(self.backBtn);
+//        make.height.mas_offset(32);
+//        make.right.mas_equalTo(self.cancelBtn.mas_left).offset(-15);
+//    }];
+    [self.view addSubview:self.topNavSearch];
+    if (self.IsAddUser) {
+        CGRect rect = self.topNavSearch.searchBar.frame;
+        CGFloat w = rect.size.width - 60;
+        rect.size.width = w;
+        self.topNavSearch.searchBar.frame = rect;
+        [self.topNavSearch addSubview:self.cancelBtn];
+        [self.cancelBtn mas_makeConstraints:^(MASConstraintMaker *make) {
+            make.left.mas_equalTo(self.topNavSearch.searchBar.mas_right).offset(5);
+            make.top.bottom.mas_equalTo(self.topNavSearch.searchBar);
+            make.width.mas_offset(55);
+        }];
+    }
+    [self.view addSubview:self.lineL];
     [self.lineL mas_makeConstraints:^(MASConstraintMaker *make) {
-        make.left.bottom.right.mas_equalTo(self.navBarV);
+        make.left.right.mas_equalTo(self.view);
+        make.top.mas_equalTo(self.topNavSearch.mas_bottom);
         make.height.mas_offset(0.5);
     }];
-    self.searchBar.layer.borderWidth = 0.5f;
-    self.searchBar.layer.cornerRadius = 3.f;
-    self.searchBar.layer.borderColor = UIColorHex(#CCCCCC).CGColor;
-    self.searchBar.layer.masksToBounds = YES;
     [self.view addSubview:self.collectionView];
     [self.view addSubview:self.tableView];
     [self.collectionView mas_makeConstraints:^(MASConstraintMaker *make) {
-        make.top.mas_equalTo(self.navBarV.mas_bottom);
+        make.top.mas_equalTo(self.lineL.mas_bottom);
         make.left.right.mas_equalTo(self.view);
         if (@available(iOS 11.0, *)) {
             make.bottom.equalTo(self.view.mas_safeAreaLayoutGuideBottom);
@@ -173,7 +293,7 @@
         }
     }];
     [self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
-        make.top.mas_equalTo(self.navBarV.mas_bottom);
+        make.top.mas_equalTo(self.lineL.mas_bottom);
         make.left.right.mas_equalTo(self.view);
         if (@available(iOS 11.0, *)) {
             make.bottom.equalTo(self.view.mas_safeAreaLayoutGuideBottom);
@@ -184,7 +304,7 @@
     [self.view addSubview:self.noDataView];
     self.noDataView.hidden = YES;
     [self.noDataView mas_makeConstraints:^(MASConstraintMaker *make) {
-        make.top.mas_equalTo(self.navBarV.mas_bottom);
+        make.top.mas_equalTo(self.lineL.mas_bottom);
         make.left.right.mas_equalTo(self.view);
         if (@available(iOS 11.0, *)) {
             make.bottom.equalTo(self.view.mas_safeAreaLayoutGuideBottom);
@@ -196,44 +316,44 @@
     [self.noDataL mas_makeConstraints:^(MASConstraintMaker *make) {
         make.center.mas_equalTo(self.noDataView);
     }];
-    _searchBar.backgroundImage = [UtilsTools imageWithColor:[UIColor clearColor] size:_searchBar.bounds.size];
-    
-    UIImage* clearImg = [UtilsTools imageWithColor:[UIColor clearColor] andHeight:44.0f];
-    [_searchBar setBackgroundImage:clearImg];
-    [_searchBar setSearchFieldBackgroundImage:clearImg forState:UIControlStateNormal];
-    [_searchBar setBackgroundColor:[UIColor clearColor]];
-
-    [_searchV setBackgroundColor:[UIColor whiteColor]];
-    [_searchV setRadius:4 borderColor:RGB(204, 204, 204) borderWidth:.5];
-    self.searchBar.delegate = self;
-
-    if ([UIDevice currentDevice].systemVersion.floatValue >= 13.0) {
-        self.searchBar.searchTextField.font = [UIFont systemFontOfSize:14.0];
-    if (!self.searchBar.searchTextField.placeholder) {
-        self.searchBar.searchTextField.placeholder = @"搜索";
-        }
-        NSAttributedString *attrString = [[NSAttributedString alloc] initWithString:self.searchBar.searchTextField.placeholder attributes: @{NSForegroundColorAttributeName:RGB(153, 153, 153), NSFontAttributeName:self.searchBar.searchTextField.font}];
-        self.searchBar.searchTextField.attributedPlaceholder = attrString;
-    }else{
-        for (UIView *view in self.searchBar.subviews.lastObject.subviews) {
-            if([view isKindOfClass:NSClassFromString(@"UISearchBarTextField")]) {
-                UITextField *textField = (UITextField *)view;
-                //设置输入框的背景颜色
-                textField.clipsToBounds = YES;
-                //设置输入字体颜色
-                textField.textColor = [UIColor blackColor];
-                //设置默认文字颜色
-                textField.attributedPlaceholder = [[NSAttributedString alloc] initWithString:@" 搜索" attributes:@{NSForegroundColorAttributeName:[UIColor hexStringToColor:@"999999"]}];
-                textField.font = [UIFont systemFontOfSize:14];
-                for (UIView * subView in view.subviews) {
-                    if ([subView isKindOfClass:NSClassFromString(@"UIImageView")]) {
-                        UIImageView * imageV = (UIImageView *)subView;
-                        imageV.image = IMG(@"searchIcon");
-                    }
-                }
-            }
-        }
-    }
+//    _searchBar.backgroundImage = [UtilsTools imageWithColor:[UIColor clearColor] size:_searchBar.bounds.size];
+//
+//    UIImage* clearImg = [UtilsTools imageWithColor:[UIColor clearColor] andHeight:44.0f];
+//    [_searchBar setBackgroundImage:clearImg];
+//    [_searchBar setSearchFieldBackgroundImage:clearImg forState:UIControlStateNormal];
+//    [_searchBar setBackgroundColor:[UIColor clearColor]];
+//
+//    [_searchV setBackgroundColor:[UIColor whiteColor]];
+//    [_searchV setRadius:4 borderColor:RGB(204, 204, 204) borderWidth:.5];
+//    self.searchBar.delegate = self;
+//
+//    if ([UIDevice currentDevice].systemVersion.floatValue >= 13.0) {
+//        self.searchBar.searchTextField.font = [UIFont systemFontOfSize:14.0];
+//    if (!self.searchBar.searchTextField.placeholder) {
+//        self.searchBar.searchTextField.placeholder = @"搜索";
+//        }
+//        NSAttributedString *attrString = [[NSAttributedString alloc] initWithString:self.searchBar.searchTextField.placeholder attributes: @{NSForegroundColorAttributeName:RGB(153, 153, 153), NSFontAttributeName:self.searchBar.searchTextField.font}];
+//        self.searchBar.searchTextField.attributedPlaceholder = attrString;
+//    }else{
+//        for (UIView *view in self.searchBar.subviews.lastObject.subviews) {
+//            if([view isKindOfClass:NSClassFromString(@"UISearchBarTextField")]) {
+//                UITextField *textField = (UITextField *)view;
+//                //设置输入框的背景颜色
+//                textField.clipsToBounds = YES;
+//                //设置输入字体颜色
+//                textField.textColor = [UIColor blackColor];
+//                //设置默认文字颜色
+//                textField.attributedPlaceholder = [[NSAttributedString alloc] initWithString:@" 搜索" attributes:@{NSForegroundColorAttributeName:[UIColor hexStringToColor:@"999999"]}];
+//                textField.font = [UIFont systemFontOfSize:14];
+//                for (UIView * subView in view.subviews) {
+//                    if ([subView isKindOfClass:NSClassFromString(@"UIImageView")]) {
+//                        UIImageView * imageV = (UIImageView *)subView;
+//                        imageV.image = IMG(@"searchIcon");
+//                    }
+//                }
+//            }
+//        }
+//    }
 }
 - (NSMutableArray *)dataDistoryArray
 {
@@ -273,7 +393,6 @@
 - (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath{
     [collectionView deselectItemAtIndexPath:indexPath animated:YES];
     [self selectIndexText:[self.dataDistoryArray objectAtIndex:indexPath.row]];
-    [self showCancelBtn];
 }
 
 //footer的size
@@ -341,13 +460,20 @@
     }
     return nil;
 }
-
+- (void)searchButtonAction:(UISearchBar *)searchBar {
+    if (searchBar.text.length > 0) {
+        [self selectIndexText:searchBar.text];
+    }
+}
 - (void)selectIndexText:(NSString *)text
 {
+    self.searchText = text;
     self.tableView.hidden = NO;
     self.collectionView.hidden = YES;
-    self.searchBar.text = text;
-    self.searchText = self.searchBar.text;
+    [self.view endEditing:YES];
+    if (self.searchBlock) {
+        self.searchBlock(text);
+    }
 }
 
 - (void)checkRepeatString:(NSString *)string {
@@ -371,45 +497,47 @@
     if (searchBar.text.length > 0) {
         [self selectIndexText:searchBar.text];
         [self checkRepeatString:searchBar.text];
-        [self showCancelBtn];
-    }
-}
-- (void)searchBar:(UISearchBar *)searchBar textDidChange:(NSString *)searchText{
-
-}
-- (void)searchBarTextDidBeginEditing:(UISearchBar *) searchBar{
-    UITextField *searchBarTextField = nil;
-    NSArray *views = ([[[UIDevice currentDevice] systemVersion] floatValue] < 7.0) ? searchBar.subviews : [[searchBar.subviews objectAtIndex:0] subviews];
-    
-    for (UIView *subview in views){
-        if ([subview isKindOfClass:[UITextField class]]){
-            searchBarTextField = (UITextField *)subview;
-            break;
-        }
+//        [self showCancelBtn];
     }
-    searchBarTextField.enablesReturnKeyAutomatically = NO;
 }
-- (void)showCancelBtn
-{
-    if (self.cancelBtn.hidden) {
-        self.cancelBtn.hidden = NO;
-        [self.cancelBtn mas_remakeConstraints:^(MASConstraintMaker *make) {
-            make.right.mas_equalTo(self.navBarV.mas_right).offset(-15);
-            make.centerY.mas_equalTo(self.backBtn);
-        }];
+- (void)textDidChange:(NSString *)text {
+    if (text.length > 0) {
+        [self selectIndexText:text];
     }
 }
-- (void)upCanCelBtnConstraits
-{
-    self.cancelBtn.hidden = YES;
-    [self.cancelBtn mas_remakeConstraints:^(MASConstraintMaker *make) {
-        make.right.mas_equalTo(self.navBarV.mas_right);
-        make.centerY.mas_equalTo(self.backBtn);
-        make.width.mas_offset(0);
-    }];
-}
-- (void)searchBar:(UISearchBar *)searchBar selectedScopeButtonIndexDidChange:(NSInteger)selectedScope{
-        NSLog(@"%@1",searchBar.text);
-}
+//- (void)searchBarTextDidBeginEditing:(UISearchBar *) searchBar{
+//    UITextField *searchBarTextField = nil;
+//    NSArray *views = ([[[UIDevice currentDevice] systemVersion] floatValue] < 7.0) ? searchBar.subviews : [[searchBar.subviews objectAtIndex:0] subviews];
+//
+//    for (UIView *subview in views){
+//        if ([subview isKindOfClass:[UITextField class]]){
+//            searchBarTextField = (UITextField *)subview;
+//            break;
+//        }
+//    }
+//    searchBarTextField.enablesReturnKeyAutomatically = NO;
+//}
+//- (void)showCancelBtn
+//{
+//    if (self.cancelBtn.hidden) {
+//        self.cancelBtn.hidden = NO;
+//        [self.cancelBtn mas_remakeConstraints:^(MASConstraintMaker *make) {
+//            make.right.mas_equalTo(self.navBarV.mas_right).offset(-15);
+//            make.centerY.mas_equalTo(self.backBtn);
+//        }];
+//    }
+//}
+//- (void)upCanCelBtnConstraits
+//{
+//    self.cancelBtn.hidden = YES;
+//    [self.cancelBtn mas_remakeConstraints:^(MASConstraintMaker *make) {
+//        make.right.mas_equalTo(self.navBarV.mas_right);
+//        make.centerY.mas_equalTo(self.backBtn);
+//        make.width.mas_offset(0);
+//    }];
+//}
+//- (void)searchBar:(UISearchBar *)searchBar selectedScopeButtonIndexDidChange:(NSInteger)selectedScope{
+//        NSLog(@"%@1",searchBar.text);
+//}
 
 @end

+ 0 - 1
smartRhino/Project/Base/SubClass/TabBarController/TabBarController.m

@@ -8,7 +8,6 @@
 
 #import "TabBarController.h"
 #import "NavigationController.h"
-#import "HomeViewController.h"
 #import "WorkFlowController.h"
 #import "MyViewController.h"
 #import "AppDelegate.h"

+ 1 - 1
smartRhino/Project/Base/SubClass/TabBarController/WorkFlowTabbarController.m

@@ -11,7 +11,7 @@
 #import "MyWorkFlowListController.h"
 #import "WorkFlowFecordController.h"
 #import "NavigationController.h"
-#import "HomeViewController.h"
+#import "IndexViewController.h"
 #import "MyViewController.h"
 #import "AppDelegate.h"
 #import "My_CenterVC.h"

+ 12 - 38
smartRhino/Project/VCModel/ChatMessage/Controller/ChatMsgListVC.m

@@ -73,10 +73,6 @@ static int kConversation_AtAll = 2;
 @property (strong,nonatomic) NSMutableArray *dataArray;
 @property (strong,nonatomic) NSMutableArray *chatListIMArray;
 @property (strong,nonatomic) NSMutableArray *selectArray;
-@property (assign,nonatomic) NSInteger       countUnredNum;
-@property (assign,nonatomic) NSInteger       noticeNum;
-@property (assign,nonatomic) NSInteger       missiveNum;
-@property (assign,nonatomic) NSInteger       waitNum;
 @property (assign,nonatomic) BOOL            isAllselect;
 @end
 
@@ -104,6 +100,11 @@ static int kConversation_AtAll = 2;
     [self.chatListIMArray removeAllObjects];
     [self getUnreadCount];
 }
+- (void)getUnreadCount
+{
+    [self initCollectionData];
+    [self initChatMsgIMData];
+}
 - (UITableView *)tableView
 {
     if (!_tableView) {
@@ -112,24 +113,6 @@ static int kConversation_AtAll = 2;
     }
     return _tableView;
 }
-- (void)getUnreadCount
-{
-    WS(weakSelf);
-    [[HttpManager sharedHttpManager] GETUrl:Host(API_APP_User_User_Uread_Count) parameters:@{} responseStyle:JOSN success:^(id  _Nonnull responseObject) {
-        weakSelf.noticeNum = [responseObject[@"noticeCount"] integerValue];
-        weakSelf.missiveNum = [responseObject[@"missiveCount"] integerValue];
-        weakSelf.waitNum = [responseObject[@"WaitHandleUFinishCount"] integerValue];
-        dispatch_async(dispatch_get_main_queue(), ^{
-            [weakSelf initCollectionData];
-            [weakSelf initChatMsgIMData];
-        });
-    } failure:^(NSError * _Nonnull error) {
-        dispatch_async(dispatch_get_main_queue(), ^{
-            [weakSelf initCollectionData];
-            [weakSelf initChatMsgIMData];
-        });
-    }];
-}
 - (void)conversationListDidUpdate:(NSArray *)aConversationList
 {
     [self _loadAllConversationsFromDBWithIsShowHud:NO];
@@ -220,11 +203,7 @@ static int kConversation_AtAll = 2;
         ChatMsgTopSearchVC *vc = [[ChatMsgTopSearchVC alloc] init];
         [weakSelf.navigationController pushViewController:vc animated:YES];
     }];
-    if (@available(iOS 11.0, *)) {
-        self.tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
-    } else {
-        self.automaticallyAdjustsScrollViewInsets = NO;
-    }
+    self.tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
     [self.view addSubview:self.tableView];
     [self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
         make.left.right.mas_equalTo(self.view);
@@ -917,7 +896,6 @@ static int kConversation_AtAll = 2;
 - (void)replaceChatData
 {
     WS(weakSelf);
-    self.countUnredNum = 0;
     [self.chatListIMArray enumerateObjectsUsingBlock:^(id  _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
         ChatMsgListImModel * chatModel = (ChatMsgListImModel *)obj;
         [weakSelf.dataArray enumerateObjectsUsingBlock:^(id  _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
@@ -926,7 +904,6 @@ static int kConversation_AtAll = 2;
                 EMConversation *conversation = model.emModel;
                 if (!chatModel.IsDisturb) {
                     chatModel.redNum = model.emModel.unreadMessagesCount;
-                    weakSelf.countUnredNum += model.emModel.unreadMessagesCount;
                 }
                 chatModel.ChatText = [weakSelf _getDetailWithModel:conversation];
             }
@@ -934,9 +911,6 @@ static int kConversation_AtAll = 2;
     }];
     dispatch_async(dispatch_get_main_queue(), ^{
         [weakSelf.tableView reloadData];
-//        NSInteger count = (weakSelf.countUnredNum + weakSelf.noticeNum + weakSelf.missiveNum);
-        NSInteger count = (weakSelf.countUnredNum + weakSelf.noticeNum + weakSelf.missiveNum + weakSelf.waitNum);
-        weakSelf.tabBarController.tabBar.items[2].badgeValue = count > 0 ? [NSString stringWithFormat:@"%ld",(long)count] : nil;
     });
 }
 - (NSAttributedString *)_getDetailWithModel:(EMConversation *)aConversation
@@ -1076,8 +1050,8 @@ static int kConversation_AtAll = 2;
     switch (bean.type) {
         case ChatMenuNoticeType:
         {
-            cell.cell0ReadNumLabel.hidden = self.noticeNum == 0 ? YES : NO;
-            NSString * count = [NSString stringWithFormat:@"%ld",(long)self.noticeNum];
+            cell.cell0ReadNumLabel.hidden = YES;
+            NSString * count = @"0";
             cell.cell0ReadNumLabel.text = count;
             UILabel * label = [UILabel new];
             label.font = [UIFont systemFontOfSize:12];
@@ -1092,8 +1066,8 @@ static int kConversation_AtAll = 2;
             break;
         case ChatMenuZhanXinType:
         {
-            cell.cell0ReadNumLabel.hidden = self.missiveNum == 0 ? YES : NO;
-            NSString * count = [NSString stringWithFormat:@"%ld",(long)self.missiveNum];
+            cell.cell0ReadNumLabel.hidden = YES;
+            NSString * count = @"0";
             cell.cell0ReadNumLabel.text = count;
             UILabel * label = [UILabel new];
             label.font = [UIFont systemFontOfSize:12];
@@ -1108,8 +1082,8 @@ static int kConversation_AtAll = 2;
             break;
         case ChatMenuWaitType:
         {
-            cell.cell0ReadNumLabel.hidden = self.waitNum == 0 ? YES : NO;
-            NSString * count = [NSString stringWithFormat:@"%ld",(long)self.waitNum];
+            cell.cell0ReadNumLabel.hidden = YES;
+            NSString * count = @"0";
             cell.cell0ReadNumLabel.text = count;
             UILabel * label = [UILabel new];
             label.font = [UIFont systemFontOfSize:12];

+ 0 - 3
smartRhino/Project/VCModel/Home/OtherHomeVC/MyTDTopic/VC/MyTDTopicDetailVC.m

@@ -1910,9 +1910,6 @@
         case CollectModel_meet:
             vc.CollectionType = 400;
             break;
-        case CollectModel_Aritle:
-            vc.CollectionType = 1;
-            break;
         default:
             vc.CollectionType = self.type;
             break;

+ 3 - 3
smartRhino/Project/VCModel/Home/VC/BookStore/View/BookAllLookCell.xib

@@ -1,9 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="15705" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="16097" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
     <device id="retina6_1" orientation="portrait" appearance="light"/>
     <dependencies>
         <deployment identifier="iOS"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15706"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="16087"/>
         <capability name="Safe area layout guides" minToolsVersion="9.0"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
@@ -17,7 +17,7 @@
                 <rect key="frame" x="0.0" y="0.0" width="348" height="120"/>
                 <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                 <subviews>
-                    <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="img_placeHolder" translatesAutoresizingMaskIntoConstraints="NO" id="1cH-ae-3WY">
+                    <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="img_placeHolder" translatesAutoresizingMaskIntoConstraints="NO" id="1cH-ae-3WY">
                         <rect key="frame" x="15" y="15" width="62" height="90"/>
                         <constraints>
                             <constraint firstAttribute="height" constant="90" id="RCa-0d-gY6"/>

+ 10 - 10
smartRhino/Project/VCModel/Home/VC/BookStore/View/BookHomeCell.m

@@ -68,7 +68,7 @@
             break;
         case BookHomeB:
         {
-            layout.sectionInset = UIEdgeInsetsMake(0, 20, 10, 0);
+            layout.sectionInset = UIEdgeInsetsMake(0, 0, 10, 0);
             layout.scrollDirection = UICollectionViewScrollDirectionHorizontal;
             NSInteger row = 0;
             if (self.dataArray.count / 3 > 0) {
@@ -77,20 +77,20 @@
                 row = 1;
             }
             [self.collectionView setContentSize:CGSizeMake((SCREEN_WIDTH - 40) * row, 101 * self.dataArray.count >= 3 ? 3 : self.dataArray.count)];
-            self.offset = SCREEN_WIDTH - 40;
+            self.offset = SCREEN_WIDTH - 30;
         }
             break;
         case BookHomeC:
         {
-            layout.sectionInset = UIEdgeInsetsMake(0, 20, 10, 0);
+            layout.sectionInset = UIEdgeInsetsMake(0, 0, 10, 0);
             layout.scrollDirection = UICollectionViewScrollDirectionHorizontal;
             [self.collectionView setContentSize:CGSizeMake((SCREEN_WIDTH - 40) * 3, 101 * 3)];
-            self.offset = SCREEN_WIDTH - 40;
+            self.offset = SCREEN_WIDTH - 30;
         }
             break;
         case BookHomeD:
         {
-            layout.sectionInset = UIEdgeInsetsMake(0, 20, 10, 0);
+            layout.sectionInset = UIEdgeInsetsMake(0, 0, 10, 0);
             layout.scrollDirection = UICollectionViewScrollDirectionHorizontal;
             NSInteger row = 0;
             if (self.dataArray.count / 3 > 0) {
@@ -99,20 +99,20 @@
                 row = 1;
             }
             [self.collectionView setContentSize:CGSizeMake((SCREEN_WIDTH - 40) * row, 101 * self.dataArray.count >= 3 ? 3 : self.dataArray.count)];
-            self.offset = SCREEN_WIDTH - 40;
+            self.offset = SCREEN_WIDTH - 30;
         }
             break;
         case BookHomeE:
         {
-            layout.sectionInset = UIEdgeInsetsMake(0, 20, 10, 0);
+            layout.sectionInset = UIEdgeInsetsMake(0, 0, 10, 0);
             layout.scrollDirection = UICollectionViewScrollDirectionHorizontal;
             [self.collectionView setContentSize:CGSizeMake((SCREEN_WIDTH - 40) * 3, 101 * 3)];
-            self.offset = SCREEN_WIDTH - 40;
+            self.offset = SCREEN_WIDTH - 30;
         }
             break;
         default:
         {
-            layout.sectionInset = UIEdgeInsetsMake(0, 20, 10, 0);
+            layout.sectionInset = UIEdgeInsetsMake(0, 0, 10, 0);
             layout.scrollDirection = UICollectionViewScrollDirectionHorizontal;
             NSInteger row = 0;
             if (self.dataArray.count / 2 > 0) {
@@ -121,7 +121,7 @@
                 row = 1;
             }
             [self.collectionView setContentSize:CGSizeMake((SCREEN_WIDTH - 40) * 0.5 * row, 101 * self.dataArray.count >= 2 ? 2 : self.dataArray.count)];
-            self.offset = SCREEN_WIDTH - 40;
+            self.offset = SCREEN_WIDTH - 20;
         }
             break;
     }

+ 6 - 6
smartRhino/Project/VCModel/Home/VC/BookStore/View/BookHomeSubNumCell.xib

@@ -18,14 +18,14 @@
                 <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                 <subviews>
                     <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="img_placeHolder" translatesAutoresizingMaskIntoConstraints="NO" id="bA2-sd-Bwc">
-                        <rect key="frame" x="0.0" y="0.0" width="65" height="94"/>
+                        <rect key="frame" x="20" y="0.0" width="65" height="94"/>
                         <constraints>
                             <constraint firstAttribute="height" constant="94" id="Vo6-NV-DS7"/>
                             <constraint firstAttribute="width" secondItem="bA2-sd-Bwc" secondAttribute="height" multiplier="112:162" id="r58-ug-rNo"/>
                         </constraints>
                     </imageView>
                     <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="vsA-5i-JVn">
-                        <rect key="frame" x="80" y="7" width="253" height="80"/>
+                        <rect key="frame" x="100" y="7" width="248" height="80"/>
                         <subviews>
                             <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="1" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="M5f-8l-e79">
                                 <rect key="frame" x="0.0" y="0.0" width="22" height="20"/>
@@ -37,13 +37,13 @@
                                 <nil key="highlightedColor"/>
                             </label>
                             <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="252" verticalCompressionResistancePriority="751" text="小学教材全解(四年级语文下)" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="liJ-1z-MiV">
-                                <rect key="frame" x="22" y="0.0" width="231" height="21"/>
+                                <rect key="frame" x="22" y="0.0" width="226" height="21"/>
                                 <fontDescription key="fontDescription" type="system" pointSize="17"/>
                                 <nil key="textColor"/>
                                 <nil key="highlightedColor"/>
                             </label>
                             <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="王德培等" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="z8u-OB-Dnl">
-                                <rect key="frame" x="22" y="29" width="231" height="51"/>
+                                <rect key="frame" x="22" y="29" width="226" height="51"/>
                                 <fontDescription key="fontDescription" name=".AppleSystemUIFont" family=".AppleSystemUIFont" pointSize="12"/>
                                 <color key="textColor" red="0.36470588235294116" green="0.39215686274509803" blue="0.43137254901960786" alpha="0.84705882352941175" colorSpace="calibratedRGB"/>
                                 <nil key="highlightedColor"/>
@@ -76,10 +76,10 @@
                 <constraint firstAttribute="trailing" secondItem="Bc8-wf-3Ic" secondAttribute="trailing" constant="15" id="6Lw-y5-oOB"/>
                 <constraint firstItem="vsA-5i-JVn" firstAttribute="leading" secondItem="bA2-sd-Bwc" secondAttribute="trailing" constant="15" id="6yi-Fb-K8a"/>
                 <constraint firstAttribute="bottom" secondItem="Bc8-wf-3Ic" secondAttribute="bottom" id="7AL-vl-Mf1"/>
-                <constraint firstAttribute="trailing" secondItem="vsA-5i-JVn" secondAttribute="trailing" constant="15" id="ELT-O2-tLk"/>
+                <constraint firstAttribute="trailing" secondItem="vsA-5i-JVn" secondAttribute="trailing" id="ELT-O2-tLk"/>
                 <constraint firstItem="vsA-5i-JVn" firstAttribute="centerY" secondItem="bA2-sd-Bwc" secondAttribute="centerY" id="EVs-3f-JGh"/>
                 <constraint firstItem="Bc8-wf-3Ic" firstAttribute="top" secondItem="bA2-sd-Bwc" secondAttribute="bottom" priority="750" constant="15" id="SgZ-gd-cb8"/>
-                <constraint firstItem="bA2-sd-Bwc" firstAttribute="leading" secondItem="gTV-IL-0wX" secondAttribute="leading" id="fU8-3I-kJ6"/>
+                <constraint firstItem="bA2-sd-Bwc" firstAttribute="leading" secondItem="gTV-IL-0wX" secondAttribute="leading" constant="20" id="fU8-3I-kJ6"/>
                 <constraint firstItem="bA2-sd-Bwc" firstAttribute="top" secondItem="gTV-IL-0wX" secondAttribute="top" id="ffI-0V-uny"/>
                 <constraint firstItem="Bc8-wf-3Ic" firstAttribute="leading" secondItem="gTV-IL-0wX" secondAttribute="leading" constant="15" id="pPE-tv-Q5G"/>
             </constraints>

+ 0 - 17
smartRhino/Project/VCModel/Home/VC/HomeViewController.h

@@ -1,17 +0,0 @@
-//
-//  HomeViewController.h
-//  TheoryNetwork
-//
-//  Created by tederen on 2019/9/20.
-//  Copyright © 2019 tederen. All rights reserved.
-//
-
-#import <UIKit/UIKit.h>
-
-NS_ASSUME_NONNULL_BEGIN
-
-@interface HomeViewController : BaseViewController
-
-@end
-
-NS_ASSUME_NONNULL_END

Разница между файлами не показана из-за своего большого размера
+ 0 - 1005
smartRhino/Project/VCModel/Home/VC/HomeViewController.m


+ 71 - 7
smartRhino/Project/VCModel/Home/VC/IndexViewController.m

@@ -66,6 +66,7 @@
 @property (nonatomic, assign) NSInteger        currentPage;
 @property (nonatomic, assign) NSInteger        totalPage;
 @property (nonatomic, assign) NSInteger        currentChannel;
+@property (nonatomic, assign) NSInteger        unReadCount;
 
 @property (nonatomic, strong) TDButton *addButton;
 @property (nonatomic, strong) TDButton *musicButtton;
@@ -78,6 +79,8 @@
 /// 我的频道
 @property (copy, nonatomic) NSMutableArray    *myChannel;
 @property (copy, nonatomic)   NSString        *style;
+@property (strong, nonatomic) NSMutableArray    *chatListIMArray;
+@property (strong, nonatomic) NSMutableArray    *dataArray;
 @end
 
 @implementation IndexViewController
@@ -85,7 +88,7 @@
 - (void)viewWillAppear:(BOOL)animated
 {
     [super viewWillAppear:animated];
-    [self getRedBadge];
+    [self getUnreadCount];
 }
 #pragma mark - LifeCycle
 - (void)viewDidLoad {
@@ -273,18 +276,79 @@
         }
     }
 }
-
-- (void)getRedBadge
+- (void)getUnreadCount
 {
     WS(weakSelf);
-    //获取我审批和我发起以及抄送我的未读数
-    [[HttpManager sharedHttpManager] GETUrl:[NSString stringWithFormat:@"%@%@",BaseUrl,@"/api/app/user/user-uread-count"] parameters:@{} responseStyle:JOSN success:^(id  _Nonnull responseObject) {
+    [[HttpManager sharedHttpManager] GETUrl:Host(API_APP_User_User_Uread_Count) parameters:@{} responseStyle:JOSN success:^(id  _Nonnull responseObject) {
         NSDictionary *dic = responseObject;
         WorkNumberModel *numberModel = [[WorkNumberModel alloc] initWithDictionary:dic error:nil];
-        weakSelf.tabBarController.tabBar.items[1].badgeValue = numberModel.allNumber;
-        weakSelf.tabBarController.tabBar.items[2].badgeValue = numberModel.allNotifacationNumber;
+        weakSelf.unReadCount = numberModel.allNumber;
+        dispatch_async(dispatch_get_main_queue(), ^{
+            [weakSelf initChatMsgIMData];
+        });
+    } failure:^(NSError * _Nonnull error) {
+    }];
+}
+-(void)initChatMsgIMData{
+    self.chatListIMArray = [NSMutableArray array];
+    WS(weakSelf);
+    SHOWLOADING
+    [[HttpManager sharedHttpManager] POSTUrl:Host(Often_Contact_List) parameters:@{@"IndividualGroupId":@(0)} responseStyle:JOSN success:^(id  _Nonnull responseObject) {
+        NSLog(@"%@",responseObject);
+        REMOVESHOW
+        if ([responseObject isKindOfClass:[NSArray class]]) {
+            for (NSDictionary * dict in responseObject) {
+                ChatMsgListImModel * model = [ChatMsgListImModel modelWithDictionary:dict];
+                [weakSelf.chatListIMArray addObject:model];
+            }
+        }
+        [weakSelf _loadAllConversationsFromDBWithIsShowHud:NO];
     } failure:^(NSError * _Nonnull error) {
+        REMOVESHOW
+        NSLog(@"%@",error);
+    }];
+}
+- (void)_loadAllConversationsFromDBWithIsShowHud:(BOOL)aIsShowHUD
+{
+    __weak typeof(self) weakself = self;
+    self.dataArray = [NSMutableArray array];
+    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
+        NSArray *conversations = [[EMClient sharedClient].chatManager getAllConversations];
+        NSArray *sorted = [conversations sortedArrayUsingComparator:^(EMConversation *obj1, EMConversation *obj2) {
+            EMMessage *message1 = [obj1 latestMessage];
+            EMMessage *message2 = [obj2 latestMessage];
+            if(message1.timestamp > message2.timestamp) {
+                return(NSComparisonResult)NSOrderedAscending;
+            } else {
+                return(NSComparisonResult)NSOrderedDescending;
+            }}];
+        NSArray *models = [EMConversationHelper modelsFromEMConversations:sorted];
+        [weakself.dataArray addObjectsFromArray:models];
+        [weakself replaceChatData];
+    });
+}
+- (void)replaceChatData
+{
+    WS(weakSelf);
+    [self.chatListIMArray enumerateObjectsUsingBlock:^(id  _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
+        ChatMsgListImModel * chatModel = (ChatMsgListImModel *)obj;
+        [weakSelf.dataArray enumerateObjectsUsingBlock:^(id  _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
+            EMConversationModel * model = (EMConversationModel *)obj;
+            if (chatModel.ImId == [model.emModel.conversationId integerValue]) {
+                if (!chatModel.IsDisturb) {
+                    chatModel.redNum = model.emModel.unreadMessagesCount;
+                    weakSelf.unReadCount += model.emModel.unreadMessagesCount;
+                }
+            }
+        }];
     }];
+    dispatch_async(dispatch_get_main_queue(), ^{
+        weakSelf.tabBarController.tabBar.items[2].badgeValue = weakSelf.unReadCount > 0 ? [NSString stringWithFormat:@"%ld",(long)weakSelf.unReadCount] : nil;
+    });
+}
+- (void)messagesDidReceive:(NSArray *)aMessages
+{
+     [self performSelector:@selector(getUnreadCount) withObject:nil afterDelay:0.1];
 }
 - (void)tableViewScrollTop
 {

+ 93 - 13
smartRhino/Project/VCModel/Source/Controller/SourceHomeVC.m

@@ -37,6 +37,7 @@
 #import "MenuListView.h"
 #import "TopicGroupManageModel.h"
 #import "MyTDTopicGroupManageVC.h"
+#import "WorkNumberModel.h"
 
 @interface SourceHomeVC ()<UITableViewDelegate,UITableViewDataSource,UICollectionViewDelegate,UICollectionViewDataSource,NoteBookShareVCDelegate,UIScrollViewDelegate>
 @property (weak, nonatomic) IBOutlet UITableView *tableView;
@@ -57,6 +58,12 @@
 @property (strong, nonatomic) UIView                    *sectionView;
 @property (assign, nonatomic) NSInteger         currentPage;
 @property (assign, nonatomic) NSInteger         totalPage;
+@property (strong, nonatomic) NSMutableArray    *chatListIMArray;
+@property (strong, nonatomic) NSMutableArray    *ImArray;
+@property (assign, nonatomic) NSInteger         unReadCount;
+@property (strong, nonatomic) WorkNumberModel       * numModel;
+
+
 @end
 
 @implementation SourceHomeVC
@@ -130,9 +137,81 @@
     }
     return _collectionView;
 }
+- (void)getUnreadCount
+{
+    WS(weakSelf);
+    [[HttpManager sharedHttpManager] GETUrl:Host(API_APP_User_User_Uread_Count) parameters:@{} responseStyle:JOSN success:^(id  _Nonnull responseObject) {
+        NSDictionary *dic = responseObject;
+        weakSelf.numModel = [[WorkNumberModel alloc] initWithDictionary:dic error:nil];
+        dispatch_async(dispatch_get_main_queue(), ^{
+            [weakSelf initChatMsgIMData];
+        });
+    } failure:^(NSError * _Nonnull error) {
+    }];
+}
+-(void)initChatMsgIMData{
+    self.chatListIMArray = [NSMutableArray array];
+    WS(weakSelf);
+    SHOWLOADING
+    [[HttpManager sharedHttpManager] POSTUrl:Host(Often_Contact_List) parameters:@{@"IndividualGroupId":@(0)} responseStyle:JOSN success:^(id  _Nonnull responseObject) {
+        NSLog(@"%@",responseObject);
+        REMOVESHOW
+        if ([responseObject isKindOfClass:[NSArray class]]) {
+            for (NSDictionary * dict in responseObject) {
+                ChatMsgListImModel * model = [ChatMsgListImModel modelWithDictionary:dict];
+                [weakSelf.chatListIMArray addObject:model];
+            }
+        }
+        [weakSelf _loadAllConversationsFromDBWithIsShowHud:NO];
+    } failure:^(NSError * _Nonnull error) {
+        REMOVESHOW
+        NSLog(@"%@",error);
+    }];
+}
+- (void)_loadAllConversationsFromDBWithIsShowHud:(BOOL)aIsShowHUD
+{
+    __weak typeof(self) weakself = self;
+    self.ImArray = [NSMutableArray array];
+    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
+        NSArray *conversations = [[EMClient sharedClient].chatManager getAllConversations];
+        NSArray *sorted = [conversations sortedArrayUsingComparator:^(EMConversation *obj1, EMConversation *obj2) {
+            EMMessage *message1 = [obj1 latestMessage];
+            EMMessage *message2 = [obj2 latestMessage];
+            if(message1.timestamp > message2.timestamp) {
+                return(NSComparisonResult)NSOrderedAscending;
+            } else {
+                return(NSComparisonResult)NSOrderedDescending;
+            }}];
+        NSArray *models = [EMConversationHelper modelsFromEMConversations:sorted];
+        [weakself.ImArray addObjectsFromArray:models];
+        [weakself replaceChatData];
+    });
+}
+- (void)replaceChatData
+{
+    WS(weakSelf);
+    self.unReadCount = 0;
+    [self.chatListIMArray enumerateObjectsUsingBlock:^(id  _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
+        ChatMsgListImModel * chatModel = (ChatMsgListImModel *)obj;
+        [weakSelf.ImArray enumerateObjectsUsingBlock:^(id  _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
+            EMConversationModel * model = (EMConversationModel *)obj;
+            if (chatModel.ImId == [model.emModel.conversationId integerValue]) {
+                if (!chatModel.IsDisturb) {
+                    chatModel.redNum = model.emModel.unreadMessagesCount;
+                    weakSelf.unReadCount += model.emModel.unreadMessagesCount;
+                }
+            }
+        }];
+    }];
+    dispatch_async(dispatch_get_main_queue(), ^{
+        weakSelf.numModel.messageUnCount = weakSelf.unReadCount;
+        [weakSelf initCollectionData:weakSelf.numModel];
+    });
+}
 - (void)viewWillAppear:(BOOL)animated
 {
     [super viewWillAppear:animated];
+    [self getUnreadCount];
     [self headRefresh];
 }
 - (void)setTableRefresh
@@ -179,7 +258,6 @@
         make.height.mas_offset(36);
     }];
     self.tableView.tableHeaderView = self.HeadView;
-    [self initCollectionData];
     [self setShowData];
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(pushSubViewController:) name:DRAWERPUSHVC object:nil];
 }
@@ -214,7 +292,7 @@
     }];
 }
 
--(void)initCollectionData{
+-(void)initCollectionData:(WorkNumberModel *)numModel{
     
     [self.collectionDataSource removeAllObjects];
     NSMutableArray * array = [NSMutableArray array];
@@ -226,7 +304,7 @@
                 model.imgName = @"chatmsg_znx_icon";
                 model.notImgName = @"chatmsg_tz_hui_icon";
                 model.type = ChatMenuZhanXinType;
-                model.readNum = 0;
+                model.readNum = numModel.FlowAuditUReadCount + numModel.FlowSendUReadCount + numModel.FlowCcUReadCount + numModel.noticeCount + numModel.missiveCount;
                 model.showEditFlag = YES;
             }break;
             case 1:{
@@ -242,7 +320,7 @@
                 model.imgName = @"chatmsg_dbsx_icon";
                 model.notImgName = @"chatmsg_tz_hui_icon";
                 model.type = ChatMenuWaitType;
-                model.readNum = 0;
+                model.readNum = numModel.WaitHandleUFinishCount;
                 model.showEditFlag = YES;
             }break;
             default:{
@@ -250,7 +328,7 @@
                 model.imgName = @"Common_sixin_icon";
                 model.notImgName = @"Common_sixin_icon";
                 model.type = ChatMenuSiXinType;
-                model.readNum = 0;
+                model.readNum = numModel.messageUnCount;
                 model.showEditFlag = YES;
             }break;
         }
@@ -860,7 +938,7 @@
     if (indexPath.section > 0) {
             TopicListItemModel * model = [self.dataArray objectAtIndex:indexPath.row];
             MyTDTopicDetailVC * vc = [MyTDTopicDetailVC initMyTDTopicDetailVC];
-            vc.type = CollectModel_NewTopic;
+            vc.type = CollectModel_NoteBook;
             vc.deleteTopicBlock = ^{
         //        [weakSelf headRefresh];
             };
@@ -886,9 +964,9 @@
     switch (bean.type) {
         case ChatMenuNoticeType:
         {
-            cell.cell0ReadNumLabel.hidden = YES;
-            NSString * count = @"0";
+            NSString * count = [NSString stringWithFormat:@"%ld",bean.readNum];
             cell.cell0ReadNumLabel.text = count;
+            cell.cell0ReadNumLabel.hidden = bean.readNum > 0 ? NO : YES;
             UILabel * label = [UILabel new];
             label.font = [UIFont systemFontOfSize:12];
             label.text = count;
@@ -902,9 +980,9 @@
             break;
         case ChatMenuZhanXinType:
         {
-            cell.cell0ReadNumLabel.hidden = YES;
-            NSString * count = @"0";
+            NSString * count = [NSString stringWithFormat:@"%ld",bean.readNum];
             cell.cell0ReadNumLabel.text = count;
+            cell.cell0ReadNumLabel.hidden = bean.readNum > 0 ? NO : YES;
             UILabel * label = [UILabel new];
             label.font = [UIFont systemFontOfSize:12];
             label.text = count;
@@ -918,9 +996,9 @@
             break;
         case ChatMenuWaitType:
         {
-            cell.cell0ReadNumLabel.hidden = YES;
-            NSString * count = @"0";
+            NSString * count = [NSString stringWithFormat:@"%ld",bean.readNum];
             cell.cell0ReadNumLabel.text = count;
+            cell.cell0ReadNumLabel.hidden = bean.readNum > 0 ? NO : YES;
             UILabel * label = [UILabel new];
             label.font = [UIFont systemFontOfSize:12];
             label.text = count;
@@ -934,7 +1012,9 @@
             break;
         default:
         {
-            cell.cell0ReadNumLabel.hidden = YES ;
+            NSString * count = [NSString stringWithFormat:@"%ld",bean.readNum];
+            cell.cell0ReadNumLabel.text = count;
+            cell.cell0ReadNumLabel.hidden = bean.readNum > 0 ? NO : YES;
         }
             break;
     }

+ 0 - 1
smartRhino/Project/VCModel/WorkFlow/AgreeApprovalViewControllerSub.m

@@ -9,7 +9,6 @@
 #import "AgreeApprovalViewControllerSub.h"
 #import "UIPlaceHolderTextView.h"
 #import "MyApprovalPageVC.h"
-#import "HomeViewController.h"
 #import "IndexViewController.h"
 
 @interface AgreeApprovalViewControllerSub ()<UITextViewDelegate>

+ 0 - 1
smartRhino/Project/VCModel/WorkFlow/NextApprovalViewController.m

@@ -18,7 +18,6 @@
 #import "FWZFileGetTool.h"
 #import "InputGongwenFileCell.h"
 #import "MyApprovalPageVC.h"
-#import "HomeViewController.h"
 #import "DownFileViewController.h"
 #import "IndexViewController.h"
 

+ 25 - 25
smartRhino/Project/VCModel/WorkFlow/WorkFlowController.m

@@ -59,7 +59,7 @@
 - (void)getData{
     [self.cooperativeWorkArray removeAllObjects];
     [self.dataReportArray removeAllObjects];
-    [self testData];
+//    [self testData];
     self.loadFlag = 1;
     [[HttpManager sharedHttpManager] GETUrl: [NSString stringWithFormat:@"%@%@",BaseUrl,WorkFlowHomeData_Post]parameters:@{} responseStyle:JOSN success:^(id  _Nonnull responseObject) {
         NSArray *array = responseObject;
@@ -70,35 +70,35 @@
         }
         [self.cooperativeWorkArray addObjectsFromArray:arr];
         self.loadFlag += 1;
-        if (self.loadFlag == 4) {
+        if (self.loadFlag == 2) {
             REMOVESHOW
             [self.collectionView reloadData];
         }
     } failure:^(NSError * _Nonnull error) {
     }];
     
-    //获取我审批和我发起以及抄送我的未读数
-    [[HttpManager sharedHttpManager] GETUrl:[NSString stringWithFormat:@"%@%@",BaseUrl,@"/api/app/user/user-uread-count"] parameters:@{} responseStyle:JOSN success:^(id  _Nonnull responseObject) {
-        NSDictionary *dic = responseObject;
-        self.numberDic = [[WorkNumberModel alloc] initWithDictionary:dic error:nil];
-        self.navigationController.tabBarItem.badgeValue = [self.numberDic allNumber];
-        /// 我的审批未读数
-        self.cooperativeWorkArray.firstObject.workNumber = [dic[@"FlowAuditUReadCount"] integerValue];
-        for (WorkFLowModel *model in self.cooperativeWorkArray) {
-            if ([model.Name isEqualToString:@"我发起的"]) {
-                model.workNumber = [dic[@"FlowSendUReadCount"] integerValue];
-            }
-            if ([model.Name isEqualToString:@"抄送我的"]) {
-                model.workNumber = [dic[@"FlowCcUReadCount"] integerValue];
-            }
-        }
-        self.loadFlag += 1;
-        if (self.loadFlag == 4) {
-            REMOVESHOW
-            [self.collectionView reloadData];
-        }
-    } failure:^(NSError * _Nonnull error) {
-    }];
+//    //获取我审批和我发起以及抄送我的未读数
+//    [[HttpManager sharedHttpManager] GETUrl:[NSString stringWithFormat:@"%@%@",BaseUrl,@"/api/app/user/user-uread-count"] parameters:@{} responseStyle:JOSN success:^(id  _Nonnull responseObject) {
+//        NSDictionary *dic = responseObject;
+//        self.numberDic = [[WorkNumberModel alloc] initWithDictionary:dic error:nil];
+//        self.navigationController.tabBarItem.badgeValue = [self.numberDic allNumber];
+//        /// 我的审批未读数
+//        self.cooperativeWorkArray.firstObject.workNumber = [dic[@"FlowAuditUReadCount"] integerValue];
+//        for (WorkFLowModel *model in self.cooperativeWorkArray) {
+//            if ([model.Name isEqualToString:@"我发起的"]) {
+//                model.workNumber = [dic[@"FlowSendUReadCount"] integerValue];
+//            }
+//            if ([model.Name isEqualToString:@"抄送我的"]) {
+//                model.workNumber = [dic[@"FlowCcUReadCount"] integerValue];
+//            }
+//        }
+//        self.loadFlag += 1;
+//        if (self.loadFlag == 4) {
+//            REMOVESHOW
+//            [self.collectionView reloadData];
+//        }
+//    } failure:^(NSError * _Nonnull error) {
+//    }];
     [[HttpManager sharedHttpManager] POSTUrl:[NSString stringWithFormat:@"%@%@",BaseUrl,WorkFlowHomeData2_Post] parameters:@{} responseStyle:JOSN success:^(id  _Nonnull responseObject) {
         NSArray *array = responseObject;
         NSLog(@"%@",responseObject);
@@ -107,7 +107,7 @@
             [self.dataReportArray addObject:mode];
         }
         self.loadFlag += 1;
-        if (self.loadFlag == 4) {
+        if (self.loadFlag == 2) {
             REMOVESHOW
             [self.collectionView reloadData];
         }

+ 5 - 17
smartRhino/Project/VCModel/WorkFlow/WorkNumberModel.h

@@ -12,19 +12,8 @@ NS_ASSUME_NONNULL_BEGIN
 
 @interface WorkNumberModel : BaseModel
 
-/// 我发起的 - 待审批
-@property (nonatomic ,assign) NSInteger SubmittedCheckingCount;
-/// 我发起的 - 已审批
-@property (nonatomic ,assign) NSInteger SubmittedCheckedCount;
-
-/// 我审批的 - 待审批
-@property (nonatomic ,assign) NSInteger MyCheckedCount;
-/// 我审批的 - 已审批
-@property (nonatomic ,assign) NSInteger MyCheckingCount;
-/// 抄送我的 - 未读
-@property (nonatomic ,assign) NSInteger CcUnreadCount;
-/// 抄送我的全部
-@property (nonatomic ,assign) NSInteger CcAllCount;
+/// 待办
+@property (nonatomic ,assign) NSInteger WaitHandleUFinishCount;
 /**最新的未读数量******************************/
 /// 通知未读数量
 @property (nonatomic ,assign) NSInteger noticeCount;
@@ -36,12 +25,11 @@ NS_ASSUME_NONNULL_BEGIN
 @property (nonatomic ,assign) NSInteger FlowSendUReadCount;
 /// 工作抄送我的未读数量
 @property (nonatomic ,assign) NSInteger FlowCcUReadCount;
-
+/// 工作抄送我的未读数量
+@property (nonatomic ,assign) NSInteger messageUnCount;
 
 /// 统计nunber
-- (NSString *)allNumber;
-/// 统计通知未读数量
-- (NSString *)allNotifacationNumber;
+- (NSInteger )allNumber;
 
 @end
 

+ 3 - 13
smartRhino/Project/VCModel/WorkFlow/WorkNumberModel.m

@@ -12,20 +12,10 @@
 
 @implementation WorkNumberModel
 
-- (NSString *)allNumber {
-    NSInteger number =  self.FlowAuditUReadCount + self.FlowSendUReadCount + self.FlowCcUReadCount;
-    if (number > 0) {
-        return [NSString stringWithFormat:@"%zi",number];
-    }
-    return nil;
+- (NSInteger )allNumber {
+    NSInteger number =  self.FlowAuditUReadCount + self.FlowSendUReadCount + self.FlowCcUReadCount + self.noticeCount + self.missiveCount + self.WaitHandleUFinishCount;
+    return number;
 }
 
-- (NSString *)allNotifacationNumber {
-    NSInteger number =  self.noticeCount + self.missiveCount;
-       if (number > 0) {
-           return [NSString stringWithFormat:@"%zi",number];
-       }
-       return nil;
-}
 
 @end

+ 58 - 59
smartRhino/Project/VCModel/common/Controller/CommonToolVC.m

@@ -58,7 +58,7 @@
 - (void)getData{
     [self.cooperativeWorkArray removeAllObjects];
     [self.dataReportArray removeAllObjects];
-    [self testData];
+//    [self testData];
     self.loadFlag = 1;
     [[HttpManager sharedHttpManager] GETUrl: [NSString stringWithFormat:@"%@%@",BaseUrl,WorkFlowHomeData_Post]parameters:@{} responseStyle:JOSN success:^(id  _Nonnull responseObject) {
         NSArray *array = responseObject;
@@ -69,7 +69,7 @@
         }
         [self.cooperativeWorkArray addObjectsFromArray:arr];
         self.loadFlag += 1;
-        if (self.loadFlag == 4) {
+        if (self.loadFlag == 3) {
             REMOVESHOW
             [self.collectionView reloadData];
         }
@@ -77,27 +77,27 @@
     }];
     
     //获取我审批和我发起以及抄送我的未读数
-    [[HttpManager sharedHttpManager] GETUrl:[NSString stringWithFormat:@"%@%@",BaseUrl,@"/api/app/user/user-uread-count"] parameters:@{} responseStyle:JOSN success:^(id  _Nonnull responseObject) {
-        NSDictionary *dic = responseObject;
-        self.numberDic = [[WorkNumberModel alloc] initWithDictionary:dic error:nil];
-        self.navigationController.tabBarItem.badgeValue = [self.numberDic allNumber];
-        /// 我的审批未读数
-        self.cooperativeWorkArray.firstObject.workNumber = [dic[@"FlowAuditUReadCount"] integerValue];
-        for (WorkFLowModel *model in self.cooperativeWorkArray) {
-            if ([model.Name isEqualToString:@"我发起的"]) {
-                model.workNumber = [dic[@"FlowSendUReadCount"] integerValue];
-            }
-            if ([model.Name isEqualToString:@"抄送我的"]) {
-                model.workNumber = [dic[@"FlowCcUReadCount"] integerValue];
-            }
-        }
-        self.loadFlag += 1;
-        if (self.loadFlag == 4) {
-            REMOVESHOW
-            [self.collectionView reloadData];
-        }
-    } failure:^(NSError * _Nonnull error) {
-    }];
+//    [[HttpManager sharedHttpManager] GETUrl:[NSString stringWithFormat:@"%@%@",BaseUrl,@"/api/app/user/user-uread-count"] parameters:@{} responseStyle:JOSN success:^(id  _Nonnull responseObject) {
+//        NSDictionary *dic = responseObject;
+//        self.numberDic = [[WorkNumberModel alloc] initWithDictionary:dic error:nil];
+//        self.navigationController.tabBarItem.badgeValue = [self.numberDic allNumber];
+//        /// 我的审批未读数
+//        self.cooperativeWorkArray.firstObject.workNumber = [dic[@"FlowAuditUReadCount"] integerValue];
+//        for (WorkFLowModel *model in self.cooperativeWorkArray) {
+//            if ([model.Name isEqualToString:@"我发起的"]) {
+//                model.workNumber = [dic[@"FlowSendUReadCount"] integerValue];
+//            }
+//            if ([model.Name isEqualToString:@"抄送我的"]) {
+//                model.workNumber = [dic[@"FlowCcUReadCount"] integerValue];
+//            }
+//        }
+//        self.loadFlag += 1;
+//        if (self.loadFlag == 4) {
+//            REMOVESHOW
+//            [self.collectionView reloadData];
+//        }
+//    } failure:^(NSError * _Nonnull error) {
+//    }];
     [[HttpManager sharedHttpManager] POSTUrl:[NSString stringWithFormat:@"%@%@",BaseUrl,WorkFlowHomeData2_Post] parameters:@{} responseStyle:JOSN success:^(id  _Nonnull responseObject) {
         NSArray *array = responseObject;
         NSLog(@"%@",responseObject);
@@ -106,7 +106,7 @@
             [self.dataReportArray addObject:mode];
         }
         self.loadFlag += 1;
-        if (self.loadFlag == 4) {
+        if (self.loadFlag == 3) {
             REMOVESHOW
             [self.collectionView reloadData];
         }
@@ -225,11 +225,7 @@
         cell.workNumberLab.hidden = NO;
     }
     cell.titleLabel.text = model.Name;
-    if (indexPath.item == 0 || indexPath.item == 1 || indexPath.item == 2) {
-        cell.iconImageView.image = model.iconImage;
-    }else{
-        [cell.iconImageView setImageWithURL:[NSURL URLWithString:model.IconUrl] placeholder:IMG(@"work_flow_approvalme")];
-    }
+    [cell.iconImageView setImageWithURL:[NSURL URLWithString:model.IconUrl] placeholder:IMG(@"work_flow_approvalme")];
     cell.leftLine.hidden = NO;
     cell.rightLine.hidden = NO;
     cell.bottomLine.hidden= NO;
@@ -242,37 +238,40 @@
 }
 - (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath{
     WorkFLowModel *model = (indexPath.section == 0) ? self.cooperativeWorkArray[indexPath.item]:self.dataReportArray[indexPath.item];
-    
     if (indexPath.section == 0) {
-        if (indexPath.item == 0 || indexPath.item == 1 || indexPath.item == 2) {
-               MyApprovalPageVC *myApprovalPageVC = [[MyApprovalPageVC alloc]init];
-               myApprovalPageVC.title =   model.Name;
-            if (indexPath.item == 0) {
-                myApprovalPageVC.pageType = Type_ONEA;
-            }
-            if (indexPath.item == 1) {
-                myApprovalPageVC.pageType = Type_ONEB;
-            }
-            if (indexPath.item == 2) {
-                myApprovalPageVC.pageType = Type_ONEC;
-            }
-            myApprovalPageVC.numberDic = self.numberDic;
-            [self.navigationController pushViewController:myApprovalPageVC animated:YES];
-        }else{
-            if ([model.Name isEqualToString:@"会议"]) {
-                [self.navigationController pushViewController:[[WorkFlowTabbarController alloc] init] animated:YES];
-//            }else if ([model.Name isEqualToString:@"车辆"]){
-//                MyWorkCarVC *vc = [[MyWorkCarVC alloc]init];
-//                vc.title = model.Name;
-//                vc.indexID = model.Id;
-//                [self.navigationController pushViewController:vc animated:YES];
-            } else {
-                MyWorkWordVC *workWordVC = [[MyWorkWordVC alloc]init];
-                workWordVC.title = model.Name;
-                workWordVC.pageType = Type_GongWen;
-                workWordVC.indexID = model.Id;
-                [self.navigationController pushViewController:workWordVC animated:YES];
-            }
+        //        if (indexPath.item == 0 || indexPath.item == 1 || indexPath.item == 2) {
+        //               MyApprovalPageVC *myApprovalPageVC = [[MyApprovalPageVC alloc]init];
+        //               myApprovalPageVC.title =   model.Name;
+        //            if (indexPath.item == 0) {
+        //                myApprovalPageVC.pageType = Type_ONEA;
+        //            }
+        //            if (indexPath.item == 1) {
+        //                myApprovalPageVC.pageType = Type_ONEB;
+        //            }
+        //            if (indexPath.item == 2) {
+        //                myApprovalPageVC.pageType = Type_ONEC;
+        //            }
+        //            myApprovalPageVC.numberDic = self.numberDic;
+        //            [self.navigationController pushViewController:myApprovalPageVC animated:YES];
+        //        }else{
+        //            if ([model.Name isEqualToString:@"会议"]) {
+        //                [self.navigationController pushViewController:[[WorkFlowTabbarController alloc] init] animated:YES];
+        //            } else {
+        //                MyWorkWordVC *workWordVC = [[MyWorkWordVC alloc]init];
+        //                workWordVC.title = model.Name;
+        //                workWordVC.pageType = Type_GongWen;
+        //                workWordVC.indexID = model.Id;
+        //                [self.navigationController pushViewController:workWordVC animated:YES];
+        //            }
+        //        }
+        if ([model.Name isEqualToString:@"会议"]) {
+            [self.navigationController pushViewController:[[WorkFlowTabbarController alloc] init] animated:YES];
+        } else {
+            MyWorkWordVC *workWordVC = [[MyWorkWordVC alloc]init];
+            workWordVC.title = model.Name;
+            workWordVC.pageType = Type_GongWen;
+            workWordVC.indexID = model.Id;
+            [self.navigationController pushViewController:workWordVC animated:YES];
         }
     }
     if (indexPath.section == 1) {

+ 60 - 60
smartRhino/Project/VCModel/common/Controller/CommonWorkVC.m

@@ -58,7 +58,7 @@
 - (void)getData{
     [self.dataArray removeAllObjects];
     [self.dataReportArray removeAllObjects];
-    [self testData];
+//    [self testData];
     self.loadFlag = 1;
     WS(weakSelf);
     [[HttpManager sharedHttpManager] GETUrl: [NSString stringWithFormat:@"%@%@",BaseUrl,WorkFlowHomeData_Post]parameters:@{} responseStyle:JOSN success:^(id  _Nonnull responseObject) {
@@ -70,7 +70,7 @@
         }
         [weakSelf.dataArray addObjectsFromArray:arr];
         weakSelf.loadFlag += 1;
-        if (weakSelf.loadFlag == 4) {
+        if (weakSelf.loadFlag == 3) {
             REMOVESHOW
             dispatch_async(dispatch_get_main_queue(), ^{
                 [weakSelf.collectionView reloadData];
@@ -80,29 +80,29 @@
     }];
     
     //获取我审批和我发起以及抄送我的未读数
-    [[HttpManager sharedHttpManager] GETUrl:[NSString stringWithFormat:@"%@%@",BaseUrl,@"/api/app/user/user-uread-count"] parameters:@{} responseStyle:JOSN success:^(id  _Nonnull responseObject) {
-        NSDictionary *dic = responseObject;
-        weakSelf.numberDic = [[WorkNumberModel alloc] initWithDictionary:dic error:nil];
-        weakSelf.navigationController.tabBarItem.badgeValue = [weakSelf.numberDic allNumber];
-        /// 我的审批未读数
-        weakSelf.dataArray.firstObject.workNumber = [dic[@"FlowAuditUReadCount"] integerValue];
-        for (WorkFLowModel *model in self.dataArray) {
-            if ([model.Name isEqualToString:@"我发起的"]) {
-                model.workNumber = [dic[@"FlowSendUReadCount"] integerValue];
-            }
-            if ([model.Name isEqualToString:@"抄送我的"]) {
-                model.workNumber = [dic[@"FlowCcUReadCount"] integerValue];
-            }
-        }
-        weakSelf.loadFlag += 1;
-        if (weakSelf.loadFlag == 4) {
-            REMOVESHOW
-            dispatch_async(dispatch_get_main_queue(), ^{
-                [weakSelf.collectionView reloadData];
-            });
-        }
-    } failure:^(NSError * _Nonnull error) {
-    }];
+//    [[HttpManager sharedHttpManager] GETUrl:[NSString stringWithFormat:@"%@%@",BaseUrl,@"/api/app/user/user-uread-count"] parameters:@{} responseStyle:JOSN success:^(id  _Nonnull responseObject) {
+//        NSDictionary *dic = responseObject;
+//        weakSelf.numberDic = [[WorkNumberModel alloc] initWithDictionary:dic error:nil];
+//        weakSelf.navigationController.tabBarItem.badgeValue = [weakSelf.numberDic allNumber];
+//        /// 我的审批未读数
+//        weakSelf.dataArray.firstObject.workNumber = [dic[@"FlowAuditUReadCount"] integerValue];
+//        for (WorkFLowModel *model in self.dataArray) {
+//            if ([model.Name isEqualToString:@"我发起的"]) {
+//                model.workNumber = [dic[@"FlowSendUReadCount"] integerValue];
+//            }
+//            if ([model.Name isEqualToString:@"抄送我的"]) {
+//                model.workNumber = [dic[@"FlowCcUReadCount"] integerValue];
+//            }
+//        }
+//        weakSelf.loadFlag += 1;
+//        if (weakSelf.loadFlag == 4) {
+//            REMOVESHOW
+//            dispatch_async(dispatch_get_main_queue(), ^{
+//                [weakSelf.collectionView reloadData];
+//            });
+//        }
+//    } failure:^(NSError * _Nonnull error) {
+//    }];
     [[HttpManager sharedHttpManager] POSTUrl:[NSString stringWithFormat:@"%@%@",BaseUrl,WorkFlowHomeData2_Post] parameters:@{} responseStyle:JOSN success:^(id  _Nonnull responseObject) {
         NSArray *array = responseObject;
         NSLog(@"%@",responseObject);
@@ -111,7 +111,7 @@
             [weakSelf.dataReportArray addObject:mode];
         }
         weakSelf.loadFlag += 1;
-        if (weakSelf.loadFlag == 4) {
+        if (weakSelf.loadFlag == 3) {
             REMOVESHOW
             dispatch_async(dispatch_get_main_queue(), ^{
                 [weakSelf.collectionView reloadData];
@@ -232,11 +232,7 @@
         cell.workNumberLab.hidden = NO;
     }
     cell.titleLabel.text = model.Name;
-    if (indexPath.item == 0 || indexPath.item == 1 || indexPath.item == 2) {
-        cell.iconImageView.image = model.iconImage;
-    }else{
-        [cell.iconImageView setImageWithURL:[NSURL URLWithString:model.IconUrl] placeholder:IMG(@"work_flow_approvalme")];
-    }
+    [cell.iconImageView setImageWithURL:[NSURL URLWithString:model.IconUrl] placeholder:IMG(@"work_flow_approvalme")];
     cell.leftLine.hidden = NO;
     cell.rightLine.hidden = NO;
     cell.bottomLine.hidden= NO;
@@ -251,35 +247,39 @@
     WorkFLowModel *model = (indexPath.section == 0) ? self.dataArray[indexPath.item]:self.dataReportArray[indexPath.item];
     
     if (indexPath.section == 0) {
-        if (indexPath.item == 0 || indexPath.item == 1 || indexPath.item == 2) {
-               MyApprovalPageVC *myApprovalPageVC = [[MyApprovalPageVC alloc]init];
-               myApprovalPageVC.title =   model.Name;
-            if (indexPath.item == 0) {
-                myApprovalPageVC.pageType = Type_ONEA;
-            }
-            if (indexPath.item == 1) {
-                myApprovalPageVC.pageType = Type_ONEB;
-            }
-            if (indexPath.item == 2) {
-                myApprovalPageVC.pageType = Type_ONEC;
-            }
-            myApprovalPageVC.numberDic = self.numberDic;
-            [self.navigationController pushViewController:myApprovalPageVC animated:YES];
-        }else{
-            if ([model.Name isEqualToString:@"会议"]) {
-                [self.navigationController pushViewController:[[WorkFlowTabbarController alloc] init] animated:YES];
-//            }else if ([model.Name isEqualToString:@"车辆"]){
-//                MyWorkCarVC *vc = [[MyWorkCarVC alloc]init];
-//                vc.title = model.Name;
-//                vc.indexID = model.Id;
-//                [self.navigationController pushViewController:vc animated:YES];
-            } else {
-                MyWorkWordVC *workWordVC = [[MyWorkWordVC alloc]init];
-                workWordVC.title = model.Name;
-                workWordVC.pageType = Type_GongWen;
-                workWordVC.indexID = model.Id;
-                [self.navigationController pushViewController:workWordVC animated:YES];
-            }
+//        if (indexPath.item == 0 || indexPath.item == 1 || indexPath.item == 2) {
+//               MyApprovalPageVC *myApprovalPageVC = [[MyApprovalPageVC alloc]init];
+//               myApprovalPageVC.title =   model.Name;
+//            if (indexPath.item == 0) {
+//                myApprovalPageVC.pageType = Type_ONEA;
+//            }
+//            if (indexPath.item == 1) {
+//                myApprovalPageVC.pageType = Type_ONEB;
+//            }
+//            if (indexPath.item == 2) {
+//                myApprovalPageVC.pageType = Type_ONEC;
+//            }
+//            myApprovalPageVC.numberDic = self.numberDic;
+//            [self.navigationController pushViewController:myApprovalPageVC animated:YES];
+//        }else{
+//            if ([model.Name isEqualToString:@"会议"]) {
+//                [self.navigationController pushViewController:[[WorkFlowTabbarController alloc] init] animated:YES];
+//            } else {
+//                MyWorkWordVC *workWordVC = [[MyWorkWordVC alloc]init];
+//                workWordVC.title = model.Name;
+//                workWordVC.pageType = Type_GongWen;
+//                workWordVC.indexID = model.Id;
+//                [self.navigationController pushViewController:workWordVC animated:YES];
+//            }
+//        }
+        if ([model.Name isEqualToString:@"会议"]) {
+            [self.navigationController pushViewController:[[WorkFlowTabbarController alloc] init] animated:YES];
+        } else {
+            MyWorkWordVC *workWordVC = [[MyWorkWordVC alloc]init];
+            workWordVC.title = model.Name;
+            workWordVC.pageType = Type_GongWen;
+            workWordVC.indexID = model.Id;
+            [self.navigationController pushViewController:workWordVC animated:YES];
         }
     }
     if (indexPath.section == 1) {

+ 4 - 4
smartRhino/Project/VCModel/common/View/CommonListCell.m

@@ -42,7 +42,7 @@
     switch (model.CollectionType) {
             // 文章
         case CollectModel_Aritle:{
-            self.iconV.image = IMG(@"文章");
+            [self.iconV sd_setImageWithURL:[NSURL URLWithString:model.Data.ArticleImgUrl.firstObject] placeholderImage:IMG(@"文章")];
         }break;
             // 话题 || 小组
         case CollectModel_Toipc:
@@ -122,9 +122,9 @@
             }
         }break;
     }
-    self.titleL.text = model.Title;
-    self.nameL.text = model.Author;
-    self.desL.text = @"暂无";
+    self.titleL.text = model.Data.Title;
+    self.nameL.text = model.Data.Author;
+    self.desL.text = model.FolderName;
 }
 - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
     [super setSelected:selected animated:animated];