|
@@ -7,6 +7,22 @@
|
|
|
|
|
|
#import "MyIncomeListCell.h"
|
|
|
|
|
|
+@interface MyIncomeListCell ()
|
|
|
+
|
|
|
+@property (weak, nonatomic) IBOutlet UIImageView *courseTypeImage;
|
|
|
+
|
|
|
+@property (weak, nonatomic) IBOutlet UILabel *timeLabel;
|
|
|
+
|
|
|
+@property (weak, nonatomic) IBOutlet UILabel *incomeLabel;
|
|
|
+
|
|
|
+@property (weak, nonatomic) IBOutlet UILabel *courseTime;
|
|
|
+
|
|
|
+@property (weak, nonatomic) IBOutlet NSLayoutConstraint *dayLabelHeight;
|
|
|
+
|
|
|
+@property (weak, nonatomic) IBOutlet NSLayoutConstraint *spaceHeight;
|
|
|
+
|
|
|
+@end
|
|
|
+
|
|
|
@implementation MyIncomeListCell
|
|
|
|
|
|
- (void)awakeFromNib {
|
|
@@ -15,6 +31,50 @@
|
|
|
self.selectionStyle = UITableViewCellSelectionStyleNone;
|
|
|
}
|
|
|
|
|
|
+- (void)configSource:(IncomeListModel *)sourceModel preSourceDay:(NSString *)preSourceDay {
|
|
|
+ if ([NSString isEmptyString:preSourceDay]) {
|
|
|
+ self.spaceHeight.constant = 10;
|
|
|
+ self.dayLabelHeight.constant = 20;
|
|
|
+ self.timeLabel.text = [NSString returnNoNullStringWithString:sourceModel.timeDay];
|
|
|
+ }
|
|
|
+ else if ([sourceModel.timeDay isEqualToString:preSourceDay])
|
|
|
+ {
|
|
|
+ self.timeLabel.text = @"";
|
|
|
+ self.spaceHeight.constant = 0;
|
|
|
+ self.dayLabelHeight.constant = 0;
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ self.spaceHeight.constant = 10;
|
|
|
+ self.dayLabelHeight.constant = 20;
|
|
|
+ self.timeLabel.text = [NSString returnNoNullStringWithString:sourceModel.timeDay];
|
|
|
+ }
|
|
|
+
|
|
|
+ NSDateFormatter *dateFormatter = [NSObject getDateformatter];
|
|
|
+ [dateFormatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"];
|
|
|
+ NSDate *beginDate = [dateFormatter dateFromString:sourceModel.startTime];
|
|
|
+ NSDate *endDate = [dateFormatter dateFromString:sourceModel.endTime];
|
|
|
+ [dateFormatter setDateFormat:@"yyyy/MM/dd HH:mm"];
|
|
|
+ NSString *beginStr = [NSString returnNoNullStringWithString:[dateFormatter stringFromDate:beginDate]];
|
|
|
+
|
|
|
+ [dateFormatter setDateFormat:@"HH:mm"];
|
|
|
+ NSString *endStr = [NSString returnNoNullStringWithString:[dateFormatter stringFromDate:endDate]];
|
|
|
+ self.courseTime.text = [NSString stringWithFormat:@"%@~%@", beginStr, endStr];
|
|
|
+
|
|
|
+ if ([sourceModel.bizType isEqualToString:@"PRACTICE"]) {
|
|
|
+ [self.courseTypeImage setImage:[UIImage imageNamed:@"income_accompany"]];
|
|
|
+ }
|
|
|
+ else if ([sourceModel.bizType isEqualToString:@"LIVE"]) {
|
|
|
+ [self.courseTypeImage setImage:[UIImage imageNamed:@"income_live"]];
|
|
|
+ }
|
|
|
+ else if ([sourceModel.bizType isEqualToString:@"VIDEO"]) {
|
|
|
+ [self.courseTypeImage setImage:[UIImage imageNamed:@"income_video"]];
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ [self.courseTypeImage setImage:[UIImage imageNamed:@"income_music"]];
|
|
|
+ }
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
|
|
|
[super setSelected:selected animated:animated];
|
|
|
|