소스 검색

开打聊天界面时,双击聊天按钮滑动到列表中未读消息

Steven 2 년 전
부모
커밋
7cf745edb5
23개의 변경된 파일231개의 추가작업 그리고 50개의 파일을 삭제
  1. 2 0
      KulexiuForStudent/KulexiuForStudent/AppDelegate.h
  2. 9 0
      KulexiuForStudent/KulexiuForStudent/AppDelegate.m
  3. 61 1
      KulexiuForStudent/KulexiuForStudent/Common/Base/KSAccompanyWebViewController.m
  4. 1 0
      KulexiuForStudent/KulexiuForStudent/Common/Base/KSNetworkingManager.m
  5. 2 0
      KulexiuForStudent/KulexiuForStudent/Common/Base/KSTabBarViewController.h
  6. 27 0
      KulexiuForStudent/KulexiuForStudent/Common/Base/KSTabBarViewController.m
  7. 3 3
      KulexiuForStudent/KulexiuForStudent/Common/KSImageShareViewController.m
  8. 13 0
      KulexiuForStudent/KulexiuForStudent/Module/Chat/Controller/ChatViewController.m
  9. 3 0
      KulexiuForStudent/KulexiuForStudent/Module/Chat/Controller/KSChatListViewController.h
  10. 49 5
      KulexiuForStudent/KulexiuForStudent/Module/Chat/Controller/KSChatListViewController.m
  11. 1 1
      KulexiuForStudent/KulexiuForStudent/Module/Chat/Group/View/GroupMemberListCell.m
  12. 33 15
      KulexiuForStudent/KulexiuForStudent/Module/Home/Controller/HomeViewController.m
  13. 1 1
      KulexiuForStudent/KulexiuForStudent/Module/Home/View/HomeNewMusic/HomeNewMusicView.m
  14. 4 4
      KulexiuForStudent/KulexiuForStudent/Module/Home/View/HomeNewMusic/HomeNewMusicView.xib
  15. 1 1
      KulexiuForStudent/KulexiuForStudent/Module/Home/View/HomeRecommendMusic/HomeRecommendMusicView.m
  16. 5 5
      KulexiuForStudent/KulexiuForStudent/Module/Home/View/HomeRecommendMusic/HomeRecommendMusicView.xib
  17. 1 1
      KulexiuForStudent/KulexiuForStudent/Module/Home/View/HotMusic/HomeHotMusicView.m
  18. 4 4
      KulexiuForStudent/KulexiuForStudent/Module/Home/View/HotMusic/HomeHotMusicView.xib
  19. 1 1
      KulexiuForStudent/KulexiuForStudent/Module/Live/View/SeatContentView.m
  20. 7 0
      KulexiuForStudent/KulexiuForStudent/Module/Login/Model/UserInfoManager.m
  21. 1 1
      KulexiuForStudent/KulexiuForStudent/Module/SealClass/Services/Classroom/Message/MemberChangeMessage.m
  22. 1 6
      KulexiuForStudent/KulexiuForStudent/Module/Widget/Controller/ToneTuningViewController.m
  23. 1 1
      KulexiuForStudent/KulexiuForStudent/Module/Widget/Model/TuningFunction/Tuner.swift

+ 2 - 0
KulexiuForStudent/KulexiuForStudent/AppDelegate.h

@@ -34,5 +34,7 @@
 
 - (void)handleNotiferSource;
 
+- (void)displayUnreadMessageCount;
+
 @end
 

+ 9 - 0
KulexiuForStudent/KulexiuForStudent/AppDelegate.m

@@ -175,6 +175,15 @@
     [self versionCheck];
 }
 
+- (void)displayUnreadMessageCount {
+    int unreadMsgCount = [[RCIMClient sharedRCIMClient] getUnreadCount:@[ @(ConversationType_PRIVATE),@(ConversationType_APPSERVICE), @(ConversationType_GROUP),@(ConversationType_SYSTEM)
+    ]];
+    if (unreadMsgCount >= 1) {
+        [self.tabBarController noteNewsWithIndex:2 count:unreadMsgCount];
+    } else {
+        [self.tabBarController clearNewsWithIndex:2];
+    }
+}
 
 - (void)registerSDK {
     NSString *universalLinkUrl = [NSString stringWithFormat:@"%@%@",hostURL,@"/studentApp/"];

+ 61 - 1
KulexiuForStudent/KulexiuForStudent/Common/Base/KSAccompanyWebViewController.m

@@ -18,8 +18,9 @@
 #import "AccompanyLoadingView.h"
 
 #define KSMidiSongFileKey (@"KSDownloadMidiSong")
+#import "KulexiuForStudent-swift.h"
 
-@interface KSAccompanyWebViewController ()<KSAQRecordManagerDelegate,KSAudioSessionManagerDelegate,PlayerEngineDelegate>
+@interface KSAccompanyWebViewController ()<KSAQRecordManagerDelegate,KSAudioSessionManagerDelegate,PlayerEngineDelegate,TunerDelegate>
 
 @property (nonatomic, strong) KSAudioSessionManager *audioSessionManager;
 
@@ -69,6 +70,10 @@
 
 @property (nonatomic, strong) AccompanyLoadingView *loadingView;
 
+@property (nonatomic, assign) BOOL isTunerRuning;
+
+@property (nonatomic, strong) Tuner *tuner;
+
 @end
 
 @implementation KSAccompanyWebViewController
@@ -651,6 +656,19 @@
                     [self removeCustomLoadingView];
                 }
             }
+            
+            else if ([[parm stringValueForKey:@"api"] isEqualToString:@"cloudToggleFollow"]) { // 跟音
+                NSDictionary *content = [parm dictionaryValueForKey:@"content"];
+                NSString *status = [content stringValueForKey:@"state"];
+                if ([status isEqualToString:@"start"]) { // 开始
+                    [self startTuner];
+                }
+                else if ([status isEqualToString:@"end"]) { // 结束
+                    [self stopTuner];
+                }
+            }
+            
+            
             else {
                 [super handleScriptMessageSource:parm];
             }
@@ -1118,6 +1136,48 @@
 - (void)removeCustomLoadingView {
     [self.loadingView stopLoading];
 }
+
+
+
+#pragma mark ----- 跟音模块
+- (void)startTuner {
+    if (self.isTunerRuning == NO) {
+        self.isTunerRuning = YES;
+        [self.tuner start];
+    }
+}
+
+- (void)stopTuner {
+    if (self.isTunerRuning) {
+        self.isTunerRuning = NO;
+        [self.tuner stop];
+    }
+}
+
+- (Tuner *)tuner {
+    if (!_tuner) {
+        _tuner = [[Tuner alloc] initWithThreshold:0 smoothing:0.25];
+        _tuner.delegate = self;
+    }
+    return _tuner;
+}
+
+- (void)tunerDidUpdate:(Tuner *)tuner output:(TunerOutput *)output {
+    if (output.amplitude < 0.01) {
+        
+    }
+    else {
+        // 回调频率
+        NSDictionary *parm = @{
+            @"api" : @"cloudFollowTime",
+            @"content" : @{@"frequency" : [NSNumber numberWithDouble:output.frequency]}
+        };
+        [self postMessage:parm];
+    }
+    NSLog(@"-------- %@%zd --- distance :%f frequence : %f" , output.pitch, output.octave, output.distance, output.frequency);
+    
+}
+
 /*
 #pragma mark - Navigation
 

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

@@ -761,6 +761,7 @@
     [parm setValue:gender forKey:@"gender"];
     [parm setValue:username forKey:@"username"];
     [parm setValue:birthdate forKey:@"birthdate"];
+    [parm setValue:@"STUDENT" forKey:@"clientType"];
     [self request:post andWithUrl:url and:parm success:success faliure:faliure];
 }
 

+ 2 - 0
KulexiuForStudent/KulexiuForStudent/Common/Base/KSTabBarViewController.h

@@ -7,6 +7,8 @@
 
 #import <UIKit/UIKit.h>
 
+#define CHATVIEW_REFRESH (@"chatViewRefresh")
+
 NS_ASSUME_NONNULL_BEGIN
 
 @interface KSTabBarViewController : UITabBarController

+ 27 - 0
KulexiuForStudent/KulexiuForStudent/Common/Base/KSTabBarViewController.m

@@ -105,7 +105,13 @@
 
 
 #pragma mark ----- UITabBarControllerDelegate
+
 - (void)tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController {
+    BOOL isDoubleClick = [self checkIsDoubleClick:viewController];
+    if ([viewController isEqual:[tabBarController.viewControllers objectAtIndex:2]] && isDoubleClick) {
+        [[NSNotificationCenter defaultCenter] postNotificationName:CHATVIEW_REFRESH object:nil];
+    }
+    
     [self setAnaimationWithTabBarController:tabBarController selectViewController:viewController];
 }
 - (void)setAnaimationWithTabBarController:(UITabBarController *)tabBarController selectViewController:(UIViewController *)viewController {
@@ -128,6 +134,27 @@
 }
 
 
+- (BOOL)checkIsDoubleClick:(UIViewController *)viewController {
+
+    static UIViewController *lastViewController = nil;
+    static NSTimeInterval lastClickTime = 0;
+    if (lastViewController != viewController) {
+        
+        lastViewController = viewController;
+        lastClickTime = [NSDate timeIntervalSinceReferenceDate];
+        return NO;
+    }
+    NSTimeInterval clickTime = [NSDate timeIntervalSinceReferenceDate];
+    if (clickTime - lastClickTime > 0.5) {
+        
+        lastClickTime = clickTime;
+        return NO;
+    }
+    lastViewController = nil;
+    lastClickTime = 0;
+    return YES;
+}
+
 /*
 #pragma mark - Navigation
 

+ 3 - 3
KulexiuForStudent/KulexiuForStudent/Common/KSImageShareViewController.m

@@ -50,13 +50,13 @@
     [self.scrollView removeFromSuperview];
     self.view.backgroundColor = HexRGB(0xf6f8f9);
     [self.view addSubview:self.headView];
-    self.headView.frame = CGRectMake(0, 0, kScreenWidth, 100);
+    self.headView.frame = CGRectMake(0, 0, KPortraitWidth, 100);
     MJWeakSelf;
     [self.headView chatAddressbookAction:^(CHATADDRESSTYPE type, NSString * _Nullable searchKey) {
         [weakSelf topViewAction:type search:searchKey];
     }];
     
-    _categoryView = [[JXCategoryTitleView alloc] initWithFrame:CGRectMake(0, 100, kScreenWidth, 10)];
+    _categoryView = [[JXCategoryTitleView alloc] initWithFrame:CGRectMake(0, 100, KPortraitWidth, 10)];
     _categoryView.backgroundColor = HexRGB(0xf6f8f9);
     self.categoryView.titles = self.titles;
     self.categoryView.delegate = self;
@@ -67,7 +67,7 @@
     self.categoryView.titleColorGradientEnabled = YES;
     self.categoryView.hidden = YES;
     _pagerView = [self preferredPagingView];
-    self.pagerView.frame = CGRectMake(0, 100, kScreenWidth, kScreenHeight - kNaviBarHeight-100 - kTabBarHeight);
+    self.pagerView.frame = CGRectMake(0, 100, KPortraitWidth, KPortraitHeight - kNaviBarHeight-100 - kTabBarHeight);
     self.pagerView.listContainerView.categoryNestPagingEnabled = YES;
     self.pagerView.mainTableView.gestureDelegate = self;
     self.pagerView.backgroundColor = [UIColor clearColor];

+ 13 - 0
KulexiuForStudent/KulexiuForStudent/Module/Chat/Controller/ChatViewController.m

@@ -10,6 +10,7 @@
 #import "CreateFansGroupViewController.h"
 #import "ChatAddressViewController.h"
 #import "KSChatListViewController.h"
+#import "KSTabBarViewController.h"
 
 @interface ChatViewController ()<JXCategoryViewDelegate>
 
@@ -19,6 +20,8 @@
 
 @property (nonatomic, assign) NSInteger currentIndex;
 
+@property (nonatomic, strong) KSChatListViewController *chatListCtrl;
+
 @end
 
 @implementation ChatViewController
@@ -29,8 +32,16 @@
     self.ks_prefersNavigationBarHidden = YES;
     self.titles = @[@"聊天", @"联系人"];
     [self configUI];
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(refreshChatList) name:CHATVIEW_REFRESH object:nil];
 }
 
+- (void)refreshChatList {
+    if (self.chatListCtrl) {
+        [self.chatListCtrl refreshChatListMessage];
+    }
+}
+
+
 - (void)configUI {
     [self.scrollView removeFromSuperview];
     [self.view addSubview:self.navView];
@@ -102,6 +113,8 @@
 
     if (index == 0) {
         KSChatListViewController *listVC = [[KSChatListViewController alloc] init];
+        listVC.view.frame = CGRectMake(0, 0, KPortraitWidth, KPortraitHeight - kNaviBarHeight - kTabBarHeight);
+        self.chatListCtrl = listVC;
         return listVC;
     }
     else {

+ 3 - 0
KulexiuForStudent/KulexiuForStudent/Module/Chat/Controller/KSChatListViewController.h

@@ -20,6 +20,9 @@ NS_ASSUME_NONNULL_BEGIN
 @property (nonatomic, strong) JXPagerView *pagerView;
 @property (nonatomic, strong, readonly) JXCategoryTitleView *categoryView;
 
+
+- (void)refreshChatListMessage;
+
 @end
 
 NS_ASSUME_NONNULL_END

+ 49 - 5
KulexiuForStudent/KulexiuForStudent/Module/Chat/Controller/KSChatListViewController.m

@@ -23,6 +23,53 @@
 
 @implementation KSChatListViewController
 
+- (void)refreshChatListMessage {
+    NSArray *visiableIndexArray = self.conversationListTableView.indexPathsForVisibleRows;
+    if (visiableIndexArray.count) {
+        NSIndexPath *firstIndexPath = [visiableIndexArray firstObject];
+
+        NSInteger firstIndex = firstIndexPath.row;
+        if ([self isAtTheBottomOfTableView]) {
+            NSIndexPath *indexPath = [NSIndexPath indexPathForRow:0 inSection:0];
+            [self.conversationListTableView scrollToRowAtIndexPath:indexPath atScrollPosition:UITableViewScrollPositionTop animated:YES];
+        }
+        else {
+            for (NSInteger index = firstIndex+1; index < self.conversationListDataSource.count; index++) {
+                RCConversationModel *model = self.conversationListDataSource[index];
+                if (model.unreadMessageCount > 0) {
+                    NSIndexPath *indexPath = [NSIndexPath indexPathForRow:index inSection:0];
+                    [self.conversationListTableView scrollToRowAtIndexPath:indexPath atScrollPosition:UITableViewScrollPositionTop animated:YES];
+                    break;
+                }
+                
+                if (index == self.conversationListDataSource.count - 1) {
+                    
+                }
+            }
+        }
+    }
+}
+
+/**
+ *  判断消息是否在collectionView的底部
+ *
+ *  @return 是否在底部
+ */
+- (BOOL)isAtTheBottomOfTableView {
+    if (self.conversationListTableView.contentSize.height <= self.conversationListTableView.frame.size.height) {
+        return YES;
+    }
+    CGFloat height = self.conversationListTableView.frame.size.height;
+    CGFloat contentOffsetY = self.conversationListTableView.contentOffset.y;
+    CGFloat bottomOffset = self.conversationListTableView.contentSize.height - contentOffsetY;
+    if (bottomOffset <= height) {
+        return YES;
+    }else{
+        return NO;
+    }
+}
+
+
 - (instancetype)init {
     self = [super init];
     if (self) {
@@ -39,16 +86,13 @@
     // Do any additional setup after loading the view.
     [self allocTitle:self.topTitle];
     self.stateView.center = CGPointMake(self.view.centerX, self.view.centerY - 30);
+    
     [self configUI];
 }
 
 - (void)viewWillAppear:(BOOL)animated {
     [super viewWillAppear:animated];
-    if (self.isSubList == NO) {
-        self.conversationListTableView.frame = CGRectMake(0, 0, kScreenWidth, kScreenHeight - kTabBarHeight);
-    }
-    else {
-        self.conversationListTableView.frame = CGRectMake(0, 0, kScreenWidth, kScreenHeight);
+    if (self.isSubList) {
         [self allocLeftButton];
         self.conversationListTableView.tableHeaderView = [UIView new];
     }

+ 1 - 1
KulexiuForStudent/KulexiuForStudent/Module/Chat/Group/View/GroupMemberListCell.m

@@ -53,7 +53,7 @@
             self.memberName.text = model.nickname;
         }
         NSString *userId = model.userId;
-        if ([userId isEqualToString:UserDefault(UIDKey)]) {
+        if ([userId isEqualToString:UserDefault(RongCloudID)]) {
             self.chatButton.hidden = YES;
             self.chatButton.userInteractionEnabled = NO;
         }

+ 33 - 15
KulexiuForStudent/KulexiuForStudent/Module/Home/Controller/HomeViewController.m

@@ -172,6 +172,9 @@
 
 @property (nonatomic, assign) BOOL isCheck;
 
+
+@property (nonatomic, strong) HomeMessageModel *buttonModel;
+
 @end
 
 @implementation HomeViewController
@@ -568,6 +571,12 @@
             if (flashArray.count) {
                 self.flashModel = [[HomeMessageModel alloc] initWithDictionary:[flashArray firstObject]];
             }
+            
+            // 首页悬浮按钮
+            NSArray *suspensionArray = [result arrayValueForKey:@"suspension"];
+            if (suspensionArray.count) {
+                self.buttonModel = [[HomeMessageModel alloc] initWithDictionary:[flashArray firstObject]];
+            }
         }
         else {
             [self MBPShow:MESSAGEKEY];
@@ -841,7 +850,16 @@
             [self showNewsWithSource:self.flashModel];
         }
     }
+    
+    // 悬浮按钮
+    if (self.buttonModel) {
+        [self showFloatingWindow];
+    }
+}
 
+// 显示悬浮窗
+- (void)showFloatingWindow {
+    
 }
 
 - (void)showNewsWithSource:(HomeMessageModel *)sourceModel {
@@ -1301,18 +1319,18 @@
         return self.albumArray.count;
     }
     else if (collectionView == self.recommendMusicCollectionView) {
-        NSInteger lastRowCount = (self.recommendMusicArray.count % 3) > 0 ? 1 : 0;
-        NSInteger count = self.recommendMusicArray.count / 3 + lastRowCount;
+        NSInteger lastRowCount = (self.recommendMusicArray.count % 4) > 0 ? 1 : 0;
+        NSInteger count = self.recommendMusicArray.count / 4 + lastRowCount;
         return count;
     }
     else if (collectionView == self.newestMusicCollectionView) {
-        NSInteger lastRowCount = (self.newestMusicArray.count % 3) > 0 ? 1 : 0;
-        NSInteger count = self.newestMusicArray.count / 3 + lastRowCount;
+        NSInteger lastRowCount = (self.newestMusicArray.count % 4) > 0 ? 1 : 0;
+        NSInteger count = self.newestMusicArray.count / 4 + lastRowCount;
         return count;
     }
     else if (collectionView == self.musicCollectionView) { // 乐谱
-        NSInteger lastRowCount = (self.musicArray.count % 3) > 0 ? 1 : 0;
-        NSInteger count = self.musicArray.count / 3 + lastRowCount;
+        NSInteger lastRowCount = (self.musicArray.count % 4) > 0 ? 1 : 0;
+        NSInteger count = self.musicArray.count / 4 + lastRowCount;
         return count;
     }
     else if (collectionView == self.talentCollectionView) { // 推荐达人
@@ -1336,8 +1354,8 @@
     }
     else if (collectionView == self.recommendMusicCollectionView) {
         NSMutableArray *songArray = [NSMutableArray array];
-        NSInteger length = indexPath.item * 3 + 3 > self.recommendMusicArray.count ? self.recommendMusicArray.count - indexPath.item * 3: 3;
-        NSRange range = NSMakeRange(indexPath.item * 3, length);
+        NSInteger length = indexPath.item * 4 + 4 > self.recommendMusicArray.count ? self.recommendMusicArray.count - indexPath.item * 4: 4;
+        NSRange range = NSMakeRange(indexPath.item * 4, length);
         
         songArray = [NSMutableArray arrayWithArray:[self.recommendMusicArray subarrayWithRange:range]];
         HomeHotMusicCollectionCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"HomeHotMusicCollectionCell" forIndexPath:indexPath];
@@ -1349,8 +1367,8 @@
     }
     else if (collectionView == self.newestMusicCollectionView) {
         NSMutableArray *songArray = [NSMutableArray array];
-        NSInteger length = indexPath.item * 3 + 3 > self.newestMusicArray.count ? self.newestMusicArray.count - indexPath.item * 3: 3;
-        NSRange range = NSMakeRange(indexPath.item * 3, length);
+        NSInteger length = indexPath.item * 4 + 4 > self.newestMusicArray.count ? self.newestMusicArray.count - indexPath.item * 4: 4;
+        NSRange range = NSMakeRange(indexPath.item * 4, length);
         
         songArray = [NSMutableArray arrayWithArray:[self.newestMusicArray subarrayWithRange:range]];
         HomeHotMusicCollectionCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"HomeHotMusicCollectionCell" forIndexPath:indexPath];
@@ -1362,8 +1380,8 @@
     }
     else if (collectionView == self.musicCollectionView) {
         NSMutableArray *songArray = [NSMutableArray array];
-        NSInteger length = indexPath.item * 3 + 3 > self.musicArray.count ? self.musicArray.count - indexPath.item * 3: 3;
-        NSRange range = NSMakeRange(indexPath.item * 3, length);
+        NSInteger length = indexPath.item * 4 + 4 > self.musicArray.count ? self.musicArray.count - indexPath.item * 4: 4;
+        NSRange range = NSMakeRange(indexPath.item * 4, length);
         
         songArray = [NSMutableArray arrayWithArray:[self.musicArray subarrayWithRange:range]];
         HomeHotMusicCollectionCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"HomeHotMusicCollectionCell" forIndexPath:indexPath];
@@ -1477,13 +1495,13 @@
         return CGSizeMake(100, 134);
     }
     else if (collectionView == self.recommendMusicCollectionView) {
-        return CGSizeMake(KPortraitWidth * 0.83, 240);
+        return CGSizeMake(KPortraitWidth * 0.83, 320);
     }
     else if (collectionView == self.newestMusicCollectionView) {
-        return CGSizeMake(KPortraitWidth * 0.83, 240);
+        return CGSizeMake(KPortraitWidth * 0.83, 320);
     }
     else if (collectionView == self.musicCollectionView) {
-        return CGSizeMake(KPortraitWidth * 0.83, 240);
+        return CGSizeMake(KPortraitWidth * 0.83, 320);
     }
     else if (collectionView == self.talentCollectionView) {
         return CGSizeMake(110, 178);

+ 1 - 1
KulexiuForStudent/KulexiuForStudent/Module/Home/View/HomeNewMusic/HomeNewMusicView.m

@@ -33,7 +33,7 @@
 }
 
 + (CGFloat)getViewHeight {
-    return 304.0f;
+    return 384.0f;
 }
 
 /*

+ 4 - 4
KulexiuForStudent/KulexiuForStudent/Module/Home/View/HomeNewMusic/HomeNewMusicView.xib

@@ -10,7 +10,7 @@
         <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
         <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
         <view contentMode="scaleToFill" id="iN0-l3-epB" customClass="HomeNewMusicView">
-            <rect key="frame" x="0.0" y="0.0" width="390" height="308"/>
+            <rect key="frame" x="0.0" y="0.0" width="390" height="388"/>
             <autoresizingMask key="autoresizingMask"/>
             <subviews>
                 <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="fy2-nu-LBW">
@@ -68,10 +68,10 @@
                     </constraints>
                 </imageView>
                 <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="csN-Ie-7a8">
-                    <rect key="frame" x="0.0" y="68" width="390" height="240"/>
+                    <rect key="frame" x="0.0" y="68" width="390" height="320"/>
                     <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                     <constraints>
-                        <constraint firstAttribute="height" constant="240" id="MyF-Wi-MeL"/>
+                        <constraint firstAttribute="height" constant="320" id="MyF-Wi-MeL"/>
                     </constraints>
                 </view>
             </subviews>
@@ -101,7 +101,7 @@
             <connections>
                 <outlet property="musicContentView" destination="csN-Ie-7a8" id="97f-Jb-JoE"/>
             </connections>
-            <point key="canvasLocation" x="101.53846153846153" y="-56.872037914691937"/>
+            <point key="canvasLocation" x="101.53846153846153" y="-28.436018957345969"/>
         </view>
     </objects>
     <resources>

+ 1 - 1
KulexiuForStudent/KulexiuForStudent/Module/Home/View/HomeRecommendMusic/HomeRecommendMusicView.m

@@ -33,7 +33,7 @@
 }
 
 + (CGFloat)getViewHeight {
-    return 304.0f;
+    return 384.0f;
 }
 
 

+ 5 - 5
KulexiuForStudent/KulexiuForStudent/Module/Home/View/HomeRecommendMusic/HomeRecommendMusicView.xib

@@ -10,8 +10,8 @@
         <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
         <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
         <view contentMode="scaleToFill" id="iN0-l3-epB" customClass="HomeRecommendMusicView">
-            <rect key="frame" x="0.0" y="0.0" width="390" height="308"/>
-            <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+            <rect key="frame" x="0.0" y="0.0" width="390" height="388"/>
+            <autoresizingMask key="autoresizingMask"/>
             <subviews>
                 <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="gSD-Yz-KRC">
                     <rect key="frame" x="331" y="32" width="45" height="18"/>
@@ -68,10 +68,10 @@
                     </constraints>
                 </imageView>
                 <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="sOs-N5-Dh3">
-                    <rect key="frame" x="0.0" y="68" width="390" height="240"/>
+                    <rect key="frame" x="0.0" y="68" width="390" height="320"/>
                     <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                     <constraints>
-                        <constraint firstAttribute="height" constant="240" id="J92-zM-Vmh"/>
+                        <constraint firstAttribute="height" constant="320" id="J92-zM-Vmh"/>
                     </constraints>
                 </view>
             </subviews>
@@ -101,7 +101,7 @@
             <connections>
                 <outlet property="musicContentView" destination="sOs-N5-Dh3" id="ara-7Z-J8V"/>
             </connections>
-            <point key="canvasLocation" x="101.53846153846153" y="-82.464454976303315"/>
+            <point key="canvasLocation" x="101.53846153846153" y="-54.028436018957343"/>
         </view>
     </objects>
     <resources>

+ 1 - 1
KulexiuForStudent/KulexiuForStudent/Module/Home/View/HotMusic/HomeHotMusicView.m

@@ -33,7 +33,7 @@
 }
 
 + (CGFloat)getViewHeight {
-    return 304.0f;
+    return 384.0f;
 }
 /*
 // Only override drawRect: if you perform custom drawing.

+ 4 - 4
KulexiuForStudent/KulexiuForStudent/Module/Home/View/HotMusic/HomeHotMusicView.xib

@@ -10,7 +10,7 @@
         <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
         <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
         <view contentMode="scaleToFill" id="iN0-l3-epB" customClass="HomeHotMusicView">
-            <rect key="frame" x="0.0" y="0.0" width="414" height="304"/>
+            <rect key="frame" x="0.0" y="0.0" width="414" height="384"/>
             <autoresizingMask key="autoresizingMask"/>
             <subviews>
                 <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="aLQ-YK-tTY">
@@ -68,10 +68,10 @@
                     </constraints>
                 </imageView>
                 <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="5PX-DV-Tle">
-                    <rect key="frame" x="0.0" y="64" width="414" height="240"/>
+                    <rect key="frame" x="0.0" y="64" width="414" height="320"/>
                     <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                     <constraints>
-                        <constraint firstAttribute="height" constant="240" id="q68-6v-m4R"/>
+                        <constraint firstAttribute="height" constant="320" id="q68-6v-m4R"/>
                     </constraints>
                 </view>
             </subviews>
@@ -101,7 +101,7 @@
             <connections>
                 <outlet property="musicContentView" destination="5PX-DV-Tle" id="82H-ul-c1D"/>
             </connections>
-            <point key="canvasLocation" x="100.00000000000001" y="-36.160714285714285"/>
+            <point key="canvasLocation" x="100.00000000000001" y="-9.375"/>
         </view>
     </objects>
     <resources>

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

@@ -37,7 +37,7 @@
 - (void)setupUI {
     self.backgroundColor = [UIColor clearColor];
     
-    if ([self.userId isEqualToString:UserDefault(UIDKey)]) { // 自己
+    if ([self.userId isEqualToString:UserDefault(RongCloudID)]) { // 自己
         [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;

+ 7 - 0
KulexiuForStudent/KulexiuForStudent/Module/Login/Model/UserInfoManager.m

@@ -259,6 +259,13 @@
         RCUserInfo *currentUserInfo =
         [[RCUserInfo alloc] initWithUserId:userId name:UserDefault(NicknameKey) portrait:UserDefault(AvatarUrlKey)];
         [RCIM sharedRCIM].currentUserInfo = currentUserInfo;
+        dispatch_async(dispatch_get_main_queue(), ^{
+            
+            AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
+            [appDelegate displayUnreadMessageCount];
+        });
+        
+        
     } error:^(RCConnectErrorCode errorCode) {
         
         if (errorCode == RC_CONN_TOKEN_INCORRECT) {

+ 1 - 1
KulexiuForStudent/KulexiuForStudent/Module/SealClass/Services/Classroom/Message/MemberChangeMessage.m

@@ -17,7 +17,7 @@
     NSDictionary *dic = [NSJSONSerialization JSONObjectWithData:data options:kNilOptions error:nil];
     if(dic) {
         NSDictionary *member = [dic dictionaryValueForKey:@"roomMember"];
-        self.userId = [member stringValueForKey:@"userId"];
+        self.userId = [member stringValueForKey:@"imUserId"];
         self.userName = [member stringValueForKey:@"username"];
         self.role = [member intValueForKey:@"role"];
         self.avatar = [member stringValueForKey:@"avatar"];

+ 1 - 6
KulexiuForStudent/KulexiuForStudent/Module/Widget/Controller/ToneTuningViewController.m

@@ -49,12 +49,7 @@
         make.left.right.top.mas_equalTo(self.view);
         make.height.mas_equalTo(kNaviBarHeight);
     }];
-//    UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
-//    button.frame = CGRectMake(100, 100, 100, 100);
-//    [button setTitle:@"Start" forState:UIControlStateNormal];
-//    [button setBackgroundColor:HexRGB(0xffffff)];
-//    [self.view addSubview:button];
-//    [button addTarget:self action:@selector(clickAction:) forControlEvents:UIControlEventTouchUpInside];
+
     [self.view addSubview:self.bodyView];
     [self.bodyView mas_makeConstraints:^(MASConstraintMaker *make) {
         make.left.right.mas_equalTo(self.view);

+ 1 - 1
KulexiuForStudent/KulexiuForStudent/Module/Widget/Model/TuningFunction/Tuner.swift

@@ -124,7 +124,7 @@ private let frequencies: [Float] = [
          8192 (20次/秒)
          4096 (40次/秒)  def
          */
-        pitchTap = PitchTap(microphone!, bufferSize: 16384, handler: tap_handler)
+        pitchTap = PitchTap(microphone!, bufferSize: 4096, handler: tap_handler)
         microphone!.start()
         pitchTap!.start()
         engine!.output = silence