// // AccompanyEvaluateCell.m // KulexiuForTeacher // // Created by 王智 on 2022/4/6. // #import "AccompanyEvaluateCell.h" @interface AccompanyEvaluateCell () @property (weak, nonatomic) IBOutlet UILabel *tipsMsg; @property (weak, nonatomic) IBOutlet UIView *emptyView; @property (weak, nonatomic) IBOutlet UILabel *contentLabel; @end @implementation AccompanyEvaluateCell - (void)awakeFromNib { [super awakeFromNib]; // Initialization code self.selectionStyle = UITableViewCellSelectionStyleNone; } - (void)configWithEvaluateMessage:(NSString *)evaluateMessage courseStatus:(NSString *)courseStatus hasEvaluate:(BOOL)hasEvaluate { NSString *tipsDesc = @""; if ([courseStatus isEqualToString:@"COMPLETE"]) { tipsDesc = @"老师尚未评价"; if (hasEvaluate) { self.emptyView.hidden = YES; if (![NSString isEmptyString:evaluateMessage]) { NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init]; [paragraphStyle setLineSpacing:4];//调整行间距 NSMutableAttributedString *attr = [[NSMutableAttributedString alloc] initWithString:evaluateMessage attributes:@{NSParagraphStyleAttributeName:paragraphStyle,NSFontAttributeName:[UIFont systemFontOfSize:13.0f],NSForegroundColorAttributeName:HexRGB(0x333333)}]; self.contentLabel.attributedText = attr; } else { self.contentLabel.attributedText = nil; } } else { self.emptyView.hidden = NO; self.contentLabel.attributedText = nil; } } else { tipsDesc = @"课程结束之后老师才能对您的学习进行评价哦"; self.emptyView.hidden = NO; self.contentLabel.attributedText = nil; } NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init]; [paragraphStyle setLineSpacing:4];//调整行间距 NSMutableAttributedString *attr = [[NSMutableAttributedString alloc] initWithString:tipsDesc attributes:@{NSParagraphStyleAttributeName:paragraphStyle,NSFontAttributeName:[UIFont systemFontOfSize:13.0f],NSForegroundColorAttributeName:HexRGB(0x999999)}]; self.tipsMsg.attributedText = attr; } - (void)setSelected:(BOOL)selected animated:(BOOL)animated { [super setSelected:selected animated:animated]; // Configure the view for the selected state } @end