Browse Source

首页接口+tab切换效果

Steven 1 year ago
parent
commit
4e7f9d3d23
28 changed files with 512 additions and 39 deletions
  1. 10 0
      KulexiuForStudent/KulexiuForStudent.xcodeproj/project.pbxproj
  2. 22 0
      KulexiuForStudent/KulexiuForStudent/Assets.xcassets/Institution/Home/tenant_close.imageset/Contents.json
  3. BIN
      KulexiuForStudent/KulexiuForStudent/Assets.xcassets/Institution/Home/tenant_close.imageset/tenant_close@2x.png
  4. BIN
      KulexiuForStudent/KulexiuForStudent/Assets.xcassets/Institution/Home/tenant_close.imageset/tenant_close@3x.png
  5. 22 0
      KulexiuForStudent/KulexiuForStudent/Assets.xcassets/Institution/Home/tenant_ticketHeader.imageset/Contents.json
  6. BIN
      KulexiuForStudent/KulexiuForStudent/Assets.xcassets/Institution/Home/tenant_ticketHeader.imageset/tenant_ticketHeader@2x.png
  7. BIN
      KulexiuForStudent/KulexiuForStudent/Assets.xcassets/Institution/Home/tenant_ticketHeader.imageset/tenant_ticketHeader@3x.png
  8. 22 0
      KulexiuForStudent/KulexiuForStudent/Assets.xcassets/Institution/Home/tenant_ticketMiddle.imageset/Contents.json
  9. BIN
      KulexiuForStudent/KulexiuForStudent/Assets.xcassets/Institution/Home/tenant_ticketMiddle.imageset/tenant_ticketMiddle@2x.png
  10. BIN
      KulexiuForStudent/KulexiuForStudent/Assets.xcassets/Institution/Home/tenant_ticketMiddle.imageset/tenant_ticketMiddle@3x.png
  11. 22 0
      KulexiuForStudent/KulexiuForStudent/Assets.xcassets/Institution/Home/tenant_ticketTitle.imageset/Contents.json
  12. BIN
      KulexiuForStudent/KulexiuForStudent/Assets.xcassets/Institution/Home/tenant_ticketTitle.imageset/tenant_ticketTitle@2x.png
  13. BIN
      KulexiuForStudent/KulexiuForStudent/Assets.xcassets/Institution/Home/tenant_ticketTitle.imageset/tenant_ticketTitle@3x.png
  14. 22 0
      KulexiuForStudent/KulexiuForStudent/Assets.xcassets/Institution/Home/tenant_ticketbottom.imageset/Contents.json
  15. BIN
      KulexiuForStudent/KulexiuForStudent/Assets.xcassets/Institution/Home/tenant_ticketbottom.imageset/tenant_ticketbottom@2x.png
  16. BIN
      KulexiuForStudent/KulexiuForStudent/Assets.xcassets/Institution/Home/tenant_ticketbottom.imageset/tenant_ticketbottom@3x.png
  17. 37 10
      KulexiuForStudent/KulexiuForStudent/Common/Base/CustomTabBarController.m
  18. 7 0
      KulexiuForStudent/KulexiuForStudent/Common/Base/KSNetworkingManager.h
  19. 15 0
      KulexiuForStudent/KulexiuForStudent/Common/Base/KSNetworkingManager.m
  20. 2 0
      KulexiuForStudent/KulexiuForStudent/Common/Tools/Extension/UIImage+Color.h
  21. 11 0
      KulexiuForStudent/KulexiuForStudent/Common/Tools/Extension/UIImage+Color.m
  22. 8 0
      KulexiuForStudent/KulexiuForStudent/InstitutionModule/Home/Controller/KSTenantHomeViewController.m
  23. 67 3
      KulexiuForStudent/KulexiuForStudent/InstitutionModule/Home/Controller/TenantDarkViewController.m
  24. 24 0
      KulexiuForStudent/KulexiuForStudent/InstitutionModule/Home/View/TenantTicketAlert.h
  25. 66 0
      KulexiuForStudent/KulexiuForStudent/InstitutionModule/Home/View/TenantTicketAlert.m
  26. 140 0
      KulexiuForStudent/KulexiuForStudent/InstitutionModule/Home/View/TenantTicketAlert.xib
  27. 4 2
      KulexiuForStudent/KulexiuForStudent/InstitutionModule/Mine/Controller/InsititutionMineViewController.m
  28. 11 24
      KulexiuForStudent/KulexiuForStudent/InstitutionModule/TabbarController/InstitutionTabBarController.m

+ 10 - 0
KulexiuForStudent/KulexiuForStudent.xcodeproj/project.pbxproj

@@ -965,6 +965,8 @@
 		BCCC36212AAF0EDF000D60CA /* SettingBottomView.xib in Resources */ = {isa = PBXBuildFile; fileRef = BCCC361E2AAF0EDF000D60CA /* SettingBottomView.xib */; };
 		BCCC36242AAF3F93000D60CA /* CustomTabBarController.m in Sources */ = {isa = PBXBuildFile; fileRef = BCCC36232AAF3F93000D60CA /* CustomTabBarController.m */; };
 		BCCC36272AAF4346000D60CA /* KSTenantHomeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = BCCC36262AAF4346000D60CA /* KSTenantHomeViewController.m */; };
+		BCCDB4332AB1C03A003C8E5F /* TenantTicketAlert.m in Sources */ = {isa = PBXBuildFile; fileRef = BCCDB4322AB1C03A003C8E5F /* TenantTicketAlert.m */; };
+		BCCDB4352AB1C040003C8E5F /* TenantTicketAlert.xib in Resources */ = {isa = PBXBuildFile; fileRef = BCCDB4342AB1C040003C8E5F /* TenantTicketAlert.xib */; };
 		BCCE95C72AB0362A00AB6385 /* TenantDarkSearhView.m in Sources */ = {isa = PBXBuildFile; fileRef = BCCE95C62AB0362A00AB6385 /* TenantDarkSearhView.m */; };
 		BCCE95C92AB0363100AB6385 /* TenantDarkSearhView.xib in Resources */ = {isa = PBXBuildFile; fileRef = BCCE95C82AB0363100AB6385 /* TenantDarkSearhView.xib */; };
 		BCCE95CC2AB03BE200AB6385 /* TenantDragView.m in Sources */ = {isa = PBXBuildFile; fileRef = BCCE95CB2AB03BE200AB6385 /* TenantDragView.m */; };
@@ -2732,6 +2734,9 @@
 		BCCC36232AAF3F93000D60CA /* CustomTabBarController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CustomTabBarController.m; sourceTree = "<group>"; };
 		BCCC36252AAF4346000D60CA /* KSTenantHomeViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KSTenantHomeViewController.h; sourceTree = "<group>"; };
 		BCCC36262AAF4346000D60CA /* KSTenantHomeViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = KSTenantHomeViewController.m; sourceTree = "<group>"; };
+		BCCDB4312AB1C03A003C8E5F /* TenantTicketAlert.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TenantTicketAlert.h; sourceTree = "<group>"; };
+		BCCDB4322AB1C03A003C8E5F /* TenantTicketAlert.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = TenantTicketAlert.m; sourceTree = "<group>"; };
+		BCCDB4342AB1C040003C8E5F /* TenantTicketAlert.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = TenantTicketAlert.xib; sourceTree = "<group>"; };
 		BCCE95C52AB0362A00AB6385 /* TenantDarkSearhView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TenantDarkSearhView.h; sourceTree = "<group>"; };
 		BCCE95C62AB0362A00AB6385 /* TenantDarkSearhView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = TenantDarkSearhView.m; sourceTree = "<group>"; };
 		BCCE95C82AB0363100AB6385 /* TenantDarkSearhView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = TenantDarkSearhView.xib; sourceTree = "<group>"; };
@@ -5071,6 +5076,9 @@
 				BCCE95DA2AB0490D00AB6385 /* TenantHomeSubjectListCell.h */,
 				BCCE95DB2AB0490D00AB6385 /* TenantHomeSubjectListCell.m */,
 				BCCE95DC2AB0490D00AB6385 /* TenantHomeSubjectListCell.xib */,
+				BCCDB4312AB1C03A003C8E5F /* TenantTicketAlert.h */,
+				BCCDB4322AB1C03A003C8E5F /* TenantTicketAlert.m */,
+				BCCDB4342AB1C040003C8E5F /* TenantTicketAlert.xib */,
 			);
 			path = View;
 			sourceTree = "<group>";
@@ -6963,6 +6971,7 @@
 				BC60E3CE287D552800B05441 /* DeleteAccountBodyView.xib in Resources */,
 				BCFDA61328BC8FCE0022B497 /* HomeHotVideoCell.xib in Resources */,
 				BCC583BE28A9EC6400BAB4CF /* cloud_animation_24.png in Resources */,
+				BCCDB4352AB1C040003C8E5F /* TenantTicketAlert.xib in Resources */,
 				BC71D0FF2881A2420010F14B /* README.txt in Resources */,
 				BC71D2852888083B0010F14B /* tabbar4.json in Resources */,
 				BCC583CD28A9EC6400BAB4CF /* cloud_animation_4.png in Resources */,
@@ -7588,6 +7597,7 @@
 				2779358927E324A80010E277 /* CoinModel.m in Sources */,
 				BCB9091728530E9C00F5FF69 /* KSShopCardView.m in Sources */,
 				275FA1EA27E7351900CFEA2E /* KSRCIMDataSource.m in Sources */,
+				BCCDB4332AB1C03A003C8E5F /* TenantTicketAlert.m in Sources */,
 				BC27A071280FF56C00F91E27 /* AccompanyEvaluateCell.m in Sources */,
 				BC119241280ED9E000A716F7 /* AccompanyDetailViewController.m in Sources */,
 				BCB6346F27F6D29600ACFDCF /* LiveroomTimeManager.m in Sources */,

+ 22 - 0
KulexiuForStudent/KulexiuForStudent/Assets.xcassets/Institution/Home/tenant_close.imageset/Contents.json

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

BIN
KulexiuForStudent/KulexiuForStudent/Assets.xcassets/Institution/Home/tenant_close.imageset/tenant_close@2x.png


BIN
KulexiuForStudent/KulexiuForStudent/Assets.xcassets/Institution/Home/tenant_close.imageset/tenant_close@3x.png


+ 22 - 0
KulexiuForStudent/KulexiuForStudent/Assets.xcassets/Institution/Home/tenant_ticketHeader.imageset/Contents.json

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

BIN
KulexiuForStudent/KulexiuForStudent/Assets.xcassets/Institution/Home/tenant_ticketHeader.imageset/tenant_ticketHeader@2x.png


BIN
KulexiuForStudent/KulexiuForStudent/Assets.xcassets/Institution/Home/tenant_ticketHeader.imageset/tenant_ticketHeader@3x.png


+ 22 - 0
KulexiuForStudent/KulexiuForStudent/Assets.xcassets/Institution/Home/tenant_ticketMiddle.imageset/Contents.json

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

BIN
KulexiuForStudent/KulexiuForStudent/Assets.xcassets/Institution/Home/tenant_ticketMiddle.imageset/tenant_ticketMiddle@2x.png


BIN
KulexiuForStudent/KulexiuForStudent/Assets.xcassets/Institution/Home/tenant_ticketMiddle.imageset/tenant_ticketMiddle@3x.png


+ 22 - 0
KulexiuForStudent/KulexiuForStudent/Assets.xcassets/Institution/Home/tenant_ticketTitle.imageset/Contents.json

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

BIN
KulexiuForStudent/KulexiuForStudent/Assets.xcassets/Institution/Home/tenant_ticketTitle.imageset/tenant_ticketTitle@2x.png


BIN
KulexiuForStudent/KulexiuForStudent/Assets.xcassets/Institution/Home/tenant_ticketTitle.imageset/tenant_ticketTitle@3x.png


+ 22 - 0
KulexiuForStudent/KulexiuForStudent/Assets.xcassets/Institution/Home/tenant_ticketbottom.imageset/Contents.json

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

BIN
KulexiuForStudent/KulexiuForStudent/Assets.xcassets/Institution/Home/tenant_ticketbottom.imageset/tenant_ticketbottom@2x.png


BIN
KulexiuForStudent/KulexiuForStudent/Assets.xcassets/Institution/Home/tenant_ticketbottom.imageset/tenant_ticketbottom@3x.png


+ 37 - 10
KulexiuForStudent/KulexiuForStudent/Common/Base/CustomTabBarController.m

@@ -12,6 +12,10 @@
 
 @interface CustomTabBarController ()
 
+@property (nonatomic, strong) UIImageView *bgImageView;
+
+@property (nonatomic, strong) UIView *colorView;
+
 @end
 
 @implementation CustomTabBarController
@@ -59,23 +63,46 @@
 }
 
 - (void)changeTabBarColor:(UIColor *)color {
-    if (@available(iOS 15.0, *)) {
-        // 适配Xcode 13 iOS 15tabbar透明的问题
-        UITabBarAppearance * appearance = [[UITabBarAppearance alloc] init];
-        [appearance configureWithOpaqueBackground];
-        appearance.backgroundColor = color;
-        appearance.shadowImage = [UIImage imageWithColor:[UIColor clearColor]];
-        [UITabBar appearance].scrollEdgeAppearance = appearance;
-        [UITabBar appearance].standardAppearance = appearance;
+
+    if (_bgImageView) {
+        [self.bgImageView removeFromSuperview];
+    }
+    [self.bgImageView setImage:[UIImage imageWithColor:color]];
+    self.bgImageView.contentMode = UIViewContentModeScaleToFill;
+    if (self.colorView) {
+        [self.colorView addSubview:self.bgImageView];
+        [self.bgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
+            make.left.right.top.bottom.mas_equalTo(self.colorView);
+        }];
     }
-    [UITabBar appearance].backgroundColor = color;
-    self.tabBar.backgroundColor = color;
 }
 
+- (UIView *)configColorView {
+    for (UIView *tempView in self.tabBar.subviews) {
+        if ([tempView isKindOfClass:NSClassFromString(@"_UIBarBackground")]) {
+            return tempView;
+        }
+    }
+    return nil;
+}
+
+- (UIView *)colorView {
+    if (!_colorView) {
+        _colorView = [self configColorView];
+    }
+    return _colorView;
+}
 
 - (void)resetTabBarColor {
     [self changeTabBarColor:[UIColor whiteColor]];
 }
+
+- (UIImageView *)bgImageView {
+    if (!_bgImageView) {
+        _bgImageView = [[UIImageView alloc] init];
+    }
+    return _bgImageView;
+}
 /*
 #pragma mark - Navigation
 

+ 7 - 0
KulexiuForStudent/KulexiuForStudent/Common/Base/KSNetworkingManager.h

@@ -903,6 +903,13 @@ NS_ASSUME_NONNULL_BEGIN
 /// @param faliure 失败
 + (void)queryUserRecentRequest:(NSString *)get userId:(NSString *)userId success:(void(^)(NSDictionary *dic))success faliure:(void(^)(NSError *error))faliure;
 
+// ticket 查询
+
+/// 查询ticket
+/// @param post post
+/// @param success 成功
+/// @param faliure 失败
++ (void)tenantActivationCodeRequest:(NSString *)post success:(void(^)(NSDictionary *dic))success faliure:(void(^)(NSError *error))faliure;
 @end
 
 NS_ASSUME_NONNULL_END

+ 15 - 0
KulexiuForStudent/KulexiuForStudent/Common/Base/KSNetworkingManager.m

@@ -1740,4 +1740,19 @@
     [self request:get andWithUrl:url and:parm success:success faliure:faliure];
 }
 
+// ticket 查询
+// /api-student/tenantActivationCode/page
+/// 查询ticket
+/// @param post post
+/// @param success 成功
+/// @param faliure 失败
++ (void)tenantActivationCodeRequest:(NSString *)post success:(void(^)(NSDictionary *dic))success faliure:(void(^)(NSError *error))faliure {
+    [self configRequestMethodJSON];
+
+    NSString *url = [NSString stringWithFormat:@"%@%@", hostURL, @"/api-student/tenantActivationCode/page"];
+    NSMutableDictionary *parm = [NSMutableDictionary dictionary];
+    [parm setValue:@(1) forKey:@"page"];
+    [parm setValue:@(10) forKey:@"rows"];
+    [self request:post andWithUrl:url and:parm success:success faliure:faliure];
+}
 @end

+ 2 - 0
KulexiuForStudent/KulexiuForStudent/Common/Tools/Extension/UIImage+Color.h

@@ -12,6 +12,8 @@
 
 + (UIImage *)imageWithColor:(UIColor *)color;
 
++ (UIImage *)imageWithColor:(UIColor *)color frame:(CGRect)frame;
+
 - (UIImage *)maskWithColor:(UIColor *)color;
 
 @end

+ 11 - 0
KulexiuForStudent/KulexiuForStudent/Common/Tools/Extension/UIImage+Color.m

@@ -21,6 +21,17 @@
     return image;
 }
 
++ (UIImage *)imageWithColor:(UIColor *)color frame:(CGRect)frame {
+    CGRect rect = frame;
+    UIGraphicsBeginImageContext(rect.size);
+    CGContextRef context = UIGraphicsGetCurrentContext();
+    CGContextSetFillColorWithColor(context, [color CGColor]);
+    CGContextFillRect(context, rect);
+    UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
+    UIGraphicsEndImageContext();
+    return image;
+}
+
 - (UIImage *)maskWithColor:(UIColor *)color {
     UIGraphicsBeginImageContextWithOptions(self.size, NO, self.scale);
     [color setFill];

+ 8 - 0
KulexiuForStudent/KulexiuForStudent/InstitutionModule/Home/Controller/KSTenantHomeViewController.m

@@ -8,6 +8,7 @@
 #import "KSTenantHomeViewController.h"
 #import "TenantDarkViewController.h"
 #import "TenantMoreViewController.h"
+#import "AppDelegate+AppService.h"
 
 @interface KSTenantHomeViewController ()
 
@@ -78,6 +79,7 @@
 
 - (void)setIsDarkPage:(BOOL)isDarkPage {
     _isDarkPage = isDarkPage;
+    
     if (isDarkPage) {
         if (_moreCtrl) {
             [self.moreCtrl removeFromParentViewController];
@@ -89,6 +91,7 @@
             make.left.right.top.bottom.mas_equalTo(self.view);
         }];
         [self changeStatusbarLight];
+        [self changeTabBarColor:HexRGB(0x121B2E)];
     }
     else {
         if (_darkCtrl) {
@@ -101,6 +104,7 @@
             make.left.right.top.bottom.mas_equalTo(self.view);
         }];
         [self changeStatusbarDark];
+        [self changeTabBarColor:HexRGB(0xffffff)];
     }
 }
 
@@ -117,6 +121,10 @@
     [UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleLightContent;
 }
 
+- (void)changeTabBarColor:(UIColor *)color {
+    AppDelegate *appDelegate = [AppDelegate shareAppDelegate];
+    [appDelegate.tabBarController changeTabBarColor:color];
+}
 /*
 #pragma mark - Navigation
 

+ 67 - 3
KulexiuForStudent/KulexiuForStudent/InstitutionModule/Home/Controller/TenantDarkViewController.m

@@ -15,6 +15,8 @@
 #import "TYCyclePagerView.h"
 #import "TenantHomeSubjectListCell.h"
 #import "UserInfoManager.h"
+#import "TenantTicketAlert.h"
+#import "AppDelegate+AppService.h"
 
 @interface TenantDarkViewController ()<TYCyclePagerViewDelegate, TYCyclePagerViewDataSource>
 
@@ -34,8 +36,11 @@
 
 @property (nonatomic, strong) UserInfo *mineInfo;
 
-@property (nonatomic, assign) BOOL isFirstLoad;
+@property (nonatomic, strong) dispatch_group_t requestGroup;
 
+@property (nonatomic, strong) TenantTicketAlert *alert;
+
+@property (nonatomic, assign) BOOL hasShowTipsView;
 
 @end
 
@@ -51,19 +56,71 @@
     [super viewDidLoad];
     // Do any additional setup after loading the view.
     [self configUI];
-    self.isFirstLoad = YES;
 }
 
 - (void)viewWillAppear:(BOOL)animated {
     [super viewWillAppear:animated];
+    [self requestSource];
+    
+}
+
+- (void)requestSource {
     [self requestData];
+    [self requsetTicket];
+    dispatch_group_notify(self.requestGroup, dispatch_get_main_queue(), ^{
+        [self refreshView];
+    });
 }
 
+- (void)ticketCheck:(NSInteger)count {
+    if (self.hasShowTipsView == NO) {
+        return;
+    }
+    AppDelegate *appDelegate = [AppDelegate shareAppDelegate];
+    if (appDelegate.isShowMemoAlert) {
+        return;
+    }
+    if (count > 0) {
+        appDelegate.isShowFlashAlert = YES;
+        self.alert = [TenantTicketAlert shareInstance];
+        MJWeakSelf;
+        [self.alert configCount:count callback:^(BOOL isActivate) {
+            appDelegate.isShowFlashAlert = NO;
+            [weakSelf showActivateView];
+            [appDelegate showMemoAlert]; // 检测是否需要弹窗版本更新
+        }];
+        [self.alert showAlert];
+        self.hasShowTipsView = YES;
+    }
+}
+
+- (void)showActivateView {
+    
+}
+
+- (void)requsetTicket {
+    dispatch_group_enter(self.requestGroup);
+    [KSNetworkingManager tenantActivationCodeRequest:KS_POST success:^(NSDictionary * _Nonnull dic) {
+        dispatch_group_leave(self.requestGroup);
+        
+        if ([dic ks_integerValueForKey:@"code"] == 200 && [dic ks_boolValueForKey:@"status"]) {
+            NSInteger count = [dic ks_integerValueForKey:@"total"];
+            [self ticketCheck:count];
+        }
+        else {
+            
+        }
+    } faliure:^(NSError * _Nonnull error) {
+        dispatch_group_leave(self.requestGroup);
+        
+    }];
+}
 
 - (void)requestData {
+    dispatch_group_enter(self.requestGroup);
     [USER_MANAGER queryUserInfoCallback:^(UserInfo * _Nonnull userInfo) {
+        dispatch_group_leave(self.requestGroup);
         self.mineInfo = userInfo;
-        [self refreshView];
     }];
 }
 
@@ -275,6 +332,13 @@
     }
     return _emptyAniView;
 }
+
+- (dispatch_group_t)requestGroup {
+    if (!_requestGroup) {
+        _requestGroup = dispatch_group_create();
+    }
+    return _requestGroup;
+}
 /*
 #pragma mark - Navigation
 

+ 24 - 0
KulexiuForStudent/KulexiuForStudent/InstitutionModule/Home/View/TenantTicketAlert.h

@@ -0,0 +1,24 @@
+//
+//  TenantTicketAlert.h
+//  KulexiuForStudent
+//
+//  Created by 王智 on 2023/9/13.
+//
+
+#import <UIKit/UIKit.h>
+
+typedef void(^TenantAlertCallback)(BOOL isActivate);
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface TenantTicketAlert : UIView
+
++ (instancetype)shareInstance;
+
+- (void)configCount:(NSInteger)count callback:(TenantAlertCallback)callback;
+
+- (void)showAlert;
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 66 - 0
KulexiuForStudent/KulexiuForStudent/InstitutionModule/Home/View/TenantTicketAlert.m

@@ -0,0 +1,66 @@
+//
+//  TenantTicketAlert.m
+//  KulexiuForStudent
+//
+//  Created by 王智 on 2023/9/13.
+//
+
+#import "TenantTicketAlert.h"
+
+@interface TenantTicketAlert ()
+
+@property (nonatomic, copy) TenantAlertCallback callback;
+
+@property (weak, nonatomic) IBOutlet UILabel *countLabel;
+
+@end
+
+@implementation TenantTicketAlert
+
++ (instancetype)shareInstance {
+    TenantTicketAlert *view = [[[NSBundle mainBundle] loadNibNamed:@"TenantTicketAlert" owner:nil options:nil] firstObject];
+    return view;
+}
+
+- (void)configCount:(NSInteger)count callback:(TenantAlertCallback)callback {
+    if (callback) {
+        self.callback = callback;
+    }
+    self.countLabel.text = [NSString stringWithFormat:@"共%zd个", count];
+}
+
+- (void)showAlert {
+    UIWindow *windows = [NSObject getKeyWindow];
+    [windows addSubview:self];
+    [self mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.left.right.top.bottom.mas_equalTo(windows);
+    }];
+}
+
+- (void)hiddenAction {
+    [self removeFromSuperview];
+}
+
+- (IBAction)cancleAction:(id)sender {
+    if (self.callback) {
+        self.callback(NO);
+    }
+    [self hiddenAction];
+}
+
+
+- (IBAction)sureAction:(id)sender {
+    if (self.callback) {
+        self.callback(YES);
+    }
+    [self hiddenAction];
+}
+/*
+// Only override drawRect: if you perform custom drawing.
+// An empty implementation adversely affects performance during animation.
+- (void)drawRect:(CGRect)rect {
+    // Drawing code
+}
+*/
+
+@end

+ 140 - 0
KulexiuForStudent/KulexiuForStudent/InstitutionModule/Home/View/TenantTicketAlert.xib

@@ -0,0 +1,140 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="21701" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
+    <device id="retina6_12" orientation="portrait" appearance="light"/>
+    <dependencies>
+        <deployment identifier="iOS"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21679"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+    </dependencies>
+    <objects>
+        <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
+        <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
+        <view contentMode="scaleToFill" id="iN0-l3-epB" customClass="TenantTicketAlert">
+            <rect key="frame" x="0.0" y="0.0" width="417" height="610"/>
+            <autoresizingMask key="autoresizingMask"/>
+            <subviews>
+                <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="hfH-61-MQN">
+                    <rect key="frame" x="73.666666666666686" y="169.66666666666663" width="270" height="271"/>
+                    <subviews>
+                        <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="tenant_ticketHeader" translatesAutoresizingMaskIntoConstraints="NO" id="JiB-gJ-UMf">
+                            <rect key="frame" x="0.0" y="0.0" width="270" height="271"/>
+                            <constraints>
+                                <constraint firstAttribute="height" constant="271" id="ebB-Ih-5Wn"/>
+                                <constraint firstAttribute="width" constant="270" id="wGB-R2-poC"/>
+                            </constraints>
+                        </imageView>
+                        <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="tenant_ticketTitle" translatesAutoresizingMaskIntoConstraints="NO" id="cOa-x8-rSd">
+                            <rect key="frame" x="76" y="0.0" width="118" height="29"/>
+                            <constraints>
+                                <constraint firstAttribute="height" constant="29" id="XoL-Dd-ZS8"/>
+                                <constraint firstAttribute="width" constant="118" id="hO1-tG-PmJ"/>
+                            </constraints>
+                        </imageView>
+                        <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="tenant_ticketMiddle" translatesAutoresizingMaskIntoConstraints="NO" id="ydz-bz-3zK">
+                            <rect key="frame" x="22" y="47" width="226" height="137"/>
+                            <constraints>
+                                <constraint firstAttribute="width" constant="226" id="X98-WX-Zqs"/>
+                                <constraint firstAttribute="height" constant="137" id="dvI-1m-mWn"/>
+                            </constraints>
+                        </imageView>
+                        <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="tenant_ticketbottom" translatesAutoresizingMaskIntoConstraints="NO" id="F5v-0X-39R">
+                            <rect key="frame" x="0.0" y="164.00000000000003" width="270" height="106.99999999999997"/>
+                            <constraints>
+                                <constraint firstAttribute="width" constant="270" id="4ai-Pp-7k0"/>
+                                <constraint firstAttribute="height" constant="107" id="gn6-Dn-jMZ"/>
+                            </constraints>
+                        </imageView>
+                        <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="PFd-1y-cFY">
+                            <rect key="frame" x="30" y="199.00000000000003" width="210" height="46"/>
+                            <constraints>
+                                <constraint firstAttribute="width" constant="210" id="1XU-vy-0qu"/>
+                                <constraint firstAttribute="height" constant="46" id="GcL-vB-BmB"/>
+                            </constraints>
+                            <fontDescription key="fontDescription" type="system" weight="semibold" pointSize="17"/>
+                            <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
+                            <state key="normal" title="去激活"/>
+                            <connections>
+                                <action selector="sureAction:" destination="iN0-l3-epB" eventType="touchUpInside" id="FcH-pF-OBN"/>
+                            </connections>
+                        </button>
+                        <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="pyf-IZ-8Cw">
+                            <rect key="frame" x="96" y="126.00000000000003" width="78" height="28"/>
+                            <subviews>
+                                <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="共32个" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="3bT-W4-k7D">
+                                    <rect key="frame" x="16" y="4" width="46" height="20"/>
+                                    <fontDescription key="fontDescription" type="system" weight="medium" pointSize="14"/>
+                                    <color key="textColor" red="0.94901960784313721" green="0.3411764705882353" blue="0.33725490196078434" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                    <nil key="highlightedColor"/>
+                                </label>
+                            </subviews>
+                            <color key="backgroundColor" red="1" green="0.8901960784313725" blue="0.8901960784313725" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                            <constraints>
+                                <constraint firstAttribute="bottom" secondItem="3bT-W4-k7D" secondAttribute="bottom" constant="4" id="0Y0-Ng-oKG"/>
+                                <constraint firstItem="3bT-W4-k7D" firstAttribute="leading" secondItem="pyf-IZ-8Cw" secondAttribute="leading" constant="16" id="6GG-iU-gd1"/>
+                                <constraint firstAttribute="trailing" secondItem="3bT-W4-k7D" secondAttribute="trailing" constant="16" id="8TS-4J-6k0"/>
+                                <constraint firstAttribute="height" constant="28" id="BaC-mj-2Q1"/>
+                                <constraint firstItem="3bT-W4-k7D" firstAttribute="top" secondItem="pyf-IZ-8Cw" secondAttribute="top" constant="4" id="cwu-jU-xHc"/>
+                            </constraints>
+                            <userDefinedRuntimeAttributes>
+                                <userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
+                                    <real key="value" value="14"/>
+                                </userDefinedRuntimeAttribute>
+                            </userDefinedRuntimeAttributes>
+                        </view>
+                    </subviews>
+                    <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                    <constraints>
+                        <constraint firstItem="ydz-bz-3zK" firstAttribute="centerX" secondItem="hfH-61-MQN" secondAttribute="centerX" id="6lf-99-JsT"/>
+                        <constraint firstItem="pyf-IZ-8Cw" firstAttribute="top" secondItem="cOa-x8-rSd" secondAttribute="bottom" constant="97" id="7Cm-by-jjD"/>
+                        <constraint firstAttribute="bottom" secondItem="PFd-1y-cFY" secondAttribute="bottom" constant="26" id="C8c-9q-V6e"/>
+                        <constraint firstAttribute="trailing" secondItem="F5v-0X-39R" secondAttribute="trailing" id="Eoj-T8-X9z"/>
+                        <constraint firstItem="pyf-IZ-8Cw" firstAttribute="centerX" secondItem="hfH-61-MQN" secondAttribute="centerX" id="HoP-Dx-aHs"/>
+                        <constraint firstItem="JiB-gJ-UMf" firstAttribute="leading" secondItem="hfH-61-MQN" secondAttribute="leading" id="KF7-Nl-mQX"/>
+                        <constraint firstAttribute="trailing" secondItem="JiB-gJ-UMf" secondAttribute="trailing" id="aHt-Yi-e22"/>
+                        <constraint firstAttribute="bottom" secondItem="JiB-gJ-UMf" secondAttribute="bottom" id="cqg-n6-sZk"/>
+                        <constraint firstItem="cOa-x8-rSd" firstAttribute="top" secondItem="hfH-61-MQN" secondAttribute="top" id="eaQ-Ry-wR4"/>
+                        <constraint firstItem="PFd-1y-cFY" firstAttribute="centerX" secondItem="hfH-61-MQN" secondAttribute="centerX" id="g9D-Gr-zaL"/>
+                        <constraint firstItem="F5v-0X-39R" firstAttribute="leading" secondItem="hfH-61-MQN" secondAttribute="leading" id="n12-YN-aVB"/>
+                        <constraint firstItem="JiB-gJ-UMf" firstAttribute="top" secondItem="hfH-61-MQN" secondAttribute="top" id="p30-Kn-BjN"/>
+                        <constraint firstAttribute="bottom" secondItem="F5v-0X-39R" secondAttribute="bottom" id="tVl-9w-Qnb"/>
+                        <constraint firstItem="cOa-x8-rSd" firstAttribute="centerX" secondItem="hfH-61-MQN" secondAttribute="centerX" id="uzg-wm-qCF"/>
+                        <constraint firstItem="ydz-bz-3zK" firstAttribute="top" secondItem="cOa-x8-rSd" secondAttribute="bottom" constant="18" id="vCU-o2-F7n"/>
+                    </constraints>
+                </view>
+                <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="d4J-NK-rTF">
+                    <rect key="frame" x="186.66666666666666" y="463.66666666666669" width="44" height="44"/>
+                    <constraints>
+                        <constraint firstAttribute="height" constant="44" id="C5z-Vg-KbG"/>
+                        <constraint firstAttribute="width" constant="44" id="T00-cZ-4IK"/>
+                    </constraints>
+                    <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
+                    <state key="normal" image="tenant_close"/>
+                    <connections>
+                        <action selector="cancleAction:" destination="iN0-l3-epB" eventType="touchUpInside" id="O4A-Id-td3"/>
+                    </connections>
+                </button>
+            </subviews>
+            <color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.5" colorSpace="custom" customColorSpace="sRGB"/>
+            <constraints>
+                <constraint firstItem="hfH-61-MQN" firstAttribute="centerY" secondItem="iN0-l3-epB" secondAttribute="centerY" id="Bi4-wG-69m"/>
+                <constraint firstItem="d4J-NK-rTF" firstAttribute="centerX" secondItem="iN0-l3-epB" secondAttribute="centerX" id="Qtq-iE-jdg"/>
+                <constraint firstItem="d4J-NK-rTF" firstAttribute="top" secondItem="hfH-61-MQN" secondAttribute="bottom" constant="23" id="Usw-9t-Enx"/>
+                <constraint firstItem="hfH-61-MQN" firstAttribute="centerX" secondItem="iN0-l3-epB" secondAttribute="centerX" id="lNO-f9-mkp"/>
+            </constraints>
+            <nil key="simulatedTopBarMetrics"/>
+            <nil key="simulatedBottomBarMetrics"/>
+            <freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
+            <connections>
+                <outlet property="countLabel" destination="3bT-W4-k7D" id="HFB-E8-RGk"/>
+            </connections>
+            <point key="canvasLocation" x="109.16030534351144" y="-121.83098591549296"/>
+        </view>
+    </objects>
+    <resources>
+        <image name="tenant_close" width="32" height="32"/>
+        <image name="tenant_ticketHeader" width="270" height="271"/>
+        <image name="tenant_ticketMiddle" width="226" height="137"/>
+        <image name="tenant_ticketTitle" width="118" height="29"/>
+        <image name="tenant_ticketbottom" width="270" height="107"/>
+    </resources>
+</document>

+ 4 - 2
KulexiuForStudent/KulexiuForStudent/InstitutionModule/Mine/Controller/InsititutionMineViewController.m

@@ -152,13 +152,15 @@
             break;
         case INSMINETYPE_USERAGREEMENT:
         {
-            
+            KSBaseWKWebViewController *webCtrl = [[KSBaseWKWebViewController alloc] init];
+            webCtrl.url = [NSString stringWithFormat:@"%@%@",WEBHOST, @"/#/registerProtocol"];
+            [self.navigationController pushViewController:webCtrl animated:YES];
         }
             break;
         case INSMINETYPE_PRIVACY:
         {
             KSBaseWKWebViewController *webCtrl = [[KSBaseWKWebViewController alloc] init];
-            webCtrl.url = [NSString stringWithFormat:@"%@%@", WEBHOST, @"/#/teacherFollow"];
+            webCtrl.url = [NSString stringWithFormat:@"%@%@",WEBHOST, @"/#/privacyProtocol"];
             [self.navigationController pushViewController:webCtrl animated:YES];
         }
             break;

+ 11 - 24
KulexiuForStudent/KulexiuForStudent/InstitutionModule/TabbarController/InstitutionTabBarController.m

@@ -60,16 +60,6 @@
     [self changeTabBarColor:HexRGB(0x121B2E)];
 }
 
-- (void)tabBarSelectedWithIndex:(NSInteger)index {
-    [self setSelectedIndex:index];
-    if (index == 0) {
-        [self changeTabBarColor:HexRGB(0x121B2E)];
-    }
-    else {
-        [self resetTabBarColor];
-    }
-}
-
 - (CustomNavViewController *)createNavControllerWithClassName:(NSString *)className title:(NSString *)title imageName:(NSString *)imageName selectedImageName:(NSString *)selectedImageName {
     KSBaseViewController *controller = [[NSClassFromString(className) alloc] init];
     controller.title = title;
@@ -83,14 +73,19 @@
 }
 
 - (void)changeBgColorWithTabBarController:(UITabBarController *)tabBarController selectViewController:(UIViewController *)viewController {
-    if ([viewController isMemberOfClass:NSClassFromString(@"KSTenantHomeViewController")]) {
-        [self changeTabBarColor:HexRGB(0x121B2E)];
-
-    }
-    else {
-        [self resetTabBarColor];
+    if ([viewController isKindOfClass:[CustomNavViewController class]]) {
+        CustomNavViewController *navCtrl = (CustomNavViewController *)viewController;
+        UIViewController *childrenCtrl = [navCtrl.visibleViewController.childViewControllers lastObject];
+        if ([childrenCtrl isMemberOfClass:NSClassFromString(@"TenantDarkViewController")]) {
+            [self changeTabBarColor:HexRGB(0x121B2E)];
+        }
+        else {
+            [self resetTabBarColor];
+        }
     }
 }
+
+
 #pragma mark ----- UITabBarControllerDelegate
 
 - (void)tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController {
@@ -98,14 +93,6 @@
     if ([viewController isEqual:[tabBarController.viewControllers objectAtIndex:2]] && isDoubleClick) {
         [[NSNotificationCenter defaultCenter] postNotificationName:CHATVIEW_REFRESH object:nil];
     }
-    NSInteger index = 0;
-    
-    if (index == 0) {
-        [self changeTabBarColor:HexRGB(0x121B2E)];
-    }
-    else {
-        [self resetTabBarColor];
-    }
     
     [self changeBgColorWithTabBarController:tabBarController selectViewController:viewController];