Sfoglia il codice sorgente

网络教室流程

Steven 1 anno fa
parent
commit
7da924e5dc
36 ha cambiato i file con 431 aggiunte e 250 eliminazioni
  1. 4 2
      KulexiuForTeacher/KulexiuForTeacher.xcodeproj/project.pbxproj
  2. 2 1
      KulexiuForTeacher/KulexiuForTeacher/AppDelegate.m
  3. 2 1
      KulexiuForTeacher/KulexiuForTeacher/Common/Base/LoginManger/TXIMLinsenter.m
  4. 2 2
      KulexiuForTeacher/KulexiuForTeacher/Common/Define/KSDomain.h
  5. 2 0
      KulexiuForTeacher/KulexiuForTeacher/Info.plist
  6. 1 0
      KulexiuForTeacher/KulexiuForTeacher/Module/Chat/Group/View/GroupApplyChooseCell.m
  7. 4 3
      KulexiuForTeacher/KulexiuForTeacher/Module/Chat/Group/View/GroupApplyChooseCell.xib
  8. 1 0
      KulexiuForTeacher/KulexiuForTeacher/Module/Chat/Group/View/GroupApplyMemberCell.m
  9. 4 3
      KulexiuForTeacher/KulexiuForTeacher/Module/Chat/Group/View/GroupApplyMemberCell.xib
  10. 1 8
      KulexiuForTeacher/KulexiuForTeacher/Module/Chat/Search/KSSearchViewController.m
  11. 146 33
      KulexiuForTeacher/KulexiuForTeacher/Module/TXClassRoom/ClassroomSong/SongListViewController.m
  12. 41 29
      KulexiuForTeacher/KulexiuForTeacher/Module/TXClassRoom/Controller/TXClassroomViewController.m
  13. 3 5
      KulexiuForTeacher/KulexiuForTeacher/Module/TXClassRoom/Model/OnlineClassManager.m
  14. 42 47
      KulexiuForTeacher/KulexiuForTeacher/Module/TXClassRoom/Service/Classroom/ClassroomService.m
  15. 3 0
      KulexiuForTeacher/KulexiuForTeacher/Module/TXClassRoom/Service/Classroom/Model/Classroom.h
  16. 12 9
      KulexiuForTeacher/KulexiuForTeacher/Module/TXClassRoom/Service/Classroom/Model/Classroom.m
  17. 1 1
      KulexiuForTeacher/KulexiuForTeacher/Module/TXClassRoom/Service/Classroom/Model/RoomMember.h
  18. 6 6
      KulexiuForTeacher/KulexiuForTeacher/Module/TXClassRoom/Service/Classroom/Model/RoomMember.m
  19. 7 4
      KulexiuForTeacher/KulexiuForTeacher/Module/TXClassRoom/Service/TRTC/TXRTCService.m
  20. 2 0
      KulexiuForTeacher/KulexiuForTeacher/Module/TXClassRoom/View/AccompanyDisplay/AccompanySongCell.h
  21. 26 16
      KulexiuForTeacher/KulexiuForTeacher/Module/TXClassRoom/View/AccompanyDisplay/AccompanySongCell.m
  22. 39 22
      KulexiuForTeacher/KulexiuForTeacher/Module/TXClassRoom/View/AccompanyDisplay/AccompanySongCell.xib
  23. 0 2
      KulexiuForTeacher/KulexiuForTeacher/Module/TXClassRoom/View/AccompanyDisplay/AccompanyView.h
  24. 8 5
      KulexiuForTeacher/KulexiuForTeacher/Module/TXClassRoom/View/AccompanyDisplay/AccompanyView.m
  25. 3 0
      KulexiuForTeacher/KulexiuForTeacher/Module/TXClassRoom/View/ClassroomTitleView/TXClassTitleView.m
  26. 4 4
      KulexiuForTeacher/KulexiuForTeacher/Module/TXClassRoom/View/CoursewareView/CoursewareAlertCell.xib
  27. 1 1
      KulexiuForTeacher/KulexiuForTeacher/Module/TXClassRoom/View/CoursewareView/CoursewareAlertView.h
  28. 2 1
      KulexiuForTeacher/KulexiuForTeacher/Module/TXClassRoom/View/CoursewareView/CoursewareAlertView.m
  29. 22 15
      KulexiuForTeacher/KulexiuForTeacher/Module/TXClassRoom/View/CoursewareView/CoursewareAlertView.xib
  30. 4 1
      KulexiuForTeacher/KulexiuForTeacher/Module/TXClassRoom/View/DanMuChat/TXDanMuView.m
  31. 22 19
      KulexiuForTeacher/KulexiuForTeacher/Module/TXClassRoom/View/MemberList/ClassMemberListView.m
  32. 2 2
      KulexiuForTeacher/KulexiuForTeacher/Module/TXClassRoom/View/MemberList/ClassMemberSettingView.m
  33. 3 3
      KulexiuForTeacher/KulexiuForTeacher/Module/TXClassRoom/View/MemberList/ClassMemberSettingView.xib
  34. 0 1
      KulexiuForTeacher/KulexiuForTeacher/Module/TXClassRoom/View/MemberList/MemberListBodyView.m
  35. 2 2
      KulexiuForTeacher/KulexiuForTeacher/Module/TXClassRoom/View/MemberList/MemberListCell.xib
  36. 7 2
      KulexiuForTeacher/KulexiuForTeacher/Module/TXClassRoom/View/TXChatAreaView/TXChatAreaView.m

+ 4 - 2
KulexiuForTeacher/KulexiuForTeacher.xcodeproj/project.pbxproj

@@ -6047,10 +6047,10 @@
 		BC71DEED2A89F46F003F165E /* VideoList */ = {
 			isa = PBXGroup;
 			children = (
-				BC71DEEE2A89F46F003F165E /* TXClassroomVideoListCell.m */,
-				BC71DEEF2A89F46F003F165E /* TXClassroomVideoListView.m */,
 				BC71DEF02A89F46F003F165E /* TXClassroomVideoListCell.h */,
+				BC71DEEE2A89F46F003F165E /* TXClassroomVideoListCell.m */,
 				BC71DEF12A89F46F003F165E /* TXClassroomVideoListView.h */,
+				BC71DEEF2A89F46F003F165E /* TXClassroomVideoListView.m */,
 			);
 			path = VideoList;
 			sourceTree = "<group>";
@@ -8658,6 +8658,7 @@
 				INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen;
 				INFOPLIST_KEY_UIMainStoryboardFile = Main;
 				INFOPLIST_KEY_UIRequiresFullScreen = YES;
+				INFOPLIST_KEY_UIStatusBarStyle = UIStatusBarStyleDarkContent;
 				INFOPLIST_KEY_UISupportedInterfaceOrientations = UIInterfaceOrientationPortrait;
 				INFOPLIST_KEY_UIUserInterfaceStyle = Light;
 				IPHONEOS_DEPLOYMENT_TARGET = 12.0;
@@ -8725,6 +8726,7 @@
 				INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen;
 				INFOPLIST_KEY_UIMainStoryboardFile = Main;
 				INFOPLIST_KEY_UIRequiresFullScreen = YES;
+				INFOPLIST_KEY_UIStatusBarStyle = UIStatusBarStyleDarkContent;
 				INFOPLIST_KEY_UISupportedInterfaceOrientations = UIInterfaceOrientationPortrait;
 				INFOPLIST_KEY_UIUserInterfaceStyle = Light;
 				IPHONEOS_DEPLOYMENT_TARGET = 12.0;

+ 2 - 1
KulexiuForTeacher/KulexiuForTeacher/AppDelegate.m

@@ -97,7 +97,7 @@
     // 配置极光推送
     [self configJPUSHWithLaunchOptions:launchOptions];
     // 融云相关配置
-    [self configIM];
+//    [self configIM];
     
      // 腾讯群相关
     [self configTXIM];
@@ -359,6 +359,7 @@
     chatConfig.backgroudColor = HexRGB(0xF8F8F8);
     chatConfig.enableWelcomeCustomMessage = NO;
     chatConfig.enableTypingStatus = YES;
+
 }
 
 #pragma mark - private method

+ 2 - 1
KulexiuForTeacher/KulexiuForTeacher/Common/Base/LoginManger/TXIMLinsenter.m

@@ -30,7 +30,8 @@
 
 - (void)TXIMLoginWithUserId:(NSString *)userId sig:(NSString *)userSig callback:(TXIMLoginCallback)callback {
     [TUILogin addLoginListener:self];
-    [[V2TIMManager sharedInstance] addConversationListener:self];
+    [[V2TIMManager sharedInstance] addSimpleMsgListener:self];
+    [[V2TIMManager sharedInstance] addGroupListener:self];
     [TUILogin login:CONFIG_TXSDKAPPID userID:userId userSig:userSig succ:^{
         self.loginIMSuccess = YES;
         if (callback) {

+ 2 - 2
KulexiuForTeacher/KulexiuForTeacher/Common/Define/KSDomain.h

@@ -11,8 +11,8 @@
 //#ifdef DEBUG
 
 #define hostURL (@"https://dev.colexiu.com")
-//#define SEALCLASSHOST (@"https://dev.colexiu.com/api-classroom")
-#define SEALCLASSHOST (@"http://192.168.3.143:9999")
+#define SEALCLASSHOST (@"https://dev.colexiu.com/api-classroom")
+//#define SEALCLASSHOST (@"http://192.168.3.143:9999")
 
 #define WEBHOST (@"https://dev.colexiu.com/teacher")
 #define SOCKET_URL (@"wss://dev.colexiu.com/audioAnalysis")

+ 2 - 0
KulexiuForTeacher/KulexiuForTeacher/Info.plist

@@ -83,5 +83,7 @@
 		<string>remote-notification</string>
 		<string>voip</string>
 	</array>
+	<key>UIViewControllerBasedStatusBarAppearance</key>
+	<false/>
 </dict>
 </plist>

+ 1 - 0
KulexiuForTeacher/KulexiuForTeacher/Module/Chat/Group/View/GroupApplyChooseCell.m

@@ -56,6 +56,7 @@
     }
     NSString *img = source.isChoose ? @"login_seleted" :@"login_unseleted";
     [self.chooseImage setImage:[UIImage imageNamed:img]];
+    self.descLabel.text = [NSString returnNoNullStringWithString:source.desc];
 }
 - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
     [super setSelected:selected animated:animated];

+ 4 - 3
KulexiuForTeacher/KulexiuForTeacher/Module/Chat/Group/View/GroupApplyChooseCell.xib

@@ -1,9 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="19529" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="21701" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
     <device id="retina6_1" orientation="portrait" appearance="light"/>
     <dependencies>
         <deployment identifier="iOS"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="19519"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21679"/>
         <capability name="Safe area layout guides" minToolsVersion="9.0"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
@@ -42,7 +42,7 @@
                                 <nil key="highlightedColor"/>
                             </label>
                             <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="申请入群" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="sYm-o4-EKw">
-                                <rect key="frame" x="95" y="32.5" width="57.5" height="20"/>
+                                <rect key="frame" x="95" y="32.5" width="236" height="20"/>
                                 <constraints>
                                     <constraint firstAttribute="height" constant="20" id="wgn-6X-lb7"/>
                                 </constraints>
@@ -74,6 +74,7 @@
                             <constraint firstItem="pGz-mE-aAb" firstAttribute="leading" secondItem="tgh-tX-q6U" secondAttribute="trailing" constant="9" id="Gpi-z1-bF7"/>
                             <constraint firstItem="pQa-7h-gVN" firstAttribute="centerY" secondItem="LMF-i7-uzV" secondAttribute="centerY" id="PCJ-2a-KLI"/>
                             <constraint firstItem="kqu-oI-K1Y" firstAttribute="centerY" secondItem="pGz-mE-aAb" secondAttribute="centerY" id="Py3-S4-7HQ"/>
+                            <constraint firstAttribute="trailing" secondItem="sYm-o4-EKw" secondAttribute="trailing" constant="12" id="Pz2-6H-AmG"/>
                             <constraint firstItem="pGz-mE-aAb" firstAttribute="top" secondItem="tgh-tX-q6U" secondAttribute="top" id="Va0-HR-j4p"/>
                             <constraint firstAttribute="trailing" secondItem="kqu-oI-K1Y" secondAttribute="trailing" constant="11" id="d3K-ns-UJF"/>
                             <constraint firstItem="sYm-o4-EKw" firstAttribute="leading" secondItem="pGz-mE-aAb" secondAttribute="leading" id="eCp-zA-t2F"/>

+ 1 - 0
KulexiuForTeacher/KulexiuForTeacher/Module/Chat/Group/View/GroupApplyMemberCell.m

@@ -51,6 +51,7 @@
         NSString *dateStr = [dateFormatter stringFromDate:messageDate];
         self.timeLabel.text = dateStr;
     }
+    self.descLabel.text = [NSString returnNoNullStringWithString:source.desc];
 }
 
 - (void)setSelected:(BOOL)selected animated:(BOOL)animated {

+ 4 - 3
KulexiuForTeacher/KulexiuForTeacher/Module/Chat/Group/View/GroupApplyMemberCell.xib

@@ -1,9 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="19529" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="21701" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
     <device id="retina6_1" orientation="portrait" appearance="light"/>
     <dependencies>
         <deployment identifier="iOS"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="19519"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21679"/>
         <capability name="Safe area layout guides" minToolsVersion="9.0"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
@@ -42,7 +42,7 @@
                                 <nil key="highlightedColor"/>
                             </label>
                             <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="申请入群" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="abU-Qe-TRe">
-                                <rect key="frame" x="64" y="28" width="57.5" height="20"/>
+                                <rect key="frame" x="64" y="28" width="216" height="20"/>
                                 <constraints>
                                     <constraint firstAttribute="height" constant="20" id="lJY-Ei-TsP"/>
                                 </constraints>
@@ -63,6 +63,7 @@
                         <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                         <constraints>
                             <constraint firstItem="25M-zg-LCA" firstAttribute="top" secondItem="37U-f9-tKa" secondAttribute="top" id="1HB-gV-vAy"/>
+                            <constraint firstAttribute="trailing" secondItem="abU-Qe-TRe" secondAttribute="trailing" constant="12" id="6fJ-vo-zHL"/>
                             <constraint firstItem="HQE-ue-TmV" firstAttribute="centerY" secondItem="25M-zg-LCA" secondAttribute="centerY" id="9XP-X1-R6Z"/>
                             <constraint firstItem="25M-zg-LCA" firstAttribute="leading" secondItem="37U-f9-tKa" secondAttribute="trailing" constant="9" id="TMX-jK-qT7"/>
                             <constraint firstItem="37U-f9-tKa" firstAttribute="centerY" secondItem="a8P-Tn-du2" secondAttribute="centerY" id="YUB-Z0-iGp"/>

+ 1 - 8
KulexiuForTeacher/KulexiuForTeacher/Module/Chat/Search/KSSearchViewController.m

@@ -190,13 +190,6 @@ static NSString *const HFId = @"HFId";
         NSArray *msgs = convInfo[kSearchChatHistoryConversationMsgs];
         if (msgs.count == 1) {
             NSString *title = cellModel.title ?: cellModel.titleAttributeString.string;
-            NSDictionary *param = @{
-                TUICore_TUIChatObjectFactory_ChatViewController_Title : title ?: @"",
-                TUICore_TUIChatObjectFactory_ChatViewController_UserID : conversation.userID ?: @"",
-                TUICore_TUIChatObjectFactory_ChatViewController_GroupID : conversation.groupID ?: @"",
-                TUICore_TUIChatObjectFactory_ChatViewController_HighlightKeyword : self.searchBar.mySearchBar.text ?: @"",
-                TUICore_TUIChatObjectFactory_ChatViewController_LocateMessage : msgs.firstObject,
-            };
             
             if (![NSString isEmptyString:conversation.userID]) { // 单聊
                 KSChatConversationViewController *ctrl = [[KSChatConversationViewController alloc] init];
@@ -313,7 +306,7 @@ static NSString *const HFId = @"HFId";
         NSString *conversationID = [NSString stringWithFormat:@"group_%@", self.groupId];
 
         parm = @{TUISearchChatHistoryParamKeyConversationId:conversationID};
-        [self.dataProvider searchForKeyword:key forModules:TUISearchResultModuleAll param:parm];
+        [self.dataProvider searchForKeyword:key forModules:TUISearchResultModuleChatHistory param:parm];
     }
     else {
         [self.dataProvider searchForKeyword:key forModules:TUISearchResultModuleAll param:parm];

+ 146 - 33
KulexiuForTeacher/KulexiuForTeacher/Module/TXClassRoom/ClassroomSong/SongListViewController.m

@@ -6,49 +6,162 @@
 //
 
 #import "SongListViewController.h"
-//#import "SongListChooseView.h"
-//#import "SongSearchView.h"
 #import "AppDelegate.h"
 #import "UIDevice+TFDevice.h"
+//#import "KSSoundPlayCell.h"
 
-@interface SongListViewController ()
+@interface SongListViewController ()<UITableViewDelegate, UITableViewDataSource>
 
-@property (nonatomic, strong) NSString *ownerType;
+@property (nonatomic, strong) UITableView *tableView;
 
-@end
+//@property (nonatomic, strong) SongSearchView *searchView;
 
-@implementation SongListViewController
+@property (nonatomic, strong) NSString *searchKey;
 
-- (void)viewDidLoad {
-    [super viewDidLoad];
-    // Do any additional setup after loading the view.
-    self.ownerType = @"COMMON";
-    
-    AppDelegate* delegate = (AppDelegate*)[UIApplication sharedApplication].delegate;
-    delegate.allowAutoRotate = YES;
-    [UIDevice switchNewOrientation:UIInterfaceOrientationLandscapeRight inController:self];
-    
-    [self allocTitle:@"教学伴奏"];
-    [self configUI];
-    [self queryTeacherSubject];
-    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(leaveRoomAction) name:@"classroomLogout" object:nil];
-    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(leaveRoomAction) name:@"classroomQuit" object:nil];
-}
+@end
 
-- (void)queryTeacherSubject {
-     
-}
+@implementation SongListViewController
 
-- (void)configUI {
-    
-}
-- (void)leaveRoomAction {
-    [self.navigationController dismissViewControllerAnimated:YES completion:nil];
-}
+//- (void)viewDidLoad {
+//    [super viewDidLoad];
+//    // Do any additional setup after loading the view.
+//    
+//    AppDelegate* delegate = (AppDelegate*)[UIApplication sharedApplication].delegate;
+//    delegate.allowAutoRotate = YES;
+//    [UIDevice switchNewOrientation:UIInterfaceOrientationLandscapeRight inController:self];
+//    
+//    [self allocTitle:@"教学伴奏"];
+//    [self configUI];
+//    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(leaveRoomAction) name:@"classroomLogout" object:nil];
+//    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(leaveRoomAction) name:@"classroomQuit" object:nil];
+//}
+//
+//
+//- (void)rightBtnClick {
+//    [self.navigationController dismissViewControllerAnimated:YES completion:nil];
+//}
+//
+//- (void)configUI {
+//    [self.view addSubview:self.tableView];
+//
+//    [self setPromptString:@"暂无曲目" imageName:@"wd_img_zwsj" inView:self.tableView];
+//    MJWeakSelf;
+//    self.tableView.mj_header = [KSGifRefreshHeader headerWithRefreshingBlock:^{
+//        [weakSelf resetAndRequest];
+//    }];
+//    
+//    self.tableView.mj_footer = [KSGifRefreshFooter footerWithRefreshingBlock:^{
+//        if (weakSelf.isLoadMore) {
+//            weakSelf.pages += 1;
+//            [weakSelf requestData];
+//        }
+//        else {
+//            [weakSelf.tableView.mj_footer endRefreshingWithNoMoreData];
+//        }
+//    }];
+//}
+//
+//- (void)viewWillDisappear:(BOOL)animated {
+//    [super viewWillDisappear:animated];
+//    [[NSNotificationCenter defaultCenter] removeObserver:self];
+//}
+//
+//- (void)resetAndRequest {
+//    [self resetParamenter];
+//    [self requestData];
+//}
+//
+//- (void)requestData {
+//    [self showhud];
+//    [KSRequestManager accompanyQueryPageLimitRequest:KS_GET categoriesId:self.categoryId subjectId:self.subjectId type:self.ownerType search:self.searchKey page:[NSString stringWithFormat:@"%zd",self.pages] rows:[NSString stringWithFormat:@"%zd",self.rows] success:^(NSDictionary * _Nonnull dic) {
+//        [self removehub];
+//        [self endRefresh];
+//        if ([dic ks_integerValueForKey:@"code"] == 200 && [dic ks_boolValueForKey:@"status"]) {
+//            // 赋值
+//            NSArray *sourceArray = [[dic ks_dictionaryValueForKey:@"data"] ks_arrayValueForKey:@"rows"];
+//            for (NSDictionary *parm in sourceArray) {
+//                SongListModel *model = [[SongListModel alloc] initWithDictionary:parm];
+//                [self.dataArray addObject:model];
+//            }
+//            if (sourceArray.count < self.rows) {
+//                self.isLoadMore = NO;
+//            }
+//        }
+//        else {
+//            [self MBPShow:MESSAGEKEY];
+//        }
+//        [self.tableView reloadData];
+//
+//    } faliure:^(NSError * _Nonnull error) {
+//        [self removehub];
+//        [self endRefresh];
+//        
+//        [self.dataArray removeAllObjects];
+//        [self.tableView reloadData];
+//    }];
+//}
+//
+//- (void)resetParamenter {
+//    self.isLoadMore = YES;
+//    self.pages = 1;
+//    self.rows = 10;
+//    self.dataArray = [NSMutableArray array];
+//    [self.tableView.mj_footer resetNoMoreData];
+//    [self.tableView reloadData];
+//}
+//- (void)endRefresh {
+//    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
+//        [self.tableView.mj_header endRefreshing];
+//        [self.tableView.mj_footer endRefreshing];
+//    });
+//}
+//
+//- (void)viewWillAppear:(BOOL)animated {
+//    [super viewWillAppear:animated];
+//    AppDelegate* delegate = (AppDelegate*)[UIApplication sharedApplication].delegate;
+//    delegate.allowAutoRotate = YES;
+//    [UIDevice switchNewOrientation:UIInterfaceOrientationLandscapeRight inController:self];
+//    
+//    [self resetAndRequest];
+//}
+//
+//- (void)leaveRoomAction {
+//    [self.navigationController dismissViewControllerAnimated:YES completion:nil];
+//}
+//
+//- (void)dealloc {
+//    [[NSNotificationCenter defaultCenter] removeObserver:self];
+//}
+//
+//#pragma mark ---- table data source
+//- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
+//    return 1;
+//}
+//
+//- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
+//    return self.dataArray.count;
+//}
+//
+//- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
+//
+//    SongListModel *model = self.dataArray[indexPath.row];
+//    KSSoundPlayCell *cell = [tableView dequeueReusableCellWithIdentifier:@"KSSoundPlayCell"];
+//    cell.isChoose = self.isChooseSong;
+//    [cell configCellWithSource:model indexPath:indexPath callback:^(BOOL isPlay, id  _Nonnull source, NSIndexPath * _Nonnull cellIndexPath) {
+//    }];
+//    
+//    return cell;
+//}
+//
+//- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
+//    SongListModel *model = self.dataArray[indexPath.row];
+//    if (self.callback) {
+//        NSString *songId = model.internalBaseClassIdentifier;
+//        self.callback(songId, model.examSongName, model.url, model.mp3Url);
+//        [self.navigationController dismissViewControllerAnimated:YES completion:nil];
+//    }
+//}
 
-- (void)dealloc {
-    [[NSNotificationCenter defaultCenter] removeObserver:self];
-}
 /*
 #pragma mark - Navigation
 

+ 41 - 29
KulexiuForTeacher/KulexiuForTeacher/Module/TXClassRoom/Controller/TXClassroomViewController.m

@@ -58,6 +58,7 @@
 
 #import "TXDanMuView.h"
 #import "TXTimeView.h"
+#import "CoursewareAlertView.h"
 
 #define MAXBIGPHOTONUMBER (3)
 #define MAXPHOTONUMBER (3)
@@ -135,6 +136,8 @@
 
 @property (nonatomic, assign) NSInteger soundVolume; // 伴奏音量
 
+@property (nonatomic, strong) CoursewareAlertView *coursewareView;
+
 @property (nonatomic, strong) TRTCCloud *engine;
 
 
@@ -163,6 +166,10 @@
 - (void)changeOrientation:(BOOL)isLandScape {
     if (isLandScape) {
         // 切换到横屏
+        if (IS_IPAD) {
+            self.zh_statusBarHidden = YES;
+        }
+
         AppDelegate* delegate = (AppDelegate*)[UIApplication sharedApplication].delegate;
         delegate.allowAutoRotate = YES;
         [UIDevice switchNewOrientation:UIInterfaceOrientationLandscapeRight inController:self];
@@ -172,6 +179,9 @@
         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(), ^{
+            if (IS_IPAD) {
+                self.zh_statusBarHidden = NO;
+            }
             [UIDevice switchNewOrientation:UIInterfaceOrientationPortrait inController:self];
         });
     }
@@ -197,6 +207,7 @@
         [self judgeShowAlert];
     }
     [IQKeyboardManager sharedManager].enableAutoToolbar = YES;
+
 }
 
 - (void)hideAlertView {
@@ -250,6 +261,7 @@
     [super viewDidLoad];
     // Do any additional setup after loading the view.
     self.ks_prefersNavigationBarHidden = YES;
+    
     self.view.backgroundColor = [UIColor whiteColor];
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(leaveRoomAction) name:@"classroomLogout" object:nil];
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(quitRoomAction) name:@"classroomQuit" object:nil];
@@ -379,12 +391,10 @@
         case ClassTitleViewActionTagMic:
         {
             
-            if (tagButton.isSelected == NO) {
-                
+            if (tagButton.isSelected == NO) { // 关闭
                 [[ClassroomService sharedService] enableDevice:NO songId:0 withType:DeviceTypeMicrophone];
             }
-            else {
-                tagButton.isSelected = NO;
+            else { // 打开
                 [[ClassroomService sharedService] enableDevice:YES songId:0 withType:DeviceTypeMicrophone];
             }
         }
@@ -392,7 +402,6 @@
         case ClassTitleViewActionTagCamera:
         {
             if (tagButton.isSelected == NO) {
-                
                 [[ClassroomService sharedService] enableDevice:NO songId:0 withType:DeviceTypeCamera];
             }
             else {
@@ -444,7 +453,6 @@
             break;
         case ClassTitleViewActionTagHangup:
         {
-            
             [self showQuitAlert];
         }
         default:
@@ -926,6 +934,8 @@
     }
     self.toolView.isVideoDisplay = NO;
     [self.view bringSubviewToFront:self.timeView];
+    [self.view bringSubviewToFront:self.titleView];
+    
 }
 
 - (void)refreshWhiteBoardFrame {
@@ -1148,12 +1158,9 @@
             case MainToolButtonTagMic: // 麦克风
             {
                 if (toolButton.isSelected) { // 打开
-                    toolButton.isSelected = NO;
                     [[ClassroomService sharedService] enableDevice:YES songId:0 withType:DeviceTypeMicrophone];
                 }
                 else { // 关闭
-                    
-                    toolButton.isSelected = YES;
                     [[ClassroomService sharedService] enableDevice:NO songId:0 withType:DeviceTypeMicrophone];
                 }
             }
@@ -1161,12 +1168,10 @@
             case MainToolButtonTagCamero: // 摄像头
             {
                 if (toolButton.isSelected) { // 打开
-                    toolButton.isSelected = NO;
                     [[ClassroomService sharedService] enableDevice:YES songId:0 withType:DeviceTypeCamera];
                 }
                 else { // 关闭
                     
-                    toolButton.isSelected = YES;
                     [[ClassroomService sharedService] enableDevice:NO songId:0 withType:DeviceTypeCamera];
                 }
             }
@@ -1350,14 +1355,16 @@
 - (void)showNetworkingStatus:(TRTCQuality)quality remoteQuality:(NSArray<TRTCQualityInfo *> *)remoteQuality  {
     dispatch_async(dispatch_get_main_queue(), ^{
         // 本地
-        if ([self.containerView.member.userId isEqualToString:UserDefault(UIDKey)]) {
+        NSString *currentUserID = [ClassroomService sharedService].currentRoom.currentMemberId;
+
+        if ([self.containerView.member.userId isEqualToString:currentUserID]) {
             [self.containerView.displayView updateUserQualityNetWorkingStatus:[self getNetStatusWithQuality:quality]];
         }
 
-        [self.videoListView updateUserQuality:UserDefault(UIDKey) netWorkingStatus:[self getNetStatusWithQuality:quality]];
+        [self.videoListView updateUserQuality:currentUserID netWorkingStatus:[self getNetStatusWithQuality:quality]];
         // 更新full
         if (self.squareOn) {
-            [self.squareView updateUserQuality:UserDefault(UIDKey) netWorkingStatus:[self getNetStatusWithQuality:quality]];
+            [self.squareView updateUserQuality:currentUserID netWorkingStatus:[self getNetStatusWithQuality:quality]];
         }
         // 远端
         for (TRTCQualityInfo *info in remoteQuality) {
@@ -1397,14 +1404,16 @@
 }
 
 - (void)didReportUserVolume:(NSArray<TRTCVolumeInfo *> *)userVolumes {
+    NSString *currentUserID = [ClassroomService sharedService].currentRoom.currentMemberId;
+
     for (TRTCVolumeInfo *info in userVolumes) {
         NSString *userId = info.userId;
         if ([NSString isEmptyString:userId]) {
-            userId = UserDefault(UIDKey);
+            userId = currentUserID;
         }
         [self.videoListView updateMicStatus:userId volume:info.volume];
         // 更新title
-        if ([UserDefault(UIDKey) isEqualToString:userId]) {
+        if ([currentUserID isEqualToString:userId]) {
             [self.titleView updateUserVolume:info.volume];
         }
         // 更新container
@@ -1590,6 +1599,7 @@
     if (!_wBoardCtrl) {
         CGRect frame = [self getWBoardFrame];
         _wBoardCtrl = [[KSWhiteboardControl alloc] initWithDelegate:self viewFrame:frame];
+        NSLog(@"----%@", [ClassroomService sharedService].currentRoom.roomId);
         _wBoardCtrl.randomNumeric = [ClassroomService sharedService].currentRoom.randomNumeric;
         NSString *roomId = [ClassroomService sharedService].currentRoom.roomId;
         if ([roomId containsString:@"S"] || [roomId containsString:@"I"]) {
@@ -1929,18 +1939,7 @@
     NSLog(@"-------sound volume %zd", self.soundVolume);
     if (action == ACCOMPANYACTION_ADDSONG) {
         // 添加伴奏
-        MJWeakSelf;
-        SongListViewController *songVC = [[SongListViewController alloc] init];
-//        songVC.isChooseSong = YES;
-        [songVC chooseSongCallback:^(NSString * _Nonnull songId, NSString * _Nonnull songName, NSString * _Nullable songUrl, NSString * _Nullable accompanyUrl) {
-            
-            [weakSelf notiferStudentDownload:songId songUrl:songUrl accompanyUrl:accompanyUrl songName:songName];
-        }];
-
-        CustomNavViewController *navCtrl = [[CustomNavViewController alloc] initWithRootViewController:songVC];
-        navCtrl.modalPresentationStyle = UIModalPresentationFullScreen;
-        _isPushChooseView = YES;
-        [self presentViewController:navCtrl animated:YES completion:nil];
+        [self.coursewareView showView];
     }
     else if (action == ACCOMPANYACTION_STOP) {
         
@@ -1994,7 +1993,7 @@
 }
 
 - (void)notiferStudentDownload:(NSString *)songId songUrl:(NSString *)songUrl accompanyUrl:(NSString *)accompanyUrl songName:(NSString *)songName {
-    
+    [self.coursewareView hideView];
     dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
         for (RoomMember *member in [ClassroomService sharedService].currentRoom.memberList) {
             
@@ -2080,6 +2079,19 @@
     }
     return _danView;
 }
+
+- (CoursewareAlertView *)coursewareView {
+    if (!_coursewareView) {
+        _coursewareView = [CoursewareAlertView shareInstance];
+        [_coursewareView configUI];
+        MJWeakSelf;
+        [_coursewareView chooseCoursewareCallback:^(NSString * _Nonnull musicUrl, NSString * _Nonnull musicName, NSString * _Nonnull songId) {
+            
+            [weakSelf notiferStudentDownload:songId songUrl:musicUrl accompanyUrl:nil songName:musicName];
+        }];
+    }
+    return _coursewareView;
+}
 /*
 #pragma mark - Navigation
 

+ 3 - 5
KulexiuForTeacher/KulexiuForTeacher/Module/TXClassRoom/Model/OnlineClassManager.m

@@ -86,9 +86,8 @@
 }
 
 - (void)notiferIsSuccess:(BOOL)isSuccess {
-    if (isSuccess == NO) {
-        [[ClassroomService sharedService] joinRoomStatusNotify:isSuccess];
-    }
+
+    [[ClassroomService sharedService] joinRoomStatusNotify:isSuccess];
 }
 
 - (void)classroomDidOverMaxUserCount {
@@ -104,8 +103,7 @@
     vc.courseId = self.roomId;
     vc.subjectId = self.subjectId;
     vc.classEndTime = self.classEndTime;
-    vc.modalPresentationStyle = UIModalPresentationFullScreen;
-    [self.baseCtrl presentViewController:vc animated:YES completion:nil];
+    [self.baseCtrl.navigationController pushViewController:vc animated:YES];
 }
 
 - (void)login:(BOOL)isAudience {

+ 42 - 47
KulexiuForTeacher/KulexiuForTeacher/Module/TXClassRoom/Service/Classroom/ClassroomService.m

@@ -225,8 +225,6 @@ isAudience:(BOOL)audience
         if (result.success) {
             NSMutableArray *memberList = [[NSMutableArray alloc] init];
             NSArray *arr = result.content[@"result"];
-            [dic setValue:@"TEACHER" forKey:@"clientType"];
-
             for (NSDictionary *boardDic in arr) {
                 RoomMember *member = [RoomMember memberFromJson:boardDic];
                 [memberList addObject:member];
@@ -261,26 +259,15 @@ isAudience:(BOOL)audience
     }
     NSMutableDictionary *dic = [[NSMutableDictionary alloc] init];
     [dic setObject:self.currentRoom.roomId forKey:@"roomId"];
-    if(DeviceTypeCamera == type) {
-        [dic setObject:@(enable) forKey:@"cameraOn"];
-    }else if (DeviceTypeMicrophone == type) {
-        [dic setObject:@(enable) forKey:@"microphoneOn"];
-    } else if (DeviceTypeHandup == type) {
-        [dic setObject:@(enable) forKey:@"handUpOn"];
-    }
-    else if (DeviceTypeMusicMode == type) {
-        [dic setObject:@(enable) forKey:@"musicModeOn"];
-    }
-    else if (DeviceTypeExamSong == type) {
-        [dic setObject:@(enable) forKey:@"examSongOn"];
-    }
-    else if (DeviceTypeMusicScore == type) { // 原音
-        [dic setObject:@(enable) forKey:@"musicScoreOn"];
+    
+    [dic setValue:[self getDeviceTypeWithEnum:type] forKey:@"deviceType"];
+    [dic setValue:@(enable) forKey:@"enable"];
+
+     if (DeviceTypeMusicScore == type) { // 原音
         [dic setObject:@(songId) forKey:@"musicScoreAccompanimentId"];
         [dic setObject:@(soundVolume) forKey:@"soundVolume"];
     }
     else if (DeviceTypeAccompany == type) { // 伴奏
-        [dic setObject:@(enable) forKey:@"accompanimentOn"];
         [dic setObject:@(songId) forKey:@"musicScoreAccompanimentId"];
         [dic setObject:@(soundVolume) forKey:@"soundVolume"];
     }
@@ -312,24 +299,14 @@ isAudience:(BOOL)audience
     }
     NSMutableDictionary *dic = [[NSMutableDictionary alloc] init];
     [dic setObject:self.currentRoom.roomId forKey:@"roomId"];
-    if(DeviceTypeCamera == type) {
-        [dic setObject:@(enable) forKey:@"cameraOn"];
-    }else if (DeviceTypeMicrophone == type) {
-        [dic setObject:@(enable) forKey:@"microphoneOn"];
-    }
-    else if (DeviceTypeMusicMode == type) {
-        [dic setObject:@(enable) forKey:@"musicModeOn"];
-    }
-    else if (DeviceTypeExamSong == type) {
-        [dic setObject:@(enable) forKey:@"examSongOn"];
-    }
-    else if (DeviceTypeMusicScore == type) { // 原音
-        [dic setObject:@(enable) forKey:@"musicScoreOn"];
+    [dic setValue:[self getDeviceTypeWithEnum:type] forKey:@"deviceType"];
+    [dic setValue:@(enable) forKey:@"enable"];
+
+    if (DeviceTypeMusicScore == type) { // 原音
         [dic setObject:@(songId) forKey:@"musicScoreAccompanimentId"];
         [dic setObject:@(soundVolume) forKey:@"soundVolume"];
     }
     else if (DeviceTypeAccompany == type) { // 伴奏
-        [dic setObject:@(enable) forKey:@"accompanimentOn"];
         [dic setObject:@(songId) forKey:@"musicScoreAccompanimentId"];
         [dic setObject:@(soundVolume) forKey:@"soundVolume"];
     }
@@ -359,8 +336,9 @@ isAudience:(BOOL)audience
     NSMutableDictionary *dic = [[NSMutableDictionary alloc] init];
     [dic setObject:self.currentRoom.roomId forKey:@"roomId"];
     [dic setObject:@(cancelMuteFlag) forKey:@"cancelMuteFlag"];
+    [dic setValue:[self getDeviceTypeWithEnum:DeviceTypeMicrophone] forKey:@"deviceType"];
     if (setMicOff) {
-        [dic setObject:@(NO) forKey:@"microphoneOn"];
+        [dic setValue:@(NO) forKey:@"enable"];
     }
     [dic setValue:@"TEACHER" forKey:@"clientType"];
 
@@ -483,23 +461,16 @@ isAudience:(BOOL)audience
     }
     NSMutableDictionary *dic = [[NSMutableDictionary alloc] init];
     [dic setObject:self.currentRoom.roomId forKey:@"roomId"];
-    if (type == DeviceTypeCamera) {
-        [dic setObject:@(enable) forKey:@"cameraOn"];
-    } else if (type == DeviceTypeMicrophone) {
-        [dic setObject:@(enable) forKey:@"microphoneOn"];
-    }
-    else if (type == DeviceTypeMusicMode) {
-        [dic setObject:@(enable) forKey:@"musicModeOn"];
-    }
-    else if (type == DeviceTypeExamSong) {
-        [dic setObject:@(enable) forKey:@"examSongOn"];
-    }
-    else if (DeviceTypeMusicScore == type) { // 原音
-        [dic setObject:@(enable) forKey:@"musicScoreOn"];
+    
+    [dic setValue:[self getDeviceTypeWithEnum:type] forKey:@"deviceType"];
+    [dic setValue:@(enable) forKey:@"enable"];
+
+    if (DeviceTypeMusicScore == type) { // 原音
+
         [dic setObject:@(songId) forKey:@"musicScoreAccompanimentId"];
     }
     else if (DeviceTypeAccompany == type) { // 伴奏
-        [dic setObject:@(enable) forKey:@"accompanimentOn"];
+
         [dic setObject:@(songId) forKey:@"musicScoreAccompanimentId"];
     }
     [dic setValue:@"TEACHER" forKey:@"clientType"];
@@ -675,4 +646,28 @@ isAudience:(BOOL)audience
     NSString *className = [configModel getMessageClassName:messageObjectName];
     return className;
 }
+
+- (NSString *)getDeviceTypeWithEnum:(DeviceType)type {
+    if (type == DeviceTypeCamera) {
+        return @"CAMERA";
+    }
+    else if (type == DeviceTypeMicrophone) {
+        return @"MICROPHONE";
+    }
+    else if (type == DeviceTypeMusicMode) {
+        return @"MUSIC_MODE";
+    }
+    else if (type == DeviceTypeHandup) {
+        return @"HAND_UP";
+    }
+    else if (type == DeviceTypeExamSong) {
+        return @"EXAM_SONG";
+    }
+    else if (type == DeviceTypeMusicScore) {
+        return @"MUSIC_SHEET";
+    }
+    else { // DeviceTypeAccompany
+        return @"ACCOMPANIMENT";
+    }
+}
 @end

+ 3 - 0
KulexiuForTeacher/KulexiuForTeacher/Module/TXClassRoom/Service/Classroom/Model/Classroom.h

@@ -24,7 +24,10 @@ typedef NS_ENUM(NSUInteger, DisplayType) {
 
 @interface Classroom : NSObject
 
+@property (nonatomic, assign) NSInteger studentNums;
+
 @property (nonatomic, assign) BOOL autoCloseFlag;
+
 @property (nonatomic, assign) NSInteger autoCloseNetworkRoomTime;
  
 @property (nonatomic, assign) BOOL isPlayBeat; // 是否在播放节拍器

+ 12 - 9
KulexiuForTeacher/KulexiuForTeacher/Module/TXClassRoom/Service/Classroom/Model/Classroom.m

@@ -18,29 +18,32 @@
 
 + (instancetype)classroomFromJson:(NSDictionary *)dic {
     Classroom *room = [[Classroom alloc] init];
-    room.roomId = dic[@"roomId"];
-    room.imToken = dic[@"imToken"];
-    room.surplusTime = [dic[@"surplusTime"] integerValue];
-    NSString *display = dic[@"display"];
+    room.roomId = [dic ks_stringValueForKey:@"roomId"];
+    room.imToken = [dic ks_stringValueForKey:@"imToken"];
+    room.surplusTime = [dic ks_integerValueForKey:@"surplusTime"];
+    NSString *display = [dic ks_stringValueForKey:@"display"];
     
     [room updateDisplayUri:display];
-    NSArray *memberArray = dic[@"members"];
+    NSArray *memberArray = [dic ks_arrayValueForKey:@"members"];
     NSMutableArray *memberList = [[NSMutableArray alloc] init];
     for (NSDictionary *memberDic in memberArray) {
         RoomMember *member = [RoomMember memberFromJson:memberDic];
         [memberList addObject:member];
     }
     room.memberList = memberList;
-    NSDictionary *userDic = dic[@"userInfo"];
+    NSDictionary *userDic = [dic ks_dictionaryValueForKey:@"userInfo"];
     RoomMember *currentMember = [RoomMember memberFromJson:userDic];
     room.currentMemberId = currentMember.userId;
     room.joinTime = currentMember.joinTime;
-    room.autoCloseFlag = [dic[@"autoCloseFlag"] boolValue];
-    room.autoCloseNetworkRoomTime = [dic[@"autoCloseNetworkRoomTime"] integerValue];
+    room.autoCloseFlag = [dic ks_boolValueForKey:@"autoCloseFlag"];
+    room.autoCloseNetworkRoomTime = [dic ks_integerValueForKey:@"autoCloseNetworkRoomTime"];
     
-    room.randomNumeric = [dic ks_integerValueForKey:@"randomNumeric"];
+//    room.randomNumeric = [dic ks_integerValueForKey:@"randomNumeric"];
+    room.randomNumeric = 1;
     room.roomConfig = [TxRTCRoomConfig configFromJson:[dic ks_dictionaryValueForKey:@"rtcRoomConfig"]];
     room.isSingleClass = [dic ks_integerValueForKey:@"studentNums"] > 1 ? NO : YES;
+    room.studentNums = [dic ks_integerValueForKey:@"studentNums"];
+
     return room;
 }
 

+ 1 - 1
KulexiuForTeacher/KulexiuForTeacher/Module/TXClassRoom/Service/Classroom/Model/RoomMember.h

@@ -15,7 +15,7 @@ NS_ASSUME_NONNULL_BEGIN
 @interface RoomMember : NSObject
 
 @property (nonatomic, copy) NSString *headUrl;
-@property (nonatomic, copy)   NSString *userId;
+@property (nonatomic, copy) NSString *userId;
 @property (nonatomic, copy)   NSString *name;
 @property (nonatomic, assign) long long joinTime;
 @property (nonatomic, assign) Role role;

+ 6 - 6
KulexiuForTeacher/KulexiuForTeacher/Module/TXClassRoom/Service/Classroom/Model/RoomMember.m

@@ -12,15 +12,15 @@
 
 + (instancetype)memberFromJson:(NSDictionary *)dic {
     RoomMember *member = [[RoomMember alloc] init];
-    member.headUrl = dic[@"headUrl"];
+    member.headUrl = [dic ks_stringValueForKey:@"headUrl"];
     member.userId = [dic ks_stringValueForKey:@"userId"];
-    member.name = dic[@"userName"];
+    member.name = [dic ks_stringValueForKey:@"userName"];
     member.joinTime = [dic[@"joinTime"] longLongValue];
     member.role = [dic[@"role"] longValue];
-    member.cameraEnable = [dic[@"camera"] boolValue];
-    member.microphoneEnable = [dic[@"microphone"] boolValue];
-    member.musicModeOn = [dic[@"musicModeOn"] boolValue];
-    member.handUpOn = [dic[@"handUpOn"] boolValue];
+    member.cameraEnable = [dic ks_boolValueForKey:@"camera"];
+    member.microphoneEnable = [dic ks_boolValueForKey:@"microphone"];
+    member.musicModeOn = [dic ks_boolValueForKey:@"musicModeOn"];
+    member.handUpOn = [dic ks_boolValueForKey:@"handUpOn"];
     
     NSDictionary *jsonDic = [dic ks_dictionaryValueForKey:@"playMidiJson"];
     if (jsonDic) {

+ 7 - 4
KulexiuForTeacher/KulexiuForTeacher/Module/TXClassRoom/Service/TRTC/TXRTCService.m

@@ -84,14 +84,15 @@
     [self setCameraDisable:!cameraOn];
     
     // 开启音量检测
-    [[TRTCCloud sharedInstance] enableAudioVolumeEvaluation:300 enable_vad:YES];
+    TRTCAudioVolumeEvaluateParams *parms = [[TRTCAudioVolumeEvaluateParams alloc] init];
+    parms.interval = 300;
+    [[TRTCCloud sharedInstance] enableAudioVolumeEvaluation:YES withParams:parms];
 }
 
 - (void)leaveRoom:(KSRTCCallback)callback {
     if (callback) {
         self.success = callback;
     }
-    [TXIM_LINSENTER logoutTXIM];
     [self.engine exitRoom];
     _engine = nil;
     [TRTCCloud destroySharedIntance];
@@ -102,7 +103,8 @@
 
 
 - (void)publishStream {
-    NSString *streamId = [NSString stringWithFormat:@"%@_%@", self.roomID, UserDefault(UIDKey)];
+    NSString *currentUserID = [ClassroomService sharedService].currentRoom.currentMemberId;
+    NSString *streamId = [NSString stringWithFormat:@"%@_%@", self.roomID, currentUserID];
     [self.engine startPublishing:streamId type:TRTCVideoStreamTypeBig];
 }
 
@@ -170,7 +172,8 @@
 }
 
 - (void)cancleRenderUserVideo:(NSString *)userId {
-    if (![userId isEqualToString:UserDefault(UIDKey)]) {
+    NSString *currentUserID = [ClassroomService sharedService].currentRoom.currentMemberId;
+    if (![userId isEqualToString:currentUserID]) {
         [self.engine stopRemoteView:userId streamType:TRTCVideoStreamTypeBig];
     }
     else {

+ 2 - 0
KulexiuForTeacher/KulexiuForTeacher/Module/TXClassRoom/View/AccompanyDisplay/AccompanySongCell.h

@@ -21,6 +21,8 @@ NS_ASSUME_NONNULL_BEGIN
 
 @interface AccompanySongCell : UITableViewCell
 
+@property (nonatomic, assign) BOOL hideDownStatus;
+
 - (void)configCellWithSource:(ClassSongMessage *)songMessage callback:(SongActionCallback)callback;
 
 @end

+ 26 - 16
KulexiuForTeacher/KulexiuForTeacher/Module/TXClassRoom/View/AccompanyDisplay/AccompanySongCell.m

@@ -10,14 +10,17 @@
 
 @interface AccompanySongCell ()
 
+@property (weak, nonatomic) IBOutlet UIView *chooseBg;
+@property (weak, nonatomic) IBOutlet UIImageView *chooseStatus;
+@property (weak, nonatomic) IBOutlet NSLayoutConstraint *chooseImgWidth;
+@property (weak, nonatomic) IBOutlet NSLayoutConstraint *Imgleft;
+
 @property (weak, nonatomic) IBOutlet UILabel *songName;
 
 @property (weak, nonatomic) IBOutlet UIButton *typeSettingButton;   // 设置伴奏/原生文件
 
 @property (nonatomic, assign) BOOL isNormal;
 
-@property (weak, nonatomic) IBOutlet UIButton *statusButton;
-
 @property (nonatomic, copy) SongActionCallback callback;
 
 @property (nonatomic, strong) ClassSongMessage *sourceModel;
@@ -52,26 +55,33 @@
         self.canChangeType = NO;
     }
     self.isNormal = !self.sourceModel.isChooseAccompany;
-    UIColor *titleColor = songMessage.isChoose ? HexRGB(0xeb6363) : HexRGB(0xffffff);
-    self.songName.textColor = titleColor;
+    if (songMessage.isChoose) {
+        self.chooseBg.hidden = NO;
+        self.chooseStatus.hidden = NO;
+        self.chooseImgWidth.constant = 12.0f;
+        self.Imgleft.constant = 8.0f;
+        self.songName.textColor = HexRGB(0x00B2A7);
+        self.songName.font = [UIFont systemFontOfSize:15.0f weight:UIFontWeightMedium];
+    }
+    else {
+        self.chooseBg.hidden = YES;
+        self.chooseStatus.hidden = YES;
+        self.chooseImgWidth.constant = 0.0f;
+        self.Imgleft.constant = 0.0f;
+        self.songName.textColor = HexRGB(0x333333);
+        self.songName.font = [UIFont systemFontOfSize:15.0f];
+    }
     [self configDownloadStatus:songMessage.downStatus];
 }
 
 - (void)configDownloadStatus:(int)downloadStatus {
-    if (downloadStatus == 0) { // 下载中
-        [self.statusButton setTitle:@"下载中" forState:UIControlStateNormal];
-        [self.statusButton setTitleColor:HexRGB(0x4EEBFF) forState:UIControlStateNormal];
-    }
-    else if (downloadStatus == 1) {  // 成功
-        [self.statusButton setTitle:@"已下载" forState:UIControlStateNormal];
-        [self.statusButton setTitleColor:HexRGB(0x8F8F8F) forState:UIControlStateNormal];
-    }
-    else {   // 失败
-        [self.statusButton setTitle:@"下载失败" forState:UIControlStateNormal];
-        [self.statusButton setTitleColor:HexRGB(0xFF5757) forState:UIControlStateNormal];
-    }
+    
 }
 
+- (void)setHideDownStatus:(BOOL)hideDownStatus {
+    _hideDownStatus = hideDownStatus;
+
+}
 
 - (IBAction)buttonAction:(UIButton *)sender {
     if (self.canChangeType) {

+ 39 - 22
KulexiuForTeacher/KulexiuForTeacher/Module/TXClassRoom/View/AccompanyDisplay/AccompanySongCell.xib

@@ -1,9 +1,9 @@
 <?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" useSafeAreas="YES" colorMatched="YES">
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="21507" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
     <device id="retina6_1" orientation="portrait" appearance="light"/>
     <dependencies>
         <deployment identifier="iOS"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21679"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21505"/>
         <capability name="Safe area layout guides" minToolsVersion="9.0"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
@@ -17,52 +17,68 @@
                 <rect key="frame" x="0.0" y="0.0" width="375" height="50"/>
                 <autoresizingMask key="autoresizingMask"/>
                 <subviews>
+                    <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="igz-Yi-WDX">
+                        <rect key="frame" x="8" y="2.5" width="359" height="45"/>
+                        <color key="backgroundColor" red="0.92549019607843142" green="0.98431372549019602" blue="0.98039215686274506" alpha="1" colorSpace="calibratedRGB"/>
+                        <constraints>
+                            <constraint firstAttribute="height" constant="45" id="IVe-HK-SST"/>
+                        </constraints>
+                        <userDefinedRuntimeAttributes>
+                            <userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
+                                <real key="value" value="6"/>
+                            </userDefinedRuntimeAttribute>
+                        </userDefinedRuntimeAttributes>
+                    </view>
+                    <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="song_playStatus" translatesAutoresizingMaskIntoConstraints="NO" id="1e4-2C-Opa">
+                        <rect key="frame" x="16" y="19.5" width="12" height="11"/>
+                        <constraints>
+                            <constraint firstAttribute="width" constant="12" id="AwD-aD-gJV"/>
+                            <constraint firstAttribute="height" constant="11" id="rMI-Yu-sxv"/>
+                        </constraints>
+                    </imageView>
                     <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="初级入门练习曲No.1" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="To4-9F-mlU">
-                        <rect key="frame" x="24" y="14" width="146" height="22"/>
+                        <rect key="frame" x="36" y="14" width="255" height="22"/>
                         <constraints>
                             <constraint firstAttribute="height" constant="22" id="cZw-h0-Qux"/>
                         </constraints>
-                        <fontDescription key="fontDescription" type="system" pointSize="16"/>
-                        <color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                        <fontDescription key="fontDescription" type="system" pointSize="15"/>
+                        <color key="textColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="calibratedRGB"/>
                         <nil key="highlightedColor"/>
                     </label>
                     <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="9Er-8P-EvS">
                         <rect key="frame" x="301" y="0.0" width="60" height="50"/>
-                        <state key="normal" image="nomalMusic_image"/>
-                        <connections>
-                            <action selector="buttonAction:" destination="KGk-i7-Jjw" eventType="touchUpInside" id="XS4-At-Tju"/>
-                        </connections>
-                    </button>
-                    <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="9mi-1n-z5X">
-                        <rect key="frame" x="221" y="10" width="75" height="30"/>
                         <constraints>
-                            <constraint firstAttribute="width" constant="75" id="LnK-WE-JWr"/>
-                            <constraint firstAttribute="height" constant="30" id="ii1-pv-Tm7"/>
+                            <constraint firstAttribute="width" constant="60" id="5Ui-AY-R5p"/>
                         </constraints>
-                        <fontDescription key="fontDescription" type="system" pointSize="14"/>
-                        <state key="normal" title="下载状态"/>
+                        <state key="normal" image="nomalMusic_image"/>
                         <connections>
-                            <action selector="displayChooseSongStatus:" destination="KGk-i7-Jjw" eventType="touchUpInside" id="Rt0-k8-0CX"/>
+                            <action selector="buttonAction:" destination="KGk-i7-Jjw" eventType="touchUpInside" id="XS4-At-Tju"/>
                         </connections>
                     </button>
                 </subviews>
                 <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                 <constraints>
+                    <constraint firstAttribute="trailing" secondItem="igz-Yi-WDX" secondAttribute="trailing" constant="8" id="7eF-yK-Vgg"/>
                     <constraint firstAttribute="trailing" secondItem="9Er-8P-EvS" secondAttribute="trailing" constant="14" id="9UK-Lb-xJ2"/>
-                    <constraint firstItem="9Er-8P-EvS" firstAttribute="leading" secondItem="9mi-1n-z5X" secondAttribute="trailing" constant="5" id="DYH-7I-knj"/>
-                    <constraint firstItem="9mi-1n-z5X" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="To4-9F-mlU" secondAttribute="trailing" constant="5" id="Ddb-Cm-r4Y"/>
+                    <constraint firstItem="1e4-2C-Opa" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="16" id="Aeb-eS-qJL"/>
+                    <constraint firstItem="igz-Yi-WDX" firstAttribute="centerY" secondItem="H2p-sc-9uM" secondAttribute="centerY" id="CLH-I7-ibM"/>
                     <constraint firstItem="9Er-8P-EvS" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" id="Iel-Pp-iWW"/>
-                    <constraint firstItem="9Er-8P-EvS" firstAttribute="centerY" secondItem="9mi-1n-z5X" secondAttribute="centerY" id="KDS-yC-fL0"/>
                     <constraint firstItem="To4-9F-mlU" firstAttribute="centerY" secondItem="H2p-sc-9uM" secondAttribute="centerY" id="KqE-1A-xvJ"/>
                     <constraint firstAttribute="bottom" secondItem="9Er-8P-EvS" secondAttribute="bottom" id="XP3-Sd-GWN"/>
-                    <constraint firstItem="To4-9F-mlU" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="24" id="vwk-Nr-R9k"/>
+                    <constraint firstItem="9Er-8P-EvS" firstAttribute="leading" secondItem="To4-9F-mlU" secondAttribute="trailing" constant="10" id="acm-8o-iV9"/>
+                    <constraint firstItem="1e4-2C-Opa" firstAttribute="centerY" secondItem="H2p-sc-9uM" secondAttribute="centerY" id="lpn-ZR-lh5"/>
+                    <constraint firstItem="To4-9F-mlU" firstAttribute="leading" secondItem="1e4-2C-Opa" secondAttribute="trailing" constant="8" id="oLP-C2-w3I"/>
+                    <constraint firstItem="igz-Yi-WDX" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="8" id="zmk-K2-DdZ"/>
                 </constraints>
             </tableViewCellContentView>
             <viewLayoutGuide key="safeArea" id="aW0-zy-SZf"/>
             <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
             <connections>
+                <outlet property="Imgleft" destination="oLP-C2-w3I" id="vtZ-GL-pie"/>
+                <outlet property="chooseBg" destination="igz-Yi-WDX" id="Kod-uv-VNU"/>
+                <outlet property="chooseImgWidth" destination="AwD-aD-gJV" id="fxP-B4-XeD"/>
+                <outlet property="chooseStatus" destination="1e4-2C-Opa" id="Wur-BS-kkK"/>
                 <outlet property="songName" destination="To4-9F-mlU" id="Cah-JN-5T5"/>
-                <outlet property="statusButton" destination="9mi-1n-z5X" id="6Yg-a8-Jyd"/>
                 <outlet property="typeSettingButton" destination="9Er-8P-EvS" id="h4r-jh-QLE"/>
             </connections>
             <point key="canvasLocation" x="132.60869565217394" y="77.678571428571431"/>
@@ -70,5 +86,6 @@
     </objects>
     <resources>
         <image name="nomalMusic_image" width="60" height="23"/>
+        <image name="song_playStatus" width="12" height="11"/>
     </resources>
 </document>

+ 0 - 2
KulexiuForTeacher/KulexiuForTeacher/Module/TXClassRoom/View/AccompanyDisplay/AccompanyView.h

@@ -7,7 +7,6 @@
 //
 
 #import <UIKit/UIKit.h>
-#import "KSNormalAlertView.h"
 
 typedef NS_ENUM(NSInteger, ACCOMPANYACTION) {
     ACCOMPANYACTION_ADDSONG,      // 添加伴奏
@@ -36,7 +35,6 @@ NS_ASSUME_NONNULL_BEGIN
 
 @property (nonatomic, strong) UIButton *playButton;
 
-@property (nonatomic, strong) KSNormalAlertView *alertView;
 
 @property (nonatomic, assign) BOOL hideDownloadStatus;
 

+ 8 - 5
KulexiuForTeacher/KulexiuForTeacher/Module/TXClassRoom/View/AccompanyDisplay/AccompanyView.m

@@ -74,7 +74,7 @@
     }];
     
     UILabel *titleLabel = [[UILabel alloc] init];
-    titleLabel.text = @"伴奏播放";
+    titleLabel.text = @"音频";
     titleLabel.textColor = HexRGB(0x131415);
     titleLabel.font = [UIFont systemFontOfSize:17.0f weight:UIFontWeightSemibold];
     [topView addSubview:titleLabel];
@@ -100,9 +100,10 @@
     [volumeBtn addTarget:self action:@selector(volumeSlideAction) forControlEvents:UIControlEventTouchUpInside];
     [topView addSubview:volumeBtn];
     [volumeBtn mas_makeConstraints:^(MASConstraintMaker *make) {
-        make.width.height.mas_equalTo(48);
+        make.width.mas_equalTo(30);
+        make.height.mas_equalTo(48);
         make.top.mas_equalTo(topView);
-        make.right.mas_equalTo(topView.mas_right).offset(-5);
+        make.right.mas_equalTo(topView.mas_right).offset(-14);
     }];
     
     // 添加伴奏
@@ -111,7 +112,8 @@
     [addButton addTarget:self action:@selector(addSongAction) forControlEvents:UIControlEventTouchUpInside];
     [topView addSubview:addButton];
     [addButton mas_makeConstraints:^(MASConstraintMaker *make) {
-        make.width.height.mas_equalTo(48);
+        make.width.mas_equalTo(30);
+        make.height.mas_equalTo(48);
         make.top.mas_equalTo(topView);
         make.right.mas_equalTo(volumeBtn.mas_left).offset(-5);
     }];
@@ -223,7 +225,7 @@
                     for (ClassSongMessage *memberSong in member.songMessage) {
                         
                         if (memberSong.musicScoreAccompanimentId == songId) {
-                            if (memberSong.downStatus == 2) { // 下载失败
+                            if (memberSong.downStatus) { // 下载失败
                                 isFailed = YES;
                             }
                             else if (memberSong.downStatus == 0) { // 下载中
@@ -453,6 +455,7 @@
 - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
     ClassSongMessage *songModel = self.songArray[indexPath.row];
     AccompanySongCell *cell = [tableView dequeueReusableCellWithIdentifier:@"AccompanySongCell"];
+    cell.hideDownStatus = self.hideDownloadStatus;
     MJWeakSelf;
     [cell configCellWithSource:songModel callback:^(SongAction action, ClassSongMessage * _Nonnull songMessage) {
         [weakSelf downloadAction:action source:songMessage indexPath:indexPath];

+ 3 - 0
KulexiuForTeacher/KulexiuForTeacher/Module/TXClassRoom/View/ClassroomTitleView/TXClassTitleView.m

@@ -396,6 +396,9 @@
     if (isDisplay) {
         [self displayView];
     }
+    else {
+        [self hiddenView];
+    }
 }
 
 - (void)openSettingView {

+ 4 - 4
KulexiuForTeacher/KulexiuForTeacher/Module/TXClassRoom/View/CoursewareView/CoursewareAlertCell.xib

@@ -1,9 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="21225" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="21701" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
     <device id="retina6_0" orientation="portrait" appearance="light"/>
     <dependencies>
         <deployment identifier="iOS"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21207"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21679"/>
         <capability name="Safe area layout guides" minToolsVersion="9.0"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
@@ -35,7 +35,7 @@
                             <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="第一期课件8-01.MP3" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="45A-8v-3ET">
                                 <rect key="frame" x="58" y="27" width="276" height="20"/>
                                 <fontDescription key="fontDescription" type="system" pointSize="16"/>
-                                <color key="textColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                <color key="textColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                                 <nil key="highlightedColor"/>
                             </label>
                             <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="unchoose_image" translatesAutoresizingMaskIntoConstraints="NO" id="hpI-3r-2Pz">
@@ -46,7 +46,7 @@
                                 </constraints>
                             </imageView>
                         </subviews>
-                        <color key="backgroundColor" red="0.31764705882352939" green="0.30980392156862746" blue="0.37254901960784315" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                        <color key="backgroundColor" red="0.94901960784313721" green="0.94901960784313721" blue="0.94901960784313721" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                         <constraints>
                             <constraint firstItem="hpI-3r-2Pz" firstAttribute="centerY" secondItem="Bwp-dr-mtN" secondAttribute="centerY" id="VrC-YM-icG"/>
                             <constraint firstItem="hpI-3r-2Pz" firstAttribute="leading" secondItem="45A-8v-3ET" secondAttribute="trailing" constant="10" id="ZQk-5C-LND"/>

+ 1 - 1
KulexiuForTeacher/KulexiuForTeacher/Module/TXClassRoom/View/CoursewareView/CoursewareAlertView.h

@@ -9,7 +9,7 @@
 
 NS_ASSUME_NONNULL_BEGIN
 
-typedef void(^ChooseMusicCallback)(NSString *musicUrl, NSString *musicName);
+typedef void(^ChooseMusicCallback)(NSString *musicUrl, NSString *musicName, NSString *songId);
 
 typedef void(^ChooseImageCallback)(NSString *musicImages);
 

+ 2 - 1
KulexiuForTeacher/KulexiuForTeacher/Module/TXClassRoom/View/CoursewareView/CoursewareAlertView.m

@@ -52,6 +52,7 @@
 
 + (instancetype)shareInstance {
     CoursewareAlertView *view = [[[NSBundle mainBundle] loadNibNamed:@"CoursewareAlertView" owner:nil options:nil] firstObject];
+    view.frame = CGRectMake(0, 0, KLandscapeWidth, KLandscapeHeight);
     return view;
 }
 
@@ -229,7 +230,7 @@
 - (IBAction)sureAction:(id)sender {
     if (self.callback) {
         CoursewareListModel *lastModel = self.sourceArray[self.lastChooseIndex];
-        self.callback(lastModel.mp3url, lastModel.musicSheetName);
+        self.callback(lastModel.mp3url, lastModel.musicSheetName, [NSString stringWithFormat:@"%.0f",lastModel.musicSheetId]);
     }
     
     if (self.imageCallback) {

+ 22 - 15
KulexiuForTeacher/KulexiuForTeacher/Module/TXClassRoom/View/CoursewareView/CoursewareAlertView.xib

@@ -1,9 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="21225" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
+<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_0" orientation="portrait" appearance="light"/>
     <dependencies>
         <deployment identifier="iOS"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21207"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21679"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
     <objects>
@@ -22,7 +22,7 @@
                                 <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="我的课件" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Ovf-8k-LcX">
                                     <rect key="frame" x="13" y="13.666666666666664" width="66" height="20"/>
                                     <fontDescription key="fontDescription" type="system" weight="semibold" pointSize="16"/>
-                                    <color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                                    <color key="textColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="calibratedRGB"/>
                                     <nil key="highlightedColor"/>
                                 </label>
                                 <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="VuV-HT-4i3">
@@ -32,13 +32,13 @@
                                         <constraint firstAttribute="width" constant="44" id="S6X-lw-Ej9"/>
                                     </constraints>
                                     <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
-                                    <state key="normal" image="cancle_white"/>
+                                    <state key="normal" image="cancle_black"/>
                                     <connections>
                                         <action selector="cancleAction:" destination="iN0-l3-epB" eventType="touchUpInside" id="8Zz-3t-RTl"/>
                                     </connections>
                                 </button>
                             </subviews>
-                            <color key="backgroundColor" red="0.31764705882352939" green="0.30980392156862746" blue="0.37254901960784315" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                            <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                             <constraints>
                                 <constraint firstAttribute="trailing" secondItem="VuV-HT-4i3" secondAttribute="trailing" constant="5" id="8tW-Xt-JmG"/>
                                 <constraint firstItem="Ovf-8k-LcX" firstAttribute="leading" secondItem="cEX-Ks-dIJ" secondAttribute="leading" constant="13" id="Hj9-i6-dCd"/>
@@ -53,7 +53,7 @@
                                 <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="bQ5-at-sgo">
                                     <rect key="frame" x="0.0" y="10" width="349" height="34"/>
                                     <subviews>
-                                        <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="search_grey" translatesAutoresizingMaskIntoConstraints="NO" id="wKj-5J-6KL">
+                                        <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="search_green" translatesAutoresizingMaskIntoConstraints="NO" id="wKj-5J-6KL">
                                             <rect key="frame" x="12" y="9" width="16" height="16"/>
                                             <constraints>
                                                 <constraint firstAttribute="width" constant="16" id="3uK-qp-feq"/>
@@ -70,7 +70,7 @@
                                         </view>
                                         <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="YYe-GB-O17">
                                             <rect key="frame" x="296" y="5" width="48" height="24"/>
-                                            <color key="backgroundColor" red="0.20784313725490194" green="0.20392156862745098" blue="0.24313725490196078" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                            <color key="backgroundColor" red="0.1764705882352941" green="0.7803921568627451" blue="0.66666666666666663" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                                             <constraints>
                                                 <constraint firstAttribute="width" constant="48" id="LrK-VO-FkC"/>
                                                 <constraint firstAttribute="height" constant="24" id="NeA-i5-BQs"/>
@@ -94,7 +94,7 @@
                                             <textInputTraits key="textInputTraits"/>
                                         </textField>
                                     </subviews>
-                                    <color key="backgroundColor" red="0.31764705879999999" green="0.30980392159999998" blue="0.37254901959999998" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                    <color key="backgroundColor" red="0.94901960784313721" green="0.94901960784313721" blue="0.94901960784313721" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                                     <constraints>
                                         <constraint firstItem="YYe-GB-O17" firstAttribute="leading" secondItem="aS4-Jh-TVC" secondAttribute="trailing" constant="15" id="Baa-w1-tgg"/>
                                         <constraint firstItem="aS4-Jh-TVC" firstAttribute="top" secondItem="bQ5-at-sgo" secondAttribute="top" id="Ko8-aA-2ny"/>
@@ -133,7 +133,9 @@
                                     </constraints>
                                     <fontDescription key="fontDescription" type="system" pointSize="14"/>
                                     <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
-                                    <state key="normal" title="取消"/>
+                                    <state key="normal" title="取消">
+                                        <color key="titleColor" red="0.1764705882" green="0.78039215689999997" blue="0.66666666669999997" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                    </state>
                                     <userDefinedRuntimeAttributes>
                                         <userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
                                             <real key="value" value="4"/>
@@ -142,7 +144,7 @@
                                             <real key="value" value="1"/>
                                         </userDefinedRuntimeAttribute>
                                         <userDefinedRuntimeAttribute type="color" keyPath="borderColor">
-                                            <color key="value" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                            <color key="value" red="0.1764705882352941" green="0.7803921568627451" blue="0.66666666666666663" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                                         </userDefinedRuntimeAttribute>
                                     </userDefinedRuntimeAttributes>
                                     <connections>
@@ -151,7 +153,7 @@
                                 </button>
                                 <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Sfr-FX-3xp">
                                     <rect key="frame" x="193.66666666666669" y="12" width="169.33333333333331" height="34"/>
-                                    <color key="backgroundColor" red="0.396078431372549" green="0.38823529411764707" blue="0.46274509803921571" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                    <color key="backgroundColor" red="0.1764705882352941" green="0.7803921568627451" blue="0.66666666666666663" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                                     <constraints>
                                         <constraint firstAttribute="height" constant="34" id="Mqb-RV-Mcw"/>
                                     </constraints>
@@ -168,7 +170,7 @@
                                     </connections>
                                 </button>
                             </subviews>
-                            <color key="backgroundColor" red="0.20784313725490194" green="0.20392156862745098" blue="0.24313725490196078" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                            <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                             <constraints>
                                 <constraint firstItem="dbh-R3-fsd" firstAttribute="leading" secondItem="xdK-Q2-bVX" secondAttribute="leading" constant="12" id="VCa-5F-Sj9"/>
                                 <constraint firstItem="Sfr-FX-3xp" firstAttribute="leading" secondItem="dbh-R3-fsd" secondAttribute="trailing" constant="12" id="Xjd-oB-kFd"/>
@@ -184,7 +186,7 @@
                             <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                         </view>
                     </subviews>
-                    <color key="backgroundColor" red="0.20784313725490194" green="0.20392156862745098" blue="0.24313725490196078" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                    <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                     <constraints>
                         <constraint firstAttribute="trailing" secondItem="xdK-Q2-bVX" secondAttribute="trailing" id="1D3-Ug-yIk"/>
                         <constraint firstItem="cEX-Ks-dIJ" firstAttribute="top" secondItem="e2w-pY-a9i" secondAttribute="top" id="1ox-fB-HNx"/>
@@ -201,6 +203,11 @@
                         <constraint firstItem="eer-ey-gVa" firstAttribute="top" secondItem="cEX-Ks-dIJ" secondAttribute="bottom" id="fUn-Yp-92J"/>
                         <constraint firstItem="eer-ey-gVa" firstAttribute="leading" secondItem="e2w-pY-a9i" secondAttribute="leading" constant="14" id="lni-td-Yef"/>
                     </constraints>
+                    <userDefinedRuntimeAttributes>
+                        <userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
+                            <real key="value" value="10"/>
+                        </userDefinedRuntimeAttribute>
+                    </userDefinedRuntimeAttributes>
                 </view>
             </subviews>
             <color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.5" colorSpace="custom" customColorSpace="sRGB"/>
@@ -220,7 +227,7 @@
         </view>
     </objects>
     <resources>
-        <image name="cancle_white" width="16" height="15"/>
-        <image name="search_grey" width="16" height="16"/>
+        <image name="cancle_black" width="18" height="18"/>
+        <image name="search_green" width="15" height="16"/>
     </resources>
 </document>

+ 4 - 1
KulexiuForTeacher/KulexiuForTeacher/Module/TXClassRoom/View/DanMuChat/TXDanMuView.m

@@ -9,6 +9,7 @@
 #import "TXDanMuView.h"
 #import "TXDanChatCell.h"
 #import "TXDanBottomView.h"
+#import "ClassroomService.h"
 
 @interface TXDanMuView ()<UITableViewDelegate, UITableViewDataSource,UIScrollViewDelegate,KSDanInputBarControlDelegate>
 
@@ -155,8 +156,10 @@
 }
 
 - (TXClassroomUserInfo *)getCurrentUser {
+    NSString *currentUserID = [ClassroomService sharedService].currentRoom.currentMemberId;
+
     TXClassroomUserInfo *user = [[TXClassroomUserInfo alloc] init];
-    user.sendUserId = UserDefault(UIDKey);
+    user.sendUserId = currentUserID;
     user.sendUserName = UserDefault(NicknameKey);
     user.avatarUrl = UserDefault(AvatarUrlKey);
     return user;

+ 22 - 19
KulexiuForTeacher/KulexiuForTeacher/Module/TXClassRoom/View/MemberList/ClassMemberListView.m

@@ -49,16 +49,29 @@
         self.backgroundColor = [UIColor whiteColor];
         self.layer.cornerRadius = 20;
         self.layer.maskedCorners = kCALayerMinXMinYCorner | kCALayerMinXMaxYCorner;
-        _titles = @[@"在线成员",@"未进入成员"];
+        [self configTitles];
         [self configUI];
         [self getGroupAttrInfo];
-        [self addNotifer];
     }
     return self;
 }
 
-- (void)addNotifer {
-    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didReceiveGroupMessage:)  name:OnReceiveTXClassroomGroupNotification object:nil];
+- (NSInteger)getOnlineMemberCount {
+    NSInteger count = 0;
+    NSArray *tempArray = [ClassroomService sharedService].currentRoom.memberList;
+    for (RoomMember *member in tempArray) {
+        if (member.role == RoleStudent) {
+            count++;
+        }
+    }
+    return count;
+}
+
+- (void)configTitles{
+    NSInteger inClassCount = [self getOnlineMemberCount];
+    NSString *leftTitle = [NSString stringWithFormat:@"在线成员(%zd)",inClassCount];
+    NSString *rightTitle = [NSString stringWithFormat:@"未进入成员(%zd)", ([ClassroomService sharedService].currentRoom.studentNums - inClassCount)];
+    _titles = @[leftTitle,rightTitle];
 
 }
 
@@ -104,7 +117,6 @@
     self.categoryView.listContainer = (id<JXCategoryViewListContainer>)self.pagerView.listContainerView;
     self.pagerView.listContainerView.listCellBackgroundColor = [UIColor clearColor];
     [self addSubview:self.pagerView];
-    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(refreshHeadTitle:) name:@"RefreshClassroomMember" object:nil];
 }
 
 - (void)getGroupAttrInfo {
@@ -130,21 +142,12 @@
     return [[JXPagerListRefreshView alloc] initWithDelegate:self];
 }
 
-- (void)refreshHeadTitle:(NSNotification *)notification {
-    id count = notification.object;
-    if ([count isMemberOfClass:[NSNumber class]]) {
-        NSInteger absentCount = [count integerValue];
-        self.absentCount = absentCount;
-    }
-    
-}
-
 - (void)refresh {
-    NSString *leftTitle = [NSString stringWithFormat:@"在线成员(%zd)",[ClassroomService sharedService].currentRoom.memberList.count];
-    NSString *rightTitle = [NSString stringWithFormat:@"未进入成员(%zd)", self.absentCount];
-    self.titles = @[leftTitle,rightTitle];
-    [self.categoryView reloadData];
-    
+    NSInteger inClassCount = [self getOnlineMemberCount];
+    NSString *leftTitle = [NSString stringWithFormat:@"在线成员(%zd)",inClassCount];
+    NSString *rightTitle = [NSString stringWithFormat:@"未进入成员(%zd)", ([ClassroomService sharedService].currentRoom.studentNums - inClassCount)];
+    _titles = @[leftTitle,rightTitle];
+    [self.pagerView reloadData];
 }
 
 - (void)reloadPersonList {

+ 2 - 2
KulexiuForTeacher/KulexiuForTeacher/Module/TXClassRoom/View/MemberList/ClassMemberSettingView.m

@@ -48,10 +48,10 @@
     _cancelMuteFlag = cancelMuteFlag;
     NSString *imageName = nil;
     if (cancelMuteFlag) {
-        imageName = @"switch on";
+        imageName = @"switch_on";
     }
     else {
-        imageName = @"switch off";
+        imageName = @"switch_off";
     }
     [self.micCtrlButton setImage:[UIImage imageNamed:imageName] forState:UIControlStateNormal];
 }

+ 3 - 3
KulexiuForTeacher/KulexiuForTeacher/Module/TXClassRoom/View/MemberList/ClassMemberSettingView.xib

@@ -31,7 +31,7 @@
                                         <action selector="backAction:" destination="iN0-l3-epB" eventType="touchUpInside" id="C1I-7A-XiN"/>
                                     </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="cob-dL-XDX">
+                                <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="课堂设置" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="cob-dL-XDX">
                                     <rect key="frame" x="161.66666666666666" y="13.666666666666664" width="70" height="21"/>
                                     <fontDescription key="fontDescription" type="system" weight="semibold" pointSize="17"/>
                                     <color key="textColor" red="0.074509803920000006" green="0.078431372550000003" blue="0.08235294118" alpha="1" colorSpace="calibratedRGB"/>
@@ -64,7 +64,7 @@
                                         <constraint firstAttribute="height" constant="40" id="sdh-oU-gm4"/>
                                     </constraints>
                                     <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
-                                    <state key="normal" image="switch on"/>
+                                    <state key="normal" image="switch_on"/>
                                     <connections>
                                         <action selector="micAction:" destination="iN0-l3-epB" eventType="touchUpInside" id="EKk-Jd-2xu"/>
                                     </connections>
@@ -120,7 +120,7 @@
     </objects>
     <resources>
         <image name="back_black" width="12" height="20"/>
-        <image name="switch on" width="39" height="20"/>
+        <image name="switch_on" width="47" height="24"/>
         <systemColor name="systemBackgroundColor">
             <color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
         </systemColor>

+ 0 - 1
KulexiuForTeacher/KulexiuForTeacher/Module/TXClassRoom/View/MemberList/MemberListBodyView.m

@@ -91,7 +91,6 @@
         [[ClassroomService sharedService] queryNoJoinRoomList:^(NSArray<RoomMember *> * _Nullable memberList) {
             self.absentStudentArray = [NSMutableArray arrayWithArray:memberList];
             [self.tableView reloadData];
-            [[NSNotificationCenter defaultCenter] postNotificationName:@"RefreshClassroomMember" object:@(self.absentStudentArray.count)];
         }];
     }
 }

+ 2 - 2
KulexiuForTeacher/KulexiuForTeacher/Module/TXClassRoom/View/MemberList/MemberListCell.xib

@@ -17,7 +17,7 @@
                 <rect key="frame" x="0.0" y="0.0" width="320" height="50"/>
                 <autoresizingMask key="autoresizingMask"/>
                 <subviews>
-                    <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="student_logo" translatesAutoresizingMaskIntoConstraints="NO" id="ojL-FB-WJJ">
+                    <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="user_default_avatal" translatesAutoresizingMaskIntoConstraints="NO" id="ojL-FB-WJJ">
                         <rect key="frame" x="10" y="5" width="40" height="40"/>
                         <constraints>
                             <constraint firstAttribute="height" constant="40" id="w92-Ae-u7g"/>
@@ -108,6 +108,6 @@
         <image name="classMember_cameroOn" width="23" height="23"/>
         <image name="classMember_micOn" width="23" height="23"/>
         <image name="handup_image" width="24" height="24"/>
-        <image name="student_logo" width="42" height="42"/>
+        <image name="user_default_avatal" width="52" height="52"/>
     </resources>
 </document>

+ 7 - 2
KulexiuForTeacher/KulexiuForTeacher/Module/TXClassRoom/View/TXChatAreaView/TXChatAreaView.m

@@ -12,6 +12,7 @@
 #import "TxClassroomChatMineCell.h"
 #import "TXChatAreaTopView.h"
 #import "TXChatBottomView.h"
+#import "ClassroomService.h"
 
 @interface TXChatAreaView ()<UITableViewDelegate, UITableViewDataSource,UIScrollViewDelegate,InputBarControlDelegate>
 
@@ -168,8 +169,10 @@
 }
 
 - (TXClassroomUserInfo *)getCurrentUser {
+    NSString *currentUserID = [ClassroomService sharedService].currentRoom.currentMemberId;
+
     TXClassroomUserInfo *user = [[TXClassroomUserInfo alloc] init];
-    user.sendUserId = UserDefault(UIDKey);
+    user.sendUserId = currentUserID;
     user.sendUserName = UserDefault(NicknameKey);
     user.avatarUrl = UserDefault(AvatarUrlKey);
     return user;
@@ -226,8 +229,10 @@
     return self.dataSource.count;
 }
 - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
+    NSString *currentUserID = [ClassroomService sharedService].currentRoom.currentMemberId;
+
     TXClassroomTextMsg *textMsg = self.dataSource[indexPath.row];
-    if ([textMsg.userInfo.sendUserId isEqualToString:UserDefault(UIDKey)]) {
+    if ([textMsg.userInfo.sendUserId isEqualToString:currentUserID]) {
         TxClassroomChatMineCell *cell = [tableView dequeueReusableCellWithIdentifier:@"TxClassroomChatMineCell"];
         [cell setModel:textMsg];
         return cell;