123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- //
- // AccompanyStudentEvaCell.m
- // KulexiuForTeacher
- //
- // Created by 王智 on 2022/4/6.
- //
- #import "AccompanyStudentEvaCell.h"
- #import "KSStarView.h"
- @interface AccompanyStudentEvaCell ()
- @property (weak, nonatomic) IBOutlet UILabel *tipsMsg;
- @property (weak, nonatomic) IBOutlet UIView *emptyView;
- @property (weak, nonatomic) IBOutlet KSStarView *starView;
- @property (weak, nonatomic) IBOutlet UILabel *contentLabel;
- @end
- @implementation AccompanyStudentEvaCell
- - (void)awakeFromNib {
- [super awakeFromNib];
- // Initialization code
- self.selectionStyle = UITableViewCellSelectionStyleNone;
- self.starView.allowMark = NO;
- self.starView.hidden = YES; // 隐藏星级
- }
- - (void)configWithEvaluateMessage:(NSString *)evaluateMessage courseStatus:(NSString *)courseStatus starNum:(NSInteger)starNum 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
|