Prechádzať zdrojové kódy

老师风采查询封面图

Steven 2 rokov pred
rodič
commit
c80f76749b

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


+ 16 - 0
KulexiuForStudent/KulexiuForStudent.xcworkspace/xcuserdata/wangzhi.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

@@ -388,5 +388,21 @@
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            uuid = "24BEAC58-E5E6-4CF3-8642-0AD0E9023C1E"
+            shouldBeEnabled = "Yes"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "KulexiuForStudent/Module/Home/Controller/HomeViewController.m"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "616"
+            endingLineNumber = "616"
+            landmarkName = "-requestTeacherStyle"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
    </Breakpoints>
 </Bucket>

+ 1 - 0
KulexiuForStudent/KulexiuForStudent/Module/Home/Model/TeacherStyleModel.h

@@ -21,6 +21,7 @@
 @property (nonatomic, strong) NSString *videoUrl;
 @property (nonatomic, strong) NSString *createTime;
 @property (nonatomic, assign) BOOL liveing;
+@property (nonatomic, strong) NSString *cover;
 
 + (instancetype)modelObjectWithDictionary:(NSDictionary *)dict;
 - (instancetype)initWithDictionary:(NSDictionary *)dict;

+ 7 - 3
KulexiuForStudent/KulexiuForStudent/Module/Home/Model/TeacherStyleModel.m

@@ -18,6 +18,7 @@ NSString *const kTeacherStyleModelUsername = @"username";
 NSString *const kTeacherStyleModelVideoUrl = @"videoUrl";
 NSString *const kTeacherStyleModelCreateTime = @"createTime";
 NSString *const kTeacherStyleModelLiveing = @"liveing";
+NSString *const kTeacherStyleModelCover = @"cover";
 
 
 @interface TeacherStyleModel ()
@@ -38,7 +39,7 @@ NSString *const kTeacherStyleModelLiveing = @"liveing";
 @synthesize videoUrl = _videoUrl;
 @synthesize createTime = _createTime;
 @synthesize liveing = _liveing;
-
+@synthesize cover = _cover;
 
 + (instancetype)modelObjectWithDictionary:(NSDictionary *)dict
 {
@@ -62,7 +63,7 @@ NSString *const kTeacherStyleModelLiveing = @"liveing";
             self.videoUrl = [self objectOrNilForKey:kTeacherStyleModelVideoUrl fromDictionary:dict];
             self.createTime = [self objectOrNilForKey:kTeacherStyleModelCreateTime fromDictionary:dict];
             self.liveing = [[self objectOrNilForKey:kTeacherStyleModelLiveing fromDictionary:dict] boolValue];
-
+        self.cover = [self objectOrNilForKey:kTeacherStyleModelCover fromDictionary:dict];
     }
     
     return self;
@@ -82,7 +83,7 @@ NSString *const kTeacherStyleModelLiveing = @"liveing";
     [mutableDict setValue:self.videoUrl forKey:kTeacherStyleModelVideoUrl];
     [mutableDict setValue:self.createTime forKey:kTeacherStyleModelCreateTime];
     [mutableDict setValue:[NSNumber numberWithBool:self.liveing] forKey:kTeacherStyleModelLiveing];
-
+    [mutableDict setValue:self.cover forKey:kTeacherStyleModelCover];
     return [NSDictionary dictionaryWithDictionary:mutableDict];
 }
 
@@ -119,6 +120,7 @@ NSString *const kTeacherStyleModelLiveing = @"liveing";
     self.videoUrl = [aDecoder decodeObjectForKey:kTeacherStyleModelVideoUrl];
     self.createTime = [aDecoder decodeObjectForKey:kTeacherStyleModelCreateTime];
     self.liveing = [aDecoder decodeBoolForKey:kTeacherStyleModelLiveing];
+    self.cover = [aDecoder decodeObjectForKey:kTeacherStyleModelCover];
     return self;
 }
 
@@ -135,6 +137,7 @@ NSString *const kTeacherStyleModelLiveing = @"liveing";
     [aCoder encodeObject:_videoUrl forKey:kTeacherStyleModelVideoUrl];
     [aCoder encodeObject:_createTime forKey:kTeacherStyleModelCreateTime];
     [aCoder encodeBool:_liveing forKey:kTeacherStyleModelLiveing];
+    [aCoder encodeObject:_cover forKey:kTeacherStyleModelCover];
 }
 
 - (id)copyWithZone:(NSZone *)zone
@@ -153,6 +156,7 @@ NSString *const kTeacherStyleModelLiveing = @"liveing";
         copy.videoUrl = [self.videoUrl copyWithZone:zone];
         copy.createTime = [self.createTime copyWithZone:zone];
         copy.liveing = self.liveing;
+        copy.cover = [self.cover copyWithZone:zone];
     }
     
     return copy;

+ 7 - 1
KulexiuForStudent/KulexiuForStudent/Module/Home/View/TeacherShowCell.m

@@ -51,7 +51,13 @@
         self.callback = callback;
     }
     self.model = sourceModel;
-    [KSVideoHelper getVideoPreviewImageUrl:sourceModel.videoUrl forImageView:self.videoCover placeholder:[UIImage imageNamed:@"video_placeholder"]];
+    if ([NSString isEmptyString:sourceModel.cover]) {
+        [self.videoCover sd_setImageWithURL:[NSURL URLWithString:[sourceModel.cover getUrlEndcodeString]] placeholderImage:[UIImage imageNamed:@"video_placeholder"]];
+    }
+    else {
+        [KSVideoHelper getVideoPreviewImageUrl:sourceModel.videoUrl forImageView:self.videoCover placeholder:[UIImage imageNamed:@"video_placeholder"]];
+
+    }
     self.descLabel.text = [NSString returnNoNullStringWithString:sourceModel.describe];
     [self.teacherAvatar sd_setImageWithURL:[NSURL URLWithString:[sourceModel.avatar getUrlEndcodeString]] placeholderImage:[UIImage imageNamed:USERDEFAULT_LOGO]];
     self.teacherNameLabel.text = [NSString returnNoNullStringWithString:sourceModel.username];