Explorar o código

1.头部按钮+25号优化

Steven hai 1 ano
pai
achega
2d1779abe5
Modificáronse 26 ficheiros con 504 adicións e 130 borrados
  1. 16 0
      KulexiuForStudent/KulexiuForStudent.xcodeproj/project.pbxproj
  2. 22 0
      KulexiuForStudent/KulexiuForStudent/Assets.xcassets/EmptyStatus/empty_webView_error.imageset/Contents.json
  3. BIN=BIN
      KulexiuForStudent/KulexiuForStudent/Assets.xcassets/EmptyStatus/empty_webView_error.imageset/empty_webView_error@2x.png
  4. BIN=BIN
      KulexiuForStudent/KulexiuForStudent/Assets.xcassets/EmptyStatus/empty_webView_error.imageset/empty_webView_error@3x.png
  5. 22 0
      KulexiuForStudent/KulexiuForStudent/Assets.xcassets/EmptyStatus/tenant_empty_webView_error.imageset/Contents.json
  6. BIN=BIN
      KulexiuForStudent/KulexiuForStudent/Assets.xcassets/EmptyStatus/tenant_empty_webView_error.imageset/tenant_empty_webView_error@2x.png
  7. BIN=BIN
      KulexiuForStudent/KulexiuForStudent/Assets.xcassets/EmptyStatus/tenant_empty_webView_error.imageset/tenant_empty_webView_error@3x.png
  8. 3 20
      KulexiuForStudent/KulexiuForStudent/Common/Base/KSAccompanyWebViewController.m
  9. 9 0
      KulexiuForStudent/KulexiuForStudent/Common/Base/KSBaseViewController.h
  10. 38 0
      KulexiuForStudent/KulexiuForStudent/Common/Base/KSBaseViewController.m
  11. 0 7
      KulexiuForStudent/KulexiuForStudent/Common/Base/KSBaseWKWebViewController.h
  12. 86 97
      KulexiuForStudent/KulexiuForStudent/Common/Base/KSBaseWKWebViewController.m
  13. 25 0
      KulexiuForStudent/KulexiuForStudent/Common/Base/KSWebLoadRefreshView.h
  14. 73 0
      KulexiuForStudent/KulexiuForStudent/Common/Base/KSWebLoadRefreshView.m
  15. 131 0
      KulexiuForStudent/KulexiuForStudent/Common/Base/KSWebLoadRefreshView.xib
  16. 19 0
      KulexiuForStudent/KulexiuForStudent/Common/Base/UIViewController+KSExtension.h
  17. 24 0
      KulexiuForStudent/KulexiuForStudent/Common/Base/UIViewController+KSExtension.m
  18. 3 0
      KulexiuForStudent/KulexiuForStudent/Common/Define/Common.h
  19. 3 0
      KulexiuForStudent/KulexiuForStudent/Common/Define/KSDomain.h
  20. 2 0
      KulexiuForStudent/KulexiuForStudent/Common/Define/PrefixHeader.pch
  21. 5 2
      KulexiuForStudent/KulexiuForStudent/InstitutionModule/Home/Controller/TenantDarkViewController.m
  22. 12 1
      KulexiuForStudent/KulexiuForStudent/InstitutionModule/Mine/Controller/INSSettingViewController.m
  23. 0 1
      KulexiuForStudent/KulexiuForStudent/Module/Chat/Controller/TXCustom/KSTXBaseChatViewController.m
  24. 0 1
      KulexiuForStudent/KulexiuForStudent/Module/CloudEngine/Controller/KSCloudViewController.m
  25. 0 1
      KulexiuForStudent/KulexiuForStudent/Module/Mall/Controller/ShopMallViewController.m
  26. 11 0
      KulexiuForStudent/KulexiuForStudent/Module/Mine/Setting/Controller/UserSettingViewController.m

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

@@ -367,6 +367,9 @@
 		BC0D1F72281015B000C5D9E5 /* VideoCourseCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = BC0D1F6F281015AF00C5D9E5 /* VideoCourseCell.xib */; };
 		BC0D1F752810165500C5D9E5 /* VideoCourseModel.m in Sources */ = {isa = PBXBuildFile; fileRef = BC0D1F742810165400C5D9E5 /* VideoCourseModel.m */; };
 		BC0D95112AC26E4000E54D3F /* UIImageView+DisplayImage.m in Sources */ = {isa = PBXBuildFile; fileRef = BC0D95102AC26E4000E54D3F /* UIImageView+DisplayImage.m */; };
+		BC0D95142AC2752400E54D3F /* UIViewController+KSExtension.m in Sources */ = {isa = PBXBuildFile; fileRef = BC0D95132AC2752400E54D3F /* UIViewController+KSExtension.m */; };
+		BC0D95182AC280CA00E54D3F /* KSWebLoadRefreshView.xib in Resources */ = {isa = PBXBuildFile; fileRef = BC0D95162AC280CA00E54D3F /* KSWebLoadRefreshView.xib */; };
+		BC0D95192AC280CB00E54D3F /* KSWebLoadRefreshView.m in Sources */ = {isa = PBXBuildFile; fileRef = BC0D95172AC280CA00E54D3F /* KSWebLoadRefreshView.m */; };
 		BC106BC52A9336F8000759A9 /* TXLiveRoomViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = BC106BC42A9336F8000759A9 /* TXLiveRoomViewController.m */; };
 		BC106BFE2A933829000759A9 /* TXMicStatusSync.m in Sources */ = {isa = PBXBuildFile; fileRef = BC106BC62A93381C000759A9 /* TXMicStatusSync.m */; };
 		BC106BFF2A933829000759A9 /* TXLiveMessageCardMessage.m in Sources */ = {isa = PBXBuildFile; fileRef = BC106BC92A93381D000759A9 /* TXLiveMessageCardMessage.m */; };
@@ -1800,6 +1803,11 @@
 		BC0D1F742810165400C5D9E5 /* VideoCourseModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VideoCourseModel.m; sourceTree = "<group>"; };
 		BC0D950F2AC26E4000E54D3F /* UIImageView+DisplayImage.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "UIImageView+DisplayImage.h"; sourceTree = "<group>"; };
 		BC0D95102AC26E4000E54D3F /* UIImageView+DisplayImage.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "UIImageView+DisplayImage.m"; sourceTree = "<group>"; };
+		BC0D95122AC2752400E54D3F /* UIViewController+KSExtension.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIViewController+KSExtension.h"; sourceTree = "<group>"; };
+		BC0D95132AC2752400E54D3F /* UIViewController+KSExtension.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIViewController+KSExtension.m"; sourceTree = "<group>"; };
+		BC0D95152AC280CA00E54D3F /* KSWebLoadRefreshView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KSWebLoadRefreshView.h; sourceTree = "<group>"; };
+		BC0D95162AC280CA00E54D3F /* KSWebLoadRefreshView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = KSWebLoadRefreshView.xib; sourceTree = "<group>"; };
+		BC0D95172AC280CA00E54D3F /* KSWebLoadRefreshView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KSWebLoadRefreshView.m; sourceTree = "<group>"; };
 		BC106BC32A9336F8000759A9 /* TXLiveRoomViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TXLiveRoomViewController.h; sourceTree = "<group>"; };
 		BC106BC42A9336F8000759A9 /* TXLiveRoomViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = TXLiveRoomViewController.m; sourceTree = "<group>"; };
 		BC106BC62A93381C000759A9 /* TXMicStatusSync.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TXMicStatusSync.m; sourceTree = "<group>"; };
@@ -4386,6 +4394,8 @@
 		2779350B27E324A40010E277 /* Base */ = {
 			isa = PBXGroup;
 			children = (
+				BC0D95122AC2752400E54D3F /* UIViewController+KSExtension.h */,
+				BC0D95132AC2752400E54D3F /* UIViewController+KSExtension.m */,
 				BC9AA0D72ABC434900CD954D /* LoadingManager */,
 				BCB5B2D42ABB1E12005BF25D /* KSEmptyStatusView.h */,
 				BCB5B2D22ABB1E12005BF25D /* KSEmptyStatusView.m */,
@@ -4423,6 +4433,9 @@
 				275FA1D627E7351800CFEA2E /* KSBaseViewController.m */,
 				275FA1D527E7351800CFEA2E /* KSBaseWKWebViewController.h */,
 				275FA1CE27E7351700CFEA2E /* KSBaseWKWebViewController.m */,
+				BC0D95152AC280CA00E54D3F /* KSWebLoadRefreshView.h */,
+				BC0D95172AC280CA00E54D3F /* KSWebLoadRefreshView.m */,
+				BC0D95162AC280CA00E54D3F /* KSWebLoadRefreshView.xib */,
 				BCFE540128152A8500AD6786 /* KSOrderManager.h */,
 				BCFE540228152A8500AD6786 /* KSOrderManager.m */,
 				275FA1C027E7351600CFEA2E /* KSLocalWebViewController.h */,
@@ -7269,6 +7282,7 @@
 				27F9032E27E87C2E00C08A19 /* DeviceCheckView.xib in Resources */,
 				275FA23727E7356B00CFEA2E /* LoginBodyView.xib in Resources */,
 				BCFDA65428BCA2000022B497 /* accomapny_animation_2.png in Resources */,
+				BC0D95182AC280CA00E54D3F /* KSWebLoadRefreshView.xib in Resources */,
 				BC71D273288804CD0010F14B /* img_33.png in Resources */,
 				BCC583C628A9EC6400BAB4CF /* cloud_animation_13.png in Resources */,
 				BCC583C428A9EC6400BAB4CF /* cloud_animation_16.png in Resources */,
@@ -7862,6 +7876,7 @@
 				2779351927E324A60010E277 /* NSMutableString+KSSafe.m in Sources */,
 				2723B5BC27F157B100E0B90B /* GroupCreateView.m in Sources */,
 				BCB6346927F6D29600ACFDCF /* KSLiveChatroomSeatResponse.m in Sources */,
+				BC0D95192AC280CB00E54D3F /* KSWebLoadRefreshView.m in Sources */,
 				2723B64627F15B5900E0B90B /* UITableView+SCIndexView.m in Sources */,
 				BC3A4EB128DAE074001C4428 /* KSQRCreateManager.m in Sources */,
 				2779352327E324A60010E277 /* UILabel+Extension.m in Sources */,
@@ -7910,6 +7925,7 @@
 				BC27A079280FFA2200F91E27 /* EvaluateDetailModel.m in Sources */,
 				2779358B27E324A80010E277 /* KLTNavigationController.m in Sources */,
 				27F9033127E87C2E00C08A19 /* DeviceCheckView.m in Sources */,
+				BC0D95142AC2752400E54D3F /* UIViewController+KSExtension.m in Sources */,
 				BC119263280FA90100A716F7 /* HomeworkDetailModel.m in Sources */,
 				BCC0F6A52A8CDD3F00C4EFA4 /* CREmojiCollectionCell.m in Sources */,
 				2723B62427F157D500E0B90B /* NoticeEditBodyView.m in Sources */,

+ 22 - 0
KulexiuForStudent/KulexiuForStudent/Assets.xcassets/EmptyStatus/empty_webView_error.imageset/Contents.json

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

BIN=BIN
KulexiuForStudent/KulexiuForStudent/Assets.xcassets/EmptyStatus/empty_webView_error.imageset/empty_webView_error@2x.png


BIN=BIN
KulexiuForStudent/KulexiuForStudent/Assets.xcassets/EmptyStatus/empty_webView_error.imageset/empty_webView_error@3x.png


+ 22 - 0
KulexiuForStudent/KulexiuForStudent/Assets.xcassets/EmptyStatus/tenant_empty_webView_error.imageset/Contents.json

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

BIN=BIN
KulexiuForStudent/KulexiuForStudent/Assets.xcassets/EmptyStatus/tenant_empty_webView_error.imageset/tenant_empty_webView_error@2x.png


BIN=BIN
KulexiuForStudent/KulexiuForStudent/Assets.xcassets/EmptyStatus/tenant_empty_webView_error.imageset/tenant_empty_webView_error@3x.png


+ 3 - 20
KulexiuForStudent/KulexiuForStudent/Common/Base/KSAccompanyWebViewController.m

@@ -204,18 +204,6 @@
 
 - (void)initWebView {
     [self.scrollView removeFromSuperview];
-    [self.view addSubview:self.navView];
-    CGFloat topHeight = kNaviBarHeight;
-    [self.navView mas_makeConstraints:^(MASConstraintMaker *make) {
-        make.left.right.top.mas_equalTo(self.view);
-        make.height.mas_equalTo(kNaviBarHeight);
-    }];
-    if (self.hiddenNavBar) {
-        topHeight = 0.0f;
-        [self.navView mas_updateConstraints:^(MASConstraintMaker *make) {
-            make.height.mas_equalTo(0);
-        }];
-    }
     
     [self.view addSubview:self.viewContainer];
     [self.viewContainer mas_makeConstraints:^(MASConstraintMaker *make) {
@@ -227,12 +215,8 @@
         WKWebViewConfiguration *config = [[WKWebViewConfiguration alloc] init];
         config.selectionGranularity = WKSelectionGranularityDynamic;
         config.allowsInlineMediaPlayback = YES;
-        if (@available(iOS 10.0, *)) {
-            config.mediaTypesRequiringUserActionForPlayback = NO;
-        } else {
-            // Fallback on earlier versions
-            config.requiresUserActionForMediaPlayback = NO;
-        }
+        config.mediaTypesRequiringUserActionForPlayback = NO;
+
         config.processPool = [KSBaseWKWebViewController singleWkProcessPool];
         config.websiteDataStore = [WKWebsiteDataStore defaultDataStore];
         [self configUserAgent:config];
@@ -259,11 +243,10 @@
         self.myWebView.scrollView.backgroundColor = [UIColor clearColor];
         // 加载进度条和title
         [self.myWebView addObserver:self forKeyPath:@"estimatedProgress" options:NSKeyValueObservingOptionNew context:nil];
-        [self.myWebView addObserver:self forKeyPath:@"title" options:NSKeyValueObservingOptionNew context:NULL];
         [self.view addSubview:self.myWebView];
         [self.myWebView mas_makeConstraints:^(MASConstraintMaker *make) {
             make.left.right.mas_equalTo(self.view);
-            make.top.mas_equalTo(self.view.mas_top).offset(topHeight);
+            make.top.mas_equalTo(self.view.mas_top);
             make.bottom.mas_equalTo(self.view.mas_bottom);
         }];
         if (@available(iOS 11.0, *)) {

+ 9 - 0
KulexiuForStudent/KulexiuForStudent/Common/Base/KSBaseViewController.h

@@ -37,6 +37,8 @@ NS_ASSUME_NONNULL_BEGIN
 
 @property (nonatomic, strong) KSStatusView *actionStatusView;
 
+@property (nonatomic, strong) KSBaseViewController *preCtrl;
+
 - (void)addfeedBackGenertor;//添加震动反馈
 
 // 打开设置页面
@@ -100,6 +102,13 @@ NS_ASSUME_NONNULL_BEGIN
 
 // 移除通知
 - (void)removeNotifier;
+
+/// 获取上一个视图控制器
+- (KSBaseViewController *)getPreViewController;
+/// 获取下一个视图控制器
+- (KSBaseViewController *)getNextViewController;
+
+- (BOOL)isViewPopDismiss;
 @end
 
 NS_ASSUME_NONNULL_END

+ 38 - 0
KulexiuForStudent/KulexiuForStudent/Common/Base/KSBaseViewController.m

@@ -419,6 +419,44 @@
 - (void)removeNotifier {
     [[NSNotificationCenter defaultCenter] removeObserver:self];
 }
+
+
+/// 获取上一个视图控制器
+- (KSBaseViewController *)getPreViewController {
+    NSInteger currentIndex = [self.navigationController.viewControllers indexOfObject:self];
+    if (currentIndex > 0 && currentIndex < self.navigationController.viewControllers.count && currentIndex != NSNotFound) {
+        // 获取上一个视图控制器
+        return [self.navigationController.viewControllers objectAtIndex:currentIndex - 1];
+    }
+    return nil;
+}
+
+/// 获取下一个视图控制器
+- (KSBaseViewController *)getNextViewController {
+    NSArray *viewControllers = self.navigationController.viewControllers;//获取当前的视图控制其
+    if (viewControllers.count > 1 && [viewControllers objectAtIndex:viewControllers.count-2] == self) { //当前视图控制器在栈中,故为push操作
+        return [self.navigationController.viewControllers objectAtIndex:viewControllers.count - 1];
+    }
+    else {
+        return [self getPreViewController];
+    }
+}
+
+// viewWillDisappear 使用
+- (BOOL)isViewPopDismiss {
+    NSArray *viewControllers = self.navigationController.viewControllers;//获取当前的视图控制其
+    if (viewControllers.count > 1 && [viewControllers objectAtIndex:viewControllers.count-2] == self) { //当前视图控制器在栈中,故为push操作
+        return NO;
+    } else if ([viewControllers indexOfObject:self] == NSNotFound) { //当前视图控制器不在栈中,故为pop操作
+        return YES;
+    }
+    return NO;
+}
+
+- (void)viewDidAppear:(BOOL)animated {
+    [super viewDidAppear:animated];
+    self.preCtrl = [self getPreViewController];
+}
 /*
 #pragma mark - Navigation
 

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

@@ -17,10 +17,6 @@ NS_ASSUME_NONNULL_BEGIN
 
 @property (nonatomic, strong) NSString *url; // webView的连接地址
 
-@property (nonatomic, assign) BOOL hiddenNavBar;  // 是否显示顶部导航栏
-
-@property (nonatomic, assign) BOOL hideTop; // 隐藏顶部包含按钮
-
 @property (nonatomic, strong) NSDictionary *parmDic; // 需要回传的参数
 
 @property (nonatomic, strong) NSString *headTitle;  // 顶部显示的title
@@ -35,9 +31,6 @@ NS_ASSUME_NONNULL_BEGIN
 
 @property (nonatomic, assign) BOOL keepOrientation;
 
-@property (nonatomic, strong) KSWebNavView *navView; // 顶部视图
-
-@property (nonatomic, strong) KSWebBackButton *webBackButton; // 返回按钮
 
 - (void)initWebView;
 

+ 86 - 97
KulexiuForStudent/KulexiuForStudent/Common/Base/KSBaseWKWebViewController.m

@@ -30,6 +30,7 @@
 #import "KSMediaManager.h"
 #import "KSUMShareManager.h"
 #import "UserInfoManager.h"
+#import "KSWebLoadRefreshView.h"
 
 typedef NS_ENUM(NSInteger, CHOOSETYPE) {
     CHOOSETYPE_XML,
@@ -65,6 +66,8 @@ typedef NS_ENUM(NSInteger, CHOOSETYPE) {
 
 @property (nonatomic, assign) BOOL isFirstLoad;
 
+@property (nonatomic, strong) KSWebLoadRefreshView *errorView;
+
 @end
 
 @implementation KSBaseWKWebViewController
@@ -82,9 +85,22 @@ typedef NS_ENUM(NSInteger, CHOOSETYPE) {
 
 
 - (void)captureViewTips:(NSNotification *)notification {
-    if ([UIScreen mainScreen].isCaptured) {
-        [self didCapturedView];
+    [self checkCaptured];
+}
+
+- (void)checkCaptured {
+    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
+        if ([self checkIsCaptured]) {
+            [self didCapturedView];
+        }
+    });
+}
+#pragma mark ---- 镜像和投屏检测
+- (BOOL)checkIsCaptured {
+    if ([UIScreen mainScreen].isCaptured && [UIScreen screens].count < 2) {
+        return YES;
     }
+    return NO;
 }
 
 - (void)didCapturedView {
@@ -95,12 +111,11 @@ typedef NS_ENUM(NSInteger, CHOOSETYPE) {
     [content setValue:@"pause" forKey:@"status"];
     [sendParm setValue:content forKey:@"content"];
     [self postMessage:sendParm];
-    
-//    [LOADING_MANAGER MBShowAUTOHidingInWindow:@"为了保证数据安全,请不要录屏"];
 }
 
 
 
+
 - (void)operationDealCallbackMessage:(NSNotification *)notification {
     NSString *status = [notification object];
     NSMutableDictionary *sendParm = [NSMutableDictionary dictionary];
@@ -120,15 +135,11 @@ typedef NS_ENUM(NSInteger, CHOOSETYPE) {
     NSInteger orientation = [parmDic ks_integerValueForKey:@"orientation"];
     
     BOOL isLandScape = orientation == 0 ? YES : NO;
-    if (_landScape != isLandScape) {
-        [self changeOrientation:isLandScape];
-    }
-    // 是否隐藏头部导航条
-    self.hideTop = [parmDic ks_boolValueForKey:@"isHideTitle"];
+    self.ks_landScape = isLandScape;
+    [self changeOrientation:isLandScape];
 }
 
 - (void)changeOrientation:(BOOL)isLandScape {
-    self.landScape = isLandScape;
     if (isLandScape) {
         // 切换到横屏
         AppDelegate* delegate = (AppDelegate*)[UIApplication sharedApplication].delegate;
@@ -167,52 +178,36 @@ typedef NS_ENUM(NSInteger, CHOOSETYPE) {
 
 - (void)viewWillDisappear:(BOOL)animated {
     [super viewWillDisappear:animated];
-    if (_hasChangeSource && self.keepOrientation == NO && self.landScape == YES) {
-        [[UIApplication sharedApplication] setIdleTimerDisabled:NO];
-        [self changeOrientation:NO];
+    BOOL isBack = [self isViewPopDismiss];
+    if (isBack) {
+        if (self.preCtrl) {
+            if (self.ks_landScape != self.preCtrl.ks_landScape) {
+                [self changeOrientation:self.preCtrl.ks_landScape];
+            }
+        }
+        if (![self.preCtrl isKindOfClass:[KSBaseWKWebViewController class]]) {
+            [[UIApplication sharedApplication] setIdleTimerDisabled:NO];
+        }
+    }
+    else {
+        KSBaseViewController *nextCtrl = [self getNextViewController];
+        if (nextCtrl) {
+            if (nextCtrl.ks_landScape != self.ks_landScape) {
+                [self changeOrientation:NO];
+            }
+        }
     }
-    self.keepOrientation = NO;
 }
 
 - (void)initWebView {
     [self.scrollView removeFromSuperview];
-    [self.view addSubview:self.navView];
-    CGFloat topHeight = kNaviBarHeight;
-    if (self.hideTop) {
-        topHeight = 0.0f;
-    }
-    [self.navView mas_makeConstraints:^(MASConstraintMaker *make) {
-        make.left.right.top.mas_equalTo(self.view);
-        make.height.mas_equalTo(topHeight);
-    }];
-    
-    [self.view addSubview:self.webBackButton];
-    [self.webBackButton mas_makeConstraints:^(MASConstraintMaker *make) {
-        make.left.top.mas_equalTo(self.view);
-        make.height.mas_equalTo(kNaviBarHeight);
-        make.width.mas_equalTo(44);
-    }];
-    if (self.hideTop) {
-        self.webBackButton.hidden = YES;
-    }
-    if (_hiddenNavBar) {
-        topHeight = 0.0f;
-    }
-    if (self.headTitle) {
-        [self.navView.topTitleLabel setText:_headTitle];
-    }
     
     if (_myWebView == nil) {
         
         WKWebViewConfiguration *config = [[WKWebViewConfiguration alloc] init];
         config.selectionGranularity = WKSelectionGranularityDynamic;
         config.allowsInlineMediaPlayback = YES;
-        if (@available(iOS 10.0, *)) {
-            config.mediaTypesRequiringUserActionForPlayback = NO;
-        } else {
-            // Fallback on earlier versions
-            config.requiresUserActionForMediaPlayback = NO;
-        }
+        config.mediaTypesRequiringUserActionForPlayback = NO;
         config.processPool = [KSBaseWKWebViewController singleWkProcessPool];
         config.websiteDataStore = [WKWebsiteDataStore defaultDataStore];
         [self configUserAgent:config];
@@ -238,12 +233,11 @@ typedef NS_ENUM(NSInteger, CHOOSETYPE) {
         _myWebView.scrollView.showsHorizontalScrollIndicator = NO;
         // 加载进度条和title
         [_myWebView addObserver:self forKeyPath:@"estimatedProgress" options:NSKeyValueObservingOptionNew context:nil];
-        [_myWebView addObserver:self forKeyPath:@"title" options:NSKeyValueObservingOptionNew context:NULL];
         
         [self.view addSubview:_myWebView];
         [_myWebView mas_makeConstraints:^(MASConstraintMaker *make) {
             make.left.right.mas_equalTo(self.view);
-            make.top.mas_equalTo(self.view.mas_top).offset(topHeight);
+            make.top.mas_equalTo(self.view.mas_top);
             make.bottom.mas_equalTo(self.view.mas_bottom);
         }];
         if (@available(iOS 11.0, *)) {
@@ -254,9 +248,6 @@ typedef NS_ENUM(NSInteger, CHOOSETYPE) {
         [self setupProgress];
         // 修改userAgent
         [self loadRequest];
-
-        [self.view bringSubviewToFront:self.navView];
-        [self.view bringSubviewToFront:self.webBackButton];
     }
     else {
         [_myWebView reload];
@@ -330,8 +321,12 @@ typedef NS_ENUM(NSInteger, CHOOSETYPE) {
 
 - (void)handleScriptMessageSource:(NSDictionary *)parm {
     if ([[parm ks_stringValueForKey:@"api"] isEqualToString:@"back"]) { // 返回
+        [self.myWebView stopLoading];
         [self.navigationController popViewControllerAnimated:YES];
     }
+    else if ([[parm ks_stringValueForKey:@"api"] isEqualToString:@"goBack"]) { // 逐级返回
+        [self backAction];
+    }
     else if ([[parm ks_stringValueForKey:@"api"] isEqualToString:@"login"]) {
         // 回到登录页面
         [self backLoginView];
@@ -356,7 +351,9 @@ typedef NS_ENUM(NSInteger, CHOOSETYPE) {
         // 横竖屏
         NSInteger orientation = [valueDic ks_integerValueForKey:@"orientation"];
         BOOL isLandScape = orientation == 0 ? YES : NO;
+        self.ks_landScape = isLandScape;
         [self changeOrientation:isLandScape];
+        
     }
     else if ([[parm ks_stringValueForKey:@"api"] isEqualToString:@"keepScreenLongLight"]) {
         NSDictionary *valueDic = [parm ks_dictionaryValueForKey:@"content"];
@@ -405,13 +402,9 @@ typedef NS_ENUM(NSInteger, CHOOSETYPE) {
             KSAccompanyWebViewController *detailCtrl = [[KSAccompanyWebViewController alloc] init];
             detailCtrl.url = [valueDic ks_stringValueForKey:@"url"];
             detailCtrl.parmDic = valueDic;
-            detailCtrl.hiddenNavBar = [valueDic ks_boolValueForKey:@"isHideTitle"];
             NSInteger orientation = [valueDic ks_integerValueForKey:@"orientation"];
             BOOL isLandScape = orientation == 0 ? YES : NO;
-            if (isLandScape == self.landScape) {
-                self.keepOrientation = YES;
-                detailCtrl.keepOrientation = YES;
-            }
+            detailCtrl.ks_landScape = isLandScape;
             [self postMessage:parm];
             [self.navigationController pushViewController:detailCtrl animated:YES];
         }
@@ -446,6 +439,7 @@ typedef NS_ENUM(NSInteger, CHOOSETYPE) {
         [self postMessage:parm];
     }
     else if ([[parm ks_stringValueForKey:@"api"] isEqualToString:@"backIconChange"]) {
+        /*
         NSDictionary *valueDic = [parm ks_dictionaryValueForKey:@"content"];
         NSString *backColor = [valueDic ks_stringValueForKey:@"iconStyle"];
         NSString *backImage = @"";
@@ -459,8 +453,10 @@ typedef NS_ENUM(NSInteger, CHOOSETYPE) {
         // 是否隐藏按钮
         BOOL hideButton = [valueDic ks_boolValueForKey:@"backIconHide"];
         self.webBackButton.hidden = hideButton;
+         */
     }
     else if ([[parm ks_stringValueForKey:@"api"] isEqualToString:@"setBarStatus"]) { // 顶部是否隐藏
+        /*
         NSDictionary *valueDic = [parm ks_dictionaryValueForKey:@"content"];
         BOOL isShow = [valueDic ks_boolValueForKey:@"status"]; // 0 隐藏 1 显示
         self.hiddenNavBar = !isShow;
@@ -472,6 +468,7 @@ typedef NS_ENUM(NSInteger, CHOOSETYPE) {
         [self.myWebView mas_updateConstraints:^(MASConstraintMaker *make) {
             make.top.mas_equalTo(self.view.mas_top).offset(navHeight);
         }];
+         */
     }
     else if ([[parm ks_stringValueForKey:@"api"] isEqualToString:@"paymentOrder"]) {
         NSDictionary *content = [parm ks_dictionaryValueForKey:@"content"];
@@ -725,11 +722,7 @@ typedef NS_ENUM(NSInteger, CHOOSETYPE) {
 }
 
 - (void)openSettingView {
-    if (@available(iOS 10, *)) {
-        [[UIApplication sharedApplication] openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString] options:@{} completionHandler:nil];
-    } else {
-        [[UIApplication sharedApplication] openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString]];
-    }
+    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString] options:@{} completionHandler:nil];
 }
 
 - (void)displaySource:(NSURL *)localUrl {
@@ -865,6 +858,7 @@ typedef NS_ENUM(NSInteger, CHOOSETYPE) {
 // 6 页面加载失败时调用
 - (void)webView:(WKWebView *)webView didFailProvisionalNavigation:(WKNavigation *)navigation {
     NSLog(@"6-------页面加载失败时调用");
+    [self showErrorView];
 }
 
 // 接收到服务器跳转请求之后调用
@@ -955,12 +949,6 @@ typedef NS_ENUM(NSInteger, CHOOSETYPE) {
                 self.progressLayer.frame = CGRectMake(0, 0, 0, 3);
             });
         }
-    }else if ([keyPath isEqualToString:@"title"]) {
-        // 顶部title
-        self.headTitle = change[@"new"];
-        if (self.hiddenNavBar == NO) {
-            self.navView.topTitleLabel.text = self.headTitle;
-        }
     }
 }
 
@@ -1021,41 +1009,10 @@ typedef NS_ENUM(NSInteger, CHOOSETYPE) {
     return json;
 }
 
-- (void)setHiddenNavBar:(BOOL)hiddenNavBar {
-    _hiddenNavBar = hiddenNavBar;
-    if (hiddenNavBar) {
-        self.navView.topTitleLabel.text = @"";
-    }
-    else {
-        self.navView.topTitleLabel.text = self.headTitle;
-    }
-}
-
-#pragma mark --- lazying
-- (KSWebNavView *)navView {
-    if (!_navView) {
-        _navView = [[KSWebNavView alloc] init];
-        
-    }
-    return _navView;
-}
-
-- (KSWebBackButton *)webBackButton {
-    if (!_webBackButton) {
-        _webBackButton = [[KSWebBackButton alloc] init];
-        MJWeakSelf;
-        [_webBackButton webViewBackAction:^{
-            [weakSelf backAction];
-        }];
-    }
-    return _webBackButton;
-}
-
 - (void)dealloc {
     NSLog(@"webView dealloc -----");
     [[_myWebView configuration].userContentController removeScriptMessageHandlerForName:@"COLEXIU"];
     [_myWebView removeObserver:self forKeyPath:@"estimatedProgress"];
-    [_myWebView removeObserver:self forKeyPath:@"title"];
     [_myWebView loadHTMLString:@"" baseURL:nil];
     [_myWebView removeFromSuperview];
     _myWebView = nil;
@@ -1333,6 +1290,38 @@ typedef NS_ENUM(NSInteger, CHOOSETYPE) {
     }
     return filesize;
 }
+
+- (KSWebLoadRefreshView *)errorView {
+    if (!_errorView) {
+        _errorView = [KSWebLoadRefreshView shareInstance];
+        MJWeakSelf;
+        [_errorView failViewActionCallback:^(BOOL isBack) {
+            [weakSelf hideErrorView];
+            if (isBack) {
+                [weakSelf backAction];
+            }
+            else {
+                [weakSelf loadRequest];
+            }
+        }];
+    }
+    return _errorView;
+}
+
+- (void)showErrorView {
+    if (![self.view.subviews containsObject:self.errorView]) {
+        [self.view addSubview:self.errorView];
+        [self.errorView mas_makeConstraints:^(MASConstraintMaker *make) {
+            make.left.right.top.bottom.mas_equalTo(self.view);
+        }];
+        [self.view bringSubviewToFront:self.errorView];
+    }
+}
+- (void)hideErrorView {
+    if ([self.view.subviews containsObject:self.errorView]) {
+        [self.errorView removeFromSuperview];
+    }
+}
 /*
 #pragma mark - Navigation
 

+ 25 - 0
KulexiuForStudent/KulexiuForStudent/Common/Base/KSWebLoadRefreshView.h

@@ -0,0 +1,25 @@
+//
+//  KSWebLoadRefreshView.h
+//  GuanYueTeamManager
+//
+//  Created by 王智 on 2023/4/20.
+//
+
+#import <UIKit/UIKit.h>
+
+typedef void(^WebLoadFailCallback)(BOOL isBack);
+
+NS_ASSUME_NONNULL_BEGIN
+
+
+@interface KSWebLoadRefreshView : UIView
+
+@property (nonatomic, assign) BOOL hideBackButton;
+
++ (instancetype)shareInstance;
+
+- (void)failViewActionCallback:(WebLoadFailCallback)callback;
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 73 - 0
KulexiuForStudent/KulexiuForStudent/Common/Base/KSWebLoadRefreshView.m

@@ -0,0 +1,73 @@
+//
+//  KSWebLoadRefreshView.m
+//  GuanYueTeamManager
+//
+//  Created by 王智 on 2023/4/20.
+//
+
+#import "KSWebLoadRefreshView.h"
+
+@interface KSWebLoadRefreshView ()
+@property (weak, nonatomic) IBOutlet UIImageView *emptyImage;
+
+@property (weak, nonatomic) IBOutlet UIView *headView;
+
+@property (weak, nonatomic) IBOutlet NSLayoutConstraint *headHeight;
+
+@property (nonatomic, copy) WebLoadFailCallback callback;
+
+@property (weak, nonatomic) IBOutlet UIButton *refreshButton;
+
+@end
+
+@implementation KSWebLoadRefreshView
+
+- (void)awakeFromNib {
+    [super awakeFromNib];
+    self.headHeight.constant = kNaviBarHeight;
+    self.refreshButton.layer.borderColor = CLIENT_THEMECOLOR.CGColor;
+    self.refreshButton.backgroundColor = CLIENT_THEMECOLOR;
+    [self.emptyImage setImage:[UIImage imageNamed:CLIENT_NONETWORKING_IMG]];
+}
+
++ (instancetype)shareInstance {
+    KSWebLoadRefreshView *view = [[[NSBundle mainBundle] loadNibNamed:@"KSWebLoadRefreshView" owner:nil options:nil] firstObject];
+    return view;
+}
+
+- (void)failViewActionCallback:(WebLoadFailCallback)callback {
+    if (callback) {
+        self.callback = callback;
+    }
+}
+
+- (IBAction)backAction:(id)sender {
+    if (self.callback) {
+        self.callback(YES);
+    }
+}
+
+- (IBAction)refreshView:(id)sender {
+    if (self.callback) {
+        self.callback(NO);
+    }
+}
+
+- (void)setHideBackButton:(BOOL)hideBackButton {
+    _hideBackButton = hideBackButton;
+    if (hideBackButton) {
+        self.headView.hidden = YES;
+    }
+    else {
+        self.headView.hidden = NO;
+    }
+}
+/*
+// Only override drawRect: if you perform custom drawing.
+// An empty implementation adversely affects performance during animation.
+- (void)drawRect:(CGRect)rect {
+    // Drawing code
+}
+*/
+
+@end

+ 131 - 0
KulexiuForStudent/KulexiuForStudent/Common/Base/KSWebLoadRefreshView.xib

@@ -0,0 +1,131 @@
+<?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="KSWebLoadRefreshView">
+            <rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
+            <autoresizingMask key="autoresizingMask"/>
+            <subviews>
+                <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="OSR-hZ-Liz">
+                    <rect key="frame" x="0.0" y="0.0" width="393" height="88"/>
+                    <subviews>
+                        <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="BvM-d4-lej">
+                            <rect key="frame" x="0.0" y="44" width="393" height="44"/>
+                            <subviews>
+                                <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="back_black" translatesAutoresizingMaskIntoConstraints="NO" id="Vlj-I7-nf3">
+                                    <rect key="frame" x="13" y="12" width="12" height="20"/>
+                                </imageView>
+                                <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="2Lm-yn-oKc">
+                                    <rect key="frame" x="0.0" y="0.0" width="44" height="44"/>
+                                    <constraints>
+                                        <constraint firstAttribute="width" constant="44" id="h42-sf-rrj"/>
+                                    </constraints>
+                                    <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
+                                    <connections>
+                                        <action selector="backAction:" destination="iN0-l3-epB" eventType="touchUpInside" id="x8u-o6-v4Y"/>
+                                    </connections>
+                                </button>
+                                <label hidden="YES" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="oMj-Xs-baj">
+                                    <rect key="frame" x="196.66666666666666" y="22" width="0.0" height="0.0"/>
+                                    <fontDescription key="fontDescription" type="system" weight="medium" pointSize="18"/>
+                                    <color key="textColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="calibratedRGB"/>
+                                    <nil key="highlightedColor"/>
+                                </label>
+                            </subviews>
+                            <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                            <constraints>
+                                <constraint firstItem="oMj-Xs-baj" firstAttribute="centerY" secondItem="BvM-d4-lej" secondAttribute="centerY" id="6dH-BZ-T37"/>
+                                <constraint firstAttribute="bottom" secondItem="2Lm-yn-oKc" secondAttribute="bottom" id="CTV-aj-dsP"/>
+                                <constraint firstItem="2Lm-yn-oKc" firstAttribute="top" secondItem="BvM-d4-lej" secondAttribute="top" id="GfQ-OO-SI0"/>
+                                <constraint firstItem="2Lm-yn-oKc" firstAttribute="leading" secondItem="BvM-d4-lej" secondAttribute="leading" id="Hsb-N0-G78"/>
+                                <constraint firstItem="oMj-Xs-baj" firstAttribute="centerX" secondItem="BvM-d4-lej" secondAttribute="centerX" id="mWx-b4-F5e"/>
+                                <constraint firstItem="Vlj-I7-nf3" firstAttribute="centerY" secondItem="BvM-d4-lej" secondAttribute="centerY" id="nSO-uv-mps"/>
+                                <constraint firstItem="Vlj-I7-nf3" firstAttribute="leading" secondItem="BvM-d4-lej" secondAttribute="leading" constant="13" id="u9X-nm-DIn"/>
+                                <constraint firstAttribute="height" constant="44" id="zlR-5P-crP"/>
+                            </constraints>
+                        </view>
+                    </subviews>
+                    <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                    <constraints>
+                        <constraint firstAttribute="trailing" secondItem="BvM-d4-lej" secondAttribute="trailing" id="9D8-Q6-nCV"/>
+                        <constraint firstItem="BvM-d4-lej" firstAttribute="leading" secondItem="OSR-hZ-Liz" secondAttribute="leading" id="Laz-Y9-rLX"/>
+                        <constraint firstAttribute="bottom" secondItem="BvM-d4-lej" secondAttribute="bottom" id="lsM-TO-THM"/>
+                        <constraint firstAttribute="height" constant="88" id="maT-MN-XB2"/>
+                    </constraints>
+                </view>
+                <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="no_networking" translatesAutoresizingMaskIntoConstraints="NO" id="MwE-bt-1NJ">
+                    <rect key="frame" x="66.666666666666686" y="110" width="260" height="230"/>
+                </imageView>
+                <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="hbq-IV-sqV">
+                    <rect key="frame" x="146.66666666666666" y="405" width="100" height="36"/>
+                    <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                    <constraints>
+                        <constraint firstAttribute="height" constant="36" id="Iwp-ts-m13"/>
+                        <constraint firstAttribute="width" constant="100" id="L8i-QD-eeX"/>
+                    </constraints>
+                    <fontDescription key="fontDescription" type="system" pointSize="16"/>
+                    <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
+                    <state key="normal" title="刷新一下">
+                        <color key="titleColor" red="0.1764705882352941" green="0.7803921568627451" blue="0.66666666666666663" alpha="1" colorSpace="calibratedRGB"/>
+                    </state>
+                    <userDefinedRuntimeAttributes>
+                        <userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
+                            <real key="value" value="18"/>
+                        </userDefinedRuntimeAttribute>
+                        <userDefinedRuntimeAttribute type="number" keyPath="borderWidth">
+                            <real key="value" value="1"/>
+                        </userDefinedRuntimeAttribute>
+                        <userDefinedRuntimeAttribute type="color" keyPath="borderColor">
+                            <color key="value" red="0.1764705882352941" green="0.7803921568627451" blue="0.66666666666666663" alpha="1" colorSpace="calibratedRGB"/>
+                        </userDefinedRuntimeAttribute>
+                    </userDefinedRuntimeAttributes>
+                    <connections>
+                        <action selector="refreshView:" destination="iN0-l3-epB" eventType="touchUpInside" id="5ge-EF-AvS"/>
+                    </connections>
+                </button>
+                <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="网络开小差,再刷新看看" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Nlm-k3-ipo">
+                    <rect key="frame" x="106.66666666666669" y="361" width="180" height="22"/>
+                    <constraints>
+                        <constraint firstAttribute="height" constant="22" id="4Ui-T9-ge2"/>
+                    </constraints>
+                    <fontDescription key="fontDescription" type="system" pointSize="16"/>
+                    <color key="textColor" red="0.59999999999999998" green="0.59999999999999998" blue="0.59999999999999998" alpha="1" colorSpace="calibratedRGB"/>
+                    <nil key="highlightedColor"/>
+                </label>
+            </subviews>
+            <color key="backgroundColor" red="0.97254901960784312" green="0.97254901960784312" blue="0.97254901960784312" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+            <constraints>
+                <constraint firstItem="OSR-hZ-Liz" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" id="07x-EN-DkY"/>
+                <constraint firstItem="Nlm-k3-ipo" firstAttribute="centerX" secondItem="iN0-l3-epB" secondAttribute="centerX" id="D66-0o-b6d"/>
+                <constraint firstAttribute="trailing" secondItem="OSR-hZ-Liz" secondAttribute="trailing" id="NFk-om-8aq"/>
+                <constraint firstItem="hbq-IV-sqV" firstAttribute="top" secondItem="Nlm-k3-ipo" secondAttribute="bottom" constant="22" id="f79-6b-Lmd"/>
+                <constraint firstItem="MwE-bt-1NJ" firstAttribute="top" secondItem="OSR-hZ-Liz" secondAttribute="bottom" constant="22" id="gXT-i9-Jdn"/>
+                <constraint firstItem="MwE-bt-1NJ" firstAttribute="centerX" secondItem="iN0-l3-epB" secondAttribute="centerX" id="hAC-pb-S9s"/>
+                <constraint firstItem="Nlm-k3-ipo" firstAttribute="top" secondItem="MwE-bt-1NJ" secondAttribute="bottom" constant="21" id="r0L-CI-jCe"/>
+                <constraint firstItem="hbq-IV-sqV" firstAttribute="centerX" secondItem="iN0-l3-epB" secondAttribute="centerX" id="w6P-Go-JVZ"/>
+                <constraint firstItem="OSR-hZ-Liz" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" id="y4K-tF-9kB"/>
+            </constraints>
+            <nil key="simulatedTopBarMetrics"/>
+            <nil key="simulatedBottomBarMetrics"/>
+            <freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
+            <connections>
+                <outlet property="emptyImage" destination="MwE-bt-1NJ" id="Vpf-cF-edg"/>
+                <outlet property="headHeight" destination="maT-MN-XB2" id="Em4-5f-BCc"/>
+                <outlet property="headView" destination="OSR-hZ-Liz" id="tG6-Qc-ubI"/>
+                <outlet property="refreshButton" destination="hbq-IV-sqV" id="IKF-N8-joE"/>
+            </connections>
+            <point key="canvasLocation" x="79" y="-12"/>
+        </view>
+    </objects>
+    <resources>
+        <image name="back_black" width="12" height="20"/>
+        <image name="no_networking" width="260" height="230"/>
+    </resources>
+</document>

+ 19 - 0
KulexiuForStudent/KulexiuForStudent/Common/Base/UIViewController+KSExtension.h

@@ -0,0 +1,19 @@
+//
+//  UIViewController+KSExtension.h
+//  GuanYueTeamManager
+//
+//  Created by 王智 on 2023/3/1.
+//
+
+#import <UIKit/UIKit.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface UIViewController (KSExtension)
+
+// 是否横屏
+@property (nonatomic, assign) BOOL ks_landScape;
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 24 - 0
KulexiuForStudent/KulexiuForStudent/Common/Base/UIViewController+KSExtension.m

@@ -0,0 +1,24 @@
+//
+//  UIViewController+KSExtension.m
+//  GuanYueTeamManager
+//
+//  Created by 王智 on 2023/3/1.
+//
+
+#import "UIViewController+KSExtension.h"
+#import <objc/runtime.h>
+
+static const char kLandScapeKey;
+
+@implementation UIViewController (KSExtension)
+
+- (BOOL)ks_landScape {
+    BOOL landScape = objc_getAssociatedObject(self, &kLandScapeKey);
+    return landScape;
+}
+
+- (void)setKs_landScape:(BOOL)ks_landScape {
+    objc_setAssociatedObject(self, &kLandScapeKey, @(ks_landScape), OBJC_ASSOCIATION_ASSIGN);
+}
+
+@end

+ 3 - 0
KulexiuForStudent/KulexiuForStudent/Common/Define/Common.h

@@ -39,6 +39,9 @@
 #define CLIENT_CHOOSE_IMG ([UserDefaultObjectForKey(TENANT_ID) integerValue] <= 0 ? @"choose_instrument" : @"tenant_choose_instrument")
 
 #define CLIENT_SWITCH_ON ([UserDefaultObjectForKey(TENANT_ID) integerValue] <= 0 ? @"switch_on" : @"tenant_switch_on")
+
+
+
 #define ALcellWidth   (37)
 
 

+ 3 - 0
KulexiuForStudent/KulexiuForStudent/Common/Define/KSDomain.h

@@ -22,6 +22,9 @@
 #define SEALCLASSHOST (@"https://dev.colexiu.com/api-classroom")
 #define WEBHOST (@"https://dev.colexiu.com/student")
 #define TENANT_WEBHOST (@"https://dev.colexiu.com/tenant")
+//#define WEBHOST (@"http://192.168.3.220:5000")
+//#define TENANT_WEBHOST (@"http://192.168.3.220:5000/tenant.html")
+
 #define SOCKET_URL (@"wss://dev.colexiu.com/audioAnalysis")
 #define JSPUSH_ENVIRONMENT (NO)
 #define RCIM_KEY (@"0vnjpoad0jbdz")

+ 2 - 0
KulexiuForStudent/KulexiuForStudent/Common/Define/PrefixHeader.pch

@@ -37,6 +37,8 @@
 #import "KSLoginManager.h"
 #import "KSHudLoagingManager.h"
 
+#import "UIViewController+KSExtension.h"
+
 #define FIRST_LOGIN_KEY (@"FirstLoginKey")
 
 #define DEALCALLBACKNOTICIFATION (@"DEALCALLBACKNOTICIFATION")

+ 5 - 2
KulexiuForStudent/KulexiuForStudent/InstitutionModule/Home/Controller/TenantDarkViewController.m

@@ -317,8 +317,11 @@
 - (void)pagerView:(TYCyclePagerView *)pageView didSelectedItemCell:(__kindof UICollectionViewCell *)cell atIndex:(NSInteger)index {
     BOOL isLock = self.mineInfo.tenantAlbumStatus == 1 ? YES : NO;
     if (isLock) {
+        TenantAlbumModel *model = self.sourceArray[index];
+        NSString *subjectType = model.subjectType;
+        
         KSBaseWKWebViewController *ctrl = [[KSBaseWKWebViewController alloc] init];
-        ctrl.url = [NSString stringWithFormat:@"%@%@",TENANT_WEBHOST,@"/#/train-tool"];
+        ctrl.url = [NSString stringWithFormat:@"%@%@?subjectType=%@",TENANT_WEBHOST,@"/#/train-tool",subjectType];
         [self.navigationController pushViewController:ctrl animated:YES];
     }
     else { // 跳转到对应页面
@@ -401,7 +404,7 @@
 
 - (void)showSearchView {
     KSBaseWKWebViewController *webCtrl = [[KSBaseWKWebViewController alloc] init];
-    webCtrl.url = [NSString stringWithFormat:@"%@/#/music-songbook/search", TENANT_WEBHOST];
+    webCtrl.url = [NSString stringWithFormat:@"%@/#/music-songbook/searchAlbum", TENANT_WEBHOST];
     [self.navigationController pushViewController:webCtrl animated:YES];
 }
 

+ 12 - 1
KulexiuForStudent/KulexiuForStudent/InstitutionModule/Mine/Controller/INSSettingViewController.m

@@ -158,8 +158,19 @@
 }
 
 - (void)chooseBirthDay {
+    NSDate *data = [NSDate date];
+    
+    if (![NSString isEmptyString:self.mineInfo.birthdate]) {
+        NSString *birthday = self.mineInfo.birthdate;
+        NSDateFormatter *formatter = [NSObject getDateformatter];
+        [formatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"];
+        NSDate *birthdate = [formatter dateFromString:birthday];
+        if (birthdate) {
+            data = birthdate;
+        }
+    }
     MJWeakSelf;
-    KSFullDatePicker *datePicker = [[KSFullDatePicker alloc] initWithTitle:@"" date:[NSDate date] pickMode:KSDATEPICKER_MODE_DAY selectDateBlock:^(NSString *date) {
+    KSFullDatePicker *datePicker = [[KSFullDatePicker alloc] initWithTitle:@"" date:data pickMode:KSDATEPICKER_MODE_DAY selectDateBlock:^(NSString *date) {
         [weakSelf.bodyView.birthdayLabel setText:date];
         weakSelf.birthday = date;
         [weakSelf modifyUserMessage:nil gender:self.userSex birthday:date];

+ 0 - 1
KulexiuForStudent/KulexiuForStudent/Module/Chat/Controller/TXCustom/KSTXBaseChatViewController.m

@@ -124,7 +124,6 @@ static UIView *gCustomTopView;
 - (void)showMusic:(NSString *)songId {
     KSAccompanyWebViewController *detailCtrl = [[KSAccompanyWebViewController alloc] init];
     detailCtrl.url = [NSString stringWithFormat:@"%@/accompany?id=%@",hostURL, songId];
-    detailCtrl.hiddenNavBar = YES;
     detailCtrl.parmDic = @{@"isOpenLight" : @(YES), @"orientation" : @(0),@"isHideTitle" : @(YES)};
     [self.navigationController pushViewController:detailCtrl animated:YES];
 }

+ 0 - 1
KulexiuForStudent/KulexiuForStudent/Module/CloudEngine/Controller/KSCloudViewController.m

@@ -822,7 +822,6 @@ typedef NS_ENUM(NSInteger,COLOR_DISPLAYTYPE) {
 
     KSBaseWKWebViewController *reportCtrl = [[KSBaseWKWebViewController alloc] init];
     reportCtrl.url = [NSString stringWithFormat:@"%@/accompany/#/report/%zd",WEBHOST,self.recordId];
-    reportCtrl.hiddenNavBar = YES;
     self.keepOrientation = YES;
     reportCtrl.keepOrientation = YES;
     [self.navigationController pushViewController:reportCtrl animated:YES];

+ 0 - 1
KulexiuForStudent/KulexiuForStudent/Module/Mall/Controller/ShopMallViewController.m

@@ -24,7 +24,6 @@
 - (void)viewDidLoad {
     [super viewDidLoad];
     // Do any additional setup after loading the view.
-    self.webBackButton.hidden = YES;
 }
 
 /*

+ 11 - 0
KulexiuForStudent/KulexiuForStudent/Module/Mine/Setting/Controller/UserSettingViewController.m

@@ -225,6 +225,17 @@
 }
 
 - (void)chooseBirthDay {
+    NSDate *data = [NSDate date];
+    
+    if (![NSString isEmptyString:self.mineInfo.birthdate]) {
+        NSString *birthday = self.mineInfo.birthdate;
+        NSDateFormatter *formatter = [NSObject getDateformatter];
+        [formatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"];
+        NSDate *birthdate = [formatter dateFromString:birthday];
+        if (birthdate) {
+            data = birthdate;
+        }
+    }
     MJWeakSelf;
     KSFullDatePicker *datePicker = [[KSFullDatePicker alloc] initWithTitle:@"" date:[NSDate date] pickMode:KSDATEPICKER_MODE_DAY selectDateBlock:^(NSString *date) {
         [weakSelf.bodyView.birthdayLabel setText:date];