| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- //
- // DownloadStatusCell.m
- // TeacherDaya
- //
- // Created by Kyle on 2020/11/25.
- // Copyright © 2020 DayaMusic. All rights reserved.
- //
- #import "DownloadStatusCell.h"
- @interface DownloadStatusCell ()
- @property (weak, nonatomic) IBOutlet UIImageView *userLogo;
- @property (weak, nonatomic) IBOutlet UILabel *userName;
- @property (weak, nonatomic) IBOutlet UILabel *statusLabel;
- @property (nonatomic, strong) NSString *songId;
- @end
- @implementation DownloadStatusCell
- - (void)awakeFromNib {
- [super awakeFromNib];
- // Initialization code
- self.selectionStyle = UITableViewCellSelectionStyleNone;
- }
- - (void)setSourceModel:(RoomMember *)member songId:(NSString *)songId {
- if (!member ) {
- return;
- }
- self.member = member;
-
- [self.userLogo sd_setImageWithURL:[NSURL URLWithString:[member.headUrl getUrlEndcodeString]] placeholderImage:[UIImage imageNamed:USERDEFAULT_LOGO]];
- self.userName.text = [NSString returnNoNullStringWithString:member.name];
-
- NSInteger downStatus = member.downStatus;
- for (ClassSongMessage *message in member.songMessage) {
- if ([message.musicScoreAccompanimentId isEqualToString:songId]) {
- downStatus = message.downStatus;
- }
- }
- [self getStatusWithType:downStatus];
- }
- - (void)getStatusWithType:(NSInteger)statusType {
- if (statusType == 1) {
- self.statusLabel.text = @"已下载";
- self.statusLabel.textColor = HexRGB(0x8F8F8F);
- }
- else if (statusType == 0) {
- self.statusLabel.text = @"下载中";
- self.statusLabel.textColor = HexRGB(0x4EEBFF);
- }
- else {
- self.statusLabel.text = @"下载失败";
- self.statusLabel.textColor = HexRGB(0xff5757);
- }
- }
- - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
- [super setSelected:selected animated:animated];
- // Configure the view for the selected state
- }
- @end
|