浏览代码

1.白板域名更换
2.视频课支持会员

Steven 10 月之前
父节点
当前提交
b64fe30eba

+ 78 - 75
KulexiuForTeacher/KulexiuForTeacher/AppDelegate.m

@@ -517,56 +517,65 @@ didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
 
 #pragma mark 根据不同消息跳转不同界面
 - (void)getVCUserInfoDict:(NSMutableDictionary *)infoDict {
-    if (![NSString isEmptyString:[infoDict ks_stringValueForKey:@"memo"]]) {
-        NSData *jsonData = [[infoDict ks_stringValueForKey:@"memo"] mj_JSONData];
-        NSError *error;
-        NSDictionary *dict = [NSJSONSerialization JSONObjectWithData:jsonData options:NSJSONReadingMutableContainers error:&error];
-        if (!error) {
-            UIViewController *vc = self.window.rootViewController;
-            NSString *token = UserDefault(TokenKey);
-            if ([vc isKindOfClass:[LaunchAnimationViewController class]] || [NSString isEmptyString:token]) {
-                self.outLinkParm = [NSMutableDictionary dictionaryWithDictionary:dict];
-                return;
-            }
-            NSString *action = [dict ks_stringValueForKey:@"action"];
-            if ([action isEqualToString:@"app"]) { // 跳原生
-                NSString *pageType = [dict ks_stringValueForKey:@"pageTag"];
-                if ([pageType isEqualToString:@"buyPractice"] || [pageType isEqualToString:@"courseRemind"]) {
-                    [self.tabBarController tabBarSelectedWithIndex:1];
-                    CustomNavViewController *navCtrl = self.tabBarController.selectedViewController;
-                    [navCtrl popToRootViewControllerAnimated:YES];
-                }
-                else if ([pageType isEqualToString:@"evaluate"]) {
-                    [self.tabBarController tabBarSelectedWithIndex:0];
-                    CustomNavViewController *navCtrl = self.tabBarController.selectedViewController;
-                    ReceiveEvaluateListController *ctrl = [[ReceiveEvaluateListController alloc] init];
-                    [navCtrl pushViewController:ctrl animated:YES];
+    BOOL isJPush = [[infoDict allKeys] containsObject:@"_j_msgid"]; // 极光推送标识区分
+    if (isJPush) {
+        if (![NSString isEmptyString:[infoDict ks_stringValueForKey:@"memo"]]) {
+            NSData *jsonData = [[infoDict ks_stringValueForKey:@"memo"] mj_JSONData];
+            NSError *error;
+            NSDictionary *dict = [NSJSONSerialization JSONObjectWithData:jsonData options:NSJSONReadingMutableContainers error:&error];
+            if (!error) {
+                UIViewController *vc = self.window.rootViewController;
+                NSString *token = UserDefault(TokenKey);
+                if ([vc isKindOfClass:[LaunchAnimationViewController class]] || [NSString isEmptyString:token]) {
+                    self.outLinkParm = [NSMutableDictionary dictionaryWithDictionary:dict];
+                    return;
                 }
-                else if ([pageType isEqualToString:@"homework"]) {
-                    NSString *parmString = [dict ks_stringValueForKey:@"params"];
-                    NSData *parmData = [parmString mj_JSONData];
-                    NSDictionary *parm = [NSJSONSerialization JSONObjectWithData:parmData options:NSJSONReadingMutableContainers error:&error];
-                    if (!error) {
-                        HomeworkDetailViewController *detailVC = [[HomeworkDetailViewController alloc] init];
-                        detailVC.courseId = [parm ks_stringValueForKey:@"courseId"];
-                        detailVC.studentId = [parm ks_stringValueForKey:@"studentId"];
+                NSString *action = [dict ks_stringValueForKey:@"action"];
+                if ([action isEqualToString:@"app"]) { // 跳原生
+                    NSString *pageType = [dict ks_stringValueForKey:@"pageTag"];
+                    if ([pageType isEqualToString:@"buyPractice"] || [pageType isEqualToString:@"courseRemind"]) {
+                        [self.tabBarController tabBarSelectedWithIndex:1];
                         CustomNavViewController *navCtrl = self.tabBarController.selectedViewController;
-                        [navCtrl pushViewController:detailVC animated:YES];
+                        [navCtrl popToRootViewControllerAnimated:YES];
                     }
-                }
-                else if ([pageType isEqualToString:@"musicSheet"]) {
-                    MyMusicViewController *musicCtrl = [[MyMusicViewController alloc] init];
-                    CustomNavViewController *navCtrl = self.tabBarController.selectedViewController;
-                    [navCtrl pushViewController:musicCtrl animated:YES];
-                }
-                else if ([pageType isEqualToString:@"message"]) {
-                    UIViewController *vc = [UIApplication sharedApplication].keyWindow.rootViewController;
-                    if ([vc isKindOfClass:[UITabBarController class]]) {
-                        KSTabBarViewController *tabCtrl = (KSTabBarViewController *)vc;
-                        CustomNavViewController *navCtrl = (CustomNavViewController *)tabCtrl.selectedViewController;
-                        if ([navCtrl.visibleViewController isKindOfClass:NSClassFromString(@"NotiferMessageViewController")]) {
-                            NotiferMessageViewController *ctrl = (NotiferMessageViewController *)navCtrl.visibleViewController;
-                            [ctrl refreshView];
+                    else if ([pageType isEqualToString:@"evaluate"]) {
+                        [self.tabBarController tabBarSelectedWithIndex:0];
+                        CustomNavViewController *navCtrl = self.tabBarController.selectedViewController;
+                        ReceiveEvaluateListController *ctrl = [[ReceiveEvaluateListController alloc] init];
+                        [navCtrl pushViewController:ctrl animated:YES];
+                    }
+                    else if ([pageType isEqualToString:@"homework"]) {
+                        NSString *parmString = [dict ks_stringValueForKey:@"params"];
+                        NSData *parmData = [parmString mj_JSONData];
+                        NSDictionary *parm = [NSJSONSerialization JSONObjectWithData:parmData options:NSJSONReadingMutableContainers error:&error];
+                        if (!error) {
+                            HomeworkDetailViewController *detailVC = [[HomeworkDetailViewController alloc] init];
+                            detailVC.courseId = [parm ks_stringValueForKey:@"courseId"];
+                            detailVC.studentId = [parm ks_stringValueForKey:@"studentId"];
+                            CustomNavViewController *navCtrl = self.tabBarController.selectedViewController;
+                            [navCtrl pushViewController:detailVC animated:YES];
+                        }
+                    }
+                    else if ([pageType isEqualToString:@"musicSheet"]) {
+                        MyMusicViewController *musicCtrl = [[MyMusicViewController alloc] init];
+                        CustomNavViewController *navCtrl = self.tabBarController.selectedViewController;
+                        [navCtrl pushViewController:musicCtrl animated:YES];
+                    }
+                    else if ([pageType isEqualToString:@"message"]) {
+                        UIViewController *vc = [UIApplication sharedApplication].keyWindow.rootViewController;
+                        if ([vc isKindOfClass:[UITabBarController class]]) {
+                            KSTabBarViewController *tabCtrl = (KSTabBarViewController *)vc;
+                            CustomNavViewController *navCtrl = (CustomNavViewController *)tabCtrl.selectedViewController;
+                            if ([navCtrl.visibleViewController isKindOfClass:NSClassFromString(@"NotiferMessageViewController")]) {
+                                NotiferMessageViewController *ctrl = (NotiferMessageViewController *)navCtrl.visibleViewController;
+                                [ctrl refreshView];
+                            }
+                            else {
+                                [self.tabBarController tabBarSelectedWithIndex:0];
+                                CustomNavViewController *navCtrl = self.tabBarController.selectedViewController;
+                                NotiferMessageViewController *ctrl = [[NotiferMessageViewController alloc] init];
+                                [navCtrl pushViewController:ctrl animated:YES];
+                            }
                         }
                         else {
                             [self.tabBarController tabBarSelectedWithIndex:0];
@@ -575,21 +584,21 @@ didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
                             [navCtrl pushViewController:ctrl animated:YES];
                         }
                     }
-                    else {
-                        [self.tabBarController tabBarSelectedWithIndex:0];
-                        CustomNavViewController *navCtrl = self.tabBarController.selectedViewController;
-                        NotiferMessageViewController *ctrl = [[NotiferMessageViewController alloc] init];
-                        [navCtrl pushViewController:ctrl animated:YES];
-                    }
-                }
-                else {  // 统一跳转消息列表
-                    UIViewController *vc = [UIApplication sharedApplication].keyWindow.rootViewController;
-                    if ([vc isKindOfClass:[UITabBarController class]]) {
-                        KSTabBarViewController *tabCtrl = (KSTabBarViewController *)vc;
-                        CustomNavViewController *navCtrl = (CustomNavViewController *)tabCtrl.selectedViewController;
-                        if ([navCtrl.visibleViewController isKindOfClass:NSClassFromString(@"NotiferMessageViewController")]) {
-                            NotiferMessageViewController *ctrl = (NotiferMessageViewController *)navCtrl.visibleViewController;
-                            [ctrl refreshView];
+                    else {  // 统一跳转消息列表
+                        UIViewController *vc = [UIApplication sharedApplication].keyWindow.rootViewController;
+                        if ([vc isKindOfClass:[UITabBarController class]]) {
+                            KSTabBarViewController *tabCtrl = (KSTabBarViewController *)vc;
+                            CustomNavViewController *navCtrl = (CustomNavViewController *)tabCtrl.selectedViewController;
+                            if ([navCtrl.visibleViewController isKindOfClass:NSClassFromString(@"NotiferMessageViewController")]) {
+                                NotiferMessageViewController *ctrl = (NotiferMessageViewController *)navCtrl.visibleViewController;
+                                [ctrl refreshView];
+                            }
+                            else {
+                                [self.tabBarController tabBarSelectedWithIndex:0];
+                                CustomNavViewController *navCtrl = self.tabBarController.selectedViewController;
+                                NotiferMessageViewController *ctrl = [[NotiferMessageViewController alloc] init];
+                                [navCtrl pushViewController:ctrl animated:YES];
+                            }
                         }
                         else {
                             [self.tabBarController tabBarSelectedWithIndex:0];
@@ -598,23 +607,17 @@ didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
                             [navCtrl pushViewController:ctrl animated:YES];
                         }
                     }
-                    else {
-                        [self.tabBarController tabBarSelectedWithIndex:0];
+                }
+                else {
+                    NSString *webUrl = [dict ks_stringValueForKey:@"url"];
+                    if (![NSString isEmptyString:webUrl]) {
+                        KSBaseWKWebViewController *webCtrl = [[KSBaseWKWebViewController alloc] init];
+                        webCtrl.url = [webUrl getUrlEndcodeString];
                         CustomNavViewController *navCtrl = self.tabBarController.selectedViewController;
-                        NotiferMessageViewController *ctrl = [[NotiferMessageViewController alloc] init];
-                        [navCtrl pushViewController:ctrl animated:YES];
+                        [navCtrl pushViewController:webCtrl animated:YES];
                     }
                 }
             }
-            else {
-                NSString *webUrl = [dict ks_stringValueForKey:@"url"];
-                if (![NSString isEmptyString:webUrl]) {
-                    KSBaseWKWebViewController *webCtrl = [[KSBaseWKWebViewController alloc] init];
-                    webCtrl.url = [webUrl getUrlEndcodeString];
-                    CustomNavViewController *navCtrl = self.tabBarController.selectedViewController;
-                    [navCtrl pushViewController:webCtrl animated:YES];
-                }
-            }
         }
     }
     else { // 跳转到聊天

+ 22 - 11
KulexiuForTeacher/KulexiuForTeacher/Module/Mine/MinePage/View/MinePageVideoCell.m

@@ -42,21 +42,32 @@
     [self.coverImage sd_setImageWithURL:[NSURL URLWithString:[model.lessonCoverUrl getUrlEndcodeString]] placeholderImage:[UIImage imageNamed:@"video_placeholder"]];
     self.courseTitle.text = [NSString returnNoNullStringWithString:model.lessonName];
    
-    if (model.lessonPrice > 0) {
-        self.courseMessage.text = [NSString  stringWithFormat:@"¥%.2f",model.lessonPrice];
+    if ([model.payType isEqualToString:@"VIP"]) {
+        self.courseMessage.text = @"会员";
+        self.courseMessage.textColor = HexRGB(0xC76E21);
+        self.descLabel.text = @"";
     }
-    else {
-        self.courseMessage.text = @"免费";
-    }
-
-    self.courseCount.text = [NSString stringWithFormat:@"/%.0f课时",model.lessonCount];
-    if (model.lessonPrice > 0) {
-        self.descLabel.text = [NSString stringWithFormat:@"%.0f人已购买",model.countStudent];
+    else if ([model.payType isEqualToString:@"PAY"]) {
+        if (model.lessonPrice > 0) {
+            self.courseMessage.textColor = HexRGB(0xFF0000);
+            NSString *text = [NSString  stringWithFormat:@"¥%.2f",model.lessonPrice];
+            NSMutableAttributedString *attrs = [[NSMutableAttributedString alloc] initWithString:text attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:18.0f weight:UIFontWeightMedium],NSForegroundColorAttributeName:HexRGB(0xFF0000)}];
+            [attrs addAttributes:@{NSFontAttributeName:[UIFont systemFontOfSize:14.0f weight:UIFontWeightMedium]} range:[text rangeOfString:@"¥"]];
+            self.courseMessage.attributedText = attrs;
+            self.descLabel.text = [NSString stringWithFormat:@"%.0f人已购买",model.countStudent];
+
+        }
+        else {
+            self.courseMessage.text = @"免费";
+            self.courseMessage.textColor = HexRGB(0xC76E21);
+            self.descLabel.text = [NSString stringWithFormat:@"%.0f人已领取",model.countStudent];
+        }
     }
     else {
-        self.descLabel.text = [NSString stringWithFormat:@"%.0f人已领取",model.countStudent];
+        self.courseMessage.text = @"";
+        self.descLabel.text = @"";
     }
-    
+    self.courseCount.text = [NSString stringWithFormat:@"/%.0f课时",model.lessonCount];
     self.subjectLabel.text = [NSString returnNoNullStringWithString:model.lessonSubjectName];
 }
 

+ 8 - 8
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="20037" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
+<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">
     <device id="retina6_1" orientation="portrait" appearance="light"/>
     <dependencies>
         <deployment identifier="iOS"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="20020"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22684"/>
         <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"/>
@@ -78,22 +78,22 @@
                                 <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="41" height="20"/>
+                                <rect key="frame" x="12" y="160" width="45.5" height="25"/>
                                 <constraints>
-                                    <constraint firstAttribute="height" constant="20" id="e27-SE-MGk"/>
+                                    <constraint firstAttribute="height" constant="25" id="e27-SE-MGk"/>
                                 </constraints>
-                                <fontDescription key="fontDescription" type="system" weight="medium" pointSize="15"/>
+                                <fontDescription key="fontDescription" type="system" weight="medium" pointSize="16"/>
                                 <color key="textColor" red="1" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
                                 <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="181" width="57" height="15"/>
+                                <rect key="frame" x="12" y="186" width="58.5" 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" y="161.5" width="42" height="17"/>
+                                <rect key="frame" x="61.5" y="164" width="43.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"/>
@@ -101,7 +101,7 @@
                         </subviews>
                         <color key="backgroundColor" systemColor="systemBackgroundColor"/>
                         <constraints>
-                            <constraint firstItem="Mbx-Mx-WUq" firstAttribute="leading" secondItem="W3y-Mv-wxM" secondAttribute="trailing" constant="8" id="0KC-St-V0b"/>
+                            <constraint firstItem="Mbx-Mx-WUq" firstAttribute="leading" secondItem="W3y-Mv-wxM" secondAttribute="trailing" constant="4" id="0KC-St-V0b"/>
                             <constraint firstItem="uOk-ia-Vh6" firstAttribute="top" secondItem="U59-Pt-Ft1" secondAttribute="bottom" constant="6" id="1pe-xh-lmN"/>
                             <constraint firstAttribute="trailing" secondItem="U59-Pt-Ft1" secondAttribute="trailing" id="4Dp-mH-SWc"/>
                             <constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="1HX-v1-naa" secondAttribute="trailing" constant="14" id="8Y8-61-Q3f"/>

+ 1 - 0
KulexiuForTeacher/KulexiuForTeacher/Module/Mine/VideoCourse/Model/VideoCourseModel.h

@@ -30,6 +30,7 @@
 @property (nonatomic, assign) double topFlag;
 @property (nonatomic, strong) NSString *updateTime;
 @property (nonatomic, strong) NSString *lessonSubjectName;
+@property (nonatomic, strong) NSString *payType;
 
 + (instancetype)modelObjectWithDictionary:(NSDictionary *)dict;
 - (instancetype)initWithDictionary:(NSDictionary *)dict;

+ 8 - 0
KulexiuForTeacher/KulexiuForTeacher/Module/Mine/VideoCourse/Model/VideoCourseModel.m

@@ -27,6 +27,7 @@ NSString *const kVideoCourseModelLessonTag = @"lessonTag";
 NSString *const kVideoCourseModelTopFlag = @"topFlag";
 NSString *const kVideoCourseModelUpdateTime = @"updateTime";
 NSString *const kVideoCourseModelLessonSubjectName = @"lessonSubjectName";
+NSString *const kVideoCourseModelPayType = @"payType";
 
 @interface VideoCourseModel ()
 
@@ -55,6 +56,7 @@ NSString *const kVideoCourseModelLessonSubjectName = @"lessonSubjectName";
 @synthesize topFlag = _topFlag;
 @synthesize updateTime = _updateTime;
 @synthesize lessonSubjectName = _lessonSubjectName;
+@synthesize payType = _payType;
 
 + (instancetype)modelObjectWithDictionary:(NSDictionary *)dict
 {
@@ -87,6 +89,7 @@ NSString *const kVideoCourseModelLessonSubjectName = @"lessonSubjectName";
             self.topFlag = [[self objectOrNilForKey:kVideoCourseModelTopFlag fromDictionary:dict] doubleValue];
             self.updateTime = [self objectOrNilForKey:kVideoCourseModelUpdateTime fromDictionary:dict];
         self.lessonSubjectName = [self objectOrNilForKey:kVideoCourseModelLessonSubjectName fromDictionary:dict];
+        self.payType = [self objectOrNilForKey:kVideoCourseModelPayType fromDictionary:dict];
     }
     
     return self;
@@ -115,6 +118,7 @@ NSString *const kVideoCourseModelLessonSubjectName = @"lessonSubjectName";
     [mutableDict setValue:[NSNumber numberWithDouble:self.topFlag] forKey:kVideoCourseModelTopFlag];
     [mutableDict setValue:self.updateTime forKey:kVideoCourseModelUpdateTime];
     [mutableDict setValue:self.lessonSubjectName forKey:kVideoCourseModelLessonSubjectName];
+    [mutableDict setValue:self.payType forKey:kVideoCourseModelPayType];
     return [NSDictionary dictionaryWithDictionary:mutableDict];
 }
 
@@ -160,6 +164,8 @@ NSString *const kVideoCourseModelLessonSubjectName = @"lessonSubjectName";
     self.topFlag = [aDecoder decodeDoubleForKey:kVideoCourseModelTopFlag];
     self.updateTime = [aDecoder decodeObjectForKey:kVideoCourseModelUpdateTime];
     self.lessonSubjectName = [aDecoder decodeObjectForKey:kVideoCourseModelLessonSubjectName];
+    self.payType = [aDecoder decodeObjectForKey:kVideoCourseModelPayType];
+    
     return self;
 }
 
@@ -185,6 +191,7 @@ NSString *const kVideoCourseModelLessonSubjectName = @"lessonSubjectName";
     [aCoder encodeDouble:_topFlag forKey:kVideoCourseModelTopFlag];
     [aCoder encodeObject:_updateTime forKey:kVideoCourseModelUpdateTime];
     [aCoder encodeObject:_lessonSubjectName forKey:kVideoCourseModelLessonSubjectName];
+    [aCoder encodeObject:_payType forKey:kVideoCourseModelPayType];
 }
 
 - (id)copyWithZone:(NSZone *)zone
@@ -212,6 +219,7 @@ NSString *const kVideoCourseModelLessonSubjectName = @"lessonSubjectName";
         copy.topFlag = self.topFlag;
         copy.updateTime = [self.updateTime copyWithZone:zone];
         copy.lessonSubjectName = [self.lessonSubjectName copyWithZone:zone];
+        copy.payType = [self.payType copyWithZone:zone];
     }
     
     return copy;

+ 22 - 10
KulexiuForTeacher/KulexiuForTeacher/Module/Mine/VideoCourse/View/VideoCourseCell.m

@@ -43,20 +43,32 @@
     [self.coverImage sd_setImageWithURL:[NSURL URLWithString:[model.lessonCoverUrl getUrlEndcodeString]] placeholderImage:[UIImage imageNamed:@"video_placeholder"]];
     self.courseTitle.text = [NSString returnNoNullStringWithString:model.lessonName];
     
-    if (model.lessonPrice > 0) {
-        self.courseMessage.text = [NSString  stringWithFormat:@"¥%.2f",model.lessonPrice];
+    if ([model.payType isEqualToString:@"VIP"]) {
+        self.courseMessage.text = @"会员";
+        self.courseMessage.textColor = HexRGB(0xC76E21);
+        self.descLabel.text = @"";
     }
-    else {
-        self.courseMessage.text = @"免费";
-    }
-    
-    self.courseCount.text = [NSString stringWithFormat:@"/%.0f课时",model.lessonCount];
-    if (model.lessonPrice > 0) {
-        self.descLabel.text = [NSString stringWithFormat:@"%.0f人已购买",model.countStudent];
+    else if ([model.payType isEqualToString:@"PAY"]) {
+        if (model.lessonPrice > 0) {
+            self.courseMessage.textColor = HexRGB(0xFF0000);
+            NSString *text = [NSString  stringWithFormat:@"¥%.2f",model.lessonPrice];
+            NSMutableAttributedString *attrs = [[NSMutableAttributedString alloc] initWithString:text attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:18.0f weight:UIFontWeightMedium],NSForegroundColorAttributeName:HexRGB(0xFF0000)}];
+            [attrs addAttributes:@{NSFontAttributeName:[UIFont systemFontOfSize:14.0f weight:UIFontWeightMedium]} range:[text rangeOfString:@"¥"]];
+            self.courseMessage.attributedText = attrs;
+            self.descLabel.text = [NSString stringWithFormat:@"%.0f人已购买",model.countStudent];
+        }
+        else {
+            self.courseMessage.text = @"免费";
+            self.courseMessage.textColor = HexRGB(0xC76E21);
+            self.descLabel.text = [NSString stringWithFormat:@"%.0f人已领取",model.countStudent];
+        }
     }
     else {
-        self.descLabel.text = [NSString stringWithFormat:@"%.0f人已领取",model.countStudent];
+        self.courseMessage.text = @"";
+        self.descLabel.text = @"";
     }
+    self.courseCount.text = [NSString stringWithFormat:@"/%.0f课时",model.lessonCount];
+    
     self.subjectLabel.text = [NSString returnNoNullStringWithString:model.lessonSubjectName];
     switch (status) {
         case VIDEOGRROUP_STATUS_ING:

+ 8 - 8
KulexiuForTeacher/KulexiuForTeacher/Module/Mine/VideoCourse/View/VideoCourseCell.xib

@@ -1,9 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="20037" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
+<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">
     <device id="retina6_1" orientation="portrait" appearance="light"/>
     <dependencies>
         <deployment identifier="iOS"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="20020"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22684"/>
         <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"/>
@@ -78,22 +78,22 @@
                                 <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="Yib-mA-6Ou">
-                                <rect key="frame" x="12" y="160" width="41" height="20"/>
+                                <rect key="frame" x="12" y="160" width="45.5" height="25"/>
                                 <constraints>
-                                    <constraint firstAttribute="height" constant="20" id="fo4-3I-tde"/>
+                                    <constraint firstAttribute="height" constant="25" id="fo4-3I-tde"/>
                                 </constraints>
-                                <fontDescription key="fontDescription" type="system" weight="medium" pointSize="15"/>
+                                <fontDescription key="fontDescription" type="system" weight="medium" pointSize="16"/>
                                 <color key="textColor" red="1" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
                                 <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="Spj-bd-Syo">
-                                <rect key="frame" x="12" y="181" width="57" height="15"/>
+                                <rect key="frame" x="12" y="186" width="58.5" 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"/>
+                                <rect key="frame" x="61.5" y="164" width="43.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"/>
@@ -110,7 +110,7 @@
                             <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="x8Q-G1-Gq9" firstAttribute="leading" secondItem="Yib-mA-6Ou" secondAttribute="trailing" constant="8" id="GF2-Ui-YuH"/>
+                            <constraint firstItem="x8Q-G1-Gq9" firstAttribute="leading" secondItem="Yib-mA-6Ou" secondAttribute="trailing" constant="4" id="GF2-Ui-YuH"/>
                             <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 firstItem="QDb-Of-i8k" firstAttribute="top" secondItem="ZgA-i1-RHm" secondAttribute="top" constant="8" id="am0-Ac-1cy"/>

+ 9 - 5
KulexiuForTeacher/KulexiuForTeacher/Module/TXClassRoom/View/NewWhiteboard/KSNewWhiteBoard.m

@@ -32,6 +32,10 @@
 #import "WebViewBaseConfig.h"
 #define touchPy 10
 
+#define WHITE_SCRIPT_NAME (@"DAYA")
+#define WHITE_AGENT_NAME (@"DAYAAPPI")
+#define WHITE_AGENT_DOMAIN (@"DAYAAPPTEACHER")
+
 @interface KSNewWhiteBoard ()<WKUIDelegate,WKNavigationDelegate,WKScriptMessageHandler,UIImagePickerControllerDelegate,UINavigationControllerDelegate,TZImagePickerControllerDelegate,UIAlertViewDelegate,UIGestureRecognizerDelegate,RSKImageCropViewControllerDelegate>
 {
     BOOL _isSelectOriginalPhoto;
@@ -110,7 +114,7 @@
 
 - (void)configUserAgent:(WKWebViewConfiguration *)config {
     NSString *oldUserAgent = config.applicationNameForUserAgent;
-    NSString *newAgent = [NSString stringWithFormat:@"%@ %@ %@",oldUserAgent,AGENT_NAME,AGENT_DOMAIN];
+    NSString *newAgent = [NSString stringWithFormat:@"%@ %@ %@",oldUserAgent,WHITE_AGENT_NAME,WHITE_AGENT_DOMAIN];
     config.applicationNameForUserAgent = newAgent;
 }
 
@@ -145,7 +149,7 @@
     WeakWebViewScriptMessageDelegate *weakScriptMessageDelegate = [[WeakWebViewScriptMessageDelegate alloc] initWithDelegate:self];
     //这个类主要用来做native与JavaScript的交互管理
     WKUserContentController * wkUController = [[WKUserContentController alloc] init];
-    [wkUController addScriptMessageHandler:weakScriptMessageDelegate name:SCRIPT_NAME];
+    [wkUController addScriptMessageHandler:weakScriptMessageDelegate name:WHITE_SCRIPT_NAME];
     config.userContentController = wkUController;
     WKPreferences *preferences = [WKPreferences new];
     // 是否支出javaScript
@@ -294,7 +298,7 @@
 #pragma mark - WKScriptMessageHandler
 - (void)userContentController:(WKUserContentController *)userContentController
       didReceiveScriptMessage:(WKScriptMessage *)message {
-    if ([message.name isEqualToString:SCRIPT_NAME]) {
+    if ([message.name isEqualToString:WHITE_SCRIPT_NAME]) {
         NSDictionary *parm = [self convertJsonStringToNSDictionary:message.body];
         // 回到主线程
         dispatch_async(dispatch_get_main_queue(), ^{
@@ -371,7 +375,7 @@
 - (void)dealloc {
     NSLog(@"-white board-");
     
-    [[_myWebView configuration].userContentController removeScriptMessageHandlerForName:SCRIPT_NAME];
+    [[_myWebView configuration].userContentController removeScriptMessageHandlerForName:WHITE_SCRIPT_NAME];
     [_myWebView loadHTMLString:@"" baseURL:nil];
     [_myWebView removeFromSuperview];
     _myWebView = nil;
@@ -771,7 +775,7 @@
 - (void)leaveRoom {
     [self removeTouchWindow];
     [self removeLoadig];
-    [[_myWebView configuration].userContentController removeScriptMessageHandlerForName:SCRIPT_NAME];
+    [[_myWebView configuration].userContentController removeScriptMessageHandlerForName:WHITE_SCRIPT_NAME];
     [_myWebView loadHTMLString:@"" baseURL:nil];
     [_myWebView removeFromSuperview];
     

+ 1 - 1
KulexiuForTeacher/KulexiuForTeacher/configuration/Config-debug.xcconfig

@@ -11,7 +11,7 @@
 REQUEST_DOMAIN = @"test.colexiu.com"
 ACCOMPANY_DOMAIN = @"test.colexiu.com"
 SOCKET_DOMAIN = @"test.colexiu.com/audioAnalysis"
-WHITE_BOARD = @"test.dayaedu.com"
+WHITE_BOARD = @"test.gym.lexiaoya.cn"
 
 JSPUSH_ENVIRONMENT = NO
 SUBMIT_UUID = NO

+ 1 - 1
KulexiuForTeacher/KulexiuForTeacher/configuration/Config-release.xcconfig

@@ -11,7 +11,7 @@
 REQUEST_DOMAIN = @"online.colexiu.com"
 ACCOMPANY_DOMAIN = @"online.colexiu.com"
 SOCKET_DOMAIN = @"online.colexiu.com/audioAnalysis"
-WHITE_BOARD = @"online.dayaedu.com"
+WHITE_BOARD = @"gym.lexiaoya.cn"
 
 JSPUSH_ENVIRONMENT = YES
 SUBMIT_UUID = YES

+ 1 - 1
KulexiuForTeacher/KulexiuForTeacher/configuration/Config-test.xcconfig

@@ -11,7 +11,7 @@
 REQUEST_DOMAIN = @"test.colexiu.com"
 ACCOMPANY_DOMAIN = @"test.colexiu.com"
 SOCKET_DOMAIN = @"test.colexiu.com/audioAnalysis"
-WHITE_BOARD = @"test.dayaedu.com"
+WHITE_BOARD = @"test.gym.lexiaoya.cn"
 
 JSPUSH_ENVIRONMENT = NO
 SUBMIT_UUID = NO