Selaa lähdekoodia

VIP课程详情进入逻辑

Steven 7 kuukautta sitten
vanhempi
commit
a64f13a0b0

+ 1 - 1
KulexiuForStudent/KulexiuForStudent/Module/Course/Controller/CourseViewController.m

@@ -514,7 +514,7 @@
 }
 
 - (void)showVipDetailAction:(TableCourseModel *)source {
-    AccompanyDetailViewController *detailVC = [[AccompanyDetailViewController alloc] init];
+    VipCouseDetailViewController *detailVC = [[VipCouseDetailViewController alloc] init];
     detailVC.courseId = source.courseId;
     detailVC.courseGroupId = source.courseGoupId;
     [self.navigationController pushViewController:detailVC animated:YES];

+ 2 - 2
KulexiuForStudent/KulexiuForStudent/Module/Course/View/CourseForLiveCell.xib

@@ -139,8 +139,8 @@
                                     </view>
                                     <label hidden="YES" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="do8-lR-Cg5">
                                         <rect key="frame" x="7" y="10" width="0.0" height="0.0"/>
-                                        <fontDescription key="fontDescription" type="system" pointSize="11"/>
-                                        <color key="textColor" red="0.41568627450000001" green="0.41568627450000001" blue="0.41568627450000001" alpha="1" colorSpace="calibratedRGB"/>
+                                        <fontDescription key="fontDescription" type="system" pointSize="14"/>
+                                        <color key="textColor" red="0.41568627450980389" green="0.41568627450980389" blue="0.41568627450980389" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                                         <nil key="highlightedColor"/>
                                     </label>
                                 </subviews>

+ 35 - 2
KulexiuForStudent/KulexiuForStudent/Module/Course/VipCourse/Controller/VipCouseDetailViewController.m

@@ -22,7 +22,8 @@
 #import "OnlineClassManager.h"
 #import "HomeworkDetailViewController.h"
 #import "KSChatConversationViewController.h"
-
+#import "OnlineClassManager.h"
+#import "AccompanyDetailBottomView.h"
 
 @interface VipCouseDetailViewController ()<UITableViewDelegate,UITableViewDataSource,WMPlayerDelegate>
 {
@@ -47,6 +48,7 @@
 
 @property (strong, nonatomic) MBProgressHUD *HUD;
 
+@property (nonatomic, strong) AccompanyDetailBottomView *bottomView;
 
 @property (nonatomic, strong) OnlineClassManager *classManager;
 
@@ -122,10 +124,15 @@
     // 老师布置过作业且没有点评 可以点击
     if (self.homeworkModel.reviewHomework == 1 || self.homeworkModel.decorateHomework == 0) {
         self.canModify = NO;
-
+        self.bottomView.actionButton.userInteractionEnabled = NO;
+        self.bottomView.actionButton.backgroundColor = HexRGB(0xe5e5e5);
+        [self.bottomView.actionButton setTitleColor:HexRGB(0x666666) forState:UIControlStateNormal];
     }
     else {
         self.canModify = YES;
+        self.bottomView.actionButton.userInteractionEnabled = YES;
+        self.bottomView.actionButton.backgroundColor = THEMECOLOR;
+        [self.bottomView.actionButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
     }
 }
 
@@ -158,14 +165,27 @@
     if ([self.homeworkModel.courseStatus isEqualToString:@"COMPLETE"]) {
         statusLabel.text = @"已结束";
         statusLabel.textColor = HexRGB(0x999999);
+        
+        self.bottomView.actionButton.userInteractionEnabled = NO;
+        [self.bottomView.actionButton setTitle:@"已结束" forState:UIControlStateNormal];
+        [self.bottomView.actionButton setBackgroundColor:HexRGB(0xe5e5e5)];
+        [self.bottomView.actionButton setTitleColor:HexRGB(0x666666) forState:UIControlStateNormal];
     }
     else if ([self.homeworkModel.courseStatus isEqualToString:@"ING"]) {
         statusLabel.text = @"进行中";
         statusLabel.textColor = THEMECOLOR;
+        self.bottomView.actionButton.userInteractionEnabled = YES;
+        [self.bottomView.actionButton setTitle:@"进入教室" forState:UIControlStateNormal];
+        [self.bottomView.actionButton setBackgroundColor:THEMECOLOR];
+        [self.bottomView.actionButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
     }
     else {
         statusLabel.text = @"未开始";
         statusLabel.textColor = HexRGB(0xff802c);
+        self.bottomView.actionButton.userInteractionEnabled = YES;
+        [self.bottomView.actionButton setTitle:@"进入教室" forState:UIControlStateNormal];
+        [self.bottomView.actionButton setBackgroundColor:THEMECOLOR];
+        [self.bottomView.actionButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
     }
 }
 
@@ -480,6 +500,18 @@
     return _classManager;
 }
 
+- (AccompanyDetailBottomView *)bottomView {
+    if (!_bottomView) {
+        _bottomView = [AccompanyDetailBottomView shareInstance];
+        _bottomView.frame = CGRectMake(0, 0, kScreenWidth, 70);
+        MJWeakSelf;
+        [_bottomView sureAction:^{
+            [weakSelf bottomButtonAction];
+        }];
+    }
+    return _bottomView;
+}
+
 - (UITableView *)tableView {
     if (!_tableView) {
         _tableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStylePlain];
@@ -497,6 +529,7 @@
         [_tableView registerNib:[UINib nibWithNibName:@"AccompanyArrangeCell" bundle:[NSBundle mainBundle]] forCellReuseIdentifier:@"AccompanyArrangeCell"];
         [_tableView registerNib:[UINib nibWithNibName:@"AccompanyHomeworkCell" bundle:[NSBundle mainBundle]] forCellReuseIdentifier:@"AccompanyHomeworkCell"];
         [_tableView registerNib:[UINib nibWithNibName:@"AccompanyRemarkCell" bundle:[NSBundle mainBundle]] forCellReuseIdentifier:@"AccompanyRemarkCell"];
+        _tableView.tableFooterView = self.bottomView;
     }
     return _tableView;
 }

+ 7 - 2
KulexiuForStudent/KulexiuForStudent/Module/Course/VipCourse/View/ProgramCourseListCell.xib

@@ -121,7 +121,7 @@
                                 </constraints>
                             </imageView>
                             <button hidden="YES" opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Dqu-Jf-1D9">
-                                <rect key="frame" x="215" y="12" width="62" height="22"/>
+                                <rect key="frame" x="218" y="12" width="62" height="22"/>
                                 <color key="backgroundColor" red="0.1764705882" green="0.78039215689999997" blue="0.66666666669999997" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                                 <constraints>
                                     <constraint firstAttribute="width" constant="62" id="QYf-fZ-JiH"/>
@@ -130,6 +130,11 @@
                                 <fontDescription key="fontDescription" type="system" weight="medium" pointSize="12"/>
                                 <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
                                 <state key="normal" title="开始上课"/>
+                                <userDefinedRuntimeAttributes>
+                                    <userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
+                                        <real key="value" value="11"/>
+                                    </userDefinedRuntimeAttribute>
+                                </userDefinedRuntimeAttributes>
                                 <connections>
                                     <action selector="enterClassRoom:" destination="KGk-i7-Jjw" eventType="touchUpInside" id="fN5-pz-tM3"/>
                                 </connections>
@@ -151,7 +156,7 @@
                             <constraint firstItem="nM7-0u-1Vp" firstAttribute="leading" secondItem="n5o-cB-ZAV" secondAttribute="trailing" constant="5" id="Quj-Mk-SRG"/>
                             <constraint firstItem="IN8-fl-KKM" firstAttribute="leading" secondItem="VwE-ev-4NJ" secondAttribute="trailing" constant="5" id="S5x-NE-bKj"/>
                             <constraint firstItem="fC0-s3-zGf" firstAttribute="leading" secondItem="DbI-ca-fVq" secondAttribute="leading" constant="12" id="Uo9-fx-EKh"/>
-                            <constraint firstAttribute="trailing" secondItem="Dqu-Jf-1D9" secondAttribute="trailing" constant="15" id="Uu6-A8-Gya"/>
+                            <constraint firstAttribute="trailing" secondItem="Dqu-Jf-1D9" secondAttribute="trailing" constant="12" id="Uu6-A8-Gya"/>
                             <constraint firstItem="VwE-ev-4NJ" firstAttribute="top" secondItem="n5o-cB-ZAV" secondAttribute="bottom" constant="4" id="VY7-N5-kOX"/>
                             <constraint firstItem="IN8-fl-KKM" firstAttribute="centerY" secondItem="VwE-ev-4NJ" secondAttribute="centerY" id="Xfo-bh-3Dl"/>
                             <constraint firstAttribute="trailing" secondItem="2NK-NE-SfV" secondAttribute="trailing" constant="12" id="YbB-Iw-Wws"/>