CNLiveCMineInteCollectionViewCell.m 21.9 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567
//
//  CNLiveCMineInteCollectionViewCell.m
//  CNLiveCMineModule
//
//  Created by open on 2021/12/28.
//

#import "CNLiveCMineInteCollectionViewCell.h"
@interface CNLiveCMineInteCollectionViewCell()
@property (nonatomic, strong) UIImageView * imageView;
@property (nonatomic, strong) UIImageView * newView;
@property (nonatomic, strong) UILabel * nameLabel;
@property (nonatomic, strong) UILabel * descLabel;
@end

@implementation CNLiveCMineInteCollectionViewCell

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.backgroundColor = UIColorHex(0xFCFDFD);
        self.layer.cornerRadius = 5;
        self.layer.masksToBounds = YES;//超出父视图部分不显示。
        self.layer.borderColor = UIColorHex(0xF9FAFB).CGColor;
        self.layer.borderWidth = 1;
        
        [self.contentView addSubview:self.imageView];
        [self.contentView addSubview:self.nameLabel];
        [self.contentView addSubview:self.descLabel];
        [self.contentView addSubview:self.newView];
    }
    return self;
}
-(void)layoutSubviews
{
    [super layoutSubviews];
    __weak typeof(self) weakSelf = self;
    [self.imageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.mas_equalTo(weakSelf);
        make.top.mas_equalTo(weakSelf.contentView.mas_top).offset(10);
        make.size.mas_equalTo(50);
    }];
    [self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.mas_equalTo(weakSelf);
        make.top.mas_equalTo(weakSelf.imageView.mas_bottom).offset(10);
    }];
    [self.descLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.mas_equalTo(weakSelf);
        make.top.mas_equalTo(weakSelf.nameLabel.mas_bottom).offset(10);
    }];
    [self.newView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.mas_equalTo(weakSelf.contentView).offset(20);
        make.top.mas_equalTo(weakSelf.contentView).offset(5);
    }];
}
-(void)setTaskModel:(CNLiveCMineInteListSubModel *)taskModel
{
    _taskModel = taskModel;
    
    if ([taskModel.isEmpty isEqualToString:@"1"]) {
        self.imageView.image = [CNLiveCMineService imageWithMineName:@"c_mine_content_item_task"];
    }else{
        [self.imageView sd_setImageWithURL:[NSURL URLWithString:taskModel.poster] placeholderImage:nil];
    }
    self.nameLabel.text = taskModel.title;
    self.descLabel.text = taskModel.subTitle;
    self.newView.hidden = ![taskModel.tag isEqualToString:@"1"];
}
#pragma mark =
-(UIImageView *)imageView
{
    if (!_imageView) {
        _imageView = [[UIImageView alloc] initWithFrame:CGRectZero];
        _imageView.contentMode = UIViewContentModeScaleToFill;
        _imageView.backgroundColor = [UIColor clearColor];
    }
    return _imageView;
}
-(UIImageView *)newView
{
    if (!_newView) {
        _newView = [[UIImageView alloc] initWithFrame:CGRectZero];
        _newView.contentMode = UIViewContentModeScaleAspectFill;
        _newView.backgroundColor = [UIColor clearColor];
        _newView.image = [CNLiveCMineService imageWithMineName:@"c_mine_content_tag_new"];
        _newView.hidden = YES;
    }
    return _newView;
}
-(UILabel *)nameLabel
{
    if (!_nameLabel) {
        _nameLabel = [[UILabel alloc] init];
        _nameLabel.numberOfLines = 1;
        _nameLabel.textAlignment = NSTextAlignmentCenter;
        _nameLabel.lineBreakMode = NSLineBreakByTruncatingTail;
        _nameLabel.textColor = UIColorHex(0x333333);
        _nameLabel.font = UIFontCNMake(15);
        _nameLabel.font = UIFontBoldCNMake(15);
        _nameLabel.text = @"";
    }
    return _nameLabel;
}
-(UILabel *)descLabel
{
    if (!_descLabel) {
        _descLabel = [[UILabel alloc] init];
        _descLabel.numberOfLines = 1;
        _descLabel.textAlignment = NSTextAlignmentCenter;
        _descLabel.lineBreakMode = NSLineBreakByTruncatingTail;
        _descLabel.textColor = UIColorHex(0x999999);
        _descLabel.font = UIFontCNMake(10);
        _descLabel.text = @"";
    }
    return _descLabel;
}
@end


@interface CNLiveCMineDetailTableViewCell()
@property (nonatomic, strong) UILabel * nameLabel;
@property (nonatomic, strong) UILabel * dateLabel;
@property (nonatomic, strong) UILabel * coinsLabel;
@property (nonatomic, strong) QMUIButton * lookButton;
@end


@implementation CNLiveCMineDetailTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        self.contentView.backgroundColor = [UIColor whiteColor];
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        [self.contentView addSubview:self.nameLabel];
        [self.contentView addSubview:self.dateLabel];
        [self.contentView addSubview:self.coinsLabel];
        [self.contentView addSubview:self.lookButton];
    }
    return self;
}
-(void)layoutSubviews
{
    [super layoutSubviews];
    __weak typeof(self) weakSelf = self;
    [self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(weakSelf.contentView).offset(15);
        make.left.mas_equalTo(weakSelf.contentView).offset(10);
    }];
    [self.dateLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(weakSelf.contentView).offset(10);
        make.bottom.mas_equalTo(weakSelf.contentView).offset(-15);
    }];
    [self.coinsLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.mas_equalTo(weakSelf.contentView);
        make.right.mas_equalTo(weakSelf.contentView.mas_right).offset(-15);
    }];
    [self.lookButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(weakSelf.coinsLabel.mas_bottom).offset(5);
        make.right.mas_equalTo(weakSelf.contentView).offset(-15);
    }];
}
-(void)setListModel:(CNLiveCMineInteDetailListModel *)listModel
{
    _listModel = listModel;
    
    self.nameLabel.text = listModel.integralDesc;
    self.dateLabel.text = listModel.exchangeTime;
    self.coinsLabel.text = listModel.integral;
    self.coinsLabel.textColor = [listModel.integral cn_containsString:@"-"]?UIColorHex(0x00C657):UIColorHex(0xF5A623);
    self.lookButton.hidden = [listModel.state isEqualToString:@"2"];
    if ([listModel.state isEqualToString:@"1"]) {
        __weak typeof(self) weakSelf = self;
        [self.coinsLabel mas_updateConstraints:^(MASConstraintMaker *make) {
            make.centerY.mas_equalTo(weakSelf.contentView).offset(-10);
            make.right.mas_equalTo(weakSelf.contentView.mas_right).offset(-15);
        }];
        [self.lookButton mas_updateConstraints:^(MASConstraintMaker *make) {
            make.top.mas_equalTo(weakSelf.coinsLabel.mas_bottom).offset(5);
            make.right.mas_equalTo(weakSelf.contentView).offset(-15);
        }];
    }
}
#pragma mark =
-(UILabel *)nameLabel
{
    if (!_nameLabel) {
        _nameLabel = [[UILabel alloc] init];
        _nameLabel.numberOfLines = 1;
        _nameLabel.textAlignment = NSTextAlignmentCenter;
        _nameLabel.lineBreakMode = NSLineBreakByTruncatingTail;
        _nameLabel.textColor = UIColorHex(0x333333);
        _nameLabel.font = UIFontCNMake(15);
        _nameLabel.font = UIFontBoldCNMake(15);
    }
    return _nameLabel;
}
-(UILabel *)dateLabel
{
    if (!_dateLabel) {
        _dateLabel = [[UILabel alloc] init];
        _dateLabel.numberOfLines = 1;
        _dateLabel.textAlignment = NSTextAlignmentCenter;
        _dateLabel.lineBreakMode = NSLineBreakByTruncatingTail;
        _dateLabel.textColor = UIColorHex(0x999999);
        _dateLabel.font = UIFontCNMake(10);
    }
    return _dateLabel;
}
-(UILabel *)coinsLabel
{
    if (!_coinsLabel) {
        _coinsLabel = [[UILabel alloc] init];
        _coinsLabel.numberOfLines = 1;
        _coinsLabel.textAlignment = NSTextAlignmentCenter;
        _coinsLabel.lineBreakMode = NSLineBreakByTruncatingTail;
        _coinsLabel.textColor = UIColorHex(0x00C657);
        _coinsLabel.font = UIFontCNMake(15);
    }
    return _coinsLabel;
}
-(QMUIButton *)lookButton
{
    if (!_lookButton) {
        _lookButton = [[QMUIButton alloc] init];
        [_lookButton setTitle:@"去看看" forState:UIControlStateNormal];
        [_lookButton setImage:[CNLiveCMineService imageWithMineName:@"c_mine_skip_more"] forState:UIControlStateNormal];
        [_lookButton setTitleColor:UIColorHex(0x999999) forState:UIControlStateNormal];
        _lookButton.titleLabel.font = UIFontCNMake(14);
        _lookButton.backgroundColor = [UIColor clearColor];
        _lookButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft;
        _lookButton.spacingBetweenImageAndTitle = 1;
        _lookButton.userInteractionEnabled = NO;
        _lookButton.imagePosition = QMUIButtonImagePositionRight;
        _lookButton.hidden = YES;
    }
    return _lookButton;
}
@end

@interface CNLiveCMineTaskTableViewCell()
@property (nonatomic, strong) UIView * mainView;
@property (nonatomic, strong) UIImageView *leftImage;
@property (nonatomic, strong) UILabel *titleLabel;
@property (nonatomic, strong) UILabel *pointLabel;
@property (nonatomic, strong) UILabel *progressLabel;
@property (nonatomic, strong) QMUIButton *completeBtn;
@end

@implementation CNLiveCMineTaskTableViewCell

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.contentView.backgroundColor = UIColorHex(0xf5f5f5);
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        [self.contentView addSubview:self.mainView];
        [self.mainView addSubview:self.leftImage];
        [self.mainView addSubview:self.titleLabel];
        [self.mainView addSubview:self.pointLabel];
        
        [self.mainView addSubview:self.progressLabel];
        [self.mainView addSubview:self.completeBtn];
    }
    return self;
}
-(void)layoutSubviews
{
    [super layoutSubviews];
    __weak typeof(self) weakSelf = self;
    [self.mainView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.bottom.mas_equalTo(weakSelf.contentView);
        make.left.mas_equalTo(weakSelf.contentView).offset(15);
        make.right.mas_equalTo(weakSelf.contentView).offset(-15);
    }];
    [self.leftImage mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(weakSelf.mainView);
        make.left.equalTo(weakSelf.mainView.mas_left).with.offset(10);
        make.size.offset(40);
    }];
    [self.completeBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(weakSelf.mainView);
        make.right.equalTo(weakSelf.mainView.mas_right).offset(-10);
        make.height.offset(30);
        make.width.offset(70);
    }];
    [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(weakSelf.mainView.mas_top).with.offset(15);
        make.left.equalTo(weakSelf.leftImage.mas_right).with.offset(10);
        make.right.equalTo(weakSelf.completeBtn.mas_left).with.offset(-10);
    }];
    [self.pointLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.equalTo(weakSelf.mainView.mas_bottom).with.offset(-15);
        make.left.equalTo(weakSelf.leftImage.mas_right).with.offset(10);
    }];
    [self.progressLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(weakSelf.pointLabel);
        make.left.equalTo(weakSelf.pointLabel.mas_right).with.offset(10);
    }];
    
    self.completeBtn.layer.cornerRadius = 15.0;
    self.completeBtn.layer.masksToBounds = YES;
}
-(void)setTaskModel:(CNLiveCMineInteTaskListItemModel *)taskModel
{
    _taskModel = taskModel;
    
    [self.leftImage sd_setImageWithURL:[NSURL URLWithString:taskModel.icon] completed:nil];
    self.titleLabel.text = taskModel.title;
    self.pointLabel.text = [NSString stringWithFormat:@"积分值+%@",taskModel.score];
    
    NSString *timesStr = [NSString stringWithFormat:@"完成%ld/%ld",(long)taskModel.times,(long)taskModel.totalCount];
    NSString *times = [NSString stringWithFormat:@"%ld",(long)taskModel.times];
    NSMutableAttributedString *str = [[NSMutableAttributedString alloc]initWithString:timesStr];
    NSRange range = [timesStr rangeOfString:times];
    [str addAttribute:NSForegroundColorAttributeName value:UIColorHex(0x23D41E) range:range];
    self.progressLabel.attributedText = str;

    if (taskModel.times >= taskModel.totalCount) {
        [self.completeBtn setTitle:@"已完成" forState:UIControlStateNormal];
        [self.completeBtn setImage:nil forState:UIControlStateNormal];
        self.completeBtn.backgroundColor = UIColorHex(0xF0F0F0);
        [self.completeBtn setTitleColor:UIColorHex(0x999999) forState:UIControlStateNormal];
    }else{
        [self setCompleterBtnType:taskModel.taskId];
        [self.completeBtn setImage:[CNLiveCMineService imageWithMineName:@"c_mine_skip_yellow_more"] forState:UIControlStateNormal];
        self.completeBtn.backgroundColor = UIColorMakeWithRGBA(245, 166, 35, 0.1);
        [self.completeBtn setTitleColor:UIColorHex(0xF5A623) forState:UIControlStateNormal];
    }
}
-(void)clickCompleteBtn:(QMUIButton *)button
{
    
}
- (void)setCompleterBtnType:(NSString *)type {
    
    if([type isEqualToString:@"update_face"]||[type isEqualToString:@"update_nick"]){//头像 昵称
        [_completeBtn setTitle:@"去完成" forState:UIControlStateNormal];
    }
    else if ([type isEqualToString:@"publish_witness"]){//发布目击者
        [_completeBtn setTitle:@"去完成" forState:UIControlStateNormal];
    }
    else if ([type isEqualToString:@"add_friend"]){//添加好友
        [_completeBtn setTitle:@"去完成" forState:UIControlStateNormal];
    }
    else if ([type isEqualToString:@"publish_moment"]){//生活圈
        [_completeBtn setTitle:@"去完成" forState:UIControlStateNormal];
    }
    else if ([type isEqualToString:@"share_video"]){//分享目击者视频
        [_completeBtn setTitle:@"去分享" forState:UIControlStateNormal];
    }
    else if ([type isEqualToString:@"share_article"]){//分享文章
        [_completeBtn setTitle:@"去分享" forState:UIControlStateNormal];
    }
    else if ([type isEqualToString:@"publish_comment"]){//评论
        [_completeBtn setTitle:@"去完成" forState:UIControlStateNormal];
    }
    else if ([type isEqualToString:@"read_article"]){//看文章-> 视讯中国 -> 今日要闻
        [_completeBtn setTitle:@"去完成" forState:UIControlStateNormal];
    }
    else if ([type isEqualToString:@"customer_feedback"]){//帮助与反馈
        [_completeBtn setTitle:@"去完成" forState:UIControlStateNormal];
    }
    else if ([type isEqualToString:@"watch_video"]){//看视频 -> 视讯中国 -> 目击者
        [_completeBtn setTitle:@"去观看" forState:UIControlStateNormal];
    }
    else if ([type isEqualToString:@"check_in"]){//签到
        [_completeBtn setTitle:@"去完成" forState:UIControlStateNormal];
    }
    else if ([type isEqualToString:@"listen_novel"]){//听小说
        [_completeBtn setTitle:@"去完成" forState:UIControlStateNormal];
    }
}
#pragma mark - Lazy loading
-(UIView *)mainView
{
    if (!_mainView) {
        _mainView = [[UIView alloc] init];
        _mainView.backgroundColor = [UIColor whiteColor];
    }
    return _mainView;
}
- (UIImageView *)leftImage{
    if (!_leftImage) {
        _leftImage = [[UIImageView alloc] init];
        _leftImage.userInteractionEnabled = YES;
    }
    return _leftImage;
}
- (UILabel *)titleLabel{
    if(_titleLabel == nil){
        _titleLabel = [[UILabel alloc] init];
        _titleLabel.textColor = UIColorHex(0x282828);
        _titleLabel.font = UIFontCNMake(16);
        _titleLabel.userInteractionEnabled = YES;
    }
    return _titleLabel;
    
}
- (UILabel *)pointLabel{
    if(_pointLabel == nil){
        _pointLabel = [[UILabel alloc] init];
        _pointLabel.textColor = UIColorHex(0x9B9B9B);
        _pointLabel.font = UIFontCNMake(12);
        _pointLabel.userInteractionEnabled = YES;
    }
    return _pointLabel;
    
}
- (UILabel *)progressLabel{
    if(_progressLabel == nil){
        _progressLabel = [[UILabel alloc] init];
        _progressLabel.textColor = UIColorHex(0x9B9B9B);
        _progressLabel.font = UIFontCNMake(12);
        _progressLabel.userInteractionEnabled = YES;
    }
    return _progressLabel;
}

-(QMUIButton *)completeBtn
{
    if (!_completeBtn) {
        _completeBtn = [[QMUIButton alloc] init];
        [_completeBtn setTitle:@"去完成" forState:UIControlStateNormal];
        [_completeBtn setImage:[CNLiveCMineService imageWithMineName:@"c_mine_skip_yellow_more"] forState:UIControlStateNormal];
        [_completeBtn setTitleColor:UIColorHex(0xF5A623) forState:UIControlStateNormal];
        _completeBtn.titleLabel.font = [UIFont systemFontOfSize:12];
        _completeBtn.titleLabel.font = [UIFont boldSystemFontOfSize:12];
        _completeBtn.spacingBetweenImageAndTitle = 0;
        _completeBtn.userInteractionEnabled = NO;
        _completeBtn.backgroundColor = UIColorMakeWithRGBA(245, 166, 35, 0.1);
        _completeBtn.imagePosition = QMUIButtonImagePositionRight;
        [_completeBtn addTarget:self action:@selector(clickCompleteBtn:) forControlEvents:UIControlEventTouchUpInside];
    }
    return _completeBtn;
}
@end

@interface CNLiveCMineAnnouTableViewCell ()
@property (nonatomic, strong) UIView * mainView;
@property (nonatomic, strong) UILabel * tagLabel;
@property (nonatomic, strong) UILabel * nameLabel;
@property (nonatomic, strong) UILabel * dateLabel;
@property (nonatomic, strong) UIImageView * moreView;
@end

@implementation CNLiveCMineAnnouTableViewCell

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.contentView.backgroundColor = UIColorHex(0xf9f9f9);
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        [self.contentView addSubview:self.mainView];
        [self.mainView addSubview:self.tagLabel];
        [self.mainView addSubview:self.nameLabel];
        [self.mainView addSubview:self.dateLabel];
        [self.mainView addSubview:self.moreView];
        
        __weak typeof(self) weakSelf = self;
        [self.mainView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.mas_equalTo(weakSelf.contentView).offset(5);
            make.bottom.mas_equalTo(weakSelf.contentView).offset(-5);
            make.left.mas_equalTo(weakSelf.contentView).offset(15);
            make.right.mas_equalTo(weakSelf.contentView).offset(-15);
        }];
        [self.moreView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerY.mas_equalTo(weakSelf.mainView);
            make.right.mas_equalTo(weakSelf.mainView).offset(-10);
            make.size.mas_equalTo(15);
        }];
        [self.tagLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.left.mas_equalTo(weakSelf.mainView).offset(10);
            make.height.mas_equalTo(15);
        }];
        [self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.left.mas_equalTo(weakSelf.mainView).offset(10);
            make.right.mas_equalTo(weakSelf.moreView.mas_left).offset(-10);
        }];
        [self.dateLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.bottom.mas_equalTo(weakSelf.mainView.mas_bottom).offset(-10);
            make.left.mas_equalTo(weakSelf.mainView.mas_left).offset(10);
            make.right.mas_equalTo(weakSelf.moreView.mas_left).offset(-10);
        }];
    }
    return self;
}

-(void)setAnnouModel:(CNLiveCMineInteListSubModel *)annouModel
{
    _annouModel = annouModel;
    self.nameLabel.text = annouModel.title;
    self.dateLabel.text = annouModel.publishTime;

    if ([annouModel.tag isEqualToString:@"1"]) {
        self.tagLabel.backgroundColor = UIColorHex(#F5A623);
        self.tagLabel.text = @" 置顶 ";
        
        __weak typeof(self) weakSelf = self;
        [self.nameLabel mas_updateConstraints:^(MASConstraintMaker *make) {
            make.centerY.mas_equalTo(weakSelf.tagLabel);
            make.left.mas_equalTo(weakSelf.contentView.mas_left).offset(60);
            make.right.mas_equalTo(weakSelf.moreView.mas_left).offset(-10);
        }];
    }
}
#pragma mark - Lazy loading
-(UIView *)mainView
{
    if (!_mainView) {
        _mainView = [[UIView alloc] init];
        _mainView.backgroundColor = [UIColor whiteColor];
        _mainView.layer.cornerRadius = 8;
        _mainView.layer.masksToBounds = YES;
    }
    return _mainView;
}
-(UILabel *)nameLabel
{
    if (!_nameLabel) {
        _nameLabel = [[UILabel alloc] init];
        _nameLabel.numberOfLines = 1;
        _nameLabel.textAlignment = NSTextAlignmentLeft;
        _nameLabel.lineBreakMode = NSLineBreakByTruncatingTail;
        _nameLabel.textColor = UIColorHex(0x333333);
        _nameLabel.font = UIFontCNMake(15);
        _nameLabel.font = UIFontBoldCNMake(15);
    }
    return _nameLabel;
}
-(UILabel *)dateLabel
{
    if (!_dateLabel) {
        _dateLabel = [[UILabel alloc] init];
        _dateLabel.numberOfLines = 1;
        _dateLabel.textAlignment = NSTextAlignmentLeft;
        _dateLabel.lineBreakMode = NSLineBreakByTruncatingTail;
        _dateLabel.textColor = UIColorHex(0x999999);
        _dateLabel.font = UIFontCNMake(10);
    }
    return _dateLabel;
}
-(UILabel *)tagLabel
{
    if (!_tagLabel) {
        _tagLabel = [[UILabel alloc] init];
        _tagLabel.numberOfLines = 1;
        _tagLabel.textAlignment = NSTextAlignmentLeft;
        _tagLabel.lineBreakMode = NSLineBreakByTruncatingTail;
        _tagLabel.textColor = [UIColor whiteColor];
        _tagLabel.font = [UIFont systemFontOfSize:10];
        _tagLabel.font = [UIFont boldSystemFontOfSize:10];
        _tagLabel.layer.cornerRadius = 3;
        _tagLabel.layer.masksToBounds = YES;
    }
    return _tagLabel;
}
- (UIImageView *)moreView{
    if (!_moreView) {
        _moreView = [[UIImageView alloc] init];
        _moreView.image = [CNLiveCMineService imageWithMineName:@"c_mine_skip_inte_detail"];
        _moreView.contentMode = UIViewContentModeScaleAspectFill;
    }
    return _moreView;
}
@end