瀏覽代碼

直播课程组

Steven 8 月之前
父節點
當前提交
a27b335055
共有 17 個文件被更改,包括 932 次插入218 次删除
  1. 10 10
      KulexiuForTeacher/KulexiuForTeacher.xcodeproj/project.pbxproj
  2. 22 0
      KulexiuForTeacher/KulexiuForTeacher/Assets.xcassets/Mine/mine_page_live_tag.imageset/Contents.json
  3. 二進制
      KulexiuForTeacher/KulexiuForTeacher/Assets.xcassets/Mine/mine_page_live_tag.imageset/mine_page_live_tag@2x.png
  4. 二進制
      KulexiuForTeacher/KulexiuForTeacher/Assets.xcassets/Mine/mine_page_live_tag.imageset/mine_page_live_tag@3x.png
  5. 2 2
      KulexiuForTeacher/KulexiuForTeacher/Module/Mine/LiveCourse/View/MyLiveCourseBodyView.h
  6. 65 58
      KulexiuForTeacher/KulexiuForTeacher/Module/Mine/LiveCourse/View/MyLiveCourseBodyView.m
  7. 11 15
      KulexiuForTeacher/KulexiuForTeacher/Module/Mine/MinePage/Controller/MinePageViewController.m
  8. 27 0
      KulexiuForTeacher/KulexiuForTeacher/Module/Mine/MinePage/View/MinePageLiveCourse/MineLiveCourseGroupCell.h
  9. 128 0
      KulexiuForTeacher/KulexiuForTeacher/Module/Mine/MinePage/View/MinePageLiveCourse/MineLiveCourseGroupCell.m
  10. 222 0
      KulexiuForTeacher/KulexiuForTeacher/Module/Mine/MinePage/View/MinePageLiveCourse/MineLiveCourseGroupCell.xib
  11. 0 16
      KulexiuForTeacher/KulexiuForTeacher/Module/Mine/MinePage/View/MinePageLiveCourse/MinePageLiveCourseGroupCell.h
  12. 0 26
      KulexiuForTeacher/KulexiuForTeacher/Module/Mine/MinePage/View/MinePageLiveCourse/MinePageLiveCourseGroupCell.m
  13. 0 69
      KulexiuForTeacher/KulexiuForTeacher/Module/Mine/MinePage/View/MinePageLiveCourse/MinePageLiveCourseGroupCell.xib
  14. 2 6
      KulexiuForTeacher/KulexiuForTeacher/Module/Mine/MinePage/View/MinePageLiveCourse/MinePageLiveCourseView.h
  15. 428 1
      KulexiuForTeacher/KulexiuForTeacher/Module/Mine/MinePage/View/MinePageLiveCourse/MinePageLiveCourseView.m
  16. 14 14
      KulexiuForTeacher/KulexiuForTeacher/Module/Mine/MinePage/View/MinePageVideoCell.xib
  17. 1 1
      KulexiuForTeacher/KulexiuForTeacher/Module/Mine/MinePage/View/VipCourse/MinePageVIPCourseView.m

+ 10 - 10
KulexiuForTeacher/KulexiuForTeacher.xcodeproj/project.pbxproj

@@ -425,6 +425,8 @@
 		BC2B716D2CEB135600A90AFF /* MinePageMusicView.m in Sources */ = {isa = PBXBuildFile; fileRef = BC2B716C2CEB135600A90AFF /* MinePageMusicView.m */; };
 		BC2B71702CEB158400A90AFF /* MinePageMusicSortView.m in Sources */ = {isa = PBXBuildFile; fileRef = BC2B716F2CEB158400A90AFF /* MinePageMusicSortView.m */; };
 		BC2B71722CEB158B00A90AFF /* MinePageMusicSortView.xib in Resources */ = {isa = PBXBuildFile; fileRef = BC2B71712CEB158B00A90AFF /* MinePageMusicSortView.xib */; };
+		BC2C1BA12CEB25DE00EDEB97 /* MineLiveCourseGroupCell.m in Sources */ = {isa = PBXBuildFile; fileRef = BC2C1B9F2CEB25DE00EDEB97 /* MineLiveCourseGroupCell.m */; };
+		BC2C1BA22CEB25DE00EDEB97 /* MineLiveCourseGroupCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = BC2C1BA02CEB25DE00EDEB97 /* MineLiveCourseGroupCell.xib */; };
 		BC319C582CE7318800E1AF50 /* MineVipProgramHeadView.m in Sources */ = {isa = PBXBuildFile; fileRef = BC319C572CE7318800E1AF50 /* MineVipProgramHeadView.m */; };
 		BC319C5A2CE7318E00E1AF50 /* MineVipProgramHeadView.xib in Resources */ = {isa = PBXBuildFile; fileRef = BC319C592CE7318E00E1AF50 /* MineVipProgramHeadView.xib */; };
 		BC319C5D2CE7412500E1AF50 /* MineVipProgramMainView.m in Sources */ = {isa = PBXBuildFile; fileRef = BC319C5C2CE7412500E1AF50 /* MineVipProgramMainView.m */; };
@@ -898,8 +900,6 @@
 		BCAF36F02CEAE3EF009434AD /* FansGroupAlertView.xib in Resources */ = {isa = PBXBuildFile; fileRef = BCAF36EF2CEAE3EF009434AD /* FansGroupAlertView.xib */; };
 		BCAF36F42CEAE57B009434AD /* MinePageLiveCourseView.m in Sources */ = {isa = PBXBuildFile; fileRef = BCAF36F32CEAE57B009434AD /* MinePageLiveCourseView.m */; };
 		BCAF36F82CEAE5F0009434AD /* MinePageVideoCourseView.m in Sources */ = {isa = PBXBuildFile; fileRef = BCAF36F72CEAE5F0009434AD /* MinePageVideoCourseView.m */; };
-		BCAF36FC2CEAE6E9009434AD /* MinePageLiveCourseGroupCell.m in Sources */ = {isa = PBXBuildFile; fileRef = BCAF36FA2CEAE6E9009434AD /* MinePageLiveCourseGroupCell.m */; };
-		BCAF36FD2CEAE6E9009434AD /* MinePageLiveCourseGroupCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = BCAF36FB2CEAE6E9009434AD /* MinePageLiveCourseGroupCell.xib */; };
 		BCAF37012CEAEA21009434AD /* MinePageVideoGroupCell.m in Sources */ = {isa = PBXBuildFile; fileRef = BCAF36FF2CEAEA21009434AD /* MinePageVideoGroupCell.m */; };
 		BCAF37022CEAEA21009434AD /* MinePageVideoGroupCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = BCAF37002CEAEA21009434AD /* MinePageVideoGroupCell.xib */; };
 		BCB14112288A49710022C13A /* HomeButtonView.xib in Resources */ = {isa = PBXBuildFile; fileRef = BCB14110288A49710022C13A /* HomeButtonView.xib */; };
@@ -1911,6 +1911,9 @@
 		BC2B716E2CEB158400A90AFF /* MinePageMusicSortView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MinePageMusicSortView.h; sourceTree = "<group>"; };
 		BC2B716F2CEB158400A90AFF /* MinePageMusicSortView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MinePageMusicSortView.m; sourceTree = "<group>"; };
 		BC2B71712CEB158B00A90AFF /* MinePageMusicSortView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MinePageMusicSortView.xib; sourceTree = "<group>"; };
+		BC2C1B9E2CEB25DE00EDEB97 /* MineLiveCourseGroupCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MineLiveCourseGroupCell.h; sourceTree = "<group>"; };
+		BC2C1B9F2CEB25DE00EDEB97 /* MineLiveCourseGroupCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MineLiveCourseGroupCell.m; sourceTree = "<group>"; };
+		BC2C1BA02CEB25DE00EDEB97 /* MineLiveCourseGroupCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MineLiveCourseGroupCell.xib; sourceTree = "<group>"; };
 		BC319C562CE7318800E1AF50 /* MineVipProgramHeadView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MineVipProgramHeadView.h; sourceTree = "<group>"; };
 		BC319C572CE7318800E1AF50 /* MineVipProgramHeadView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MineVipProgramHeadView.m; sourceTree = "<group>"; };
 		BC319C592CE7318E00E1AF50 /* MineVipProgramHeadView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MineVipProgramHeadView.xib; sourceTree = "<group>"; };
@@ -2654,9 +2657,6 @@
 		BCAF36F32CEAE57B009434AD /* MinePageLiveCourseView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MinePageLiveCourseView.m; sourceTree = "<group>"; };
 		BCAF36F62CEAE5F0009434AD /* MinePageVideoCourseView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MinePageVideoCourseView.h; sourceTree = "<group>"; };
 		BCAF36F72CEAE5F0009434AD /* MinePageVideoCourseView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MinePageVideoCourseView.m; sourceTree = "<group>"; };
-		BCAF36F92CEAE6E9009434AD /* MinePageLiveCourseGroupCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MinePageLiveCourseGroupCell.h; sourceTree = "<group>"; };
-		BCAF36FA2CEAE6E9009434AD /* MinePageLiveCourseGroupCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MinePageLiveCourseGroupCell.m; sourceTree = "<group>"; };
-		BCAF36FB2CEAE6E9009434AD /* MinePageLiveCourseGroupCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MinePageLiveCourseGroupCell.xib; sourceTree = "<group>"; };
 		BCAF36FE2CEAEA21009434AD /* MinePageVideoGroupCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MinePageVideoGroupCell.h; sourceTree = "<group>"; };
 		BCAF36FF2CEAEA21009434AD /* MinePageVideoGroupCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MinePageVideoGroupCell.m; sourceTree = "<group>"; };
 		BCAF37002CEAEA21009434AD /* MinePageVideoGroupCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MinePageVideoGroupCell.xib; sourceTree = "<group>"; };
@@ -6856,9 +6856,9 @@
 			children = (
 				BCAF36F22CEAE57B009434AD /* MinePageLiveCourseView.h */,
 				BCAF36F32CEAE57B009434AD /* MinePageLiveCourseView.m */,
-				BCAF36F92CEAE6E9009434AD /* MinePageLiveCourseGroupCell.h */,
-				BCAF36FA2CEAE6E9009434AD /* MinePageLiveCourseGroupCell.m */,
-				BCAF36FB2CEAE6E9009434AD /* MinePageLiveCourseGroupCell.xib */,
+				BC2C1B9E2CEB25DE00EDEB97 /* MineLiveCourseGroupCell.h */,
+				BC2C1B9F2CEB25DE00EDEB97 /* MineLiveCourseGroupCell.m */,
+				BC2C1BA02CEB25DE00EDEB97 /* MineLiveCourseGroupCell.xib */,
 			);
 			path = MinePageLiveCourse;
 			sourceTree = "<group>";
@@ -7769,6 +7769,7 @@
 				BCC583FA28A9FA8100BAB4CF /* cloud_animation_26.png in Resources */,
 				2708565E27EDA83100EC8E72 /* GroupMemberListCell.xib in Resources */,
 				BC9AA0CA2ABC3C7B00CD954D /* KSPhotoChooseView.xib in Resources */,
+				BC2C1BA22CEB25DE00EDEB97 /* MineLiveCourseGroupCell.xib in Resources */,
 				BC433E612CE6F80E002870EC /* MinePageVipProgramCell.xib in Resources */,
 				BCDE359A289BC02200A9A560 /* HomeHotAlbumCell.xib in Resources */,
 				2780A06627E81E5E00447CFD /* MineNavView.xib in Resources */,
@@ -7928,7 +7929,6 @@
 				BC106BA62A8F45AA000759A9 /* TXLiveDownSeatView.xib in Resources */,
 				BC1263A528FF98BB00509E90 /* HomeNewMusicView.xib in Resources */,
 				BCE6A08727F81B4D00C97704 /* MinePageSubmitView.xib in Resources */,
-				BCAF36FD2CEAE6E9009434AD /* MinePageLiveCourseGroupCell.xib in Resources */,
 				BC71DF0D2A89F470003F165E /* NewTXMetronomeAlertView.xib in Resources */,
 				BC31BF902B219C5700F7D538 /* TunerSettingView.xib in Resources */,
 				BC14A60F28A0AAE80086395C /* MineFunctionView.xib in Resources */,
@@ -8510,6 +8510,7 @@
 				BCA193B5282A80AA004A585D /* RecentCourseModel.m in Sources */,
 				2779326B27E30FD80010E277 /* FSCalendarSeparatorDecorationView.m in Sources */,
 				BC14E47F2AB2EE58000C4983 /* UnbindBottomView.m in Sources */,
+				BC2C1BA12CEB25DE00EDEB97 /* MineLiveCourseGroupCell.m in Sources */,
 				BC7CFFB22817E6DB00CAEB21 /* KSMutilDatePicker.m in Sources */,
 				BCED5CAA284F5D8D009A42DE /* FriendListModel.m in Sources */,
 				BC7B0F5529276D980044CF61 /* KSWareSliderView.m in Sources */,
@@ -8702,7 +8703,6 @@
 				BC71DF1C2A89F470003F165E /* IACircleSliderThumbLayer.m in Sources */,
 				BC31BF912B219C5700F7D538 /* TunerSettingView.m in Sources */,
 				2779320927E30FC30010E277 /* KSRecordPowerAnimationView.m in Sources */,
-				BCAF36FC2CEAE6E9009434AD /* MinePageLiveCourseGroupCell.m in Sources */,
 				BC106C552A9365DE000759A9 /* ClassMemberEmptyView.m in Sources */,
 				BC02BCE628B324C9005CB483 /* LiveDownSeatView.m in Sources */,
 				27BC3B3327F2FD2D00D81E30 /* VideoListBodyView.m in Sources */,

+ 22 - 0
KulexiuForTeacher/KulexiuForTeacher/Assets.xcassets/Mine/mine_page_live_tag.imageset/Contents.json

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

二進制
KulexiuForTeacher/KulexiuForTeacher/Assets.xcassets/Mine/mine_page_live_tag.imageset/mine_page_live_tag@2x.png


二進制
KulexiuForTeacher/KulexiuForTeacher/Assets.xcassets/Mine/mine_page_live_tag.imageset/mine_page_live_tag@3x.png


+ 2 - 2
KulexiuForTeacher/KulexiuForTeacher/Module/Mine/LiveCourse/View/MyLiveCourseBodyView.h

@@ -5,13 +5,13 @@
 //  Created by 王智 on 2022/4/6.
 //
 
-#import <KSJXBodyView.h>
+#import <kSJXCollectionView.h>
 #import "KSButtonStatusView.h"
 #import "Reachability.h"
 
 NS_ASSUME_NONNULL_BEGIN
 
-@interface MyLiveCourseBodyView : KSJXBodyView
+@interface MyLiveCourseBodyView : kSJXCollectionView
 
 @property (nonatomic, strong) NSString *teaherStatus;
 

+ 65 - 58
KulexiuForTeacher/KulexiuForTeacher/Module/Mine/LiveCourse/View/MyLiveCourseBodyView.m

@@ -6,12 +6,12 @@
 //
 
 #import "MyLiveCourseBodyView.h"
-#import "LiveCourseCell.h"
+#import "MineLiveCourseGroupCell.h"
 #import "LiveCourseModel.h"
 #import "KSBaseWKWebViewController.h"
 #import "AuthDisplayView.h"
 
-@interface MyLiveCourseBodyView ()<UITableViewDelegate,UITableViewDataSource>
+@interface MyLiveCourseBodyView ()<UICollectionViewDelegate,UICollectionViewDataSource,UICollectionViewDelegateFlowLayout>
 
 @property (nonatomic, strong) NSMutableArray *dataArray;
 
@@ -38,39 +38,30 @@
     self = [super initWithFrame:frame];
     if (self) {
         self.backgroundColor = HexRGB(0xf8f9fc);
-        self.tableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStylePlain];
-        self.tableView.backgroundColor = HexRGB(0xf8f9fc);
-        self.tableView.showsVerticalScrollIndicator = NO;
-        self.tableView.rowHeight = 182.0f;
-        self.tableView.dataSource = self;
-        self.tableView.delegate = self;
-        self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
-        [self addSubview:self.tableView];
-        [self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
-            make.left.right.bottom.top.mas_equalTo(self);
-        }];
-        
-        UIView *headView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, 10)];
-        headView.backgroundColor = HexRGB(0xf8f9fc);
-        self.tableView.tableHeaderView = headView;
+        UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init];
+        layout.sectionInset = UIEdgeInsetsMake(12, 14, 12, 14);
         
-        UIView *bottomView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, 10)];
-        bottomView.backgroundColor = HexRGB(0xf8f9fc);
-        self.tableView.tableFooterView = bottomView;
-        [self.tableView registerNib:[UINib nibWithNibName:@"LiveCourseCell" bundle:[NSBundle mainBundle]] forCellReuseIdentifier:@"LiveCourseCell"];
-
+        self.collectionView = [[UICollectionView alloc] initWithFrame:CGRectMake(0, 0, frame.size.width, frame.size.height) collectionViewLayout:layout];
+        self.collectionView.backgroundColor = HexRGB(0xf8f9fc);
+        self.collectionView.delegate = self;
+        self.collectionView.dataSource = self;
+        self.collectionView.showsVerticalScrollIndicator = NO;
+        self.collectionView.showsHorizontalScrollIndicator = NO;
+        [self.collectionView registerNib:[UINib nibWithNibName:@"MineLiveCourseGroupCell" bundle:[NSBundle mainBundle]] forCellWithReuseIdentifier:@"MineLiveCourseGroupCell"];
+        [self addSubview:self.collectionView];
+        self.collectionView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
         MJWeakSelf;
-        self.tableView.mj_header = [KSGifRefreshHeader headerWithRefreshingBlock:^{
+        self.collectionView.mj_header = [KSGifRefreshHeader headerWithRefreshingBlock:^{
             [weakSelf resetParamenter];
             [weakSelf requestData];
         }];
-        self.tableView.mj_footer = [KSGifRefreshFooter footerWithRefreshingBlock:^{
+        self.collectionView.mj_footer = [KSGifRefreshFooter footerWithRefreshingBlock:^{
             if (weakSelf.isLoadMore) {
                 weakSelf.pages += 1;
                 [weakSelf requestData];
             }
             else {
-                [weakSelf.tableView.mj_footer endRefreshingWithNoMoreData];
+                [weakSelf.collectionView.mj_footer endRefreshingWithNoMoreData];
             }
         }];
     }
@@ -103,8 +94,8 @@
     @weakObj(self);
     dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
         @strongObj(self);
-        [self.tableView.mj_header endRefreshing];
-        [self.tableView.mj_footer endRefreshing];
+        [self.collectionView.mj_header endRefreshing];
+        [self.collectionView.mj_footer endRefreshing];
     });
 }
 
@@ -119,10 +110,10 @@
     self.rows = 10;
     [self configRequestStatus];
     self.dataArray = [NSMutableArray array];
-    [self.tableView.mj_footer resetNoMoreData];
-    [self setPromptString:[self getEmptyMessage] imageName:@"authTeacher_Live" buttonTitle:@"立即创建" inView:self.tableView];
+    [self.collectionView.mj_footer resetNoMoreData];
+    [self setPromptString:[self getEmptyMessage] imageName:@"authTeacher_Live" buttonTitle:@"立即创建" inView:self.collectionView];
     
-    [self.tableView reloadData];
+    [self.collectionView reloadData];
 }
 
 - (NSString *)getEmptyMessage {
@@ -163,21 +154,21 @@
         else {
             [LOADING_MANAGER MBShowAUTOHidingInWindow:MESSAGEKEY];
         }
-        [self.tableView reloadData];
+        [self.collectionView reloadData];
         [self changePromptLabelStateWithArray:self.dataArray];
     } faliure:^(NSError * _Nonnull error) {
         [self endRefresh];
         if (self.networkAvaiable == NO) {
-            [self setPromptString:@"暂无网络" imageName:@"no_networking" buttonTitle:@"" inView:self.tableView];
+            [self setPromptString:@"暂无网络" imageName:@"no_networking" buttonTitle:@"" inView:self.collectionView];
         }
         [self.dataArray removeAllObjects];
-        [self.tableView reloadData];
+        [self.collectionView reloadData];
         [self changePromptLabelStateWithArray:self.dataArray];
     }];
 }
 
 - (void)beginRefreshImmediately {
-    [self.tableView.mj_header beginRefreshing];
+    [self.collectionView.mj_header beginRefreshing];
 }
 
 - (void)beginFirstRefresh {
@@ -191,16 +182,19 @@
         return;
     }
     if (self.lastSelectedIndexPath != nil) {
-        UITableViewCell *cell = [self.tableView cellForRowAtIndexPath:self.lastSelectedIndexPath];
-        [cell setSelected:NO animated:NO];
+        UICollectionViewCell *cell = [self.collectionView cellForItemAtIndexPath:self.lastSelectedIndexPath];
+        [cell setSelected:NO];
     }
-    UITableViewCell *cell = [self.tableView cellForRowAtIndexPath:indexPath];
-    [cell setSelected:YES animated:NO];
+    UICollectionViewCell *cell = [self.collectionView cellForItemAtIndexPath:indexPath];
+    [cell setSelected:YES];
     self.lastSelectedIndexPath = indexPath;
 }
 
 - (void)layoutSubviews {
     [super layoutSubviews];
+    [self.collectionView mas_remakeConstraints:^(MASConstraintMaker *make) {
+        make.left.right.top.bottom.mas_equalTo(self);
+    }];
     if (self.teacherAuthPass == NO) {
         [self showAuthView];
     }
@@ -209,19 +203,46 @@
     }
 }
 
-#pragma mark - UITableViewDataSource
-- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
+#pragma mark ----- collection view
+- (NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView {
+    return 1;
+}
+
+- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
     return self.dataArray.count;
 }
 
-- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
-    LiveCourseCell *cell = [tableView dequeueReusableCellWithIdentifier:@"LiveCourseCell"];
-    LiveCourseModel *model = self.dataArray[indexPath.row];
+- (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
+    MineLiveCourseGroupCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"MineLiveCourseGroupCell" forIndexPath:indexPath];
+    
+    LiveCourseModel *model = [self.dataArray objectAtIndex:indexPath.row];
     COURSERSTATUS status = [self getCourseStatus:self.selectIndex];
     [cell configCellWithSource:model groupStatus:status hideStatusView:NO];
     return cell;
 }
 
+- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
+    // 直播课程组详情
+    LiveCourseModel *model = self.dataArray[indexPath.item];
+    if (self.selectIndex == 5) {
+        [self editLiveCourseWithGroupId:[NSString stringWithFormat:@"%.0f",model.courseGroupId]];
+        
+    }
+    else {
+        [self displayLiveCourseDetailWithGroupId:[NSString stringWithFormat:@"%.0f",model.courseGroupId]];
+    }
+}
+
+- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath {
+    CGFloat width = KPortraitWidth - 28;
+    if (IS_IPAD) {
+        width = (KPortraitWidth - 28 - 12 * 2 - 12) / 2.0f;
+    }
+    CGFloat height = (width - 12 * 2) / 16 * 9 + 143;
+    return CGSizeMake(width, height);
+}
+
+
 - (COURSERSTATUS)getCourseStatus:(NSInteger)index {
     COURSERSTATUS status;
     if (index == 0) {
@@ -245,20 +266,6 @@
     return status;
 }
 
-
-- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
-    // 直播课程组详情
-    LiveCourseModel *model = self.dataArray[indexPath.row];
-    if (self.selectIndex == 5) {
-        [self editLiveCourseWithGroupId:[NSString stringWithFormat:@"%.0f",model.courseGroupId]];
-        
-    }
-    else {
-        [self displayLiveCourseDetailWithGroupId:[NSString stringWithFormat:@"%.0f",model.courseGroupId]];
-    }
-}
-
-
 - (void)editLiveCourseWithGroupId:(NSString *)groupId {
     KSBaseWKWebViewController *ctrl = [[KSBaseWKWebViewController alloc] init];
     NSString *url = [NSString stringWithFormat:@"%@%@%@", WEBHOST, @"/#/liveCreate?groupId=",groupId];
@@ -300,7 +307,7 @@
     [view addSubview:self.promptView];
     [self.promptView mas_makeConstraints:^(MASConstraintMaker *make) {
         make.left.right.mas_equalTo(self);
-        make.top.mas_equalTo(self.tableView);
+        make.top.mas_equalTo(self.collectionView);
         make.height.mas_equalTo(self);
     }];
 }

+ 11 - 15
KulexiuForTeacher/KulexiuForTeacher/Module/Mine/MinePage/Controller/MinePageViewController.m

@@ -10,8 +10,6 @@
 #import "JXCategoryView.h"
 #import "JXPagerListRefreshView.h"
 #import "MinePageVIPCourseView.h"
-#import "MinePageCourseView.h"
-#import "MinePageVideoView.h"
 #import "TeacherInfo.h"
 #import "UserInfoManager.h"
 #import "MinePageTopView.h"
@@ -21,6 +19,7 @@
 #import "MinePageAccompanyCourseView.h"
 #import "MinePageVideoCourseView.h"
 #import "MinePageMusicView.h"
+#import "MinePageLiveCourseView.h"
 
 #define HEADER_HEIGHT (50)
 
@@ -120,14 +119,9 @@
 - (void)refreshAuthStatus {
     for (NSInteger index = 0; index < self.listViewArray.count; index++) {
         id view = self.listViewArray[index];
-        if ([view isKindOfClass:[MinePageCourseView class]]) {
-            MinePageCourseView *courseView = (MinePageCourseView *)view;
+        if ([view isKindOfClass:[MinePageLiveCourseView class]]) {
+            MinePageLiveCourseView *courseView = (MinePageLiveCourseView *)view;
             courseView.liveFlag = [self.teacherInfo.liveFlag isEqualToString:@"1"] ? YES : NO;
-            courseView.teaherStatus = self.teacherInfo.entryStatus;
-        }
-        else if ([view isKindOfClass:[MinePageVideoView class]]) {
-            MinePageVideoView *videoCourseView = (MinePageVideoView *)view;
-            videoCourseView.teaherStatus = self.teacherInfo.entryStatus;
         }
     }
 }
@@ -143,7 +137,11 @@
             KSJXBodyView *listView = (KSJXBodyView *)value;
             [listView beginFirstRefresh];
         }
-    }
+        else if ([value isKindOfClass:[kSJXCollectionView class]]) {
+            kSJXCollectionView *listView = (kSJXCollectionView *)value;
+            [listView beginFirstRefresh];
+        }
+     }
     [IQKeyboardManager sharedManager].enable = NO;
 }
 
@@ -186,8 +184,8 @@
 - (void)refreshSubjectMessage {
     for (NSInteger index = 0; index < self.listViewArray.count; index++) {
         id view = self.listViewArray[index];
-        if ([view isKindOfClass:[MinePageCourseView class]]) {
-            MinePageCourseView *courseView = (MinePageCourseView *)view;
+        if ([view isKindOfClass:[MinePageMusicView class]]) {
+            MinePageMusicView *courseView = (MinePageMusicView *)view;
             courseView.subjectList = [self.subjectList mutableCopy];
         }
     }
@@ -237,18 +235,16 @@
         return listView;
     }
     else if (index == 2) { // 直播
-        MinePageCourseView *listView = [[MinePageCourseView alloc] init];
+        MinePageLiveCourseView *listView = [[MinePageLiveCourseView alloc] init];
         listView.naviController = self.navigationController;
         [self.listViewArray replaceObjectAtIndex:index withObject:listView];
         self.listViewArray[index] = listView;
         listView.selectIndex = index;
         if (self.teacherInfo) {
             listView.liveFlag = [self.teacherInfo.liveFlag isEqualToString:@"1"] ? YES : NO;
-            listView.teaherStatus = self.teacherInfo.entryStatus;
         }
         else {
             listView.liveFlag = YES;
-            listView.teaherStatus = @"PASS";
         }
         [listView beginFirstRefresh];
         return listView;

+ 27 - 0
KulexiuForTeacher/KulexiuForTeacher/Module/Mine/MinePage/View/MinePageLiveCourse/MineLiveCourseGroupCell.h

@@ -0,0 +1,27 @@
+//
+//  MineLiveCourseGroupCell.h
+//  KulexiuForTeacher
+//
+//  Created by 王智 on 2024/11/18.
+//
+
+#import <UIKit/UIKit.h>
+#import "LiveCourseModel.h"
+
+typedef NS_ENUM(NSInteger, COURSERSTATUS) {
+    COURSERSTATUS_ING,        // 进行中
+    COURSERSTATUS_NOTSALE,    // 未上架
+    COURSERSTATUS_APPLY,      // 报名中
+    COURSERSTATUS_COMPLETE,   // 已完成
+    COURSERSTATUS_CANCLE,     // 已取消
+    COURSERSTATUS_OUTSALE,    // 已下架
+};
+NS_ASSUME_NONNULL_BEGIN
+
+@interface MineLiveCourseGroupCell : UICollectionViewCell
+
+- (void)configCellWithSource:(LiveCourseModel *)model groupStatus:(COURSERSTATUS)status hideStatusView:(BOOL)hideStatusView;
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 128 - 0
KulexiuForTeacher/KulexiuForTeacher/Module/Mine/MinePage/View/MinePageLiveCourse/MineLiveCourseGroupCell.m

@@ -0,0 +1,128 @@
+//
+//  MineLiveCourseGroupCell.m
+//  KulexiuForTeacher
+//
+//  Created by 王智 on 2024/11/18.
+//
+
+#import "MineLiveCourseGroupCell.h"
+
+@interface MineLiveCourseGroupCell ()
+
+@property (weak, nonatomic) IBOutlet UIView *statusView;
+@property (weak, nonatomic) IBOutlet UILabel *statusLabel;
+
+@property (weak, nonatomic) IBOutlet UIImageView *coverImage;
+@property (weak, nonatomic) IBOutlet UILabel *courseName;
+
+@property (weak, nonatomic) IBOutlet UILabel *orderUser;
+@property (weak, nonatomic) IBOutlet UILabel *courseTime;
+
+@property (weak, nonatomic) IBOutlet UILabel *priceLabel;
+@property (weak, nonatomic) IBOutlet UILabel *courseCount;
+@property (weak, nonatomic) IBOutlet UILabel *subjectLabel;
+@property (weak, nonatomic) IBOutlet UILabel *teacherDesc;
+
+@end
+
+@implementation MineLiveCourseGroupCell
+
+- (void)awakeFromNib {
+    [super awakeFromNib];
+    // Initialization code
+    [self setupRadius];
+}
+
+- (void)setupRadius {
+    _statusView.layer.cornerRadius = 10.0f;
+    _statusView.layer.maskedCorners = kCALayerMinXMaxYCorner | kCALayerMinXMinYCorner;
+}
+
+- (void)configCellWithSource:(LiveCourseModel *)model groupStatus:(COURSERSTATUS)status hideStatusView:(BOOL)hideStatusView {
+    [self.coverImage sd_setImageWithURL:[NSURL URLWithString:[model.backgroundPic getUrlEndcodeString]] placeholderImage:[UIImage imageNamed:@"video_placeholder"]];
+    self.courseName.text = [NSString returnNoNullStringWithString:model.courseGroupName];
+        
+    if (model.coursePrice > 0) {
+        self.orderUser.text = [NSString stringWithFormat:@"%.0f人已购买",model.studentCount];
+    }
+    else {
+        self.orderUser.text = [NSString stringWithFormat:@"%.0f人已领取",model.studentCount];
+    }
+    
+    if (model.coursePrice > 0) {
+        self.priceLabel.text = [NSString  stringWithFormat:@"¥%.2f",model.coursePrice];
+        
+    }
+    else {
+        self.priceLabel.text = [NSString  stringWithFormat:@"免费"];
+    }
+    
+    self.courseCount.text = [NSString stringWithFormat:@"/ %.0f课时",model.courseNum];
+    // time
+    NSDateFormatter *formatter = [NSObject getDateformatter];
+    [formatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"];
+    NSDate *startDate = [formatter dateFromString:model.courseStartTime];
+    [formatter setDateFormat:@"yyyy-MM-dd HH:mm"];
+    NSString *courseBegin = [formatter stringFromDate:startDate];
+    self.courseTime.text = [NSString returnNoNullStringWithString:courseBegin];
+    self.subjectLabel.text = [NSString returnNoNullStringWithString:model.subjectName];
+    
+    // 介绍
+    self.teacherDesc.text = [NSString returnNoNullStringWithString:model.courseIntroduce];
+    switch (status) {
+        case COURSERSTATUS_ING:
+        {
+            self.statusView.backgroundColor = HexRGB(0xd5fff7);
+            self.statusLabel.textColor = HexRGB(0x2dc7aa);
+            self.statusLabel.text = @"进行中";
+            self.orderUser.hidden = NO;
+            self.statusView.hidden = NO;
+        }
+            break;
+        case COURSERSTATUS_NOTSALE:
+        {
+            self.statusView.backgroundColor = HexRGB(0xFFEEE3);
+            self.statusLabel.textColor = HexRGB(0xFF4E19);
+            self.statusLabel.text = @"未上架";
+            self.orderUser.hidden = YES;
+        }
+            break;
+        case COURSERSTATUS_APPLY:
+        {
+            self.statusView.backgroundColor = HexRGB(0xFFE7E7);
+            self.statusLabel.textColor = HexRGB(0xFF1919);
+            self.statusLabel.text = @"销售中";
+            self.orderUser.hidden = NO;
+        }
+            break;
+        case COURSERSTATUS_COMPLETE:
+        {
+            self.statusView.backgroundColor = HexRGB(0xDEF2FF);
+            self.statusLabel.textColor = HexRGB(0x008AE0);
+            self.statusLabel.text = @"已完成";
+            self.orderUser.hidden = NO;
+            
+        }
+            break;
+        case COURSERSTATUS_CANCLE:
+        {
+            self.statusView.backgroundColor = HexRGB(0xF0F0F0);
+            self.statusLabel.textColor = HexRGB(0x666666);
+            self.statusLabel.text = @"已取消";
+            self.orderUser.hidden = NO;
+        }
+            break;
+        case COURSERSTATUS_OUTSALE:
+        {
+            self.statusView.backgroundColor = HexRGB(0xF0F0F0);
+            self.statusLabel.textColor = HexRGB(0x666666);
+            self.statusLabel.text = @"已下架";
+            self.orderUser.hidden = NO;
+        }
+            break;
+        default:
+            break;
+    }
+}
+
+@end

+ 222 - 0
KulexiuForTeacher/KulexiuForTeacher/Module/Mine/MinePage/View/MinePageLiveCourse/MineLiveCourseGroupCell.xib

@@ -0,0 +1,222 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="23504" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
+    <device id="retina6_12" orientation="portrait" appearance="light"/>
+    <dependencies>
+        <deployment identifier="iOS"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="23506"/>
+        <capability name="Safe area layout guides" minToolsVersion="9.0"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+    </dependencies>
+    <objects>
+        <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
+        <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
+        <collectionViewCell opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" id="gTV-IL-0wX" customClass="MineLiveCourseGroupCell">
+            <rect key="frame" x="0.0" y="0.0" width="285" height="287"/>
+            <autoresizingMask key="autoresizingMask"/>
+            <view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
+                <rect key="frame" x="0.0" y="0.0" width="285" height="287"/>
+                <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+                <subviews>
+                    <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="oRV-eY-dq7">
+                        <rect key="frame" x="0.0" y="0.0" width="285" height="287"/>
+                        <subviews>
+                            <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="mine_page_live_tag" translatesAutoresizingMaskIntoConstraints="NO" id="xdA-OV-wj5">
+                                <rect key="frame" x="12" y="15" width="20" height="16"/>
+                                <constraints>
+                                    <constraint firstAttribute="height" constant="16" id="9EG-i8-1O6"/>
+                                    <constraint firstAttribute="width" constant="20" id="sW7-3N-Ttb"/>
+                                </constraints>
+                            </imageView>
+                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" horizontalCompressionResistancePriority="752" text="开课时间:" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="0Gb-VJ-opm">
+                                <rect key="frame" x="39" y="13" width="62.666666666666657" height="20"/>
+                                <constraints>
+                                    <constraint firstAttribute="height" constant="20" id="te3-si-gN2"/>
+                                </constraints>
+                                <fontDescription key="fontDescription" type="system" weight="semibold" pointSize="14"/>
+                                <color key="textColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                <nil key="highlightedColor"/>
+                            </label>
+                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" horizontalCompressionResistancePriority="749" text="2024-11-16 09:30" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="L1q-Ls-jli">
+                                <rect key="frame" x="101.66666666666666" y="13" width="122.66666666666666" height="20"/>
+                                <constraints>
+                                    <constraint firstAttribute="height" constant="20" id="fjp-3H-eEd"/>
+                                </constraints>
+                                <fontDescription key="fontDescription" type="system" weight="semibold" pointSize="14"/>
+                                <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="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="video_placeholder" translatesAutoresizingMaskIntoConstraints="NO" id="vAB-E9-FHQ">
+                                <rect key="frame" x="12" y="46" width="261" height="146.66666666666666"/>
+                                <constraints>
+                                    <constraint firstAttribute="width" secondItem="vAB-E9-FHQ" secondAttribute="height" multiplier="16:9" id="4c2-BJ-yji"/>
+                                </constraints>
+                                <userDefinedRuntimeAttributes>
+                                    <userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
+                                        <real key="value" value="6"/>
+                                    </userDefinedRuntimeAttribute>
+                                </userDefinedRuntimeAttributes>
+                            </imageView>
+                            <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="4he-A4-4f0">
+                                <rect key="frame" x="20" y="54" width="36" height="19"/>
+                                <subviews>
+                                    <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="长笛" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="jUo-GT-p8T">
+                                        <rect key="frame" x="6" y="3.0000000000000009" width="24" height="13.333333333333336"/>
+                                        <fontDescription key="fontDescription" type="system" pointSize="12"/>
+                                        <color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                                        <nil key="highlightedColor"/>
+                                    </label>
+                                </subviews>
+                                <color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.40000000000000002" colorSpace="custom" customColorSpace="sRGB"/>
+                                <constraints>
+                                    <constraint firstAttribute="trailing" secondItem="jUo-GT-p8T" secondAttribute="trailing" constant="6" id="6hg-ez-jU3"/>
+                                    <constraint firstAttribute="height" constant="19" id="Aec-os-lVl"/>
+                                    <constraint firstItem="jUo-GT-p8T" firstAttribute="leading" secondItem="4he-A4-4f0" secondAttribute="leading" constant="6" id="HtJ-ED-DTz"/>
+                                    <constraint firstItem="jUo-GT-p8T" firstAttribute="centerY" secondItem="4he-A4-4f0" secondAttribute="centerY" id="KoS-Uj-H6R"/>
+                                </constraints>
+                                <userDefinedRuntimeAttributes>
+                                    <userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
+                                        <real key="value" value="3"/>
+                                    </userDefinedRuntimeAttribute>
+                                </userDefinedRuntimeAttributes>
+                            </view>
+                            <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="yTY-zb-NMC">
+                                <rect key="frame" x="219" y="53" width="54" height="20"/>
+                                <subviews>
+                                    <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="进行中" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="o0s-oa-65j">
+                                        <rect key="frame" x="12" y="4" width="30" height="12"/>
+                                        <fontDescription key="fontDescription" type="system" pointSize="10"/>
+                                        <color key="textColor" red="1" green="0.20410433411598206" blue="0.1207968071103096" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                        <nil key="highlightedColor"/>
+                                    </label>
+                                </subviews>
+                                <color key="backgroundColor" red="1" green="0.90588235294117647" blue="0.90588235294117647" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                <constraints>
+                                    <constraint firstAttribute="trailing" secondItem="o0s-oa-65j" secondAttribute="trailing" constant="12" id="ISH-Im-voT"/>
+                                    <constraint firstAttribute="height" constant="20" id="fxo-9X-jYR"/>
+                                    <constraint firstItem="o0s-oa-65j" firstAttribute="centerY" secondItem="yTY-zb-NMC" secondAttribute="centerY" id="nsj-rP-gxR"/>
+                                    <constraint firstItem="o0s-oa-65j" firstAttribute="leading" secondItem="yTY-zb-NMC" secondAttribute="leading" constant="12" id="v4p-QW-eTa"/>
+                                </constraints>
+                            </view>
+                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="从零开始学竖笛直播课" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="4zV-AG-v6z">
+                                <rect key="frame" x="12" y="200.66666666666666" width="261" height="22"/>
+                                <constraints>
+                                    <constraint firstAttribute="height" constant="22" id="SIK-Qh-kDT"/>
+                                </constraints>
+                                <fontDescription key="fontDescription" type="system" weight="semibold" pointSize="16"/>
+                                <color key="textColor" red="0.074509803921568626" green="0.078431372549019607" blue="0.082352941176470587" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                <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="fVi-EI-HNi">
+                                <rect key="frame" x="12" y="226.66666666666666" width="261" height="20"/>
+                                <constraints>
+                                    <constraint firstAttribute="height" constant="20" id="1Cl-ud-umW"/>
+                                </constraints>
+                                <fontDescription key="fontDescription" type="system" pointSize="14"/>
+                                <color key="textColor" red="0.46666666666666667" green="0.46666666666666667" blue="0.46666666666666667" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                <nil key="highlightedColor"/>
+                            </label>
+                            <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="L2D-Md-biT">
+                                <rect key="frame" x="12" y="254" width="65" height="19"/>
+                                <subviews>
+                                    <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="6人已购买" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Jy4-WH-Grt">
+                                        <rect key="frame" x="4" y="2.3333333333333153" width="57" height="14.333333333333336"/>
+                                        <fontDescription key="fontDescription" type="system" pointSize="12"/>
+                                        <color key="textColor" red="1" green="0.40784313725490196" blue="0.15294117647058825" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                        <nil key="highlightedColor"/>
+                                    </label>
+                                </subviews>
+                                <color key="backgroundColor" red="1" green="0.50196078431372548" blue="0.17254901960784313" alpha="0.070000000000000007" colorSpace="custom" customColorSpace="sRGB"/>
+                                <constraints>
+                                    <constraint firstAttribute="trailing" secondItem="Jy4-WH-Grt" secondAttribute="trailing" constant="4" id="8Yn-R4-osn"/>
+                                    <constraint firstAttribute="height" constant="19" id="LRW-XQ-mwb"/>
+                                    <constraint firstItem="Jy4-WH-Grt" firstAttribute="leading" secondItem="L2D-Md-biT" secondAttribute="leading" constant="4" id="P3A-pt-FxI"/>
+                                    <constraint firstItem="Jy4-WH-Grt" firstAttribute="centerY" secondItem="L2D-Md-biT" secondAttribute="centerY" id="aYy-Fa-1Fq"/>
+                                </constraints>
+                                <userDefinedRuntimeAttributes>
+                                    <userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
+                                        <real key="value" value="2"/>
+                                    </userDefinedRuntimeAttribute>
+                                </userDefinedRuntimeAttributes>
+                            </view>
+                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="¥120" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="6cN-Qs-aEM">
+                                <rect key="frame" x="173.66666666666666" y="251" width="49" height="24"/>
+                                <constraints>
+                                    <constraint firstAttribute="height" constant="24" id="dVD-1n-VbO"/>
+                                </constraints>
+                                <fontDescription key="fontDescription" name="DINAlternate-Bold" family="DIN Alternate" pointSize="20"/>
+                                <color key="textColor" red="0.95686274509803915" green="0.27058823529411763" blue="0.25490196078431371" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                <nil key="highlightedColor"/>
+                            </label>
+                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="/4课时" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Vjg-7W-RnJ">
+                                <rect key="frame" x="230.66666666666666" y="256" width="42.333333333333343" height="17"/>
+                                <fontDescription key="fontDescription" type="system" pointSize="14"/>
+                                <color key="textColor" red="0.59999999999999998" green="0.59999999999999998" blue="0.59999999999999998" alpha="1" colorSpace="calibratedRGB"/>
+                                <nil key="highlightedColor"/>
+                            </label>
+                        </subviews>
+                        <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                        <constraints>
+                            <constraint firstItem="4zV-AG-v6z" firstAttribute="top" secondItem="vAB-E9-FHQ" secondAttribute="bottom" constant="8" id="0i0-H1-hFr"/>
+                            <constraint firstAttribute="trailing" secondItem="fVi-EI-HNi" secondAttribute="trailing" constant="12" id="1Hm-ff-sWl"/>
+                            <constraint firstItem="fVi-EI-HNi" firstAttribute="top" secondItem="4zV-AG-v6z" secondAttribute="bottom" constant="4" id="36l-FH-DQg"/>
+                            <constraint firstItem="vAB-E9-FHQ" firstAttribute="leading" secondItem="oRV-eY-dq7" secondAttribute="leading" constant="12" id="4Sh-KB-wqN"/>
+                            <constraint firstItem="yTY-zb-NMC" firstAttribute="top" secondItem="vAB-E9-FHQ" secondAttribute="top" constant="7" id="8OW-Xf-9H7"/>
+                            <constraint firstAttribute="bottom" secondItem="Vjg-7W-RnJ" secondAttribute="bottom" constant="14" id="9SP-Sg-vZv"/>
+                            <constraint firstItem="Vjg-7W-RnJ" firstAttribute="leading" secondItem="6cN-Qs-aEM" secondAttribute="trailing" constant="8" id="9ak-Kw-gjF"/>
+                            <constraint firstItem="0Gb-VJ-opm" firstAttribute="centerY" secondItem="xdA-OV-wj5" secondAttribute="centerY" id="CR4-UW-XoV"/>
+                            <constraint firstItem="xdA-OV-wj5" firstAttribute="top" secondItem="oRV-eY-dq7" secondAttribute="top" constant="15" id="Gzd-oJ-mYe"/>
+                            <constraint firstAttribute="trailing" secondItem="Vjg-7W-RnJ" secondAttribute="trailing" constant="12" id="Nfj-7d-Hgh"/>
+                            <constraint firstAttribute="bottom" secondItem="L2D-Md-biT" secondAttribute="bottom" constant="14" id="O7X-Nf-Xek"/>
+                            <constraint firstItem="L1q-Ls-jli" firstAttribute="centerY" secondItem="0Gb-VJ-opm" secondAttribute="centerY" id="POs-gc-W6h"/>
+                            <constraint firstItem="4zV-AG-v6z" firstAttribute="leading" secondItem="oRV-eY-dq7" secondAttribute="leading" constant="12" id="Qtd-vN-Edb"/>
+                            <constraint firstItem="fVi-EI-HNi" firstAttribute="leading" secondItem="oRV-eY-dq7" secondAttribute="leading" constant="12" id="R6S-Os-f5p"/>
+                            <constraint firstItem="L2D-Md-biT" firstAttribute="leading" secondItem="oRV-eY-dq7" secondAttribute="leading" constant="12" id="SQw-ea-PP8"/>
+                            <constraint firstAttribute="trailing" secondItem="4zV-AG-v6z" secondAttribute="trailing" constant="12" id="V4Y-hv-qQd"/>
+                            <constraint firstItem="xdA-OV-wj5" firstAttribute="leading" secondItem="oRV-eY-dq7" secondAttribute="leading" constant="12" id="Wal-A1-le5"/>
+                            <constraint firstItem="vAB-E9-FHQ" firstAttribute="top" secondItem="xdA-OV-wj5" secondAttribute="bottom" constant="15" id="aln-19-hca"/>
+                            <constraint firstItem="4he-A4-4f0" firstAttribute="leading" secondItem="vAB-E9-FHQ" secondAttribute="leading" constant="8" id="bZV-nv-Srv"/>
+                            <constraint firstItem="Vjg-7W-RnJ" firstAttribute="bottom" secondItem="6cN-Qs-aEM" secondAttribute="bottom" constant="-2" id="buL-x6-ksg"/>
+                            <constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="L1q-Ls-jli" secondAttribute="trailing" constant="12" id="cso-cX-VCK"/>
+                            <constraint firstItem="yTY-zb-NMC" firstAttribute="trailing" secondItem="vAB-E9-FHQ" secondAttribute="trailing" id="iWh-s9-WoZ"/>
+                            <constraint firstItem="L1q-Ls-jli" firstAttribute="leading" secondItem="0Gb-VJ-opm" secondAttribute="trailing" id="sf8-Et-4cE"/>
+                            <constraint firstItem="4he-A4-4f0" firstAttribute="top" secondItem="vAB-E9-FHQ" secondAttribute="top" constant="8" id="vH0-Hw-yHR"/>
+                            <constraint firstAttribute="trailing" secondItem="vAB-E9-FHQ" secondAttribute="trailing" constant="12" id="xG6-Yj-VHB"/>
+                            <constraint firstItem="0Gb-VJ-opm" firstAttribute="leading" secondItem="xdA-OV-wj5" secondAttribute="trailing" constant="7" id="zK2-tO-g5X"/>
+                            <constraint firstItem="L1q-Ls-jli" firstAttribute="centerY" secondItem="0Gb-VJ-opm" secondAttribute="centerY" id="zfo-iU-T2L"/>
+                        </constraints>
+                        <userDefinedRuntimeAttributes>
+                            <userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
+                                <real key="value" value="6"/>
+                            </userDefinedRuntimeAttribute>
+                        </userDefinedRuntimeAttributes>
+                    </view>
+                </subviews>
+            </view>
+            <viewLayoutGuide key="safeArea" id="SEy-5g-ep8"/>
+            <constraints>
+                <constraint firstAttribute="bottom" secondItem="oRV-eY-dq7" secondAttribute="bottom" id="Fky-tQ-2yT"/>
+                <constraint firstItem="oRV-eY-dq7" firstAttribute="top" secondItem="gTV-IL-0wX" secondAttribute="top" id="MQX-bk-fk6"/>
+                <constraint firstItem="oRV-eY-dq7" firstAttribute="leading" secondItem="gTV-IL-0wX" secondAttribute="leading" id="b67-JI-fdi"/>
+                <constraint firstAttribute="trailing" secondItem="oRV-eY-dq7" secondAttribute="trailing" id="ion-cs-TCG"/>
+            </constraints>
+            <size key="customSize" width="285" height="291"/>
+            <connections>
+                <outlet property="courseCount" destination="Vjg-7W-RnJ" id="AC9-29-iiy"/>
+                <outlet property="courseName" destination="4zV-AG-v6z" id="PQA-tI-WnM"/>
+                <outlet property="courseTime" destination="L1q-Ls-jli" id="fAL-cW-y0a"/>
+                <outlet property="coverImage" destination="vAB-E9-FHQ" id="r8q-zR-NKF"/>
+                <outlet property="orderUser" destination="Jy4-WH-Grt" id="Yfb-dR-Ai8"/>
+                <outlet property="priceLabel" destination="6cN-Qs-aEM" id="KDy-ya-8bS"/>
+                <outlet property="statusLabel" destination="o0s-oa-65j" id="cXG-m7-vo5"/>
+                <outlet property="statusView" destination="yTY-zb-NMC" id="ghW-PV-chX"/>
+                <outlet property="subjectLabel" destination="jUo-GT-p8T" id="gPU-lT-YWZ"/>
+                <outlet property="teacherDesc" destination="fVi-EI-HNi" id="Abh-M5-AbX"/>
+            </connections>
+            <point key="canvasLocation" x="156.4885496183206" y="99.647887323943664"/>
+        </collectionViewCell>
+    </objects>
+    <resources>
+        <image name="mine_page_live_tag" width="20" height="16"/>
+        <image name="video_placeholder" width="103" height="72"/>
+    </resources>
+</document>

+ 0 - 16
KulexiuForTeacher/KulexiuForTeacher/Module/Mine/MinePage/View/MinePageLiveCourse/MinePageLiveCourseGroupCell.h

@@ -1,16 +0,0 @@
-//
-//  MinePageLiveCourseGroupCell.h
-//  KulexiuForTeacher
-//
-//  Created by 王智 on 2024/11/18.
-//
-
-#import <UIKit/UIKit.h>
-
-NS_ASSUME_NONNULL_BEGIN
-
-@interface MinePageLiveCourseGroupCell : UITableViewCell
-
-@end
-
-NS_ASSUME_NONNULL_END

+ 0 - 26
KulexiuForTeacher/KulexiuForTeacher/Module/Mine/MinePage/View/MinePageLiveCourse/MinePageLiveCourseGroupCell.m

@@ -1,26 +0,0 @@
-//
-//  MinePageLiveCourseGroupCell.m
-//  KulexiuForTeacher
-//
-//  Created by 王智 on 2024/11/18.
-//
-
-#import "MinePageLiveCourseGroupCell.h"
-
-@implementation MinePageLiveCourseGroupCell
-
-- (void)awakeFromNib {
-    [super awakeFromNib];
-    // Initialization code
-    self.selectionStyle = UITableViewCellSelectionStyleNone;
-}
-
-
-
-- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
-    [super setSelected:selected animated:animated];
-
-    // Configure the view for the selected state
-}
-
-@end

+ 0 - 69
KulexiuForTeacher/KulexiuForTeacher/Module/Mine/MinePage/View/MinePageLiveCourse/MinePageLiveCourseGroupCell.xib

@@ -1,69 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="23504" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
-    <device id="retina6_12" orientation="portrait" appearance="light"/>
-    <dependencies>
-        <deployment identifier="iOS"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="23506"/>
-        <capability name="Safe area layout guides" minToolsVersion="9.0"/>
-        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
-    </dependencies>
-    <objects>
-        <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
-        <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
-        <tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" rowHeight="236" id="KGk-i7-Jjw" customClass="MinePageLiveCourseGroupCell">
-            <rect key="frame" x="0.0" y="0.0" width="335" height="236"/>
-            <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
-            <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM">
-                <rect key="frame" x="0.0" y="0.0" width="335" height="236"/>
-                <autoresizingMask key="autoresizingMask"/>
-                <subviews>
-                    <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="SVw-BB-Sxt">
-                        <rect key="frame" x="14" y="0.0" width="307" height="224"/>
-                        <subviews>
-                            <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="goo-Bu-bsj">
-                                <rect key="frame" x="8" y="14" width="35" height="24"/>
-                                <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
-                            </imageView>
-                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="开课时间:" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="cRF-wl-5mR">
-                                <rect key="frame" x="51" y="16" width="63" height="17"/>
-                                <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
-                                <fontDescription key="fontDescription" type="system" weight="semibold" pointSize="14"/>
-                                <color key="textColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
-                                <nil key="highlightedColor"/>
-                            </label>
-                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="2024-11-16 09:30" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="XmG-2z-3ZS">
-                                <rect key="frame" x="122" y="16" width="123" height="17"/>
-                                <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
-                                <fontDescription key="fontDescription" type="system" weight="semibold" pointSize="14"/>
-                                <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" ambiguous="YES" translatesAutoresizingMaskIntoConstraints="NO" id="HqD-99-lz3">
-                                <rect key="frame" x="12" y="57" width="283" height="128"/>
-                            </imageView>
-                        </subviews>
-                        <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
-                        <constraints>
-                            <constraint firstItem="HqD-99-lz3" firstAttribute="leading" secondItem="SVw-BB-Sxt" secondAttribute="leading" constant="12" id="HsW-Dj-t8J"/>
-                            <constraint firstAttribute="trailing" secondItem="HqD-99-lz3" secondAttribute="trailing" constant="12" id="pTs-tB-JHG"/>
-                        </constraints>
-                        <userDefinedRuntimeAttributes>
-                            <userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
-                                <real key="value" value="6"/>
-                            </userDefinedRuntimeAttribute>
-                        </userDefinedRuntimeAttributes>
-                    </view>
-                </subviews>
-                <constraints>
-                    <constraint firstItem="SVw-BB-Sxt" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="14" id="DA1-zh-8dt"/>
-                    <constraint firstAttribute="trailing" secondItem="SVw-BB-Sxt" secondAttribute="trailing" constant="14" id="Edl-zX-LKU"/>
-                    <constraint firstItem="SVw-BB-Sxt" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" id="O0z-Wz-0cq"/>
-                    <constraint firstAttribute="bottom" secondItem="SVw-BB-Sxt" secondAttribute="bottom" constant="12" id="iUf-0K-E3E"/>
-                </constraints>
-            </tableViewCellContentView>
-            <viewLayoutGuide key="safeArea" id="aW0-zy-SZf"/>
-            <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
-            <point key="canvasLocation" x="66.412213740458014" y="87.323943661971839"/>
-        </tableViewCell>
-    </objects>
-</document>

+ 2 - 6
KulexiuForTeacher/KulexiuForTeacher/Module/Mine/MinePage/View/MinePageLiveCourse/MinePageLiveCourseView.h

@@ -5,20 +5,16 @@
 //  Created by 王智 on 2024/11/18.
 //
 
-#import "KSJXBodyView.h"
+#import "kSJXCollectionView.h"
 #import "StateView.h"
 #import "Reachability.h"
 
 NS_ASSUME_NONNULL_BEGIN
 
-@interface MinePageLiveCourseView : KSJXBodyView
-
-@property (nonatomic, strong) NSString *teaherStatus;
+@interface MinePageLiveCourseView : kSJXCollectionView
 
 @property (nonatomic, assign) BOOL liveFlag; // 是否有直播权限
 
-@property (nonatomic, strong) NSMutableArray *subjectList;
-
 @end
 
 NS_ASSUME_NONNULL_END

+ 428 - 1
KulexiuForTeacher/KulexiuForTeacher/Module/Mine/MinePage/View/MinePageLiveCourse/MinePageLiveCourseView.m

@@ -6,13 +6,440 @@
 //
 
 #import "MinePageLiveCourseView.h"
+#import "MinePageCourseTipsView.h"
+#import "MineCourseSettingView.h"
+#import "MineLiveCourseGroupCell.h"
+#import "LiveCourseModel.h"
+#import "StateView.h"
+#import "Reachability.h"
+#import "KSBaseWKWebViewController.h"
+#import "AuthDisplayView.h"
 
-@interface MinePageLiveCourseView ()
+
+@interface MinePageLiveCourseView ()<UICollectionViewDelegate,UICollectionViewDataSource,UICollectionViewDelegateFlowLayout>
+@property (nonatomic, strong) NSMutableArray *dataArray;
+
+@property (nonatomic, strong) StateView *promptView;
+@property (nonatomic, strong) UIView *promptPlaceView;
+
+@property (nonatomic, assign) BOOL networkAvaiable; // 网络是否可用
+
+@property (nonatomic, assign) BOOL isLoadMore;
+@property (nonatomic, assign) NSInteger rows;
+@property (nonatomic, assign) NSInteger pages;
+
+@property (nonatomic, strong) UIView *headView;
+
+@property (nonatomic, strong) MinePageCourseTipsView *tipsView;
+
+@property (nonatomic, strong) MineCourseSettingView *settingView;
+
+@property (nonatomic, assign) BOOL hideTips; // 是否隐藏提示
+
+@property (nonatomic, strong) AuthDisplayView *authView;
 
 @end
 
 @implementation MinePageLiveCourseView
 
+- (instancetype)initWithFrame:(CGRect)frame {
+    self = [super initWithFrame:frame];
+    if (self) {
+        self.backgroundColor = HexRGB(0xf8f9fc);
+        UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init];
+        layout.sectionInset = UIEdgeInsetsMake(12, 14, 12, 14);
+        
+        self.collectionView = [[UICollectionView alloc] initWithFrame:CGRectMake(0, 0, frame.size.width, frame.size.height) collectionViewLayout:layout];
+        self.collectionView.backgroundColor = HexRGB(0xf8f9fc);
+        self.collectionView.delegate = self;
+        self.collectionView.dataSource = self;
+        self.collectionView.showsVerticalScrollIndicator = NO;
+        self.collectionView.showsHorizontalScrollIndicator = NO;
+        [self.collectionView registerNib:[UINib nibWithNibName:@"MineLiveCourseGroupCell" bundle:[NSBundle mainBundle]] forCellWithReuseIdentifier:@"MineLiveCourseGroupCell"];
+        [self addSubview:self.collectionView];
+        self.collectionView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
+        MJWeakSelf;
+        self.collectionView.mj_header = [KSGifRefreshHeader headerWithRefreshingBlock:^{
+            [weakSelf resetParamenter];
+            [weakSelf requestData];
+        }];
+        self.collectionView.mj_footer = [KSGifRefreshFooter footerWithRefreshingBlock:^{
+            if (weakSelf.isLoadMore) {
+                weakSelf.pages += 1;
+                [weakSelf requestData];
+            }
+            else {
+                [weakSelf.collectionView.mj_footer endRefreshingWithNoMoreData];
+            }
+        }];
+    }
+    return self;
+}
+
+- (void)endRefresh {
+    @weakObj(self);
+    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
+        @strongObj(self);
+        [self.collectionView.mj_header endRefreshing];
+        [self.collectionView.mj_footer endRefreshing];
+    });
+}
+
+- (void)refreshAndRequestData {
+    [self resetParamenter];
+    [self requestData];
+}
+
+- (void)resetParamenter {
+    self.isLoadMore = YES;
+    self.pages = 1;
+    self.rows = 10;
+    self.dataArray = [NSMutableArray array];
+    [self.collectionView.mj_footer resetNoMoreData];
+    [self setPromptString:@"暂无内容" imageName:@"empty_course" inView:self.collectionView];
+    [self.collectionView reloadData];
+}
+
+- (void)requestData {
+    [KSNetworkingManager LiveCourseGroupRequest:KS_POST groupStatus:@"APPLY" page:self.pages rows:self.rows success:^(NSDictionary * _Nonnull dic) {
+        [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) {
+                LiveCourseModel *model = [[LiveCourseModel alloc] initWithDictionary:parm];
+                [self.dataArray addObject:model];
+            }
+            
+            if (sourceArray.count < self.rows) {
+                self.isLoadMore = NO;
+            }
+        }
+        else {
+            [LOADING_MANAGER MBShowAUTOHidingInWindow:MESSAGEKEY];
+        }
+        [self.collectionView reloadData];
+        [self changePromptLabelStateWithArray:self.dataArray];
+    } faliure:^(NSError * _Nonnull error) {
+        [self endRefresh];
+        if (self.networkAvaiable == NO) {
+            [self setPromptString:@"暂无网络" imageName:@"no_networking" inView:self.collectionView];
+        }
+        [self.dataArray removeAllObjects];
+        [self.collectionView reloadData];
+        [self changePromptLabelStateWithArray:self.dataArray];
+    }];
+}
+
+- (void)beginRefreshImmediately {
+    [self.collectionView.mj_header beginRefreshing];
+}
+
+- (void)selectCellAtIndexPath:(NSIndexPath *)indexPath {
+    
+    if (self.lastSelectedIndexPath == indexPath) {
+        return;
+    }
+    if (self.lastSelectedIndexPath != nil) {
+        UICollectionViewCell *cell = [self.collectionView cellForItemAtIndexPath:self.lastSelectedIndexPath];
+        [cell setSelected:NO];
+    }
+    UICollectionViewCell *cell = [self.collectionView cellForItemAtIndexPath:indexPath];
+    [cell setSelected:YES];
+    self.lastSelectedIndexPath = indexPath;
+}
+
+- (void)layoutSubviews {
+    [super layoutSubviews];
+    CGFloat tipsHeight = [self.tipsView getViewHeight];
+    CGFloat settingHeight = [MineCourseSettingView getViewHeight];
+    CGFloat headHeight = 0.0f;
+    if (self.hideTips) {
+        headHeight = settingHeight + 12;
+    }
+    else {
+        headHeight = tipsHeight + settingHeight + 12;
+    }
+    
+    if (![self.subviews containsObject:self.headView]) {
+        [self addSubview:self.headView];
+        [self evaluateHeadView];
+        [self.headView mas_makeConstraints:^(MASConstraintMaker *make) {
+            make.left.right.top.mas_equalTo(self);
+            make.height.mas_equalTo(headHeight);
+        }];
+    }
+    else {
+        [self.headView mas_updateConstraints:^(MASConstraintMaker *make) {
+            make.height.mas_equalTo(headHeight);
+        }];
+        if (self.hideTips) {
+            self.tipsView.hidden = YES;
+            [self.tipsView mas_updateConstraints:^(MASConstraintMaker *make) {
+                make.height.mas_equalTo(0);
+            }];
+        }
+        else {
+            self.tipsView.hidden = NO;
+            [self.tipsView mas_updateConstraints:^(MASConstraintMaker *make) {
+                make.height.mas_equalTo(tipsHeight);
+            }];
+        }
+    }
+    
+    [self.collectionView mas_remakeConstraints:^(MASConstraintMaker *make) {
+        make.left.right.bottom.mas_equalTo(self);
+        make.top.mas_equalTo(self.headView.mas_bottom);
+    }];
+}
+
+- (void)evaluateHeadView {
+    
+    CGFloat tipsHeight = 0.0f;
+    if (self.hideTips == NO) {
+        tipsHeight = [self.tipsView getViewHeight];
+    }
+    CGFloat settingHeight = [MineCourseSettingView getViewHeight];
+    [self.headView addSubview:self.tipsView];
+    [self.tipsView mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.left.right.top.mas_equalTo(self.headView);
+        make.height.mas_equalTo(tipsHeight);
+    }];
+    [self.headView addSubview:self.settingView];
+    [self.settingView mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.left.right.mas_equalTo(self.headView);
+        make.bottom.mas_equalTo(self.headView.mas_bottom).offset(-12);
+        make.height.mas_equalTo(settingHeight);
+    }];
+}
+
+- (void)beginFirstRefresh {
+    if (!self.isHeaderRefreshed) {
+        [self beginRefreshImmediately];
+    }
+}
+
+#pragma mark ----- collection view
+- (NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView {
+    return 1;
+}
+
+- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
+    return self.dataArray.count;
+}
+
+- (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
+    MineLiveCourseGroupCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"MineLiveCourseGroupCell" forIndexPath:indexPath];
+    
+    LiveCourseModel *model = [self.dataArray objectAtIndex:indexPath.row];
+    [cell configCellWithSource:model groupStatus:COURSERSTATUS_APPLY hideStatusView:YES];
+    return cell;
+}
+
+- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
+    LiveCourseModel *model = self.dataArray[indexPath.row];
+    KSBaseWKWebViewController *ctrl = [[KSBaseWKWebViewController alloc] init];
+    NSString *url = [NSString stringWithFormat:@"%@%@%.0f", WEBHOST, @"/#/liveDetail?groupId=",model.courseGroupId];
+    ctrl.url = url;
+    [self.naviController pushViewController:ctrl animated:YES];
+}
+
+- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath {
+    CGFloat width = KPortraitWidth - 28;
+    if (IS_IPAD) {
+        width = (KPortraitWidth - 28 - 12 * 2 - 12) / 2.0f;
+    }
+    CGFloat height = (width - 12 * 2) / 16 * 9 + 143;
+    return CGSizeMake(width, height);
+}
+
+#pragma mark ----- lazying
+
+- (UIView *)headView {
+    if (!_headView) {
+        _headView = [[UIView alloc] initWithFrame:CGRectZero];
+        _headView.backgroundColor = [UIColor clearColor];
+    }
+    return _headView;
+}
+
+- (AuthDisplayView *)authView {
+    if (!_authView) {
+        _authView = [AuthDisplayView shareInstance];
+        [_authView.imageView setImage:[UIImage imageNamed:[self getAuthDisplayImage]]];
+        MJWeakSelf;
+        [_authView sureCallback:^{
+            [weakSelf authAction];
+        }];
+    }
+    return _authView;
+}
+
+- (NSString *)getAuthDisplayImage {
+    return @"authTeacher_Live";
+}
+
+- (MinePageCourseTipsView *)tipsView {
+    if (!_tipsView) {
+        _tipsView = [MinePageCourseTipsView shareIntance];
+        MJWeakSelf;
+        [_tipsView configWithTypeImage:@"minePage_course_introduce" headTitle:@"什么是直播课?" descMsg:@"直播课是老师根据教学目的精心编排的课程,按照固定时间进行直播授课。您可根据老师开放的课程内容,选择自己感兴趣的课程进行学习。如果您错过了直播,也不必担心,可以随时观看直播回放。" callback:^(COURSE_TIPS_ACTION action) {
+            [weakSelf courseTipsAction:action];
+        }];
+    }
+    return _tipsView;
+}
+
+- (MineCourseSettingView *)settingView {
+    if (!_settingView) {
+        _settingView = [MineCourseSettingView shareInstance];
+        MJWeakSelf;
+        [_settingView configWithCourseType:COURSE_TYPE_LIVE callback:^{
+            [weakSelf settingCourseAction];
+        }];
+    }
+    return _settingView;
+}
+
+- (void)settingCourseAction {
+    // 设置
+    KSBaseWKWebViewController *webCtrl = [[KSBaseWKWebViewController alloc] init];
+    webCtrl.url = [NSString stringWithFormat:@"%@%@", WEBHOST, @"/#/liveCreate"];
+    [self.naviController pushViewController:webCtrl animated:YES];
+}
+
+- (void)courseTipsAction:(COURSE_TIPS_ACTION)action {
+    switch (action) {
+        case COURSE_TIPS_ACTION_REMOVE:
+        {
+            self.hideTips = YES;
+            [self setNeedsLayout];
+        }
+            break;
+        case COURSE_TIPS_ACTION_STOPREMIND:
+        {
+            self.hideTips = YES;
+            [self setNeedsLayout];
+        }
+            break;
+        default:
+            break;
+    }
+}
+
+/**
+ 设置没有数据时的显示
+ 
+ @param promptString 提示语
+ @param imgName 图片名称
+ @param view 显示在什么地方
+ */
+- (void)setPromptString:(NSString *)promptString imageName:(NSString *)imgName inView:(UIView *)view {
+    if (self.promptView != nil) {
+        [self.promptView removeFromSuperview];
+    }
+    else {
+        self.promptView = [[StateView alloc]init];
+        self.promptView.frame = CGRectMake(0, 0, KPortraitWidth, KPortraitHeight - 300);
+    }
+    _promptPlaceView = view;
+    //当请求不到数据时 ,自定义提示view 将会出现;
+    self.promptView.imageName = imgName;
+    self.promptView.alpha = 0.0f;
+    [self.promptView setText:promptString];
+    [view addSubview:self.promptView];
+}
+
+// 结束刷新后调用方法
+- (void)changePromptLabelStateWithArray:(NSMutableArray *)array {
+    NSInteger count;
+    if (array.count) {
+        count = array.count;
+    } else {
+        count = 0;
+    }
+    
+    [UIView animateWithDuration:0.1 animations:^{
+        [[self promptView] setAlpha:count ? 0.0f :1.0f ] ;
+    }] ;
+    
+}
+
+- (BOOL)networkAvaiable {
+    return [self checkNetworkAvaiable];
+}
+
+- (BOOL)checkNetworkAvaiable {
+    BOOL isExistenceNetwork = YES;
+    Reachability *reach = [Reachability reachabilityWithHostName:@"www.apple.com"];
+    switch ([reach currentReachabilityStatus]) {
+        case NotReachable:
+            isExistenceNetwork = NO;
+            //NSLog(@"notReachable");
+            break;
+        case ReachableViaWiFi:
+            isExistenceNetwork = YES;
+            //NSLog(@"WIFI");
+            break;
+        case ReachableViaWWAN:
+            isExistenceNetwork = YES;
+            //NSLog(@"3G");
+            break;
+    }
+    return isExistenceNetwork;
+}
+
+- (void)setLiveFlag:(BOOL)liveFlag {
+    _liveFlag = liveFlag;
+    if (liveFlag == NO) {
+        [self showAuthView];
+    }
+    else {
+        [self hideAuthView];
+    }
+}
+
+- (void)showAuthView {
+    [self configAuthDisplay];
+    if ([self.subviews containsObject:self.authView]) {
+        [self bringSubviewToFront:self.authView];
+    }
+    else {
+        [self addSubview:self.authView];
+        [self.authView mas_makeConstraints:^(MASConstraintMaker *make) {
+            make.left.top.bottom.right.mas_equalTo(self);
+        }];
+    }
+}
+
+- (void)hideAuthView {
+    if ([self.subviews containsObject:self.authView]) {
+        [self.authView removeFromSuperview];
+        self.authView = nil;
+    }
+}
+
+- (void)configAuthDisplay {
+    [self.authView configDisplayMessage:[self getAuthDisplayMessage]];
+    if (self.liveFlag == NO) {
+        [self.authView.sureButton setTitle:@"立即开通" forState:UIControlStateNormal];
+        self.authView.sureButton.userInteractionEnabled = YES;
+        self.authView.sureButton.hidden = NO;
+    }
+}
+
+- (NSString *)getAuthDisplayMessage {
+    if (self.liveFlag == NO) { // 如果达人认证通过
+        return @"您尚未开通直播服务,开通后即可创建直播课程~";
+    }
+    return @"";
+}
+
+// 开通直播
+- (void)authAction {
+    KSBaseWKWebViewController *webCtrl = [[KSBaseWKWebViewController alloc] init];
+    webCtrl.url = [NSString stringWithFormat:@"%@%@", WEBHOST, @"/#/openLive"];
+    [self.naviController pushViewController:webCtrl animated:YES];
+}
 /*
 // Only override drawRect: if you perform custom drawing.
 // An empty implementation adversely affects performance during animation.

+ 14 - 14
KulexiuForTeacher/KulexiuForTeacher/Module/Mine/MinePage/View/MinePageVideoCell.xib

@@ -1,9 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="32700.99.1234" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="23504" 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="22684"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="23506"/>
         <capability name="Safe area layout guides" minToolsVersion="9.0"/>
         <capability name="System colors in document resources" minToolsVersion="11.0"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
@@ -12,14 +12,14 @@
         <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
         <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
         <collectionViewCell opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" id="gTV-IL-0wX" customClass="MinePageVideoCell">
-            <rect key="frame" x="0.0" y="0.0" width="207" height="200"/>
+            <rect key="frame" x="0.0" y="0.0" width="207" height="220"/>
             <autoresizingMask key="autoresizingMask"/>
             <view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
-                <rect key="frame" x="0.0" y="0.0" width="207" height="200"/>
+                <rect key="frame" x="0.0" y="0.0" width="207" height="220"/>
                 <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                 <subviews>
                     <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="RA1-Ms-Rdt">
-                        <rect key="frame" x="0.0" y="0.0" width="207" height="200"/>
+                        <rect key="frame" x="0.0" y="0.0" width="207" height="220"/>
                         <subviews>
                             <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="video_placeholder" translatesAutoresizingMaskIntoConstraints="NO" id="U59-Pt-Ft1">
                                 <rect key="frame" x="0.0" y="0.0" width="207" height="111"/>
@@ -28,10 +28,10 @@
                                 </constraints>
                             </imageView>
                             <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="mM7-Jr-9nv">
-                                <rect key="frame" x="0.0" y="6" width="55" height="17"/>
+                                <rect key="frame" x="0.0" y="6" width="54" height="17"/>
                                 <subviews>
                                     <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="已上架" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="pS1-qb-H8H">
-                                        <rect key="frame" x="12" y="2.5" width="31" height="12"/>
+                                        <rect key="frame" x="12" y="2.5" width="30" height="12"/>
                                         <fontDescription key="fontDescription" type="system" pointSize="10"/>
                                         <color key="textColor" red="0.1764705882" green="0.78039215689999997" blue="0.66666666669999997" alpha="1" colorSpace="calibratedRGB"/>
                                         <nil key="highlightedColor"/>
@@ -46,10 +46,10 @@
                                 </constraints>
                             </view>
                             <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="UwI-V7-ylA">
-                                <rect key="frame" x="176.5" y="93" width="24.5" height="13"/>
+                                <rect key="frame" x="177" y="93" width="24" height="13"/>
                                 <subviews>
                                     <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="长笛" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="4gv-0P-tG8">
-                                        <rect key="frame" x="3" y="0.0" width="18.5" height="13"/>
+                                        <rect key="frame" x="3" y="0.0" width="18" height="13"/>
                                         <constraints>
                                             <constraint firstAttribute="height" constant="13" id="DKP-ZU-4j4"/>
                                         </constraints>
@@ -78,7 +78,7 @@
                                 <nil key="highlightedColor"/>
                             </label>
                             <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" horizontalCompressionResistancePriority="749" text="¥120" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="W3y-Mv-wxM">
-                                <rect key="frame" x="12" y="160" width="45.5" height="25"/>
+                                <rect key="frame" x="12" y="160" width="45" height="25"/>
                                 <constraints>
                                     <constraint firstAttribute="height" constant="25" id="e27-SE-MGk"/>
                                 </constraints>
@@ -87,13 +87,13 @@
                                 <nil key="highlightedColor"/>
                             </label>
                             <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="6人已购买" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="1HX-v1-naa">
-                                <rect key="frame" x="12" y="186" width="58.5" height="15"/>
+                                <rect key="frame" x="12" y="186" width="57" height="15"/>
                                 <fontDescription key="fontDescription" type="system" pointSize="12"/>
                                 <color key="textColor" red="1" green="0.50196078430000002" blue="0.17254901959999999" alpha="1" colorSpace="calibratedRGB"/>
                                 <nil key="highlightedColor"/>
                             </label>
                             <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="/ 4课时" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Mbx-Mx-WUq">
-                                <rect key="frame" x="61.5" y="164" width="47.5" height="17"/>
+                                <rect key="frame" x="61" y="164" width="46.5" height="17"/>
                                 <fontDescription key="fontDescription" type="system" pointSize="14"/>
                                 <color key="textColor" red="0.59999999999999998" green="0.59999999999999998" blue="0.59999999999999998" alpha="1" colorSpace="calibratedRGB"/>
                                 <nil key="highlightedColor"/>
@@ -130,7 +130,7 @@
                 <constraint firstItem="RA1-Ms-Rdt" firstAttribute="top" secondItem="gTV-IL-0wX" secondAttribute="top" id="JeN-cc-UTb"/>
                 <constraint firstAttribute="trailing" secondItem="RA1-Ms-Rdt" secondAttribute="trailing" id="OE6-Fp-3Fh"/>
             </constraints>
-            <size key="customSize" width="207" height="239"/>
+            <size key="customSize" width="207" height="259"/>
             <userDefinedRuntimeAttributes>
                 <userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
                     <real key="value" value="5"/>
@@ -145,7 +145,7 @@
                 <outlet property="statusView" destination="mM7-Jr-9nv" id="uJp-9P-QmL"/>
                 <outlet property="subjectLabel" destination="4gv-0P-tG8" id="ZbB-cP-L8Y"/>
             </connections>
-            <point key="canvasLocation" x="245.6521739130435" y="142.96875"/>
+            <point key="canvasLocation" x="245.6521739130435" y="149.33035714285714"/>
         </collectionViewCell>
     </objects>
     <resources>

+ 1 - 1
KulexiuForTeacher/KulexiuForTeacher/Module/Mine/MinePage/View/VipCourse/MinePageVIPCourseView.m

@@ -51,7 +51,7 @@
         self.tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
         [self.tableView registerNib:[UINib nibWithNibName:@"MinePageVipProgramCell" bundle:[NSBundle mainBundle]] forCellReuseIdentifier:@"MinePageVipProgramCell"];
 
-        UIView *bottomView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, 10)];
+        UIView *bottomView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, KPortraitWidth, iPhoneXSafeBottomMargin)];
         bottomView.backgroundColor = HexRGB(0xf8f9fc);
         self.tableView.tableFooterView = bottomView;