Steven 2 лет назад
Родитель
Сommit
fd18543c38

BIN
KulexiuForTeacher/KulexiuForTeacher.xcworkspace/xcuserdata/wangzhi.xcuserdatad/UserInterfaceState.xcuserstate


+ 17 - 1
KulexiuForTeacher/KulexiuForTeacher.xcworkspace/xcuserdata/wangzhi.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

@@ -168,7 +168,7 @@
          BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
          <BreakpointContent
             uuid = "8DD68A09-3B2E-4A8A-B22E-23AF1FF8586E"
-            shouldBeEnabled = "Yes"
+            shouldBeEnabled = "No"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             filePath = "KulexiuForTeacher/Common/Tools/Custom/KeyChainTools.m"
@@ -180,5 +180,21 @@
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            uuid = "64FC6080-AEF2-4AD5-9086-96799FBFC99C"
+            shouldBeEnabled = "Yes"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "KulexiuForTeacher/Module/Mine/CreateStyle/View/MyStyleIntroduceCell.m"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "36"
+            endingLineNumber = "36"
+            landmarkName = "-configWithIntroduceMessage:modifyCallback:"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
    </Breakpoints>
 </Bucket>

+ 2 - 2
KulexiuForTeacher/KulexiuForTeacher/Module/Home/MyCourse/View/MyVideoCourseBodyView.m

@@ -214,11 +214,11 @@
     VideoCourseCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"VideoCourseCell" forIndexPath:indexPath];
     
     VideoCourseModel *model = [self.dataArray objectAtIndex:indexPath.row];
-    BOOL isCheck = NO;
-    [cell configSourceModel:model isInCheck:isCheck];
+    [cell configSourceModel:model groupStatus:VIDEOGRROUP_STATUS_ING hideBottomView:YES];
     return cell;
 }
 
+
 - (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
     VideoCourseModel *model = [self.dataArray objectAtIndex:indexPath.row];
     NSString *url = [NSString stringWithFormat:@"%@%@%.0f", WEBHOST, @"/#/videoDetail?groupId=",model.internalBaseClassIdentifier];

+ 0 - 1
KulexiuForTeacher/KulexiuForTeacher/Module/Mine/MinePage/View/LiveCourseCell.m

@@ -98,7 +98,6 @@
             self.statusLabel.text = @"销售中";
             self.actionView.hidden = NO;
             self.actionViewWidth.constant = 70.0f;
-            self.actionLabel.textColor = HexRGB(0xFF1919);
             self.actionLabel.text = @"下架课程";
             self.actionLabel.textColor = HexRGB(0x008AE0);
             [self.actionImage setImage:[UIImage imageNamed:@"unshelve_course"]];

+ 8 - 1
KulexiuForTeacher/KulexiuForTeacher/Module/Mine/VideoCourse/View/VideoCourseCell.h

@@ -8,11 +8,18 @@
 #import <UIKit/UIKit.h>
 #import "VideoCourseModel.h"
 
+typedef NS_ENUM(NSInteger, VIDEOGRROUP_STATUS) {
+    VIDEOGRROUP_STATUS_ING,             // 进行中
+    VIDEOGRROUP_STATUS_CHECK,           // 审核中
+    VIDEOGRROUP_STATUS_CHECKFAILED,     // 审核失败
+    VIDEOGRROUP_STATUS_OUTSALE,         // 已下架
+};
+
 NS_ASSUME_NONNULL_BEGIN
 
 @interface VideoCourseCell : UICollectionViewCell
 
-- (void)configSourceModel:(VideoCourseModel *)model isInCheck:(BOOL)isCheck;
+- (void)configSourceModel:(VideoCourseModel *)model groupStatus:(VIDEOGRROUP_STATUS)status hideBottomView:(BOOL)hideBottomView;
 
 @end
 

+ 82 - 25
KulexiuForTeacher/KulexiuForTeacher/Module/Mine/VideoCourse/View/VideoCourseCell.m

@@ -9,21 +9,25 @@
 
 @interface VideoCourseCell ()
 
-@property (weak, nonatomic) IBOutlet UIImageView *coverImage;
+@property (weak, nonatomic) IBOutlet UIView *statusView;
+@property (weak, nonatomic) IBOutlet UILabel *statusLabel;
 
-@property (weak, nonatomic) IBOutlet UILabel *courseTitle;
+@property (weak, nonatomic) IBOutlet UIView *actionView;
+@property (weak, nonatomic) IBOutlet UIImageView *actionImage;
+@property (weak, nonatomic) IBOutlet UILabel *actionLabel;
+@property (weak, nonatomic) IBOutlet NSLayoutConstraint *actionViewHeight;
 
-@property (weak, nonatomic) IBOutlet UIImageView *teacherAvatar;
+@property (weak, nonatomic) IBOutlet UIImageView *coverImage;
 
-@property (weak, nonatomic) IBOutlet UILabel *teacherName;
+@property (weak, nonatomic) IBOutlet UILabel *courseTitle;
 
 @property (weak, nonatomic) IBOutlet UILabel *courseMessage;
 
-@property (weak, nonatomic) IBOutlet UIView *descView;
 @property (weak, nonatomic) IBOutlet UILabel *descLabel;
 
 @property (weak, nonatomic) IBOutlet UILabel *subjectLabel;
 
+@property (weak, nonatomic) IBOutlet UILabel *courseCount;
 @end
 
 @implementation VideoCourseCell
@@ -31,40 +35,93 @@
 - (void)awakeFromNib {
     [super awakeFromNib];
     // Initialization code
+    [self setupRadius];
 }
 
-- (void)configSourceModel:(VideoCourseModel *)model isInCheck:(BOOL)isCheck {
+- (void)setupRadius {
+    _statusView.layer.cornerRadius = 8.5f;
+    _statusView.layer.maskedCorners = kCALayerMaxXMaxYCorner | kCALayerMaxXMinYCorner;
+}
+
+- (void)configSourceModel:(VideoCourseModel *)model groupStatus:(VIDEOGRROUP_STATUS)status hideBottomView:(BOOL)hideBottomView {
+    
     [self.coverImage sd_setImageWithURL:[NSURL URLWithString:[model.lessonCoverUrl getUrlEndcodeString]] placeholderImage:[UIImage imageNamed:@"video_placeholder"]];
     self.courseTitle.text = [NSString returnNoNullStringWithString:model.lessonName];
-    [self.teacherAvatar sd_setImageWithURL:[NSURL URLWithString:[model.avatar getUrlEndcodeString]] placeholderImage:[UIImage imageNamed:USERDEFAULT_LOGO]];
-    self.teacherName.text = [NSString returnNoNullStringWithString:model.username];
-    if ([NSString isEmptyString:model.username]) {
-        self.teacherName.text = [NSString stringWithFormat:@"游客%.0f",model.teacherId];
-    }
-    else {
-        self.teacherName.text = model.username;
-    }
+    
     if (model.lessonPrice > 0) {
-        self.courseMessage.text = [NSString  stringWithFormat:@"¥%.2f/%.0f课时",model.lessonPrice,model.lessonCount];
+        self.courseMessage.text = [NSString  stringWithFormat:@"¥%.2f",model.lessonPrice];
     }
     else {
-        self.courseMessage.text = [NSString  stringWithFormat:@"免费/%.0f课时",model.lessonCount];
+        self.courseMessage.text = @"免费";
     }
     
-    if (isCheck) {
-        self.descView.hidden = YES;
-        self.descLabel.text = @"";
+    self.courseCount.text = [NSString stringWithFormat:@"/%.0f课时",model.lessonCount];
+    if (model.lessonPrice > 0) {
+        self.descLabel.text = [NSString stringWithFormat:@"%.0f人已购买",model.countStudent];
     }
     else {
-        self.descView.hidden = NO;
-        if (model.lessonPrice > 0) {
-            self.descLabel.text = [NSString stringWithFormat:@"%.0f人已购买",model.countStudent];
+        self.descLabel.text = [NSString stringWithFormat:@"%.0f人已领取",model.countStudent];
+    }
+    self.subjectLabel.text = [NSString returnNoNullStringWithString:model.lessonSubjectName];
+    self.actionViewHeight.constant = 0.0f;
+    switch (status) {
+        case VIDEOGRROUP_STATUS_ING:
+        {
+            self.statusView.backgroundColor = HexRGB(0xd5fff7);
+            self.statusLabel.textColor = HexRGB(0x2dc7aa);
+            self.statusLabel.text = @"已上架";
+            self.actionView.hidden = NO;
+            if (hideBottomView) {
+                self.actionView.hidden = YES;
+            }
+            else {
+                self.actionViewHeight.constant = 40.0f;
+                self.actionLabel.textColor = HexRGB(0x008AE0);
+                self.actionLabel.text = @"下架此课程";
+                [self.actionImage setImage:[UIImage imageNamed:@"unshelve_course"]];
+                self.descLabel.hidden = NO;
+            }
+            
+        }
+            break;
+        case VIDEOGRROUP_STATUS_CHECK:
+        {
+            self.statusView.backgroundColor = HexRGB(0xDEF2FF);
+            self.statusLabel.textColor = HexRGB(0x008AE0);
+            self.statusLabel.text = @"审核中";
+            self.actionView.hidden = YES;
+            self.descLabel.hidden = YES;
         }
-        else {
-            self.descLabel.text = [NSString stringWithFormat:@"%.0f人已领取",model.countStudent];
+            break;
+        case VIDEOGRROUP_STATUS_CHECKFAILED:
+        {
+            self.statusView.backgroundColor = HexRGB(0xFFE7E7);
+            self.statusLabel.textColor = HexRGB(0xFF1919);
+            self.statusLabel.text = @"失败";
+            self.actionView.hidden = NO;
+            self.actionViewHeight.constant = 40.0f;
+            self.actionLabel.textColor = HexRGB(0xFF4E19);
+            self.actionLabel.text = @"重新编辑";
+            [self.actionImage setImage:[UIImage imageNamed:@"racking_course"]];
+            self.descLabel.hidden = NO;
         }
+            break;
+        case VIDEOGRROUP_STATUS_OUTSALE:
+        {
+            self.statusView.backgroundColor = HexRGB(0xF0F0F0);
+            self.statusLabel.textColor = HexRGB(0x666666);
+            self.statusLabel.text = @"已取消";
+            self.actionView.hidden = NO;
+            self.actionViewHeight.constant = 40.0f;
+            self.actionLabel.text = @"重新上架";
+            self.actionLabel.textColor = HexRGB(0xFF1919);
+            [self.actionImage setImage:[UIImage imageNamed:@"racking_course"]];
+            self.descLabel.hidden = NO;
+        }
+            break;
+        default:
+            break;
     }
-    self.subjectLabel.text = [NSString returnNoNullStringWithString:model.lessonSubjectName];
 }
 
 @end

+ 103 - 63
KulexiuForTeacher/KulexiuForTeacher/Module/Mine/VideoCourse/View/VideoCourseCell.xib

@@ -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="VideoCourseCell">
-            <rect key="frame" x="0.0" y="0.0" width="168" height="200"/>
+            <rect key="frame" x="0.0" y="0.0" width="168" height="240"/>
             <autoresizingMask key="autoresizingMask"/>
             <view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
-                <rect key="frame" x="0.0" y="0.0" width="168" height="200"/>
+                <rect key="frame" x="0.0" y="0.0" width="168" height="240"/>
                 <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                 <subviews>
                     <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="ZgA-i1-RHm">
-                        <rect key="frame" x="0.0" y="0.0" width="168" height="200"/>
+                        <rect key="frame" x="0.0" y="0.0" width="168" height="240"/>
                         <subviews>
                             <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="video_placeholder" translatesAutoresizingMaskIntoConstraints="NO" id="G9V-fH-gog">
                                 <rect key="frame" x="0.0" y="0.0" width="168" height="111"/>
@@ -27,8 +27,26 @@
                                     <constraint firstAttribute="height" constant="111" id="6CZ-fO-O3c"/>
                                 </constraints>
                             </imageView>
+                            <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="QDb-Of-i8k">
+                                <rect key="frame" x="0.0" y="8" width="55" 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="tL4-sh-aRc">
+                                        <rect key="frame" x="12" y="2.5" width="31" 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"/>
+                                    </label>
+                                </subviews>
+                                <color key="backgroundColor" red="0.83529411760000005" green="1" blue="0.96862745100000003" alpha="1" colorSpace="calibratedRGB"/>
+                                <constraints>
+                                    <constraint firstAttribute="height" constant="17" id="ahL-AO-0nc"/>
+                                    <constraint firstItem="tL4-sh-aRc" firstAttribute="centerY" secondItem="QDb-Of-i8k" secondAttribute="centerY" id="m2g-pk-or9"/>
+                                    <constraint firstAttribute="trailing" secondItem="tL4-sh-aRc" secondAttribute="trailing" constant="12" id="rDI-hv-zgt"/>
+                                    <constraint firstItem="tL4-sh-aRc" firstAttribute="leading" secondItem="QDb-Of-i8k" secondAttribute="leading" constant="12" id="xrj-WZ-e1d"/>
+                                </constraints>
+                            </view>
                             <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="GEE-Kj-3db">
-                                <rect key="frame" x="8" y="6" width="24.5" height="13"/>
+                                <rect key="frame" x="137.5" y="93" width="24.5" 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="YY6-4v-mF1">
                                         <rect key="frame" x="3" y="0.0" width="18.5" height="13"/>
@@ -53,87 +71,105 @@
                                     </userDefinedRuntimeAttribute>
                                 </userDefinedRuntimeAttributes>
                             </view>
-                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="从零开始学竖笛视频课" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="yCS-l4-WAt">
-                                <rect key="frame" x="11" y="117" width="146" height="17"/>
+                            <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="yCS-l4-WAt">
+                                <rect key="frame" x="11" y="117" width="144" height="17"/>
                                 <fontDescription key="fontDescription" type="system" pointSize="14"/>
-                                <color key="textColor" red="0.10196078431372549" green="0.10196078431372549" blue="0.10196078431372549" alpha="0.84705882352941175" colorSpace="calibratedRGB"/>
+                                <color key="textColor" red="0.10196078431372549" green="0.10196078431372549" blue="0.10196078431372549" alpha="1" colorSpace="custom" customColorSpace="calibratedRGB"/>
                                 <nil key="highlightedColor"/>
                             </label>
-                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="¥120/4课时" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Yib-mA-6Ou">
-                                <rect key="frame" x="9" y="164" width="81" height="20"/>
+                            <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="Yib-mA-6Ou">
+                                <rect key="frame" x="12" y="160" width="41" height="20"/>
                                 <constraints>
                                     <constraint firstAttribute="height" constant="20" id="fo4-3I-tde"/>
                                 </constraints>
-                                <fontDescription key="fontDescription" type="system" weight="medium" pointSize="14"/>
-                                <color key="textColor" red="0.1764705882352941" green="0.7803921568627451" blue="0.66666666666666663" alpha="1" colorSpace="calibratedRGB"/>
+                                <fontDescription key="fontDescription" type="system" weight="medium" pointSize="15"/>
+                                <color key="textColor" red="1" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
                                 <nil key="highlightedColor"/>
                             </label>
-                            <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="user_default_avatal" translatesAutoresizingMaskIntoConstraints="NO" id="3il-XM-fqj">
-                                <rect key="frame" x="11" y="139" width="20" height="20"/>
-                                <constraints>
-                                    <constraint firstAttribute="width" constant="20" id="1af-AW-k6Y"/>
-                                    <constraint firstAttribute="height" constant="20" id="Y9m-cV-JYR"/>
-                                </constraints>
-                                <userDefinedRuntimeAttributes>
-                                    <userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
-                                        <real key="value" value="10"/>
-                                    </userDefinedRuntimeAttribute>
-                                </userDefinedRuntimeAttributes>
-                            </imageView>
-                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="张老师" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="wbK-Jo-ZbH">
-                                <rect key="frame" x="36" y="141.5" width="37" height="15"/>
+                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="6人已购买" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Spj-bd-Syo">
+                                <rect key="frame" x="12" y="181" width="57" height="15"/>
                                 <fontDescription key="fontDescription" type="system" pointSize="12"/>
+                                <color key="textColor" red="1" green="0.50196078431372548" blue="0.17254901960784313" 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="x8Q-G1-Gq9">
+                                <rect key="frame" x="61" y="161.5" width="42" 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>
-                            <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="bIp-3Q-l9m">
-                                <rect key="frame" x="79" y="139" width="79" height="20"/>
+                            <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="ipj-PO-tx8">
+                                <rect key="frame" x="0.0" y="200" width="168" height="40"/>
                                 <subviews>
-                                    <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="00e-da-LHX">
-                                        <rect key="frame" x="0.0" y="4.5" width="1" height="11"/>
-                                        <color key="backgroundColor" red="0.82745098039215681" green="0.82745098039215681" blue="0.82745098039215681" alpha="1" colorSpace="calibratedRGB"/>
+                                    <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="AAn-Mo-haN">
+                                        <rect key="frame" x="0.0" y="0.0" width="168" height="1"/>
+                                        <color key="backgroundColor" red="0.97254901960784312" green="0.97254901960784312" blue="0.97254901960784312" alpha="1" colorSpace="calibratedRGB"/>
                                         <constraints>
-                                            <constraint firstAttribute="width" constant="1" id="DB4-3O-ysi"/>
-                                            <constraint firstAttribute="height" constant="11" id="WC2-EJ-sEy"/>
+                                            <constraint firstAttribute="height" constant="1" id="Vsj-f7-CdH"/>
+                                        </constraints>
+                                    </view>
+                                    <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="2k6-8I-8eh">
+                                        <rect key="frame" x="44" y="10" width="80" height="20"/>
+                                        <subviews>
+                                            <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="unshelve_course" translatesAutoresizingMaskIntoConstraints="NO" id="4i1-bR-DLX">
+                                                <rect key="frame" x="75" y="6.5" width="5" height="7"/>
+                                                <constraints>
+                                                    <constraint firstAttribute="height" constant="7" id="HYe-eo-rL1"/>
+                                                    <constraint firstAttribute="width" constant="5" id="cgt-qB-UtW"/>
+                                                </constraints>
+                                            </imageView>
+                                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="下架此课程" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Hfh-X0-Fzs">
+                                                <rect key="frame" x="0.0" y="1.5" width="71.5" height="17"/>
+                                                <fontDescription key="fontDescription" type="system" pointSize="14"/>
+                                                <color key="textColor" red="0.0" green="0.54117647059999996" blue="0.87843137250000003" alpha="1" colorSpace="calibratedRGB"/>
+                                                <nil key="highlightedColor"/>
+                                            </label>
+                                        </subviews>
+                                        <color key="backgroundColor" systemColor="systemBackgroundColor"/>
+                                        <constraints>
+                                            <constraint firstItem="Hfh-X0-Fzs" firstAttribute="centerY" secondItem="2k6-8I-8eh" secondAttribute="centerY" id="4un-2C-eUO"/>
+                                            <constraint firstItem="Hfh-X0-Fzs" firstAttribute="leading" secondItem="2k6-8I-8eh" secondAttribute="leading" id="g1i-5U-I4E"/>
+                                            <constraint firstAttribute="trailing" secondItem="4i1-bR-DLX" secondAttribute="trailing" id="iZj-df-E4e"/>
+                                            <constraint firstAttribute="width" constant="80" id="kwG-uv-hyI"/>
+                                            <constraint firstAttribute="height" constant="20" id="tfG-m8-WU4"/>
+                                            <constraint firstItem="4i1-bR-DLX" firstAttribute="centerY" secondItem="2k6-8I-8eh" secondAttribute="centerY" id="vhR-zf-3vX"/>
                                         </constraints>
                                     </view>
-                                    <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="6人已购买" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Spj-bd-Syo">
-                                        <rect key="frame" x="7" y="2.5" width="57" height="15"/>
-                                        <fontDescription key="fontDescription" type="system" pointSize="12"/>
-                                        <color key="textColor" red="1" green="0.50196078431372548" blue="0.17254901960784313" alpha="1" colorSpace="calibratedRGB"/>
-                                        <nil key="highlightedColor"/>
-                                    </label>
                                 </subviews>
-                                <color key="backgroundColor" systemColor="systemBackgroundColor"/>
+                                <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                                 <constraints>
-                                    <constraint firstItem="Spj-bd-Syo" firstAttribute="leading" secondItem="00e-da-LHX" secondAttribute="trailing" constant="6" id="DcA-GQ-uex"/>
-                                    <constraint firstItem="00e-da-LHX" firstAttribute="leading" secondItem="bIp-3Q-l9m" secondAttribute="leading" id="PAd-8V-fS6"/>
-                                    <constraint firstItem="Spj-bd-Syo" firstAttribute="centerY" secondItem="bIp-3Q-l9m" secondAttribute="centerY" id="bcy-rr-kIP"/>
-                                    <constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="Spj-bd-Syo" secondAttribute="trailing" constant="2" id="eRd-Ja-Uy9"/>
-                                    <constraint firstAttribute="height" constant="20" id="hgn-YW-c4O"/>
-                                    <constraint firstItem="00e-da-LHX" firstAttribute="centerY" secondItem="bIp-3Q-l9m" secondAttribute="centerY" id="sCN-Nb-Z2j"/>
+                                    <constraint firstItem="AAn-Mo-haN" firstAttribute="leading" secondItem="ipj-PO-tx8" secondAttribute="leading" id="4qj-LL-8Ew"/>
+                                    <constraint firstItem="2k6-8I-8eh" firstAttribute="centerX" secondItem="ipj-PO-tx8" secondAttribute="centerX" id="50V-rg-eXx"/>
+                                    <constraint firstAttribute="trailing" secondItem="AAn-Mo-haN" secondAttribute="trailing" id="DMO-BR-pnL"/>
+                                    <constraint firstItem="2k6-8I-8eh" firstAttribute="centerY" secondItem="ipj-PO-tx8" secondAttribute="centerY" id="FGd-0i-s8p"/>
+                                    <constraint firstItem="AAn-Mo-haN" firstAttribute="top" secondItem="ipj-PO-tx8" secondAttribute="top" id="LuU-jp-orx"/>
+                                    <constraint firstAttribute="height" constant="40" id="QDu-aF-nEU"/>
                                 </constraints>
                             </view>
                         </subviews>
                         <color key="backgroundColor" systemColor="systemBackgroundColor"/>
                         <constraints>
                             <constraint firstItem="yCS-l4-WAt" firstAttribute="leading" secondItem="ZgA-i1-RHm" secondAttribute="leading" constant="11" id="1Ls-Wb-fRT"/>
+                            <constraint firstItem="Spj-bd-Syo" firstAttribute="leading" secondItem="Yib-mA-6Ou" secondAttribute="leading" id="21X-Vs-W4W"/>
+                            <constraint firstItem="ipj-PO-tx8" firstAttribute="leading" secondItem="ZgA-i1-RHm" secondAttribute="leading" id="2H4-aL-8iv"/>
+                            <constraint firstItem="QDb-Of-i8k" firstAttribute="leading" secondItem="ZgA-i1-RHm" secondAttribute="leading" id="4uA-9W-JFO"/>
                             <constraint firstItem="G9V-fH-gog" firstAttribute="top" secondItem="ZgA-i1-RHm" secondAttribute="top" id="5ix-vd-TUM"/>
-                            <constraint firstItem="Yib-mA-6Ou" firstAttribute="leading" secondItem="ZgA-i1-RHm" secondAttribute="leading" constant="9" id="74G-dg-JPA"/>
+                            <constraint firstItem="Yib-mA-6Ou" firstAttribute="leading" secondItem="ZgA-i1-RHm" secondAttribute="leading" constant="12" id="74G-dg-JPA"/>
+                            <constraint firstItem="x8Q-G1-Gq9" firstAttribute="centerY" secondItem="Yib-mA-6Ou" secondAttribute="centerY" id="7X8-T5-BvU"/>
+                            <constraint firstItem="Yib-mA-6Ou" firstAttribute="top" secondItem="G9V-fH-gog" secondAttribute="bottom" constant="49" id="7vc-nV-XeK"/>
                             <constraint firstItem="G9V-fH-gog" firstAttribute="leading" secondItem="ZgA-i1-RHm" secondAttribute="leading" id="9e1-eo-OKH"/>
                             <constraint firstItem="yCS-l4-WAt" firstAttribute="top" secondItem="G9V-fH-gog" secondAttribute="bottom" constant="6" id="EOx-Xx-BzN"/>
-                            <constraint firstItem="3il-XM-fqj" firstAttribute="top" secondItem="yCS-l4-WAt" secondAttribute="bottom" constant="5" id="Jjh-pl-Duz"/>
-                            <constraint firstItem="GEE-Kj-3db" firstAttribute="leading" secondItem="G9V-fH-gog" secondAttribute="leading" constant="8" id="MzD-x3-WhY"/>
-                            <constraint firstAttribute="trailing" secondItem="yCS-l4-WAt" secondAttribute="trailing" constant="11" id="N8r-qo-ZmS"/>
-                            <constraint firstItem="3il-XM-fqj" firstAttribute="leading" secondItem="ZgA-i1-RHm" secondAttribute="leading" constant="11" id="P7e-LF-pGN"/>
-                            <constraint firstItem="wbK-Jo-ZbH" firstAttribute="centerY" secondItem="3il-XM-fqj" secondAttribute="centerY" id="TWM-PS-Pnk"/>
-                            <constraint firstItem="Yib-mA-6Ou" firstAttribute="top" secondItem="3il-XM-fqj" secondAttribute="bottom" constant="5" id="TeL-Vw-ZDm"/>
-                            <constraint firstItem="wbK-Jo-ZbH" firstAttribute="leading" secondItem="3il-XM-fqj" secondAttribute="trailing" constant="5" id="gE4-f5-Im6"/>
-                            <constraint firstItem="bIp-3Q-l9m" firstAttribute="leading" secondItem="wbK-Jo-ZbH" secondAttribute="trailing" constant="6" id="ort-Rw-FuH"/>
-                            <constraint firstItem="GEE-Kj-3db" firstAttribute="top" secondItem="G9V-fH-gog" secondAttribute="top" constant="6" id="qcc-jr-5Df"/>
-                            <constraint firstAttribute="trailing" secondItem="bIp-3Q-l9m" secondAttribute="trailing" constant="10" id="rAH-2L-iRc"/>
+                            <constraint firstItem="x8Q-G1-Gq9" firstAttribute="leading" secondItem="Yib-mA-6Ou" secondAttribute="trailing" constant="8" id="GF2-Ui-YuH"/>
+                            <constraint firstAttribute="bottom" secondItem="ipj-PO-tx8" secondAttribute="bottom" id="GX2-pS-GEd"/>
+                            <constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="x8Q-G1-Gq9" secondAttribute="trailing" constant="12" id="M2o-33-e5R"/>
+                            <constraint firstAttribute="trailing" secondItem="yCS-l4-WAt" secondAttribute="trailing" constant="13" id="N8r-qo-ZmS"/>
+                            <constraint firstAttribute="trailing" secondItem="ipj-PO-tx8" secondAttribute="trailing" id="Sf6-5F-BqA"/>
+                            <constraint firstItem="QDb-Of-i8k" firstAttribute="top" secondItem="ZgA-i1-RHm" secondAttribute="top" constant="8" id="am0-Ac-1cy"/>
+                            <constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="Spj-bd-Syo" secondAttribute="trailing" constant="14" id="cas-aJ-Em1"/>
+                            <constraint firstAttribute="trailing" secondItem="GEE-Kj-3db" secondAttribute="trailing" constant="6" id="rh1-SG-rcT"/>
                             <constraint firstAttribute="trailing" secondItem="G9V-fH-gog" secondAttribute="trailing" id="sWA-Zo-Iyz"/>
-                            <constraint firstItem="bIp-3Q-l9m" firstAttribute="centerY" secondItem="wbK-Jo-ZbH" secondAttribute="centerY" id="yTm-Tw-5qJ"/>
+                            <constraint firstItem="Spj-bd-Syo" firstAttribute="top" secondItem="Yib-mA-6Ou" secondAttribute="bottom" constant="1" id="u3G-MR-ZBS"/>
+                            <constraint firstItem="GEE-Kj-3db" firstAttribute="bottom" secondItem="G9V-fH-gog" secondAttribute="bottom" constant="-5" id="xbZ-XR-Yif"/>
                         </constraints>
                     </view>
                 </subviews>
@@ -145,27 +181,31 @@
                 <constraint firstItem="ZgA-i1-RHm" firstAttribute="top" secondItem="gTV-IL-0wX" secondAttribute="top" id="iHB-AW-C7d"/>
                 <constraint firstAttribute="trailing" secondItem="ZgA-i1-RHm" secondAttribute="trailing" id="jjA-3j-GiE"/>
             </constraints>
-            <size key="customSize" width="229" height="243"/>
+            <size key="customSize" width="229" height="283"/>
             <userDefinedRuntimeAttributes>
                 <userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
                     <real key="value" value="5"/>
                 </userDefinedRuntimeAttribute>
             </userDefinedRuntimeAttributes>
             <connections>
+                <outlet property="actionImage" destination="4i1-bR-DLX" id="jPy-Gh-vnO"/>
+                <outlet property="actionLabel" destination="Hfh-X0-Fzs" id="Btb-xb-Bnb"/>
+                <outlet property="actionView" destination="ipj-PO-tx8" id="KJO-rj-Uud"/>
+                <outlet property="actionViewHeight" destination="QDu-aF-nEU" id="xiX-75-bkj"/>
+                <outlet property="courseCount" destination="x8Q-G1-Gq9" id="uHy-hh-aCg"/>
                 <outlet property="courseMessage" destination="Yib-mA-6Ou" id="hPM-ZS-6ZL"/>
                 <outlet property="courseTitle" destination="yCS-l4-WAt" id="1Wb-8W-iHt"/>
                 <outlet property="coverImage" destination="G9V-fH-gog" id="8HX-tu-M6Z"/>
                 <outlet property="descLabel" destination="Spj-bd-Syo" id="nNb-i0-kTJ"/>
-                <outlet property="descView" destination="bIp-3Q-l9m" id="dqb-bI-PbZ"/>
+                <outlet property="statusLabel" destination="tL4-sh-aRc" id="vMd-Ng-mev"/>
+                <outlet property="statusView" destination="QDb-Of-i8k" id="ZcC-TZ-wjg"/>
                 <outlet property="subjectLabel" destination="YY6-4v-mF1" id="IRT-60-PG9"/>
-                <outlet property="teacherAvatar" destination="3il-XM-fqj" id="cCU-eN-inL"/>
-                <outlet property="teacherName" destination="wbK-Jo-ZbH" id="hq7-Jt-Ikb"/>
             </connections>
-            <point key="canvasLocation" x="260.86956521739131" y="22.433035714285712"/>
+            <point key="canvasLocation" x="260.86956521739131" y="34.151785714285715"/>
         </collectionViewCell>
     </objects>
     <resources>
-        <image name="user_default_avatal" width="52" height="52"/>
+        <image name="unshelve_course" width="5" height="7"/>
         <image name="video_placeholder" width="103" height="72"/>
         <systemColor name="systemBackgroundColor">
             <color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>

+ 21 - 3
KulexiuForTeacher/KulexiuForTeacher/Module/Mine/VideoCourse/View/VideoListBodyView.m

@@ -196,11 +196,28 @@
     VideoCourseCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"VideoCourseCell" forIndexPath:indexPath];
     
     VideoCourseModel *model = [self.dataArray objectAtIndex:indexPath.row];
-    BOOL isCheck = self.selectIndex != 0;
-    [cell configSourceModel:model isInCheck:isCheck];
+    VIDEOGRROUP_STATUS status = [self getCourseStatus:self.selectIndex];
+    [cell configSourceModel:model groupStatus:status hideBottomView:NO];
     return cell;
 }
 
+- (VIDEOGRROUP_STATUS)getCourseStatus:(NSInteger)cellIndex {
+    VIDEOGRROUP_STATUS status;
+    if (cellIndex == 0) {
+        status = VIDEOGRROUP_STATUS_ING;
+    }
+    else if (cellIndex == 1) {
+        status = VIDEOGRROUP_STATUS_CHECK;
+    }
+    else if (cellIndex == 2) {
+        status = VIDEOGRROUP_STATUS_CHECKFAILED;
+    }
+    else  {
+        status = VIDEOGRROUP_STATUS_OUTSALE;
+    }
+    return status;
+}
+
 - (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
     VideoCourseModel *model = [self.dataArray objectAtIndex:indexPath.row];
     NSString *url = @"";
@@ -216,7 +233,8 @@
 }
 
 - (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath {
-    return CGSizeMake((kScreenWidth - 28 - 11) / 2.0f, 200);
+    CGFloat height = self.selectIndex == 1 ? 200 : 240;
+    return CGSizeMake((kScreenWidth - 28 - 11) / 2.0f, height);
 }
 
 /**