Steven 2 лет назад
Родитель
Сommit
f557fa2233
15 измененных файлов с 120 добавлено и 50 удалено
  1. 4 4
      KulexiuForStudent/KulexiuForStudent.xcodeproj/project.pbxproj
  2. BIN
      KulexiuForStudent/KulexiuForStudent.xcworkspace/xcuserdata/wangzhi.xcuserdatad/UserInterfaceState.xcuserstate
  3. 16 0
      KulexiuForStudent/KulexiuForStudent.xcworkspace/xcuserdata/wangzhi.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
  4. 2 2
      KulexiuForStudent/KulexiuForStudent/Common/Base/KSBaseWKWebViewController.m
  5. 2 2
      KulexiuForStudent/KulexiuForStudent/Common/Base/KSNetworkingManager.h
  6. 1 1
      KulexiuForStudent/KulexiuForStudent/Common/Base/KSNetworkingManager.m
  7. 14 14
      KulexiuForStudent/KulexiuForStudent/Common/Define/PrefixHeader.pch
  8. 5 4
      KulexiuForStudent/KulexiuForStudent/Common/Tools/Category/UIDevice+TFDevice.h
  9. 34 5
      KulexiuForStudent/KulexiuForStudent/Common/Tools/Category/UIDevice+TFDevice.m
  10. 27 10
      KulexiuForStudent/KulexiuForStudent/Module/Classroom/Controller/NewClassRoomViewController.m
  11. 3 0
      KulexiuForStudent/KulexiuForStudent/Module/Classroom/Model/OnlineClassManager.m
  12. 2 2
      KulexiuForStudent/KulexiuForStudent/Module/CloudEngine/Controller/KSCloudViewController.m
  13. 6 4
      KulexiuForStudent/KulexiuForStudent/Module/Live/Controller/LiveVideoRoomViewController.m
  14. 3 1
      KulexiuForStudent/KulexiuForStudent/Module/Live/View/SeatContentView.m
  15. 1 1
      KulexiuForStudent/KulexiuForStudent/Module/Mine/AddressList/Controller/AddressListViewController.m

+ 4 - 4
KulexiuForStudent/KulexiuForStudent.xcodeproj/project.pbxproj

@@ -7336,7 +7336,7 @@
 				ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
 				CODE_SIGN_ENTITLEMENTS = KulexiuForStudent/KulexiuForStudent.entitlements;
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 1.3.6;
+				CURRENT_PROJECT_VERSION = 1.3.7;
 				DEVELOPMENT_TEAM = B2AP53HHTU;
 				ENABLE_BITCODE = NO;
 				FRAMEWORK_SEARCH_PATHS = (
@@ -7392,7 +7392,7 @@
 					"$(PROJECT_DIR)/KulexiuForStudent/Common/ThirdPart/UMSocialSDK/share/share_ios_6.10.5/SocialLibraries/Sina/SinaSDK",
 					"$(PROJECT_DIR)/KulexiuForStudent/Common/ThirdPart/UMSocialSDK/share/share_ios_6.10.5/UMSocialSDKPlugin",
 				);
-				MARKETING_VERSION = 1.3.6;
+				MARKETING_VERSION = 1.3.7;
 				PRODUCT_BUNDLE_IDENTIFIER = com.Colexiu.KulexiuForStudent;
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				SWIFT_EMIT_LOC_STRINGS = YES;
@@ -7408,7 +7408,7 @@
 				ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
 				CODE_SIGN_ENTITLEMENTS = KulexiuForStudent/KulexiuForStudent.entitlements;
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 1.3.6;
+				CURRENT_PROJECT_VERSION = 1.3.7;
 				DEVELOPMENT_TEAM = B2AP53HHTU;
 				ENABLE_BITCODE = NO;
 				FRAMEWORK_SEARCH_PATHS = (
@@ -7464,7 +7464,7 @@
 					"$(PROJECT_DIR)/KulexiuForStudent/Common/ThirdPart/UMSocialSDK/share/share_ios_6.10.5/SocialLibraries/Sina/SinaSDK",
 					"$(PROJECT_DIR)/KulexiuForStudent/Common/ThirdPart/UMSocialSDK/share/share_ios_6.10.5/UMSocialSDKPlugin",
 				);
-				MARKETING_VERSION = 1.3.6;
+				MARKETING_VERSION = 1.3.7;
 				PRODUCT_BUNDLE_IDENTIFIER = com.Colexiu.KulexiuForStudent;
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				SWIFT_EMIT_LOC_STRINGS = YES;

BIN
KulexiuForStudent/KulexiuForStudent.xcworkspace/xcuserdata/wangzhi.xcuserdatad/UserInterfaceState.xcuserstate


+ 16 - 0
KulexiuForStudent/KulexiuForStudent.xcworkspace/xcuserdata/wangzhi.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

@@ -16,5 +16,21 @@
             stopOnStyle = "1">
          </BreakpointContent>
       </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            uuid = "E855A530-0110-4534-B8B8-81C1B0CBB0FF"
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "KulexiuForStudent/Module/Live/Controller/LiveVideoRoomViewController.m"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "786"
+            endingLineNumber = "786"
+            landmarkName = "-updateVideoViewContainer"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
    </Breakpoints>
 </Bucket>

+ 2 - 2
KulexiuForStudent/KulexiuForStudent/Common/Base/KSBaseWKWebViewController.m

@@ -132,12 +132,12 @@ typedef NS_ENUM(NSInteger, CHOOSETYPE) {
         // 切换到横屏
         AppDelegate* delegate = (AppDelegate*)[UIApplication sharedApplication].delegate;
         delegate.allowAutoRotate = YES;
-        [UIDevice switchNewOrientation:UIInterfaceOrientationLandscapeRight];
+        [UIDevice switchNewOrientation:UIInterfaceOrientationLandscapeRight inController:self];
     }
     else {
         AppDelegate* delegate = (AppDelegate*)[UIApplication sharedApplication].delegate;
         delegate.allowAutoRotate = NO;
-        [UIDevice switchNewOrientation:UIInterfaceOrientationPortrait];
+        [UIDevice switchNewOrientation:UIInterfaceOrientationPortrait inController:self];
     }
 }
 

+ 2 - 2
KulexiuForStudent/KulexiuForStudent/Common/Base/KSNetworkingManager.h

@@ -671,7 +671,7 @@ NS_ASSUME_NONNULL_BEGIN
 
 // /api-mall-portal/member/address/add
 
-/// 添加收地址
+/// 添加收地址
 /// @param post post
 /// @param name 收货人名称
 /// @param phoneNumber 电话号码
@@ -697,7 +697,7 @@ NS_ASSUME_NONNULL_BEGIN
 // 修改收货地址
 // /api-mall-portal/member/address/update/{id}
 
-/// 修改收地址
+/// 修改收地址
 /// @param post post
 /// @param addressId 地址id
 /// @param name 收货人名称

+ 1 - 1
KulexiuForStudent/KulexiuForStudent/Common/Base/KSNetworkingManager.m

@@ -1420,7 +1420,7 @@
 // 修改收货地址
 // /mall-portal-server/member/address/update/{id}
 
-/// 修改收地址
+/// 修改收地址
 /// @param post post
 /// @param addressId 地址id
 /// @param name 收货人名称

+ 14 - 14
KulexiuForStudent/KulexiuForStudent/Common/Define/PrefixHeader.pch

@@ -117,24 +117,24 @@ shouldPrevent = NO; \
 
 //#ifdef DEBUG
 
-#define hostURL (@"https://dev.colexiu.com")
-#define SEALCLASSHOST (@"https://dev.colexiu.com/api-classroom")
-#define WEBHOST (@"https://dev.colexiu.com/student")
-#define SOCKET_URL (@"wss://dev.colexiu.com/audioAnalysis")
-#define JSPUSH_ENVIRONMENT (NO)
-#define RCIM_KEY (@"0vnjpoad0jbdz")
-#define SUBMIT_UUID (YES)
+//#define hostURL (@"https://dev.colexiu.com")
+//#define SEALCLASSHOST (@"https://dev.colexiu.com/api-classroom")
+//#define WEBHOST (@"https://dev.colexiu.com/student")
+//#define SOCKET_URL (@"wss://dev.colexiu.com/audioAnalysis")
+//#define JSPUSH_ENVIRONMENT (NO)
+//#define RCIM_KEY (@"0vnjpoad0jbdz")
+//#define SUBMIT_UUID (YES)
 
 
 //#else
 
-//#define hostURL (@"https://online.colexiu.com")
-//#define SEALCLASSHOST (@"https://online.colexiu.com/api-classroom")
-//#define WEBHOST (@"https://online.colexiu.com/student")
-//#define SOCKET_URL (@"wss://online.colexiu.com/audioAnalysis")
-//#define JSPUSH_ENVIRONMENT (YES)
-//#define RCIM_KEY (@"e5t4ouvpe42pa")
-//#define SUBMIT_UUID (YES)
+#define hostURL (@"https://online.colexiu.com")
+#define SEALCLASSHOST (@"https://online.colexiu.com/api-classroom")
+#define WEBHOST (@"https://online.colexiu.com/student")
+#define SOCKET_URL (@"wss://online.colexiu.com/audioAnalysis")
+#define JSPUSH_ENVIRONMENT (YES)
+#define RCIM_KEY (@"e5t4ouvpe42pa")
+#define SUBMIT_UUID (YES)
 
 //#endif
 

+ 5 - 4
KulexiuForStudent/KulexiuForStudent/Common/Tools/Category/UIDevice+TFDevice.h

@@ -11,10 +11,11 @@ NS_ASSUME_NONNULL_BEGIN
 
 @interface UIDevice (TFDevice)
 
-/**
- * @interfaceOrientation 输入要强制转屏的方向
- */
-+ (void)switchNewOrientation:(UIInterfaceOrientation)interfaceOrientation;
+/// 旋转屏幕
+/// - Parameters:
+///   - interfaceOrientation: 输入要强制转屏的方向
+///   - controller: 当前旋转的控制器
++ (void)switchNewOrientation:(UIInterfaceOrientation)interfaceOrientation inController:(UIViewController *)controller;
 
 @end
 

+ 34 - 5
KulexiuForStudent/KulexiuForStudent/Common/Tools/Category/UIDevice+TFDevice.m

@@ -10,12 +10,41 @@
 
 @implementation UIDevice (TFDevice)
 
-+ (void)switchNewOrientation:(UIInterfaceOrientation)interfaceOrientation {
+/// 旋转屏幕
+/// - Parameters:
+///   - interfaceOrientation: 输入要强制转屏的方向
+///   - controller: 当前旋转的控制器
++ (void)switchNewOrientation:(UIInterfaceOrientation)interfaceOrientation inController:(UIViewController *)controller {
     
-    NSNumber *resetOrientationTarget = [NSNumber numberWithInt:UIInterfaceOrientationUnknown];
-    [[UIDevice currentDevice] setValue:resetOrientationTarget forKey:@"orientation"];
-    NSNumber *orientationTarget = [NSNumber numberWithInteger:interfaceOrientation];
-    [[UIDevice currentDevice] setValue:orientationTarget forKey:@"orientation"];
+    if (@available(iOS 16.0, *)) {
+        if ([controller respondsToSelector: @selector(setNeedsUpdateOfSupportedInterfaceOrientations)]) {
+            [controller performSelector: @selector(setNeedsUpdateOfSupportedInterfaceOrientations)];
+        }
+        UIInterfaceOrientationMask interfaceOrientations;
+        if (interfaceOrientation == UIInterfaceOrientationPortrait) {
+            interfaceOrientations = UIInterfaceOrientationMaskPortrait;
+        }
+        else {
+            interfaceOrientations = UIInterfaceOrientationMaskLandscapeRight;
+        }
+        NSArray *array = [[[UIApplication sharedApplication] connectedScenes] allObjects];
+        UIWindowScene *scene = (UIWindowScene *)array[0];
+        UIWindowSceneGeometryPreferencesIOS *geometryPreferences = [[UIWindowSceneGeometryPreferencesIOS alloc] initWithInterfaceOrientations:interfaceOrientations];
+        [scene requestGeometryUpdateWithPreferences:geometryPreferences
+                                       errorHandler:^(NSError * _Nonnull error) {
+            
+            NSLog(@"wuwuFQ:%@", error);
+        }];
+    } else {
+        // Fallback on earlier versions
+        NSNumber *resetOrientationTarget = [NSNumber numberWithInt:UIInterfaceOrientationUnknown];
+        [[UIDevice currentDevice] setValue:resetOrientationTarget forKey:@"orientation"];
+        
+        NSNumber *orientationTarget = [NSNumber numberWithInteger:interfaceOrientation];
+        [[UIDevice currentDevice] setValue:orientationTarget forKey:@"orientation"];
+        
+        
+    }
 }
 
 @end

+ 27 - 10
KulexiuForStudent/KulexiuForStudent/Module/Classroom/Controller/NewClassRoomViewController.m

@@ -101,15 +101,31 @@ typedef NS_ENUM(NSInteger, ACCOMPANYACTION) {
 
 @implementation NewClassRoomViewController
 
+- (void)changeOrientation:(BOOL)isLandScape {
+    if (isLandScape) {
+        // 切换到横屏
+        AppDelegate* delegate = (AppDelegate*)[UIApplication sharedApplication].delegate;
+        delegate.allowAutoRotate = YES;
+        dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
+            [UIDevice switchNewOrientation:UIInterfaceOrientationLandscapeRight inController:self];
+        });
+    }
+    else {
+        // 切换到横屏
+        AppDelegate* delegate = (AppDelegate*)[UIApplication sharedApplication].delegate;
+        delegate.allowAutoRotate = NO;
+        dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
+            [UIDevice switchNewOrientation:UIInterfaceOrientationPortrait inController:self];
+        });
+    }
+}
 #pragma mark - Life cycle
 
 - (void)viewWillAppear:(BOOL)animated {
     [super viewWillAppear:animated];
     self.zh_statusBarHidden = YES;
     // 切换到横屏
-    AppDelegate* delegate = (AppDelegate*)[UIApplication sharedApplication].delegate;
-    delegate.allowAutoRotate = YES;
-    [UIDevice switchNewOrientation:UIInterfaceOrientationLandscapeRight];
+    [self changeOrientation:YES];
     [[UIApplication sharedApplication] setIdleTimerDisabled:YES];
     [RCRTCEngine sharedInstance].statusReportDelegate = self;
 }
@@ -121,9 +137,7 @@ typedef NS_ENUM(NSInteger, ACCOMPANYACTION) {
         [self removeAll];
     }
     // 竖屏
-    AppDelegate* delegate = (AppDelegate*)[UIApplication sharedApplication].delegate;
-    delegate.allowAutoRotate = NO;
-    [UIDevice switchNewOrientation:UIInterfaceOrientationPortrait];
+    [self changeOrientation:NO];
     [[UIApplication sharedApplication] setIdleTimerDisabled:NO];
     self.zh_statusBarHidden = NO;
     [self hideAlertView];
@@ -164,9 +178,7 @@ typedef NS_ENUM(NSInteger, ACCOMPANYACTION) {
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(quitRoomAction) name:@"classroomQuit" object:nil];
     
     // 切换到横屏
-    AppDelegate* delegate = (AppDelegate*)[UIApplication sharedApplication].delegate;
-    delegate.allowAutoRotate = YES;
-    [UIDevice switchNewOrientation:UIInterfaceOrientationLandscapeRight];
+    [self changeOrientation:YES];
     [self addSubviews];
     [self bindDelegates];
     [self publishStream];
@@ -436,7 +448,12 @@ typedef NS_ENUM(NSInteger, ACCOMPANYACTION) {
         
     } error:^(RCRTCCode code) {
         [self.hud hideAnimated:YES];
-        [self.tipsView showTipsMessage:@"切换线路失败!" inView:self.view];
+        if (code == RCRTCCodeAudioDeviceStartError) {
+            [self.tipsView showTipsMessage:@"音频设备启动失败,请重启设备后重试!" inView:self.view];
+        }
+        else {
+            [self.tipsView showTipsMessage:@"切换线路失败!" inView:self.view];
+        }
     }];
 }
 

+ 3 - 0
KulexiuForStudent/KulexiuForStudent/Module/Classroom/Model/OnlineClassManager.m

@@ -72,6 +72,9 @@
     [self.baseCtrl removehub];
     [self notiferIsSuccess:NO];
     NSString *tipsMessage = [NSString stringWithFormat:@"加入房间失败RTC:%@",code];
+    if (code.integerValue == RCRTCCodeAudioDeviceStartError) {
+        tipsMessage = @"音频设备启动失败,请重启设备后重试!";
+    }
     [KSNormalAlertView ks_showAlertWithTitle:tipsMessage confirmTitle:@"确定" confirm:^{
         
     }];

+ 2 - 2
KulexiuForStudent/KulexiuForStudent/Module/CloudEngine/Controller/KSCloudViewController.m

@@ -274,12 +274,12 @@ typedef NS_ENUM(NSInteger,COLOR_DISPLAYTYPE) {
         // 切换到横屏
         AppDelegate* delegate = (AppDelegate*)[UIApplication sharedApplication].delegate;
         delegate.allowAutoRotate = YES;
-        [UIDevice switchNewOrientation:UIInterfaceOrientationLandscapeRight];
+        [UIDevice switchNewOrientation:UIInterfaceOrientationLandscapeRight inController:self];
     }
     else {
         AppDelegate* delegate = (AppDelegate*)[UIApplication sharedApplication].delegate;
         delegate.allowAutoRotate = NO;
-        [UIDevice switchNewOrientation:UIInterfaceOrientationPortrait];
+        [UIDevice switchNewOrientation:UIInterfaceOrientationPortrait inController:self];
     }
 }
 

+ 6 - 4
KulexiuForStudent/KulexiuForStudent/Module/Live/Controller/LiveVideoRoomViewController.m

@@ -610,7 +610,7 @@ static int clickPraiseBtnTimes  = 0;
                 
                 strongSelf.micStatus = MICSTATUS_CONNECTING;
                 // 刷新麦位状态
-                [strongSelf renderSeatView];
+//                [strongSelf renderSeatView];
             });
             
         } onFailed:^(RCRTCCode code) {
@@ -669,7 +669,7 @@ static int clickPraiseBtnTimes  = 0;
                 
                 strongSelf.micStatus = MICSTATUS_NOMAL;
                 // 刷新麦位状态
-                [strongSelf renderSeatView];
+//                [strongSelf renderSeatView];
                 // 发送下麦消息
                 [weakSelf sendDownSeatMessage];
             });
@@ -935,7 +935,9 @@ static int clickPraiseBtnTimes  = 0;
 }
 // 远端用户切换身份(主播接收)
 - (void)didSwitchRoleWithUser:(RCRTCRemoteUser *)user roleType:(RCRTCLiveRoleType)roleType {
-    [self renderSeatView];
+    if (roleType == RCRTCLiveRoleTypeAudience) {
+        [self renderSeatView];
+    }
     
     NSLog(@"didSwitchRoleWithUser --------");
 }
@@ -967,7 +969,7 @@ static int clickPraiseBtnTimes  = 0;
         // 刷新顶部视图
     }
     else {
-        [self renderSeatView];
+//        [self renderSeatView];
     }
     NSLog(@"didJoinUser --------");
 }

+ 3 - 1
KulexiuForStudent/KulexiuForStudent/Module/Live/View/SeatContentView.m

@@ -39,10 +39,12 @@
     
     if ([self.userId isEqualToString:UserDefault(UIDKey)]) { // 自己
         [self.userAvatar sd_setImageWithURL:[NSURL URLWithString:[UserDefault(AvatarUrlKey) getUrlEndcodeString]] placeholderImage:[UIImage imageNamed:USERDEFAULT_LOGO]];
+        self.userAvatar.layer.borderColor = HexRGB(0xf37f17).CGColor;
+        self.userAvatar.layer.borderWidth = 1.0f;
         [self addSubview:self.userAvatar];
         [self.userAvatar mas_makeConstraints:^(MASConstraintMaker *make) {
             make.centerX.mas_equalTo(self.mas_centerX);
-            make.top.mas_equalTo(self.mas_top);
+            make.top.mas_equalTo(self.mas_top).offset(4);
             make.width.height.mas_equalTo(46);
         }];
         UIView *bgView = [[UIView alloc] initWithFrame:CGRectZero];

+ 1 - 1
KulexiuForStudent/KulexiuForStudent/Module/Mine/AddressList/Controller/AddressListViewController.m

@@ -153,7 +153,7 @@
 - (void)deleteAddressConfirm:(NSString *)addressId {
     KSImageAlert *alertView = [KSImageAlert shareInstance];
     MJWeakSelf;
-    alertView.titleLabel.text = @"确认删除收地址吗";
+    alertView.titleLabel.text = @"确认删除收地址吗";
     [alertView.cancleButton setTitle:@"取消" forState:UIControlStateNormal];
     [alertView.sureButton setTitle:@"确定" forState:UIControlStateNormal];
     [alertView sureCallback:^(BOOL isSure) {