| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106 |
- //
- // PlatformActivityCell.m
- // model
- //
- // Created by JuYi on 2018/7/17.
- // Copyright © 2018年 Mine. All rights reserved.
- // 平台活动cell
- #import "PlatformActivityCell.h"
- @implementation PlatformActivityCell
- - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
- self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
- if (self) {
- //
- self.selectionStyle = UITableViewCellSelectionStyleNone;
-
- [self creatCellSubViews];
- }
- return self;
- }
- - (void)creatCellSubViews {
- //
- self.iconImageView = [[UIImageView alloc] initWithFrame:CGRectMake(20, 18, 80, 80)];
- [self.contentView addSubview:self.iconImageView];
- //
- self.titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(self.iconImageView.frame) + 15, 18, ScreenWidth - 135, 15)];
- self.titleLabel.textAlignment = NSTextAlignmentLeft;
- self.titleLabel.textColor = RGBValueColor(0x333333, 1.0);
- self.titleLabel.font = [UIFont systemFontOfSize:15];
- [self.contentView addSubview:self.titleLabel];
- //
- self.subTitleLabel = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(self.iconImageView.frame) + 15, CGRectGetMaxY(self.titleLabel.frame) + 5, ScreenWidth - 135, 34)];
- self.subTitleLabel.textAlignment = NSTextAlignmentLeft;
- self.subTitleLabel.numberOfLines = 0;
- self.subTitleLabel.textColor = RGBValueColor(0x333333, 1.0); //
- self.subTitleLabel.font = [UIFont systemFontOfSize:13];
- [self.contentView addSubview:self.subTitleLabel];
- //
- self.childTitleLabel = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(self.iconImageView.frame) + 15, CGRectGetMaxY(self.subTitleLabel.frame) + 5, ScreenWidth - 135, 13)];
- self.childTitleLabel.textAlignment = NSTextAlignmentLeft;
- self.childTitleLabel.textColor = RGBValueColor(0x999999, 1.0); //333333
- self.childTitleLabel.font = [UIFont systemFontOfSize:13];
- [self.contentView addSubview:self.childTitleLabel];
- //
- self.lineView = [[UIView alloc] initWithFrame:CGRectMake(0, CGRectGetMaxY(self.iconImageView.frame) + 18, ScreenWidth, 0.5)];
- self.lineView.backgroundColor = RGBValueColor(0xdfdfdf, 1.0);
- [self.contentView addSubview:self.lineView];
- //
- UIButton *statusBtn = [UIButton buttonWithType:UIButtonTypeCustom];
- statusBtn.frame = CGRectMake(ScreenWidth - 95, CGRectGetMaxY(self.lineView.frame) + 8, 75, 24);
- [statusBtn setBackgroundImage:[UIImage imageNamed:@"yibaoming"] forState:UIControlStateNormal];
- [statusBtn setTitle:@"已报名" forState:UIControlStateNormal];
- [statusBtn setTitleColor:RGBValueColor(0xffffff, 1.0) forState:UIControlStateNormal];
- statusBtn.titleLabel.font = [UIFont systemFontOfSize:12.0];
- [self.contentView addSubview:statusBtn];
- self.statusBtn = statusBtn;
- }
- - (void)setPlatformActivityCellValueWithDic:(NSDictionary *)dic titleStr:(NSString *)titleStr {
-
- NSString *url = [NSString stringWithFormat:@"%@/%@", PublicUrl, dic[@"pic"]];
- [self.iconImageView sd_setImageWithURL:[NSURL URLWithString:url] placeholderImage:[UIImage imageNamed:@"jiazai"]];
-
- self.titleLabel.text = dic[@"caption"];
- self.subTitleLabel.text = dic[@"intro"];
- NSString *timeStr = [NSString stringWithFormat:@"%@", dic[@"endt"]];
- if ([timeStr containsString:@" "]) {
- NSArray *timeArr = [timeStr componentsSeparatedByString:@" "];
- NSArray *dateArr = [timeArr[0] componentsSeparatedByString:@"-"];
- self.childTitleLabel.text = [NSString stringWithFormat:@"结束时间:%@.%@.%@", dateArr[0], dateArr[1], dateArr[2]];
- }
-
- if ([dic[@"issign"] isEqualToString:@"1"]) { // 这里假如有字段区分 未报名 已报名
- [self.statusBtn setBackgroundImage:[UIImage imageNamed:@"yibaoming"] forState:UIControlStateNormal];
- [self.statusBtn setTitle:@"已报名" forState:UIControlStateNormal];
- // } else if ([dic[@"issign"] isEqualToString:@"0"]) {
- // [self.statusBtn setBackgroundImage:[UIImage imageNamed:@"yibaoming"] forState:UIControlStateNormal];
- // [self.statusBtn setTitle:@"已报名" forState:UIControlStateNormal];
- } else if ([dic[@"issign"] isEqualToString:@"0"]) {
- [self.statusBtn setBackgroundImage:[UIImage imageNamed:@"jinxingzhong"] forState:UIControlStateNormal];
- [self.statusBtn setTitle:@"未报名" forState:UIControlStateNormal];
- }
-
-
- }
- /*
- {
- beg = "2018-07-31 16:08:51";
- brprice = "500.0";
- caption = "51欢乐趴集结号";
- endt = "2018-08-01 16:09:03";
- intro = "阿斯顿飞";
- meprice = "120.0";
- moprice = "250.0";
- pic = "upload/activity/2018-06-15/451123138753678023.jpg";
- pk = 2;
- sbeg = "2018-10-01 16:08:25";
- sendt = "2018-06-16 16:08:47";
- term = "";
- }
- */
- @end
|