Steven 2 年之前
父节点
当前提交
7aa259c385

二进制
KulexiuForTeacher/KulexiuForTeacher.xcworkspace/xcuserdata/wangzhi.xcuserdatad/UserInterfaceState.xcuserstate


+ 38 - 0
KulexiuForTeacher/KulexiuForTeacher/Common/Base/KSBaseWKWebViewController.m

@@ -78,6 +78,25 @@ typedef NS_ENUM(NSInteger, CHOOSETYPE) {
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(operationDealCallbackMessage:) name:DEALCALLBACKNOTICIFATION object:nil];
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(backLoginView) name:@"liveroomBackRefresh" object:nil];
     self.isFirstLoad = YES;
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(captureViewTips:) name:UIScreenCapturedDidChangeNotification object:nil];
+}
+
+- (void)captureViewTips:(NSNotification *)notification {
+    if ([UIScreen mainScreen].isCaptured) {
+        [self didCapturedView];
+    }
+}
+
+- (void)didCapturedView {
+    
+    NSMutableDictionary *sendParm = [NSMutableDictionary dictionary];
+    [sendParm setValue:@"setVideoPlayer" forKey:@"api"];
+    NSMutableDictionary *content = [NSMutableDictionary dictionary];
+    [content setValue:@"pause" forKey:@"status"];
+    [sendParm setValue:content forKey:@"content"];
+    [self postMessage:sendParm];
+    
+    [self MBPShow:@"为了保证数据安全,请不要录屏"];
 }
 
 - (void)operationDealCallbackMessage:(NSNotification *)notification {
@@ -131,6 +150,10 @@ typedef NS_ENUM(NSInteger, CHOOSETYPE) {
         [self sendResumeMessage];
     }
     self.isFirstLoad = NO;
+    
+    if ([UIScreen mainScreen].isCaptured) {
+        [self didCapturedView];
+    }
 }
 
 - (void)sendResumeMessage {
@@ -549,6 +572,21 @@ typedef NS_ENUM(NSInteger, CHOOSETYPE) {
         [sendParm setValue:content forKey:@"content"];
         [self postMessage:sendParm];
     }
+    else if ([[parm stringValueForKey:@"api"] isEqualToString:@"getDeviceStatus"]) {
+        NSDictionary *valueDic = [parm dictionaryValueForKey:@"content"];
+        NSString *type = [valueDic stringValueForKey:@"type"];
+        if ([type isEqualToString:@"video"]) {
+            NSString *status = [UIScreen mainScreen].isCaptured ? @"1" : @"0";
+            NSMutableDictionary *sendParm = [NSMutableDictionary dictionary];
+            [sendParm setValue:@"getDeviceStatus" forKey:@"api"];
+            NSMutableDictionary *content = [NSMutableDictionary dictionary];
+            [content setValue:[valueDic stringValueForKey:@"type"] forKey:@"type"];
+            [content setValue:[valueDic stringValueForKey:@"uuid"] forKey:@"uuid"];
+            [content setValue:status forKey:@"status"];
+            [sendParm setValue:content forKey:@"content"];
+            [self postMessage:sendParm];
+        }
+    }
 }
 
 

+ 13 - 0
KulexiuForTeacher/KulexiuForTeacher/Module/Home/Controller/HomeViewController.m

@@ -105,6 +105,8 @@
 
 @property (nonatomic, strong) UICollectionView *musicCollectionView; // 曲谱容器
 
+@property (nonatomic, assign) CGFloat hotMusicHeight; // music 高度
+
 @property (nonatomic, strong) BadgeIntroduceView *intruduceAlert;
 
 @property (nonatomic, strong) HomeAuthAlertView *authAlertView;
@@ -442,6 +444,17 @@
 }
 
 - (void)refreshMusicView {
+    if (self.dataArray.count) {
+        self.hotMusicHeight = [HomeHotMusicView getViewHeight];
+        self.hotMusicView.hidden = NO;
+    }
+    else {
+        self.hotMusicHeight = CGFLOAT_MIN;
+        self.hotMusicView.hidden = YES;
+    }
+    [self.hotMusicView mas_updateConstraints:^(MASConstraintMaker *make) {
+        make.height.mas_equalTo(self.hotMusicHeight);
+    }];
     [self.musicCollectionView reloadData];
 }
 

+ 31 - 5
KulexiuForTeacher/KulexiuForTeacher/Module/Mine/CreateStyle/Controller/MyStyleViewController.m

@@ -25,6 +25,7 @@
 #import "ModifyPhoneCheckController.h"
 #import "UserAuthViewController.h"
 #import "ModifyNameViewController.h"
+#import "LiveRoomAlertView.h"
 
 @interface MyStyleViewController ()<UITableViewDelegate,UITableViewDataSource,WMPlayerDelegate,RSKImageCropViewControllerDelegate,RSKImageCropViewControllerDataSource>
 {
@@ -62,6 +63,10 @@
 
 @property (nonatomic, strong) MyStyleEditHeadView *infoHeadView;
 
+@property (nonatomic, assign) BOOL hasModify;
+
+/// 提示窗
+@property (nonatomic, strong) LiveRoomAlertView *alertView;
 
 @end
 
@@ -202,6 +207,7 @@
     [KSNetworkingManager saveTeacherStyleRequest:KS_POST styleVideo:videoArray subjectId:subjectIds subjectName:subjectNames introduction:self.content success:^(NSDictionary * _Nonnull dic) {
         [self removehub];
         if ([dic integerValueForKey:@"code"] == 200 && [dic boolValueForKey:@"status"]) {
+            self.hasModify = NO;
             MJWeakSelf;
             NSString *descMessage = (hasNewVideoSubmit || self.hasModifyVideoImage) ? @"提交成功,请耐心等待审核" : @"保存成功";
             [self KSShowMsg:descMessage promptCompletion:^{
@@ -252,6 +258,7 @@
                 [weakSelf chooseInstrumentWithArray:sourceArray];
             }
             else { // 刷新
+                weakSelf.hasModify = YES;
                 [weakSelf refreshInstrumentPart:sourceArray];
             }
         }];
@@ -261,6 +268,7 @@
         MyStyleIntroduceCell *cell = [tableView dequeueReusableCellWithIdentifier:@"MyStyleIntroduceCell"];
         MJWeakSelf;
         [cell configWithIntroduceMessage:self.content modifyCallback:^(NSString * _Nullable content) {
+            weakSelf.hasModify = YES;
             weakSelf.content = content;
         }];
         return cell;
@@ -289,7 +297,7 @@
             MJWeakSelf;
             [self.mediaManager noAlertCallback:^(NSString * _Nullable videoUrl, NSMutableArray * _Nullable imageArray, NSMutableArray * _Nullable imageAsset) {
                 NSLog(@"%@", videoUrl);
-                
+                weakSelf.hasModify = YES;
                 [weakSelf uploadVideoWithUrl:videoUrl coverUrl:nil];
             }];
             [self.mediaManager pushImagePickerController];
@@ -310,6 +318,7 @@
             NSInteger index = container.tag - 1000;
             if (self.videoArray.count > index) {
                 if ([self canDeleteVideoIndex:index]) {
+                    self.hasModify = YES;
                     [self.videoArray removeObjectAtIndex:index];
                 }
                 else {
@@ -334,8 +343,6 @@
                 // 裁剪
                 weakSelf.hasModifyVideoImage = YES;
                 [weakSelf cropImage:[imageArray lastObject] fileIndex:index];
-
-                
             }];
             [self.mediaManager pushImagePickerController];
         }
@@ -473,6 +480,7 @@
     ctrl.preChooseArray = instrumentArray;
     MJWeakSelf;
     [ctrl chooseCallback:^(NSMutableArray *chooseArray) {
+        weakSelf.hasModify = YES;
         [weakSelf refreshInstrumentPart:chooseArray];
     }];
     [self.navigationController pushViewController:ctrl animated:YES];
@@ -554,6 +562,21 @@
     return _navView;
 }
 
+- (void)backAction {
+    [self.view endEditing:YES];
+    // 根据需要返回到不同页面
+    if (self.hasModify) {
+        self.alertView = [LiveRoomAlertView liveroomAlertWithTitle:@"您尚未保存修改信息,返回后将取消修改" leftButtonTitle:@"取消" rightTitle:@"确认" inView:self.view cancel:^{
+            
+        } confirm:^{
+            [self.navigationController popViewControllerAnimated:YES];
+        }];
+    }
+    else {
+        [self.navigationController popViewControllerAnimated:YES];
+    }
+}
+
 
 - (UITableView *)tableView {
     if (!_tableView) {
@@ -731,14 +754,16 @@
 
 - (CGRect)imageCropViewControllerCustomMaskRect:(RSKImageCropViewController *)controller {
     CGFloat width = (KPortraitWidth - 40);
-    CGFloat height = width / 16 * 9;
+//    CGFloat height = width / 16 * 9;
+    CGFloat height = width;
     return CGRectMake(20, (KPortraitHeight - height) / 2.0f, width, height);
 }
 
 - (UIBezierPath *)imageCropViewControllerCustomMaskPath:(RSKImageCropViewController *)controller {
     //返回裁剪框的位置
     CGFloat width = (KPortraitWidth - 40);
-    CGFloat height = width / 16 * 9;
+//    CGFloat height = width / 16 * 9;
+    CGFloat height = width;
     UIBezierPath *path=[UIBezierPath bezierPathWithRoundedRect:CGRectMake(20, (KPortraitHeight - height) / 2.0f, width, height) cornerRadius:0];
     return path;
 }
@@ -765,6 +790,7 @@
  */
 - (void)imageCropViewController:(RSKImageCropViewController *)controller didCropImage:(UIImage *)croppedImage usingCropRect:(CGRect)cropRect rotationAngle:(CGFloat)rotationAngle {
 //    croppedImage
+    self.hasModify = YES;
     [self uploadImage:croppedImage index:self.chooseFileIndex];
     [controller.navigationController dismissViewControllerAnimated:YES completion:nil];
 }

+ 2 - 2
KulexiuForTeacher/KulexiuForTeacher/Module/Mine/MinePage/View/MineEmptyGroupCell.xib

@@ -28,8 +28,8 @@
                                     <constraint firstAttribute="height" constant="116" id="Tnc-lU-SgC"/>
                                 </constraints>
                             </imageView>
-                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="还没有内容,请「编辑」" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="UYe-Lq-Uwc">
-                                <rect key="frame" x="73" y="117" width="146" height="18"/>
+                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="暂无粉丝群~" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="UYe-Lq-Uwc">
+                                <rect key="frame" x="109" y="117" width="74.5" height="18"/>
                                 <constraints>
                                     <constraint firstAttribute="height" constant="18" id="ELU-si-7op"/>
                                 </constraints>

+ 1 - 0
KulexiuForTeacher/KulexiuForTeacher/Module/Mine/MinePage/View/MineEmptyIntroduceCell.xib

@@ -94,6 +94,7 @@
                             <constraint firstItem="vhk-Je-Vgt" firstAttribute="leading" secondItem="L1e-7I-RtY" secondAttribute="leading" id="FCc-1Z-gJE"/>
                             <constraint firstItem="Hc9-f8-TsP" firstAttribute="top" secondItem="L1e-7I-RtY" secondAttribute="top" constant="11" id="MOE-35-bmy"/>
                             <constraint firstAttribute="trailing" secondItem="vhk-Je-Vgt" secondAttribute="trailing" id="R5w-xc-env"/>
+                            <constraint firstAttribute="bottom" secondItem="vhk-Je-Vgt" secondAttribute="bottom" constant="2" id="cwf-8F-j3p"/>
                             <constraint firstItem="Hc9-f8-TsP" firstAttribute="leading" secondItem="L1e-7I-RtY" secondAttribute="leading" constant="14" id="fPp-R6-6ik"/>
                         </constraints>
                         <userDefinedRuntimeAttributes>

+ 4 - 3
KulexiuForTeacher/KulexiuForTeacher/Module/Mine/MinePage/View/MinePageCourseView.m

@@ -69,7 +69,7 @@
         self.tableView.delegate = self;
         self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
         [self addSubview:self.tableView];
-        
+        self.tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
         [self.dateFormatter setDateFormat:@"yyyy-MM"];
         NSDate *currentDate = [NSDate date];
         self.chooseMonth = [self.dateFormatter stringFromDate:currentDate];
@@ -122,7 +122,7 @@
     
     self.dataArray = [NSMutableArray array];
     [self.tableView.mj_footer resetNoMoreData];
-    [self setPromptString:@"本月没有课程" imageName:@"empty_course_grey" inView:self.tableView];
+    [self setPromptString:@"本月没有课程" imageName:@"empty_course" inView:self.tableView];
     [self.tableView reloadData];
 }
 
@@ -243,6 +243,7 @@
     CGFloat topHeight = [MinePageSortView getViewHeight];
     
     self.tableView.frame = CGRectMake(0, topHeight, self.bounds.size.width, self.bounds.size.height - topHeight);
+    
     if (self.selectIndex != 4) {
         if (![self.subviews containsObject:self.sortView]) {
             [self addSubview:self.sortView];
@@ -299,7 +300,7 @@
     else if (self.selectIndex == 2) {
         LiveCourseCell *cell = [tableView dequeueReusableCellWithIdentifier:@"LiveCourseCell"];
         LiveCourseModel *model = self.dataArray[indexPath.row];
-        [cell configCellWithSource:model groupStatus:COURSERSTATUS_ING hideStatusView:YES];
+        [cell configCellWithSource:model groupStatus:COURSERSTATUS_APPLY hideStatusView:YES];
         return cell;
     }
     else {

+ 2 - 1
KulexiuForTeacher/KulexiuForTeacher/Module/Mine/MinePage/View/MinePageVideoView.m

@@ -53,6 +53,7 @@
         self.collectionView.showsHorizontalScrollIndicator = NO;
         [self.collectionView registerNib:[UINib nibWithNibName:@"MinePageVideoCell" bundle:[NSBundle mainBundle]] forCellWithReuseIdentifier:@"MinePageVideoCell"];
         [self addSubview:self.collectionView];
+        self.collectionView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
         MJWeakSelf;
         self.collectionView.mj_header = [KSGifRefreshHeader headerWithRefreshingBlock:^{
             [weakSelf resetParamenter];
@@ -89,7 +90,7 @@
     self.rows = 10;
     self.dataArray = [NSMutableArray array];
     [self.collectionView.mj_footer resetNoMoreData];
-    [self setPromptString:@"本月没有课程" imageName:@"empty_course_grey" inView:self.collectionView];
+    [self setPromptString:@"本月没有课程" imageName:@"empty_course" inView:self.collectionView];
     [self.collectionView reloadData];
 }
 

+ 1 - 0
KulexiuForTeacher/KulexiuForTeacher/Module/Mine/MinePage/View/MineVideoCell.xib

@@ -42,6 +42,7 @@
                         <constraints>
                             <constraint firstItem="GKG-Y1-2TR" firstAttribute="leading" secondItem="Kbc-sU-aNo" secondAttribute="leading" constant="14" id="Hks-Y0-o7I"/>
                             <constraint firstItem="5jL-Cm-W81" firstAttribute="top" secondItem="GKG-Y1-2TR" secondAttribute="bottom" constant="20" id="MRu-mO-Pan"/>
+                            <constraint firstItem="GKG-Y1-2TR" firstAttribute="top" secondItem="Kbc-sU-aNo" secondAttribute="top" constant="11" id="MrN-TB-eHt"/>
                             <constraint firstAttribute="trailing" secondItem="5jL-Cm-W81" secondAttribute="trailing" constant="14" id="NmJ-0j-yfj"/>
                             <constraint firstAttribute="bottom" secondItem="5jL-Cm-W81" secondAttribute="bottom" constant="20" id="Sb3-sC-RcP"/>
                             <constraint firstItem="5jL-Cm-W81" firstAttribute="leading" secondItem="Kbc-sU-aNo" secondAttribute="leading" constant="14" id="mqo-5J-vfY"/>

+ 2 - 2
KulexiuForTeacher/Podfile

@@ -18,8 +18,8 @@
   pod 'Reachability', '~> 3.2'
   pod 'JCore', '2.7.1-noidfa'
   pod 'JPush', '4.3.0'
-#  pod 'JXCategoryView'
-#  pod 'JXPagingView/Pager'
+  pod 'JXCategoryView'
+  pod 'JXPagingView/Pager'
   pod 'Bugly'
   pod 'Whiteboard'
   pod 'RSKImageCropper'