//
//  ListPrizeTableViewCell.m
//  Open
//
//  Created by 雷俊博 on 2019/9/3.
//  Copyright © 2019 黄江涛 . All rights reserved.
//

#import "ListPrizeTableViewCell.h"
#import "Constants.h"

#import <Masonry.h>

@interface ListPrizeTableViewCell ()

@property (nonatomic, strong)UIView *backView;

@property (nonatomic, strong)UIImageView *img_package;

//红色背景图片还是灰色背景图片
@property (nonatomic, strong)UIImageView *img_state;

@property (nonatomic, strong)UIImageView *lineView;

//金币或红包
@property (nonatomic, strong)UILabel *lb_type;


//金币数
@property (nonatomic, strong)UILabel *lb_number;

@property (nonatomic, strong)UILabel *lb_unit;

@property (nonatomic, strong)UILabel *lb_bottomType;

@property (nonatomic, strong)UILabel *lb_content;

//@property (nonatomic, strong)


@property (nonatomic, strong)UILabel *lb_date;

@property (nonatomic, strong)UIImageView *img_failure;

@property (nonatomic, strong)UILabel *lb_account;


@property (nonatomic, strong)UIImageView *img_rightState;

@property (nonatomic, strong)UIButton *btn_detail;

@property (nonatomic, strong)UIImageView *img_listState;

@property(nonatomic,strong)MASConstraint *lb_numberConstraint;


//unknow
@property (nonatomic, strong)UILabel *lb_download1;

@property (nonatomic, strong)UILabel *lb_download2;


@end

@implementation ListPrizeTableViewCell
#pragma mark - life cycle
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self.contentView addSubview:self.backView];
        [self.contentView addSubview:self.img_state];
        [self.contentView addSubview:self.lb_content];
        [self.contentView addSubview:self.lb_date];
        [self.contentView addSubview:self.img_failure];
        [self.contentView addSubview:self.lb_account];
        
       
        
        [self.contentView addSubview:self.lb_download1];
        [self.contentView addSubview:self.lb_download2];
        
        [self.contentView addSubview:self.img_listState];
        
        self.backgroundColor = [UIColor clearColor];
        
        
        
       
        
        
        
      
        
        
        [self setupUI];
    }
    return self;
}

- (void)setupUI
{
    
    [self.backView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.bottom.right.offset(0);
        make.left.offset(20 * WIDTHRADIU);
    }];
    
    [self.img_state mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.left.offset(0);
        make.width.offset(120 * WIDTHRADIU);
        make.height.offset(85 * WIDTHRADIU);
    }];
    
    [self.lb_type mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.img_state);
        make.left.offset(7 * WIDTHRADIU);
    }];
    
    [self.lineView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.img_state);
        make.left.offset(24 * WIDTHRADIU);
    }];
    WeakSelf
    [self.lb_number mas_makeConstraints:^(MASConstraintMaker *make) {
      weakSelf.lb_numberConstraint =  make.centerX.equalTo(self.img_state).offset(12 * WIDTHRADIU - 9 * WIDTHRADIU);
        make.top.offset(16 * WIDTHRADIU);
        make.height.offset(35 * WIDTHRADIU);
    }];
    
    [self.lb_unit mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.lb_number.mas_right).offset(5 * WIDTHRADIU);
        make.bottom.equalTo(self.lb_number);
        make.height.offset(11 * WIDTHRADIU);
    }];
    
    
    [self.lb_bottomType mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.lb_number.mas_bottom).offset(10 * WIDTHRADIU);
        make.centerX.equalTo(self.img_state).offset(12 * WIDTHRADIU);
        make.height.offset(12 * WIDTHRADIU);
    }];
    
    [self.lb_content mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.img_state.mas_right).offset(15 * WIDTHRADIU);
        make.top.offset(15 * WIDTHRADIU);
        make.height.offset(16 * WIDTHRADIU);
    }];
    
    
    [self.lb_download1 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.img_state.mas_right).offset(15 * WIDTHRADIU);
        make.top.offset(15 * WIDTHRADIU);
    }];
    
    [self.lb_download2 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.lb_download1.mas_bottom).offset(8 * WIDTHRADIU);
        make.left.equalTo(self.lb_download1);
        make.height.offset(12 * WIDTHRADIU);
    }];
    
    
    [self.lb_date mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.lb_content.mas_bottom).offset(12 * WIDTHRADIU);
        make.left.equalTo(self.lb_content);
        make.height.offset(12 * WIDTHRADIU);
    }];
    
    [self.img_failure mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.lb_date.mas_bottom).offset(8 * WIDTHRADIU);
        make.left.equalTo(self.lb_content);
    }];
    
    [self.lb_account mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.lb_date.mas_bottom).offset(8 * WIDTHRADIU);
        make.left.equalTo(self.img_failure.mas_right);
        make.height.offset(12 * WIDTHRADIU);
    }];
    
    [self.img_rightState mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.top.offset(0);
        make.width.height.offset(50 * WIDTHRADIU);
    }];
    
    [self.btn_detail mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.offset(-5 * WIDTHRADIU);
        make.bottom.offset(-7 * WIDTHRADIU);
    }];
    
    [self.img_listState mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.offset(-20 * WIDTHRADIU);
        make.top.offset(10 * WIDTHRADIU);
    }];
    
    [self.img_package mas_makeConstraints:^(MASConstraintMaker *make) {
        make.center.equalTo(self.img_state);
    }];
   
   
    
    
}

#pragma mark public methods
- (void)refreshUIWithData:(NSDictionary *)dic
{
    NSString *giftId = dic[@"giftId"];
    
    if (![NSString blankString:dic[@"createTime"]]) {
        NSDate *startDate = [self getDateWithDateStr:dic[@"createTime"]];
        NSDate *endDate = [self getDateAfter30DaysWithCurrentDate:startDate];
        
        self.lb_date.text = [NSString stringWithFormat:@"有效期：%@-%@",[self getCustomDateStrWithDate:startDate],[self getCustomDateStrWithDate:endDate]];
    }
    
    if ([giftId isEqualToString:@"1"]){
        self.type = CTListPrizeTypeCoins200;
    }else if ([giftId isEqualToString:@"9"]) {
        self.type = CTListPrizeTypePackage10;
    }else if ([giftId isEqualToString:@"10"]){
        self.type = CTListPrizeTypePackage3;
        
    }else if ([giftId isEqualToString:@"11"]){
        self.type = CTListPrizeTypePackage2;
    }else if ([giftId isEqualToString:@"12"]){
        self.type = CTListPrizeTypeCoins388;
    }else if ([giftId isEqualToString:@"13"]){
        self.type = CTListPrizeTypeCoins588;
    }else if ([giftId isEqualToString:@"14"]){
        self.type = CTListPrizeTypePackage5;
    }else if ([giftId isEqualToString:@"17"]){
        self.type = CTListPrizeTypeCouponsFree_YanWo;
    }else if ([giftId isEqualToString:@"21"]){
        self.type = CTListPrizeTypeCoupons50_YanWo;
        
    }else if ([giftId isEqualToString:@"18"]){
        self.type = CTListPrizeTypeInsurance_DaDi;
    }else if ([giftId isEqualToString:@"22"]){
        self.type = CTListPrizeTypeCustomPackage;
    }else if ([giftId isEqualToString:@"24"]){
        self.type = CTListPrizeTypeShoe;
    }else if ([giftId isEqualToString:@"25"]){
        self.type = CTListPrizeTypeSmartCup;
    }else if ([giftId isEqualToString:@"26"]){
        self.type = CTListPrizeTypeToyCar;
    }else if ([giftId isEqualToString:@"27"]){
        self.type = CTListPrizeTypeElectricFan;
    }else if ([giftId isEqualToString:@"28"]){
        self.type = CTListPrizeTypeMedicalMask;
    }else if ([giftId isEqualToString:@"29"]){
        self.type = CTListPrizeTypeDisinfectant;
    }else if ([giftId isEqualToString:@"30"]){
        self.type = CTListPrizeTypeTissue;
    }else if ([giftId isEqualToString:@"34"]){
        self.type = CTListPrizeTypeFan;
    }else if ([giftId isEqualToString:@"35"]){
        self.type = CTListPrizeTypeWashbasin;
    }else if ([giftId isEqualToString:@"36"]){
        self.type = CTListPrizeTypeSandals;
    }else if ([dic[@"giftId"] isEqualToString:@"37"]){
        self.type = CTListPrizeTypeFreeBusiness;
    }else if ([dic[@"giftId"] isEqualToString:@"38"]){
        self.type = CTListPrizeType1000Gift;
    }else if ([giftId isEqualToString:@"39"]){
        self.type = CTListPrizeTypeAccidentInsurance;
    }else if ([giftId isEqualToString:@"40"]){
        self.type = CTListPrizeTypeMajorDiseaseInsurance;
    }else if ([dic[@"giftId"] isEqualToString:@"41"]){
        self.type = CTListPrizeTypeTeaSet;
    }else if ([dic[@"giftId"] isEqualToString:@"42"]){
        self.type = CTListPrizeTypeTeaMassageStick;
    }else if ([dic[@"giftId"] isEqualToString:@"43"]){
        self.type = CTListPrizeTypeDogCleanerCoupon;
    }else if ([dic[@"giftId"] isEqualToString:@"44"]){
        self.type = CTListPrizeTypeMiniHumidifier;
    }else if ([dic[@"giftId"] isEqualToString:@"45"]){
        self.type = CTListPrizeTypeRazor;
    }else if ([dic[@"giftId"] isEqualToString:@"46"]){
        self.type = CTListPrizeType299PhysicalExaminationCoupons;
    }else if ([dic[@"giftId"] isEqualToString:@"47"]){
        self.type = CTListPrizeType598PhysicalExaminationCoupons;
    }else if ([dic[@"giftId"] isEqualToString:@"48"]){
        self.type = CTListPrizeTypeCookerTool;
    }else if ([dic[@"giftId"] isEqualToString:@"49"]){
        self.type = CTListPrizeTypeWashingLiquid;
    }else if ([dic[@"giftId"] isEqualToString:@"50"]){
        self.type = CTListPrizeTypeStorageBox;
    }else if ([dic[@"giftId"] isEqualToString:@"51"]){
        self.type = CTListPrizeTypeUSBElectronicScale;
    }else if ([dic[@"giftId"] isEqualToString:@"52"]){
        self.type = CTListPrizeTypeAutoFoldUmbrella;
    }else if ([dic[@"giftId"] isEqualToString:@"53"]){
        self.type = CTListPrizeTypeMosquitoKillingLamp;
    }else if ([dic[@"giftId"] isEqualToString:@"54"]){
        self.type = CTListPrizeTypeHUAWeiMate40;
    }else if ([dic[@"giftId"] isEqualToString:@"55"]){
        self.type = CTListPrizeTypeKKPackage;
    }else if ([dic[@"giftId"] isEqualToString:@"57"]){
        self.type = CTListPrizeTypeKKPackage2;
    }else if ([dic[@"giftId"] isEqualToString:@"58"]){
        self.type = CTListPrizeTypeHoldFan;
    } else if ([dic[@"giftId"] isEqualToString:@"59"]){
        self.type = CTListPrizeTypequalityDrawing;
    } else if ([dic[@"giftId"] isEqualToString:@"60"]){
        self.type = CTListPrizeTypeTeapot;
    }else if ([dic[@"giftId"] isEqualToString:@"61"]){
        self.type = CTListPrizeTypeiPhone12Pro;
    }else if ([dic[@"giftId"] isEqualToString:@"62"]){
        self.type = CTListPrizeTypeUglyOrange;
    } else if ([dic[@"giftId"] isEqualToString:@"63"]){
        self.type = CTListPrizeTypeRedmi9A;
    } else if ([dic[@"giftId"] isEqualToString:@"64"]){
        self.type = CTListPrizeTypeSummerSleepingMat;
    } else if ([dic[@"giftId"] isEqualToString:@"66"]){
        self.type = CTListPrizeTypePhoneBill;
    } else if ([dic[@"giftId"] isEqualToString:@"67"]){
        self.type = CTListPrizeTypeFilialObedienceExperienceCoupons;
        
    } else if ([dic[@"giftId"] isEqualToString:@"69"]){
        self.type = CTListPrizeTypeChineseWolfberry;
        
    }else if ([dic[@"giftId"] isEqualToString:@"70"]){
        self.type = CTListPrizeTypeSummerQuilt;
        
    }else if ([dic[@"giftId"] isEqualToString:@"71"]){
        self.type = CTListPrizeTypeWashingMachine;
        
    }else if ([dic[@"giftId"] isEqualToString:@"72"]){
        self.type = CTListPrizeTypeDisposableMop;
        
    }else if ([dic[@"giftId"] isEqualToString:@"74"]){
        self.type = CTListPrizeTypeHairDrier;
        
    }else if ([dic[@"giftId"] isEqualToString:@"75"]){
        self.type = CTListPrizeTypeKitchenRack;
        
    }else if ([dic[@"giftId"] isEqualToString:@"76"]){
        self.type = CTListPrizeTypeMultifunctionalPluginBoard;
        
    }else if ([dic[@"giftId"] isEqualToString:@"78"]){
        //颈椎按摩器
        self.type = CTListPrizeTypeCervicalSpineMassager;
    }else if ([dic[@"giftId"] isEqualToString:@"79"]){
        //无线蓝牙耳机
        self.type = CTListPrizeTypeWirelessBluetoothHeadset;
    }else if ([dic[@"giftId"] isEqualToString:@"80"]){
        //冬季水杯
        self.type = CTListPrizeTypeWinterCup;
    }else if ([dic[@"giftId"] isEqualToString:@"82"]){
        //收纳箱
        self.type = CTListPrizeTypeBin;
    }else if ([dic[@"giftId"] isEqualToString:@"83"]){
        //空气加湿器
        self.type = CTListPrizeTypeAirHumidifier;
    }else if ([dic[@"giftId"] isEqualToString:@"84"]){
        //创意洗菜篮
        self.type = CTListPrizeTypeCreativeLaundryBasket;
    }else if ([dic[@"giftId"] isEqualToString:@"85"]){
        //交通意外险
        self.type = CTListPrizeTypeTrafficAccidentInsurance;
    }else if ([dic[@"giftId"] isEqualToString:@"87"]){
        //浴室防滑垫
        self.type = CTListPrizeTypeBathroomMat;
    }else if ([dic[@"giftId"] isEqualToString:@"88"]){
        // ipad mini
        self.type = CTListPrizeTypeIpadMini;
    }else if ([dic[@"giftId"] isEqualToString:@"89"]){
        // 陶瓷砂锅
        self.type = CTListPrizeTypeCeramicCasserole;
    }else if ([dic[@"giftId"] isEqualToString:@"90"]){
        // 床上书桌
        self.type = CTListPrizeTypeBedDesk;
    }else if ([dic[@"giftId"] isEqualToString:@"91"]){
        // 毛球修剪器
        self.type = CTListPrizeTypeHairBallTrimmer;
    }else if ([dic[@"giftId"] isEqualToString:@"92"]){
        // 毛绒坐垫
        self.type = CTListPrizeTypePlushCushions;
    }else if ([dic[@"giftId"] isEqualToString:@"94"]){
        //88888金币
        self.type = CTListPrizeTypeGoldCOINS;
    }else if ([dic[@"giftId"] isEqualToString:@"93"]){
        // 原浆抽纸
        self.type = CTListPrizeTypeVirginPulpPaper;
    }else if ([dic[@"giftId"] isEqualToString:@"95"]){
        // 高档保温杯
        self.type = CTListPrizeTypeTopCup;
    }else if ([dic[@"giftId"] isEqualToString:@"96"]){
        //实木衣架
        self.type = CTListPrizeTypeSolidWoodHangers;
    }else if ([dic[@"giftId"] isEqualToString:@"98"]){
        //吸水防滑垫
        self.type = CTListPrizeTypeAbsorbent;
    }else if ([dic[@"giftId"] isEqualToString:@"99"]){
        //电子秤
        self.type = CTListPrizeTypeElectronicScale;
    }else if ([dic[@"giftId"] isEqualToString:@"100"]){
        //充电无线鼠标
        self.type = CTListPrizeTypeWirelessMouse;
    }else if ([dic[@"giftId"] isEqualToString:@"101"]){
        //新冠病毒意外险
        self.type = CTListPrizeTypePlagueGuard;
    }else if ([dic[@"giftId"] isEqualToString:@"103"]){
        //洗碗手套
        self.type = CTListPrizeTypeDishwashingGloves;
    }else if ([dic[@"giftId"] isEqualToString:@"105"]){
        //新春挂件
        self.type = CTListPrizeTypeNewYearHanged;
    }else if ([dic[@"giftId"] isEqualToString:@"106"]){
        //过年糖果盘
        self.type = CTListPrizeTypeNewYearCandy;
    }else if ([dic[@"giftId"] isEqualToString:@"107"]){
        //24小时家庭医生
        self.type = CTListPrizeTypeHourDoctor;
    }else if ([dic[@"giftId"] isEqualToString:@"109"]){
        //原木餐巾纸
        self.type = CTListPrizeTypeLogNapkins;
    }else if ([dic[@"giftId"] isEqualToString:@"110"]){
        //耐高温水杯
        self.type = CTListPrizeTypeHighTempCup;
    }else if ([dic[@"giftId"] isEqualToString:@"111"]){
        //吸水厚毛巾
        self.type = CTListPrizeTypeHeavyAbsorbentTowel;
    }else if ([dic[@"giftId"] isEqualToString:@"113"]){
        //黑科技扫把
        self.type = CTListPrizeTypeHackTechBroom;
    }else if ([dic[@"giftId"] isEqualToString:@"114"]){
        //头部抓痒按摩器
        self.type = CTListPrizeTypeHeadScratcherMassager;
    }else if ([dic[@"giftId"] isEqualToString:@"115"]){
        //中国红口罩
        self.type = CTListPrizeTypeChineseRedMaskr;
    }else if ([dic[@"giftId"] isEqualToString:@"116"]){
        //招行交通意外险
        self.type = CTListPrizeTypeCmbchinaTrafficInsurance;
    }else if ([dic[@"giftId"] isEqualToString:@"144"]){
        //玻璃杯
        self.type = CTListPrizeTypeBOLIBEI;
    }else if ([dic[@"giftId"] isEqualToString:@"145"]){
        //空气净化器
        self.type = CTListPrizeTypeKONGQI;
    }else if ([dic[@"giftId"] isEqualToString:@"146"]){
        //凉拖鞋
        self.type = CTListPrizeTypeLIANGTUOXIE;
    }else if ([dic[@"giftId"] isEqualToString:@"147"]){
        //吸水毛巾
        self.type = CTListPrizeTypeXISHUIMAOPJIN;
    }else{
        self.type = CTListPrizeTypeUnKnow;
    }
    
   
   
    
    if ([dic[@"lotterStatus"] isEqualToString:@"未领取"]) {
        self.state = CTListPrizeStateUnGet;
    }else if ([dic[@"lotterStatus"] isEqualToString:@"发放中"]){
        self.state = CTListPrizeStateGiving;
    }else if ([dic[@"lotterStatus"] isEqualToString:@"已过期"]){
        self.state = CTListPrizeStateInvalid;
    }else if ([dic[@"lotterStatus"] isEqualToString:@"已领取"]){
         self.state = CTListPrizeStateReceived;
    }else if ([dic[@"lotterStatus"] isEqualToString:@"领取失败"]){
        self.state = CTListPrizeStateFailure;
        
    }

    
    [self.lb_numberConstraint uninstall];
    switch (self.type) {
        case CTListPrizeTypeCoins200:
        case CTListPrizeTypeCoins388:
        case CTListPrizeTypeCoins588:
            {
                //奖品类型
                NSString *str = @"金\n币";
                NSMutableAttributedString *attributedStr = [[NSMutableAttributedString alloc] initWithString:str];
                NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
                paragraphStyle.lineSpacing = 8.0 * WIDTHRADIU; // 设置行间距
                paragraphStyle.alignment = NSTextAlignmentCenter; //设置两端对齐显示
                [attributedStr addAttribute:NSParagraphStyleAttributeName value:paragraphStyle range:NSMakeRange(0, attributedStr.length)];
                self.lb_type.attributedText = attributedStr;
                
                self.lineView.hidden = NO;
                
                //隐藏单位标签
                self.lb_unit.hidden = YES;
                
                //金币数量
                self.lb_number.text = [dic[@"giftName"] stringByReplacingOccurrencesOfString:@"金币" withString:@""];
                //奖品类型2
                self.lb_bottomType.text = @"金币奖励";
                
                //奖品名称
                self.lb_content.text = [NSString stringWithFormat:@"%@",dic[@"giftName"]];
                
                self.lb_content.hidden = NO;
                self.lb_date.hidden = NO;
                self.lb_account.hidden = NO;
                self.btn_detail.hidden = NO;
                self.img_listState.hidden = NO;
                self.img_rightState.hidden = NO;
                self.lb_download1.hidden = YES;
                self.lb_download2.hidden = YES;
                
                //金币时数字的位置在虚线后面部分居中
                [self.lb_number mas_makeConstraints:^(MASConstraintMaker *make) {
                    self.lb_numberConstraint = make.centerX.equalTo(self.img_state).offset(12 * WIDTHRADIU);
                }];
                
                
                switch (self.state) {
                    case CTListPrizeStateUnGet:
                        {
                            self.lb_account.text = @"未领取";
                        }
                        break;
                    case CTListPrizeStateGiving:
                    {
                        self.lb_account.text = @"发放中";
                    }
                        break;
                    case CTListPrizeStateReceived:
                    {
                        self.lb_account.text = @"发放成功";
                        
                        if (![NSString blankString:dic[@"createTime"]]) {
                            NSDate *startDate = [self getDateWithDateStr:dic[@"createTime"]];
//                            NSDate *endDate = [self getDateAfter30DaysWithCurrentDate:startDate];
                            
                            self.lb_date.text =  [NSString stringWithFormat:@"领取时间：%@",[self  getCustomDateStrWithDate:startDate]];
                        }
                    }
                        break;
                    case CTListPrizeStateInvalid:
                    {
                        self.lb_account.text = @"已过期";
                    }
                        break;
                    case CTListPrizeStateFailure:
                    {
                        self.lb_account.text = @"发放失败";
                    }
                        break;
                    default:
                        break;
                }
            }
            break;
        case CTListPrizeTypePackage2:
        case CTListPrizeTypePackage3:
        case CTListPrizeTypePackage5:
        case CTListPrizeTypePackage10:
        case CTListPrizeTypeKKPackage:
        {
            //奖品类型
            NSString *str = @"红\n包";
            NSMutableAttributedString *attributedStr = [[NSMutableAttributedString alloc] initWithString:str];
            NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
            paragraphStyle.lineSpacing = 8.0 * WIDTHRADIU; // 设置行间距
            paragraphStyle.alignment = NSTextAlignmentCenter; //设置两端对齐显示
            [attributedStr addAttribute:NSParagraphStyleAttributeName value:paragraphStyle range:NSMakeRange(0, attributedStr.length)];
            self.lb_type.attributedText = attributedStr;
            self.lb_unit.text = @"元";
            
            self.lb_unit.hidden = NO;
            
            self.lineView.hidden = NO;
           
            
            self.lb_bottomType.text = @"微信红包";
            if (self.type == CTListPrizeTypePackage5) {
                self.lb_content.text = @"一斤鸡蛋钱";
                self.lb_number.text = @"5";
            }else if (self.type == CTListPrizeTypeKKPackage){
                self.lb_bottomType.text = @"现金红包";
                self.lb_content.text = @"6.6元现金红包";
                self.lb_number.text = @"6.6";
            } else{
                
                self.lb_number.text = [dic[@"giftName"] stringByReplacingOccurrencesOfString:@"元红包" withString:@""];
                self.lb_content.text = [NSString stringWithFormat:@"%@元微信红包",self.lb_number.text];
               
            }
            
            
            self.lb_content.hidden = NO;
            self.lb_date.hidden = NO;
            self.lb_account.hidden = NO;
            self.btn_detail.hidden = NO;
            self.img_listState.hidden = NO;
            self.img_rightState.hidden = NO;
            self.lb_download1.hidden = YES;
            self.lb_download2.hidden = YES;
            
            [self.lb_number mas_makeConstraints:^(MASConstraintMaker *make) {
                self.lb_numberConstraint = make.centerX.equalTo(self.img_state).offset(12 * WIDTHRADIU - 9 * WIDTHRADIU);
            }];
            
            switch (self.state) {
                case CTListPrizeStateUnGet:
                {
                    
                    self.lb_account.text = @"未领取";
                }
                    break;
                case CTListPrizeStateGiving:
                {
                    
                    self.lb_account.text = @"发放中";
                }
                    break;
                case CTListPrizeStateReceived:
                {
                    self.lb_account.text = @"发放成功";
                    if (![NSString blankString:dic[@"createTime"]]) {
                        NSDate *startDate = [self getDateWithDateStr:dic[@"createTime"]];
//                        NSDate *endDate = [self getDateAfter30DaysWithCurrentDate:startDate];
                        
                        self.lb_date.text =  [NSString stringWithFormat:@"领取时间：%@",[self  getCustomDateStrWithDate:startDate]];
                    }
                }
                    break;
                case CTListPrizeStateInvalid:
                {
                    self.lb_account.text = @"已过期";
                }
                    break;
                case CTListPrizeStateFailure:
                {
                    self.lb_account.text = @"发放失败";
                }
                    break;
                default:
                    break;
            }
        }
            break;
            
        case CTListPrizeTypeCouponsFree_YanWo:
        {
            //奖品类型
            NSString *str = @"优\n惠\n劵";
            NSMutableAttributedString *attributedStr = [[NSMutableAttributedString alloc] initWithString:str];
            NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
            paragraphStyle.lineSpacing = 8.0 * WIDTHRADIU; // 设置行间距
            paragraphStyle.alignment = NSTextAlignmentCenter; //设置两端对齐显示
            [attributedStr addAttribute:NSParagraphStyleAttributeName value:paragraphStyle range:NSMakeRange(0, attributedStr.length)];
            self.lb_type.attributedText = attributedStr;
            
            self.lb_unit.hidden = YES;
            
            self.lineView.hidden = NO;
            
            self.lb_number.text = @"免费";
            self.lb_bottomType.text = @"老料燕窝劵";
            //奖品名称
            self.lb_content.text = @"免费领“老料燕窝”";
            
            self.lb_content.hidden = NO;
            self.lb_date.hidden = NO;
            self.lb_account.hidden = NO;
            self.btn_detail.hidden = NO;
            self.img_listState.hidden = NO;
            self.img_rightState.hidden = NO;
            self.lb_download1.hidden = YES;
            self.lb_download2.hidden = YES;
            
            //金币时数字的位置在虚线后面部分居中
            [self.lb_number mas_makeConstraints:^(MASConstraintMaker *make) {
                self.lb_numberConstraint = make.centerX.equalTo(self.img_state).offset(12 * WIDTHRADIU);
            }];
            
            switch (self.state) {
                case CTListPrizeStateUnGet:
                {
                    self.lb_account.text = @"未领取";
                }
                    break;
                case CTListPrizeStateGiving:
                {
                    self.lb_account.text = @"发放中";
                }
                    break;
                case CTListPrizeStateReceived:
                {
                    self.lb_account.text = @"发放成功";
                    
                    if (![NSString blankString:dic[@"createTime"]]) {
                        NSDate *startDate = [self getDateWithDateStr:dic[@"createTime"]];
//                        NSDate *endDate = [self getDateAfter30DaysWithCurrentDate:startDate];
                        
                        self.lb_date.text =  [NSString stringWithFormat:@"领取时间：%@",[self  getCustomDateStrWithDate:startDate]];
                    }
                }
                    break;
                case CTListPrizeStateInvalid:
                {
                    self.lb_account.text = @"已过期";
                }
                    break;
                case CTListPrizeStateFailure:
                {
                    self.lb_account.text = @"发放失败";
                }
                    break;
                default:
                    break;
            }
            
        }
            break;
        case CTListPrizeType1000Gift:
        case CTListPrizeTypeAccidentInsurance:
        case CTListPrizeTypeMajorDiseaseInsurance:
        case CTListPrizeTypeDogCleanerCoupon:
        case CTListPrizeType299PhysicalExaminationCoupons:
        case CTListPrizeType598PhysicalExaminationCoupons:
        case CTListPrizeTypeKKPackage2:
        case CTListPrizeTypePhoneBill:
        case CTListPrizeTypeFilialObedienceExperienceCoupons:
        case CTListPrizeTypeTrafficAccidentInsurance:
        case CTListPrizeTypeCmbchinaTrafficInsurance:
        case CTListPrizeTypePlagueGuard:
        case CTListPrizeTypeHourDoctor:
        {
            //奖品类型
            NSString *str = nil;
            
            if (self.type == CTListPrizeType1000Gift || self.type == CTListPrizeTypeDogCleanerCoupon)
            {
                str = @"优\n惠\n劵";
            }else if (self.type == CTListPrizeTypeAccidentInsurance)
            {
                str = @"意\n外\n险";
            }else if (self.type == CTListPrizeTypePlagueGuard)
            {
                str = @"意\n外\n险";
            }else if (self.type == CTListPrizeTypeTrafficAccidentInsurance)
            {
                str = @"意\n外\n险";
            }else if (self.type == CTListPrizeTypeCmbchinaTrafficInsurance)
            {
                str = @"意\n外\n险";
            }else if (self.type == CTListPrizeTypeMajorDiseaseInsurance)
            {
                str = @"重\n疾\n险";
            }else if (self.type == CTListPrizeType299PhysicalExaminationCoupons || self.type == CTListPrizeType598PhysicalExaminationCoupons)
            {
                str = @"体\n检\n劵";
            }else if (self.type == CTListPrizeTypeKKPackage2)
            {
                str = @"红\n包";
            }else if(self.type == CTListPrizeTypeFilialObedienceExperienceCoupons){
                str = @"体\n检\n劵";
            } else if (self.type == CTListPrizeTypePhoneBill){
                str = @"话\n费\n劵";
            }else if(self.type == CTListPrizeTypeHourDoctor){
                str = @"免\n费";
            }
            NSMutableAttributedString *attributedStr = [[NSMutableAttributedString alloc] initWithString:str];
            NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
            paragraphStyle.lineSpacing = 8.0 * WIDTHRADIU; // 设置行间距
            paragraphStyle.alignment = NSTextAlignmentCenter; //设置两端对齐显示
            [attributedStr addAttribute:NSParagraphStyleAttributeName value:paragraphStyle range:NSMakeRange(0, attributedStr.length)];
            self.lb_type.attributedText = attributedStr;
            
            self.lb_unit.hidden = YES;
            
            self.lineView.hidden = NO;
            
            self.lb_number.text = @"免费";
            if (self.type == CTListPrizeType1000Gift) {
                self.lb_bottomType.text = @"现金抵扣卷";
                //奖品名称
                self.lb_content.text = @"现金抵扣卷";
            }else if (self.type == CTListPrizeTypeAccidentInsurance) {
                self.lb_bottomType.text = @"健康大礼包";
                //奖品名称
                self.lb_content.text = @"健康大礼包";
            }else if (self.type == CTListPrizeTypeMajorDiseaseInsurance) {
                self.lb_bottomType.text = @"健康大礼包";
                //奖品名称
                self.lb_content.text = @"健康大礼包";
            }else if (self.type == CTListPrizeTypeDogCleanerCoupon) {
                self.lb_number.text = @"1000";
                self.lb_bottomType.text = @"现金抵扣劵";
                //奖品名称
                self.lb_content.text = @"小狗吸尘器抵扣劵";
            }else if (self.type == CTListPrizeType299PhysicalExaminationCoupons) {
                self.lb_number.text = @"299";
                self.lb_bottomType.text = @"体检券";
                //奖品名称
                self.lb_content.text = @"单人体检劵";
            }else if (self.type == CTListPrizeType598PhysicalExaminationCoupons) {
                self.lb_number.text = @"598";
                self.lb_bottomType.text = @"体检券";
                //奖品名称
                self.lb_content.text = @"父母双人体检券";
            }else if (self.type == CTListPrizeTypeKKPackage2){
                self.lb_number.text = @"现金";
                self.lb_bottomType.text = @"现金红包";
                //奖品名称
                self.lb_content.text = @"现金红包";
            }else if (self.type == CTListPrizeTypePhoneBill){
                self.lb_number.text = @"5";
                self.lb_bottomType.text = @"话费劵";
                //奖品名称
                self.lb_content.text = @"5元话费劵";
            }else if (self.type == CTListPrizeTypeFilialObedienceExperienceCoupons){
                self.lb_bottomType.text = @"体验劵";
                //奖品名称
                self.lb_content.text = @"孝心体检券";
            }else if (self.type == CTListPrizeTypeTrafficAccidentInsurance) {
                self.lb_bottomType.text = @"健康大礼包";
                //奖品名称
                self.lb_content.text = @"健康大礼包";
            }else if (self.type == CTListPrizeTypeCmbchinaTrafficInsurance) {
                self.lb_bottomType.text = @"健康大礼包";
                //奖品名称
                self.lb_content.text = @"健康大礼包";
            }else if (self.type == CTListPrizeTypePlagueGuard) {
                self.lb_bottomType.text = @"健康大礼包";
                //奖品名称
                self.lb_content.text = @"健康大礼包";
            }else if (self.type == CTListPrizeTypeHourDoctor) {
                self.lb_bottomType.text = @"家庭医生";
                //奖品名称
                self.lb_content.text = @"家庭医生";
            }
            
            self.lb_content.hidden = NO;
            self.lb_date.hidden = NO;
            self.lb_account.hidden = NO;
            self.btn_detail.hidden = NO;
            self.img_listState.hidden = NO;
            self.img_rightState.hidden = NO;
            self.lb_download1.hidden = YES;
            self.lb_download2.hidden = YES;
            
            //金币时数字的位置在虚线后面部分居中
            [self.lb_number mas_makeConstraints:^(MASConstraintMaker *make) {
                self.lb_numberConstraint = make.centerX.equalTo(self.img_state).offset(12 * WIDTHRADIU);
            }];
            
            switch (self.state) {
                case CTListPrizeStateUnGet:
                {
                    self.lb_account.text = @"未领取";
                }
                    break;
                case CTListPrizeStateGiving:
                {
                    self.lb_account.text = @"发放中";
                }
                    break;
                case CTListPrizeStateReceived:
                {
                    self.lb_account.text = @"发放成功";
                    
                    if (![NSString blankString:dic[@"createTime"]]) {
                        NSDate *startDate = [self getDateWithDateStr:dic[@"createTime"]];
//                        NSDate *endDate = [self getDateAfter30DaysWithCurrentDate:startDate];
                        
                        self.lb_date.text =  [NSString stringWithFormat:@"领取时间：%@",[self  getCustomDateStrWithDate:startDate]];
                    }
                }
                    break;
                case CTListPrizeStateInvalid:
                {
                    self.lb_account.text = @"已过期";
                }
                    break;
                case CTListPrizeStateFailure:
                {
                    self.lb_account.text = @"发放失败";
                }
                    break;
                default:
                    break;
            }
            
        }
            break;
        case CTListPrizeTypeCoupons50_YanWo:
        {
            //奖品类型
            NSString *str = @"优\n惠\n劵";
            NSMutableAttributedString *attributedStr = [[NSMutableAttributedString alloc] initWithString:str];
            NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
            paragraphStyle.lineSpacing = 8.0 * WIDTHRADIU; // 设置行间距
            paragraphStyle.alignment = NSTextAlignmentCenter; //设置两端对齐显示
            [attributedStr addAttribute:NSParagraphStyleAttributeName value:paragraphStyle range:NSMakeRange(0, attributedStr.length)];
            self.lb_type.attributedText = attributedStr;
            
            self.lb_unit.hidden = NO;
            
            self.lineView.hidden = NO;
            
                
            self.lb_number.text = @"50";
            self.lb_bottomType.text = @"老料燕窝劵";
            
           
            self.lb_content.text = @"50元折扣劵“老料燕窝”";
                
            
            
        
            
            
            self.lb_content.hidden = NO;
            self.lb_date.hidden = NO;
            self.lb_account.hidden = NO;
            self.btn_detail.hidden = NO;
            self.img_listState.hidden = NO;
            self.img_rightState.hidden = NO;
            self.lb_download1.hidden = YES;
            self.lb_download2.hidden = YES;
            
            [self.lb_number mas_makeConstraints:^(MASConstraintMaker *make) {
                self.lb_numberConstraint = make.centerX.equalTo(self.img_state).offset(12 * WIDTHRADIU - 9 * WIDTHRADIU);
            }];
            
            switch (self.state) {
                case CTListPrizeStateUnGet:
                {
                    self.lb_account.text = @"未领取";
                }
                    break;
                case CTListPrizeStateGiving:
                {
                    self.lb_account.text = @"发放中";
                }
                    break;
                case CTListPrizeStateReceived:
                {
                    self.lb_account.text = @"发放成功";
                    
                    if (![NSString blankString:dic[@"createTime"]]) {
                        NSDate *startDate = [self getDateWithDateStr:dic[@"createTime"]];
//                        NSDate *endDate = [self getDateAfter30DaysWithCurrentDate:startDate];
                        
                        self.lb_date.text =  [NSString stringWithFormat:@"领取时间：%@",[self  getCustomDateStrWithDate:startDate]];
                    }
                }
                    break;
                case CTListPrizeStateInvalid:
                {
                    self.lb_account.text = @"已过期";
                }
                    break;
                case CTListPrizeStateFailure:
                {
                    self.lb_account.text = @"发放失败";
                }
                    break;
                default:
                    break;
            }
            
            
        }
            break;
        case CTListPrizeTypeFreeBusiness:
        {
            //奖品类型
            NSString *str = @"大\n礼\n包";
            NSMutableAttributedString *attributedStr = [[NSMutableAttributedString alloc] initWithString:str];
            NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
            paragraphStyle.lineSpacing = 8.0 * WIDTHRADIU; // 设置行间距
            paragraphStyle.alignment = NSTextAlignmentCenter; //设置两端对齐显示
            [attributedStr addAttribute:NSParagraphStyleAttributeName value:paragraphStyle range:NSMakeRange(0, attributedStr.length)];
            self.lb_type.attributedText = attributedStr;
            
            self.lb_unit.hidden = YES;
            
            self.lineView.hidden = NO;
            
            self.lb_number.text = @"免费";
            self.lb_bottomType.text = @"创业大礼包";
            //奖品名称
            self.lb_content.text = @"创业大礼包";
            
            self.lb_content.hidden = NO;
            self.lb_date.hidden = NO;
            self.lb_account.hidden = NO;
            self.btn_detail.hidden = NO;
            self.img_listState.hidden = NO;
            self.img_rightState.hidden = NO;
            self.lb_download1.hidden = YES;
            self.lb_download2.hidden = YES;
            
            //金币时数字的位置在虚线后面部分居中
            [self.lb_number mas_makeConstraints:^(MASConstraintMaker *make) {
                self.lb_numberConstraint = make.centerX.equalTo(self.img_state).offset(12 * WIDTHRADIU);
            }];
            
            switch (self.state) {
                case CTListPrizeStateUnGet:
                {
                    self.lb_account.text = @"未领取";
                }
                    break;
                case CTListPrizeStateGiving:
                {
                    self.lb_account.text = @"发放中";
                }
                    break;
                case CTListPrizeStateReceived:
                {
                    self.lb_account.text = @"发放成功";
                    
                    if (![NSString blankString:dic[@"createTime"]]) {
                        NSDate *startDate = [self getDateWithDateStr:dic[@"createTime"]];
//                        NSDate *endDate = [self getDateAfter30DaysWithCurrentDate:startDate];
                        
                        self.lb_date.text =  [NSString stringWithFormat:@"领取时间：%@",[self  getCustomDateStrWithDate:startDate]];
                    }
                }
                    break;
                case CTListPrizeStateInvalid:
                {
                    self.lb_account.text = @"已过期";
                }
                    break;
                case CTListPrizeStateFailure:
                {
                    self.lb_account.text = @"发放失败";
                }
                    break;
                default:
                    break;
            }
            
        }
            break;
        case CTListPrizeTypeGoldCOINS:
        {
            //奖品类型
            NSString *str = @"大\n礼\n包";
            NSMutableAttributedString *attributedStr = [[NSMutableAttributedString alloc] initWithString:str];
            NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
            paragraphStyle.lineSpacing = 8.0 * WIDTHRADIU; // 设置行间距
            paragraphStyle.alignment = NSTextAlignmentCenter; //设置两端对齐显示
            [attributedStr addAttribute:NSParagraphStyleAttributeName value:paragraphStyle range:NSMakeRange(0, attributedStr.length)];
            self.lb_type.attributedText = attributedStr;
            
            self.lb_unit.hidden = YES;
            
            self.lineView.hidden = NO;
            
            self.lb_number.text = @"免费";
            self.lb_bottomType.text = @"88888金币";
            //奖品名称
            self.lb_content.text = @"88888金币";
            
            self.lb_content.hidden = NO;
            self.lb_date.hidden = NO;
            self.lb_account.hidden = NO;
            self.btn_detail.hidden = NO;
            self.img_listState.hidden = NO;
            self.img_rightState.hidden = NO;
            self.lb_download1.hidden = YES;
            self.lb_download2.hidden = YES;
            
            //金币时数字的位置在虚线后面部分居中
            [self.lb_number mas_makeConstraints:^(MASConstraintMaker *make) {
                self.lb_numberConstraint = make.centerX.equalTo(self.img_state).offset(12 * WIDTHRADIU);
            }];
            
            switch (self.state) {
                case CTListPrizeStateUnGet:
                {
                    self.lb_account.text = @"未领取";
                }
                    break;
                case CTListPrizeStateGiving:
                {
                    self.lb_account.text = @"发放中";
                }
                    break;
                case CTListPrizeStateReceived:
                {
                    self.lb_account.text = @"发放成功";
                    
                    if (![NSString blankString:dic[@"createTime"]]) {
                        NSDate *startDate = [self getDateWithDateStr:dic[@"createTime"]];
//                        NSDate *endDate = [self getDateAfter30DaysWithCurrentDate:startDate];
                        
                        self.lb_date.text =  [NSString stringWithFormat:@"领取时间：%@",[self  getCustomDateStrWithDate:startDate]];
                    }
                }
                    break;
                case CTListPrizeStateInvalid:
                {
                    self.lb_account.text = @"已过期";
                }
                    break;
                case CTListPrizeStateFailure:
                {
                    self.lb_account.text = @"发放失败";
                }
                    break;
                default:
                    break;
            }
            
        }
            break;
        case CTListPrizeTypeInsurance_DaDi:
        {
            //奖品类型
            NSString *str = @"保\n险";
            NSMutableAttributedString *attributedStr = [[NSMutableAttributedString alloc] initWithString:str];
            NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
            paragraphStyle.lineSpacing = 8.0 * WIDTHRADIU; // 设置行间距
            paragraphStyle.alignment = NSTextAlignmentCenter; //设置两端对齐显示
            [attributedStr addAttribute:NSParagraphStyleAttributeName value:paragraphStyle range:NSMakeRange(0, attributedStr.length)];
            self.lb_type.attributedText = attributedStr;
            
            self.lineView.hidden = NO;
            
            //隐藏单位标签
            self.lb_unit.hidden = YES;
            
            //金币数量
            self.lb_number.text = @"30";
            
            //奖品类型2
            self.lb_bottomType.text = @"农村家财险";
            
            //奖品名称
            self.lb_content.text = @"农村家财险(全年)";
            
            self.lb_content.hidden = NO;
            self.lb_date.hidden = NO;
            self.lb_account.hidden = NO;
            self.btn_detail.hidden = NO;
            self.img_listState.hidden = NO;
            self.img_rightState.hidden = NO;
            self.lb_download1.hidden = YES;
            self.lb_download2.hidden = YES;
            
            //金币时数字的位置在虚线后面部分居中
            [self.lb_number mas_makeConstraints:^(MASConstraintMaker *make) {
                self.lb_numberConstraint = make.centerX.equalTo(self.img_state).offset(12 * WIDTHRADIU);
            }];
            
            if (![NSString blankString:dic[@"createTime"]]) {
                NSDate *startDate = [self getDateWithDateStr:dic[@"createTime"]];
                NSDate *endDate = [self getDateAfter15DaysWithCurrentDate:startDate];
                
                self.lb_date.text = [NSString stringWithFormat:@"有效期：%@-%@",[self getCustomDateStrWithDate:startDate],[self getCustomDateStrWithDate:endDate]];
            }
            
            switch (self.state) {
                case CTListPrizeStateUnGet:
                {
                    self.lb_account.text = @"未领取";
                }
                    break;
                case CTListPrizeStateGiving:
                {
                    self.lb_account.text = @"发放中";
                }
                    break;
                case CTListPrizeStateReceived:
                {
                    self.lb_account.text = @"发放成功";
                    
                    if (![NSString blankString:dic[@"createTime"]]) {
                        NSDate *startDate = [self getDateWithDateStr:dic[@"createTime"]];
//                        NSDate *endDate = [self getDateAfter30DaysWithCurrentDate:startDate];
                        
                        self.lb_date.text =  [NSString stringWithFormat:@"领取时间：%@",[self  getCustomDateStrWithDate:startDate]];
                    }
                }
                    break;
                case CTListPrizeStateInvalid:
                {
                    self.lb_account.text = @"已过期";
                }
                    break;
                case CTListPrizeStateFailure:
                {
                    self.lb_account.text = @"发放失败";
                }
                    break;
                default:
                    break;
            }
            
        }
            break;
        case CTListPrizeTypeCustomPackage:
        {
            //奖品类型
            NSString *str = @"红\n包";
            NSMutableAttributedString *attributedStr = [[NSMutableAttributedString alloc] initWithString:str];
            NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
            paragraphStyle.lineSpacing = 8.0 * WIDTHRADIU; // 设置行间距
            paragraphStyle.alignment = NSTextAlignmentCenter; //设置两端对齐显示
            [attributedStr addAttribute:NSParagraphStyleAttributeName value:paragraphStyle range:NSMakeRange(0, attributedStr.length)];
            self.lb_type.attributedText = attributedStr;
            self.lineView.hidden = NO;
                           
            //隐藏单位标签
            self.lb_unit.hidden = YES;
                           
            //红包数量
            if ([dic[@"randomMoney"] isKindOfClass:[NSNumber class]]) {
                NSNumber *randomMoney = dic[@"randomMoney"];
                 self.lb_number.text = [NSString stringWithFormat:@"%@",randomMoney];
            }
          
            
           self.lb_bottomType.text = @"现金红包(元)";
           self.lb_content.text = @"随机现金红包";
            
           self.lb_content.hidden = NO;
            self.lb_date.hidden = NO;
            self.lb_account.hidden = NO;
            self.btn_detail.hidden = NO;
            self.img_listState.hidden = NO;
            self.img_rightState.hidden = NO;
            self.lb_download1.hidden = YES;
            self.lb_download2.hidden = YES;
            
            //随机现金红包时数字的位置在虚线后面部分居中
            [self.lb_number mas_makeConstraints:^(MASConstraintMaker *make) {
                self.lb_numberConstraint = make.centerX.equalTo(self.img_state).offset(12 * WIDTHRADIU);
            }];
            
            switch (self.state) {
                           case CTListPrizeStateUnGet:
                           {
                               
                               self.lb_account.text = @"未领取";
                           }
                               break;
                           case CTListPrizeStateGiving:
                           {
                               
                               self.lb_account.text = @"发放中";
                           }
                               break;
                           case CTListPrizeStateReceived:
                           {
                               self.lb_account.text = @"发放成功";
                               if (![NSString blankString:dic[@"createTime"]]) {
                                   NSDate *startDate = [self getDateWithDateStr:dic[@"createTime"]];
//                                   NSDate *endDate = [self getDateAfter30DaysWithCurrentDate:startDate];
                                   
                                   self.lb_date.text =  [NSString stringWithFormat:@"领取时间：%@",[self  getCustomDateStrWithDate:startDate]];
                               }
                           }
                               break;
                           case CTListPrizeStateInvalid:
                           {
                               self.lb_account.text = @"已过期";
                           }
                               break;
                           case CTListPrizeStateFailure:
                           {
                               self.lb_account.text = @"发放失败";
                           }
                               break;
                           default:
                               break;
                       }
        }
            break;
        case CTListPrizeTypeUnKnow:
        {
            NSString *str = @"";
            NSMutableAttributedString *attributedStr = [[NSMutableAttributedString alloc] initWithString:str];
            NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
            paragraphStyle.lineSpacing = 8.0 * WIDTHRADIU; // 设置行间距
            paragraphStyle.alignment = NSTextAlignmentCenter; //设置两端对齐显示
            [attributedStr addAttribute:NSParagraphStyleAttributeName value:paragraphStyle range:NSMakeRange(0, attributedStr.length)];
            self.lb_type.attributedText = attributedStr;
            
            self.lb_unit.hidden = YES;
             self.lineView.hidden = YES;
            self.lb_number.text = @"";
            self.lb_bottomType.text = @"";
            self.lb_content.hidden = YES;
            self.lb_date.hidden = YES;
            self.lb_account.hidden = YES;
            self.btn_detail.hidden = YES;
            self.img_rightState.hidden = YES;
            self.img_listState.hidden = YES;
            self.lb_download1.hidden = NO;
            self.lb_download2.hidden = NO;
            [self.lb_number mas_makeConstraints:^(MASConstraintMaker *make) {
                self.lb_numberConstraint = make.centerX.equalTo(self.img_state).offset(12 * WIDTHRADIU);
            }];
            
            self.img_state.image = [UIImage imageNamed:@"奖品-框-未发放"];
            
        }
            break;
        case CTListPrizeTypeShoe:
        case CTListPrizeTypeSmartCup:
        case CTListPrizeTypeToyCar:
        case CTListPrizeTypeElectricFan:
        case CTListPrizeTypeMedicalMask:
        case CTListPrizeTypeDisinfectant:
        case CTListPrizeTypeTissue:
        case CTListPrizeTypeFan:
        case CTListPrizeTypeWashbasin:
        case CTListPrizeTypeSandals:
        case CTListPrizeTypeTeaSet:
        case CTListPrizeTypeTeaMassageStick:
        case CTListPrizeTypeMiniHumidifier:
        case CTListPrizeTypeRazor:
        case CTListPrizeTypeCookerTool:
        case CTListPrizeTypeWashingLiquid:
        case CTListPrizeTypeStorageBox:
        case CTListPrizeTypeUSBElectronicScale:
        case CTListPrizeTypeAutoFoldUmbrella:
        case CTListPrizeTypeMosquitoKillingLamp:
        case CTListPrizeTypeHUAWeiMate40:
        case CTListPrizeTypeHoldFan:
        case CTListPrizeTypequalityDrawing:
        case CTListPrizeTypeTeapot:
        case CTListPrizeTypeiPhone12Pro:
        case CTListPrizeTypeUglyOrange:
        case CTListPrizeTypeRedmi9A:
        case CTListPrizeTypeSummerSleepingMat:
        case CTListPrizeTypeChineseWolfberry:
        case CTListPrizeTypeSummerQuilt:
        case CTListPrizeTypeWashingMachine:
        case CTListPrizeTypeDisposableMop:
        case CTListPrizeTypeHairDrier:
        case CTListPrizeTypeKitchenRack:
        case CTListPrizeTypeMultifunctionalPluginBoard:
        case CTListPrizeTypeCervicalSpineMassager://颈椎按摩器
        case CTListPrizeTypeWirelessBluetoothHeadset://无线蓝牙耳机
        case CTListPrizeTypeWinterCup://冬季水杯
        case CTListPrizeTypeBin://收纳箱
        case CTListPrizeTypeAirHumidifier://空气加湿器
        case CTListPrizeTypeCreativeLaundryBasket://创意洗菜篮
        case CTListPrizeTypeBathroomMat://浴室防滑垫
        case CTListPrizeTypeIpadMini:// ipad mini
        case CTListPrizeTypeCeramicCasserole:// 陶瓷砂锅
        case CTListPrizeTypeBedDesk://床上书桌
        case CTListPrizeTypeHairBallTrimmer:// 毛球修剪器
        case CTListPrizeTypePlushCushions:// 毛绒坐垫
        case CTListPrizeTypeSolidWoodHangers:// 实木衣架
        case CTListPrizeTypeTopCup:// 高档保温杯
        case CTListPrizeTypeVirginPulpPaper:// 原浆抽纸
        case CTListPrizeTypeAbsorbent://吸水防滑垫
        case CTListPrizeTypeElectronicScale://电子秤
        case CTListPrizeTypeWirelessMouse://充电无线鼠标
        case CTListPrizeTypeDishwashingGloves://洗碗手套
        case CTListPrizeTypeNewYearHanged://新春挂件
        case CTListPrizeTypeNewYearCandy://过年糖果盘
        case CTListPrizeTypeLogNapkins://原木餐巾纸
        case CTListPrizeTypeHighTempCup://耐高温水杯
        case CTListPrizeTypeHeavyAbsorbentTowel://吸水厚毛巾
        case CTListPrizeTypeHackTechBroom://黑科技扫把
        case CTListPrizeTypeHeadScratcherMassager://头部抓痒按摩器
        case CTListPrizeTypeChineseRedMaskr://中国红口罩
        case CTListPrizeTypeBOLIBEI://吸水厚毛巾
        case CTListPrizeTypeKONGQI://黑科技扫把
        case CTListPrizeTypeLIANGTUOXIE://头部抓痒按摩器
        case CTListPrizeTypeXISHUIMAOPJIN://中国红口罩
        {
            //奖品类型
            NSString *str = @"奖\n品";
            NSMutableAttributedString *attributedStr = [[NSMutableAttributedString alloc] initWithString:str];
            NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
            paragraphStyle.lineSpacing = 8.0 * WIDTHRADIU; // 设置行间距
            paragraphStyle.alignment = NSTextAlignmentCenter; //设置两端对齐显示
            [attributedStr addAttribute:NSParagraphStyleAttributeName value:paragraphStyle range:NSMakeRange(0, attributedStr.length)];
            self.lb_type.attributedText = attributedStr;
            
            self.lineView.hidden = NO;
            
            //隐藏单位标签
            self.lb_unit.hidden = YES;
            
            //金币数量
            self.lb_number.text = @"免费";
            
            //奖品类型2
            if (self.type == CTListPrizeTypeSmartCup) {
                self.lb_bottomType.text = @"保温杯";
                
                //奖品名称
                self.lb_content.text = @"保温杯一个";
            }else if (self.type == CTListPrizeTypeShoe){
                self.lb_bottomType.text = @"居家棉拖鞋";
                
                //奖品名称
                self.lb_content.text = @"居家棉拖鞋一双";
            }else if (self.type == CTListPrizeTypeToyCar){
                self.lb_bottomType.text = @"遥控玩具车";
                self.lb_content.text = @"玩具遥控赛车一辆";
            }else if (self.type == CTListPrizeTypeElectricFan){
                self.lb_bottomType.text = @"迷你暖风机";
                self.lb_content.text = @"迷你暖风机一个";
            }else if (self.type == CTListPrizeTypeMedicalMask){
                self.lb_bottomType.text = @"医用口罩";
                self.lb_content.text = @"医用口罩一包";
            }else if (self.type == CTListPrizeTypeDisinfectant){
                self.lb_bottomType.text = @"抗病毒";
                self.lb_content.text = @"抗病毒一瓶";
            }else if (self.type == CTListPrizeTypeTissue){
                self.lb_bottomType.text = @"消毒湿纸巾";
                self.lb_content.text = @"消毒湿纸巾";
            }else if (self.type == CTListPrizeTypeFan){
                self.lb_bottomType.text = @"桌面电风扇";
                self.lb_content.text = @"桌面电风扇";
            }else if (self.type == CTListPrizeTypeWashbasin){
                self.lb_bottomType.text = @"家用脸盆";
                self.lb_content.text = @"家用脸盆";
            }else if (self.type == CTListPrizeTypeSandals){
                self.lb_bottomType.text = @"家居凉拖鞋";
                self.lb_content.text = @"家居凉拖鞋";
            }else if (self.type == CTListPrizeTypeTeaSet){
                self.lb_bottomType.text = @"功夫茶具";
                self.lb_content.text = @"功夫茶具";
            }else if (self.type == CTListPrizeTypeTeaMassageStick){
                self.lb_bottomType.text = @"按摩棒";
                self.lb_content.text = @"按摩棒";
            }else if (self.type == CTListPrizeTypeMiniHumidifier){
                self.lb_bottomType.text = @"迷你加湿器";
                self.lb_content.text = @"迷你加湿器";
            }else if (self.type == CTListPrizeTypeRazor){
                self.lb_bottomType.text = @"黑金色剃须刀";
                self.lb_content.text = @"黑金色剃须刀";
            }else if (self.type == CTListPrizeTypeCookerTool){
                self.lb_bottomType.text = @"厨具五件套";
                self.lb_content.text = @"厨具五件套";
            }else if (self.type == CTListPrizeTypeWashingLiquid){
                self.lb_bottomType.text = @"洗衣液";
                self.lb_content.text = @"洗衣液";
            }else if (self.type == CTListPrizeTypeStorageBox){
                self.lb_bottomType.text = @"内衣收纳盒";
                self.lb_content.text = @"内衣收纳盒";
            }else if (self.type == CTListPrizeTypeUSBElectronicScale){
                self.lb_bottomType.text = @"USB电子秤";
                self.lb_content.text = @"USB电子秤";
            }else if (self.type == CTListPrizeTypeAutoFoldUmbrella){
                self.lb_bottomType.text = @"自动折叠晴雨伞";
                self.lb_content.text = @"自动折叠晴雨伞";
            }else if (self.type == CTListPrizeTypeMosquitoKillingLamp){
                self.lb_bottomType.text = @"灭蚊灯";
                self.lb_content.text = @"灭蚊灯";
            }else if (self.type == CTListPrizeTypeHUAWeiMate40){
                self.lb_bottomType.text = @"华为Mate40";
                self.lb_content.text = @"华为Mate40";
            }else if (self.type == CTListPrizeTypeHoldFan){
                self.lb_bottomType.text = @"手持风扇";
                self.lb_content.text = @"手持风扇";
            }else if (self.type == CTListPrizeTypequalityDrawing){
                self.lb_bottomType.text = @"品质抽纸";
                self.lb_content.text = @"品质抽纸";
            }else if (self.type == CTListPrizeTypeTeapot){
                self.lb_bottomType.text = @"饮茶水壶";
                self.lb_content.text = @"饮茶水壶";
            }else if (self.type == CTListPrizeTypeiPhone12Pro){
                self.lb_bottomType.text = @"iPhone12Pro";
                self.lb_content.text = @"iPhone12Pro";
            }else if (self.type == CTListPrizeTypeUglyOrange){
                self.lb_bottomType.text = @"甘甜丑橘";
                self.lb_content.text = @"甘甜丑橘";
            }else if (self.type == CTListPrizeTypeRedmi9A){
                self.lb_bottomType.text = @"红米9A";
                self.lb_content.text = @"红米9A";
            }else if (self.type == CTListPrizeTypeSummerSleepingMat){
                self.lb_bottomType.text = @"夏日凉席";
                self.lb_content.text = @"夏日凉席";
            }else if (self.type == CTListPrizeTypeChineseWolfberry){
                self.lb_bottomType.text = @"养生枸杞";
                self.lb_content.text = @"养生枸杞";
            }else if (self.type == CTListPrizeTypeSummerQuilt){
                self.lb_bottomType.text = @"空调被";
                self.lb_content.text = @"空调被";
            }else if (self.type == CTListPrizeTypeWashingMachine){
                self.lb_bottomType.text = @"洗衣机";
                self.lb_content.text = @"洗衣机";
            }else if (self.type == CTListPrizeTypeDisposableMop){
                self.lb_bottomType.text = @"免洗拖把";
                self.lb_content.text = @"免洗拖把";
            }else if (self.type == CTListPrizeTypeHairDrier){
                self.lb_bottomType.text = @"吹风机";
                self.lb_content.text = @"吹风机";
            }else if (self.type == CTListPrizeTypeKitchenRack){
                self.lb_bottomType.text = @"厨房置物架";
                self.lb_content.text = @"厨房置物架";
            }else if (self.type == CTListPrizeTypeMultifunctionalPluginBoard){
                self.lb_bottomType.text = @"多功能插板";
                self.lb_content.text = @"多功能插板";
            }else if (self.type == CTListPrizeTypeBathroomMat){
                self.lb_bottomType.text = @"浴室防滑垫";
                self.lb_content.text = @"浴室防滑垫";
            }else if (self.type == CTListPrizeTypeIpadMini){
                self.lb_bottomType.text = @"ipad mini";
                self.lb_content.text = @"ipad mini";
            }else if (self.type == CTListPrizeTypeCeramicCasserole){
                self.lb_bottomType.text = @"陶瓷砂锅";
                self.lb_content.text = @"陶瓷砂锅";
            }else if (self.type == CTListPrizeTypeCervicalSpineMassager){
                self.lb_bottomType.text = @"颈椎按摩器";
                self.lb_content.text = @"颈椎按摩器";
            }else if (self.type == CTListPrizeTypeWirelessBluetoothHeadset){
                self.lb_bottomType.text = @"浴室防滑垫";
                self.lb_content.text = @"浴室防滑垫";
                self.lb_number.text = @"无线蓝牙耳机";
            }else if (self.type == CTListPrizeTypeWinterCup){
                self.lb_bottomType.text = @"冬季水杯";
                self.lb_content.text = @"冬季水杯";
            }else if (self.type == CTListPrizeTypeBin){
                self.lb_bottomType.text = @"收纳箱";
                self.lb_content.text = @"收纳箱";
            }else if (self.type == CTListPrizeTypeAirHumidifier){
                self.lb_bottomType.text = @"空气加湿器";
                self.lb_content.text = @"空气加湿器";
            }else if (self.type == CTListPrizeTypeCreativeLaundryBasket){
                self.lb_bottomType.text = @"创意洗菜篮";
                self.lb_content.text = @"创意洗菜篮";
            }else if (self.type == CTListPrizeTypeBedDesk){
                self.lb_bottomType.text = @"床上书桌";
                self.lb_content.text = @"床上书桌";
            }else if (self.type == CTListPrizeTypeHairBallTrimmer){
                self.lb_bottomType.text = @"毛球修剪器";
                self.lb_content.text = @"毛球修剪器";
            }else if (self.type == CTListPrizeTypePlushCushions){
                self.lb_bottomType.text = @"毛绒坐垫";
                self.lb_content.text = @"毛绒坐垫";
            }else if (self.type == CTListPrizeTypeSolidWoodHangers){
                self.lb_bottomType.text = @"实木衣架";
                self.lb_content.text = @"实木衣架";
            }else if (self.type == CTListPrizeTypeTopCup){
                self.lb_bottomType.text = @"高档保温杯";
                self.lb_content.text = @"高档保温杯";
            }else if (self.type == CTListPrizeTypeVirginPulpPaper){
                self.lb_bottomType.text = @"原浆抽纸";
                self.lb_content.text = @"原浆抽纸";
            }else if (self.type == CTListPrizeTypeAbsorbent){
                self.lb_bottomType.text = @"吸水防滑垫";
                self.lb_content.text = @"吸水防滑垫";
            }else if (self.type == CTListPrizeTypeElectronicScale){
                self.lb_bottomType.text = @"电子秤";
                self.lb_content.text = @"电子秤";
            }else if (self.type == CTListPrizeTypeWirelessMouse){
                self.lb_bottomType.text = @"充电无线鼠标";
                self.lb_content.text = @"充电无线鼠标";
            }else if (self.type == CTListPrizeTypeDishwashingGloves){
                self.lb_bottomType.text = @"洗碗手套";
                self.lb_content.text = @"洗碗手套";
            }else if (self.type == CTListPrizeTypeNewYearHanged){
                self.lb_bottomType.text = @"新春挂件";
                self.lb_content.text = @"新春挂件";
            }else if (self.type == CTListPrizeTypeNewYearCandy){
                self.lb_bottomType.text = @"过年糖果盘";
                self.lb_content.text = @"过年糖果盘";
            }else if (self.type == CTListPrizeTypeLogNapkins){
                self.lb_bottomType.text = @"原木餐巾纸";
                self.lb_content.text = @"原木餐巾纸";
            }else if (self.type == CTListPrizeTypeHighTempCup){
                self.lb_bottomType.text = @"耐高温水杯";
                self.lb_content.text = @"耐高温水杯";
            }else if (self.type == CTListPrizeTypeHeavyAbsorbentTowel){
                self.lb_bottomType.text = @"吸水厚毛巾";
                self.lb_content.text = @"吸水厚毛巾";
            }else if (self.type == CTListPrizeTypeHackTechBroom){
                self.lb_bottomType.text = @"黑科技扫把";
                self.lb_content.text = @"黑科技扫把";
            }else if (self.type == CTListPrizeTypeHeadScratcherMassager){
                self.lb_bottomType.text = @"头部抓痒按摩器";
                self.lb_content.text = @"头部抓痒按摩器";
            }else if (self.type == CTListPrizeTypeChineseRedMaskr){
                self.lb_bottomType.text = @"中国红口罩";
                self.lb_content.text = @"中国红口罩";
            }else if (self.type == CTListPrizeTypeBOLIBEI){
                self.lb_bottomType.text = @"玻璃杯";
                self.lb_content.text = @"玻璃杯";
            }else if (self.type == CTListPrizeTypeKONGQI){
                self.lb_bottomType.text = @"空气净化器";
                self.lb_content.text = @"空气净化器";
            }else if (self.type == CTListPrizeTypeLIANGTUOXIE){
                self.lb_bottomType.text = @"凉拖鞋";
                self.lb_content.text = @"凉拖鞋";
            }else if (self.type == CTListPrizeTypeXISHUIMAOPJIN){
                self.lb_bottomType.text = @"吸水毛巾";
                self.lb_content.text = @"吸水毛巾";
            }
            
            
            self.lb_content.hidden = NO;
            self.lb_date.hidden = NO;
            self.lb_account.hidden = NO;
            self.btn_detail.hidden = NO;
            self.img_listState.hidden = NO;
            self.img_rightState.hidden = NO;
            self.lb_download1.hidden = YES;
            self.lb_download2.hidden = YES;
            
            //金币时数字的位置在虚线后面部分居中
            [self.lb_number mas_makeConstraints:^(MASConstraintMaker *make) {
                self.lb_numberConstraint = make.centerX.equalTo(self.img_state).offset(12 * WIDTHRADIU);
            }];
            
            switch (self.state) {
                case CTListPrizeStateUnGet:
                    {
                        self.lb_account.text = @"未领取";
                    }
                    break;
                case CTListPrizeStateGiving:
                {
                    self.lb_account.text = @"发放中";
                }
                    break;
                case CTListPrizeStateReceived:
                {
                    self.lb_account.text = @"发放成功";
                    
                    if (![NSString blankString:dic[@"createTime"]]) {
                        NSDate *startDate = [self getDateWithDateStr:dic[@"createTime"]];
//                        NSDate *endDate = [self getDateAfter30DaysWithCurrentDate:startDate];
                        
                        self.lb_date.text =  [NSString stringWithFormat:@"领取时间：%@",[self  getCustomDateStrWithDate:startDate]];
                    }
                }
                    break;
                case CTListPrizeStateInvalid:
                {
                    self.lb_account.text = @"已过期";
                }
                    break;
                case CTListPrizeStateFailure:
                {
                    self.lb_account.text = @"发放失败";
                }
                    break;
                default:
                    break;
            }
        }
            break;
            
        default:
            break;
    }
    
    
    if (self.type == CTListPrizeTypeCouponsFree_YanWo || self.type == CTListPrizeTypeDogCleanerCoupon  || self.type == CTListPrizeTypeShoe || self.type == CTListPrizeTypeSmartCup || self.type == CTListPrizeTypeToyCar || self.type == CTListPrizeTypeElectricFan || self.type == CTListPrizeTypeMedicalMask || self.type == CTListPrizeTypeDisinfectant || self.type == CTListPrizeTypeTissue || self.type == CTListPrizeTypeFan || self.type == CTListPrizeTypeWashbasin || self.type == CTListPrizeTypeSandals || self.type == CTListPrizeTypeTeaSet || self.type == CTListPrizeTypeTeaMassageStick || self.type == CTListPrizeTypeMiniHumidifier || self.type == CTListPrizeTypeRazor || self.type == CTListPrizeType299PhysicalExaminationCoupons || self.type == CTListPrizeType598PhysicalExaminationCoupons || self.type == CTListPrizeTypeCookerTool || self.type == CTListPrizeTypeWashingLiquid || self.type == CTListPrizeTypeStorageBox || self.type == CTListPrizeTypeUSBElectronicScale || self.type == CTListPrizeTypeAutoFoldUmbrella || self.type == CTListPrizeTypeMosquitoKillingLamp || self.type == CTListPrizeTypeHUAWeiMate40 || self.type == CTListPrizeTypeKKPackage2 || self.type == CTListPrizeTypeHoldFan || self.type == CTListPrizeTypequalityDrawing || self.type == CTListPrizeTypeTeapot || self.type == CTListPrizeTypeiPhone12Pro || self.type == CTListPrizeTypeUglyOrange || self.type == CTListPrizeTypeRedmi9A || self.type == CTListPrizeTypeSummerSleepingMat || self.type == CTListPrizeTypePhoneBill || self.type == CTListPrizeTypeFilialObedienceExperienceCoupons  || self.type == CTListPrizeTypeChineseWolfberry || self.type == CTListPrizeTypeSummerQuilt || self.type == CTListPrizeTypeWashingMachine|| self.type == CTListPrizeTypeDisposableMop || self.type == CTListPrizeTypeHairDrier || self.type == CTListPrizeTypeKitchenRack ||  self.type == CTListPrizeTypeMultifunctionalPluginBoard  || self.type == CTListPrizeTypeBathroomMat || self.type == CTListPrizeTypeIpadMini || self.type == CTListPrizeTypeCeramicCasserole  || self.type == CTListPrizeTypeCervicalSpineMassager || self.type == CTListPrizeTypeWirelessBluetoothHeadset || self.type == CTListPrizeTypeWinterCup || self.type == CTListPrizeTypeBin || self.type == CTListPrizeTypeAirHumidifier  || self.type == CTListPrizeTypeCreativeLaundryBasket || self.type == CTListPrizeTypeBedDesk || self.type == CTListPrizeTypeHairBallTrimmer  || self.type == CTListPrizeTypePlushCushions  || self.type == CTListPrizeTypeSolidWoodHangers || self.type == CTListPrizeTypeTopCup || self.type == CTListPrizeTypeVirginPulpPaper  || self.type == CTListPrizeTypeAbsorbent || self.type == CTListPrizeTypeElectronicScale || self.type == CTListPrizeTypeWirelessMouse || self.type == CTListPrizeTypeDishwashingGloves || self.type == CTListPrizeTypeNewYearHanged || self.type == CTListPrizeTypeNewYearCandy || self.type == CTListPrizeTypeHourDoctor || self.type == CTListPrizeTypeLogNapkins || self.type == CTListPrizeTypeHighTempCup || self.type == CTListPrizeTypeHeavyAbsorbentTowel || self.type == CTListPrizeTypeHackTechBroom || self.type == CTListPrizeTypeHeadScratcherMassager || self.type == CTListPrizeTypeChineseRedMaskr|| self.type == CTListPrizeTypeBOLIBEI || self.type == CTListPrizeTypeKONGQI|| self.type == CTListPrizeTypeLIANGTUOXIE || self.type == CTListPrizeTypeXISHUIMAOPJIN)  {
        self.lb_number.font = [UIFont systemFontOfSize:33 * WIDTHRADIU];
    }else{
         self.lb_number.font = [UIFont systemFontOfSize:36 * WIDTHRADIU];
    }
    
    
}

#pragma mark - 字符串转日期后30天后的日期
- (NSDate *)getDateWithDateStr:(NSString *)str
{
    NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
    [dateFormatter setDateFormat:@"yyyy/MM/dd"];
    NSDate *date = [dateFormatter dateFromString:str];
    
    return date;
}

- (NSDate *)getDateAfter30DaysWithCurrentDate:(NSDate *)date
{
    NSDate *newDate = [date dateByAddingTimeInterval:30 * 60 * 60  * 24];
    return newDate;
}

- (NSDate *)getDateAfter15DaysWithCurrentDate:(NSDate *)date
{
    NSDate *newDate = [date dateByAddingTimeInterval:15 * 60 * 60  * 24];
    return newDate;
}

- (NSString *)getCustomDateStrWithDate:(NSDate *)date
{
    // 获取代表公历的NSCalendar对象
    NSCalendar *gregorian = [[NSCalendar alloc]
                             initWithCalendarIdentifier:NSCalendarIdentifierGregorian];
    // 定义一个时间字段的旗标，指定将会获取指定年、月、日、时、分、秒的信息
    unsigned unitFlags = NSCalendarUnitYear |
    NSCalendarUnitMonth |  NSCalendarUnitDay |
    NSCalendarUnitHour |  NSCalendarUnitMinute |
    NSCalendarUnitSecond | NSCalendarUnitWeekday;
    // 获取不同时间字段的信息
    NSDateComponents* comp = [gregorian components: unitFlags
                                          fromDate:date];
    // 获取各时间字段的数值
    NSLog(@"现在是%ld年" , comp.year);
    NSLog(@"现在是%ld月 " , comp.month);
    NSLog(@"现在是%ld日" , comp.day);
    NSLog(@"现在是%ld时" , comp.hour);
    NSLog(@"现在是%ld分" , comp.minute);
    NSLog(@"现在是%ld秒" , comp.second);
    NSLog(@"现在是星期%ld" , comp.weekday);
    
    return [NSString stringWithFormat:@"%ld.%ld.%ld",(long)comp.year,comp.month,comp.day];
    
}


#pragma mark - getters and setters

- (void)setType:(CTListPrizeType)type
{
    _type = type;
    
    switch (type) {
        case CTListPrizeTypeCoins200:
        case CTListPrizeTypeCoins388:
        case CTListPrizeTypeCoins588:
        {
            self.img_package.image = [UIImage imageNamed:@""];
        }
            break;
        case CTListPrizeTypePackage2:
        case CTListPrizeTypePackage3:
        case CTListPrizeTypePackage5:
        case CTListPrizeTypePackage10:
        case CTListPrizeTypeKKPackage:
        {
            self.img_package.image = [UIImage imageNamed:@""];
        }
            break;
        case CTListPrizeTypeCouponsFree_YanWo:
        case CTListPrizeTypeCoupons50_YanWo:
        {
            self.img_package.image = [UIImage imageNamed:@""];
        }
            break;
        case CTListPrizeTypeInsurance_DaDi:
        {
            self.img_package.image = [UIImage imageNamed:@""];
        }
            break;
        case CTListPrizeTypeUnKnow:
        {
            self.img_package.image = [UIImage imageNamed:@"神秘礼包"];
        }
            break;
            
        default:
            self.img_package.image = [UIImage imageNamed:@""];
            break;
    }
    
}

- (void)setState:(CTListPrizeState)state
{
    _state = state;
    switch (state) {
        case CTListPrizeStateUnGet:
            {
                self.img_state.image = [UIImage imageNamed:@"奖品-框-未发放"];
                self.img_rightState.image = [UIImage imageNamed:@"未领取"];
                 self.img_listState.image = [UIImage imageNamed:@""];
                self.img_failure.image = [UIImage imageNamed:@""];
                
                self.lb_content.textColor = [UIColor colorWithHex:0x808080];
                self.lb_date.textColor = [UIColor colorWithHex:0x808080];
                self.lb_account.textColor = [UIColor colorWithHex:0x808080];
            }
            break;
        case CTListPrizeStateGiving:
        {
            self.img_state.image = [UIImage imageNamed:@"奖品-框-未发放"];
            self.img_rightState.image = [UIImage imageNamed:@"发放中"];
             self.img_listState.image = [UIImage imageNamed:@""];
            self.img_failure.image = [UIImage imageNamed:@""];
            
            self.lb_content.textColor = [UIColor colorWithHex:0x808080];
            self.lb_date.textColor = [UIColor colorWithHex:0x808080];
            self.lb_account.textColor = [UIColor colorWithHex:0x808080];
        }
            break;
        case CTListPrizeStateReceived:
        {
            self.img_state.image = [UIImage imageNamed:@"奖品-框-已发放"];
            self.img_rightState.image = [UIImage imageNamed:@""];
            self.img_listState.image = [UIImage imageNamed:@"my_activity_prize_Rogerthat_normal"];
            self.img_failure.image = [UIImage imageNamed:@""];
            
            self.lb_content.textColor = [UIColor colorWithHex:0xcccccc];
            self.lb_date.textColor = [UIColor colorWithHex:0xcccccc];
            self.lb_account.textColor = [UIColor colorWithHex:0xcccccc];
        }
            break;
        case CTListPrizeStateInvalid:
        {
            self.img_state.image = [UIImage imageNamed:@"奖品-框-已发放"];
            self.img_rightState.image = [UIImage imageNamed:@""];
             self.img_listState.image = [UIImage imageNamed:@"my_activity_prize_Invalid_normal"];
            self.img_failure.image = [UIImage imageNamed:@""];
            self.lb_content.textColor = [UIColor colorWithHex:0xcccccc];
            self.lb_date.textColor = [UIColor colorWithHex:0xcccccc];
            self.lb_account.textColor = [UIColor colorWithHex:0xcccccc];
        }
            break;
        case CTListPrizeStateFailure:
        {
            self.img_state.image = [UIImage imageNamed:@"奖品-框-发放失败"];
            self.img_rightState.image = [UIImage imageNamed:@"发放失败"];
            self.img_listState.image = [UIImage imageNamed:@""];
            self.img_failure.image = [UIImage imageNamed:@"警示"];
            self.lb_content.textColor = [UIColor colorWithHex:0xf19011];
            self.lb_date.textColor = [UIColor colorWithHex:0xf19011];
            self.lb_account.textColor = [UIColor colorWithHex:0xf19011];
        }
        default:
            break;
    }
}


- (UIView *)backView
{
    if (!_backView) {
        _backView = [[UIView alloc]init];
        _backView.backgroundColor = [UIColor whiteColor];
        
        _backView.layer.cornerRadius = 5;
        
        // 阴影颜色
        _backView.layer.shadowColor = [UIColor colorWithHex:0x797979].CGColor;
        // 阴影偏移，默认(0, -3)
        _backView.layer.shadowOffset = CGSizeMake(0,0);
        // 阴影透明度，默认0
        _backView.layer.shadowOpacity = 0.5;
        // 阴影半径，默认3
        _backView.layer.shadowRadius = 2;
        
        [_backView addSubview:self.img_rightState];
        [_backView addSubview:self.btn_detail];
        
        
        
        
    }
    return _backView;
}

- (UIImageView *)img_package
{
    if (!_img_package) {
        _img_package = [[UIImageView alloc]init];
    }
    return _img_package;
}

- (UIImageView *)img_state
{
    if (!_img_state) {
        _img_state = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, 120 * WIDTHRADIU, 85 * WIDTHRADIU)];
        _img_state.image = [UIImage imageNamed:@"奖品-框-未发放"];
        [_img_state addSubview:self.lb_type];
        [_img_state addSubview:self.lineView];
        [_img_state addSubview:self.lb_number];
        [_img_state addSubview:self.lb_unit];
        [_img_state addSubview:self.lb_bottomType];
        
        [_img_state addSubview:self.img_package];
        
        
    }
    return _img_state;
}

- (UILabel *)lb_type
{
    if (!_lb_type) {
        _lb_type = [[UILabel alloc]init];
        _lb_type.textAlignment = NSTextAlignmentCenter;
        _lb_type.textColor = [UIColor whiteColor];
        _lb_type.font = [UIFont systemFontOfSize:12 * WIDTHRADIU];
        _lb_type.numberOfLines = 0;
        
//        NSString *str = @"红\n包";
//        NSMutableAttributedString *attributedStr = [[NSMutableAttributedString alloc] initWithString:str];
//        NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
//        paragraphStyle.lineSpacing = 8.0 * WIDTHRADIU; // 设置行间距
//        paragraphStyle.alignment = NSTextAlignmentCenter; //设置两端对齐显示
//        [attributedStr addAttribute:NSParagraphStyleAttributeName value:paragraphStyle range:NSMakeRange(0, attributedStr.length)];
//        _lb_type.attributedText = attributedStr;
        
    }
    return _lb_type;
}

- (UIImageView *)lineView
{
    if (!_lineView) {
        _lineView = [[UIImageView alloc]init];
        
        _lineView.image = [UIImage imageNamed:@"分割线"];
        
    }
    return _lineView;
}

- (UILabel *)lb_number
{
    if (!_lb_number) {
        _lb_number = [[UILabel alloc]init];
        _lb_number.textColor = [UIColor whiteColor];
        _lb_number.textAlignment = NSTextAlignmentCenter;
        _lb_number.font = [UIFont systemFontOfSize:45 * WIDTHRADIU];
        //_lb_number.text = @"10";
        
    }
    return _lb_number;
}

- (UILabel *)lb_unit
{
    if (!_lb_unit) {
        _lb_unit = [[UILabel alloc]init];
        _lb_unit.textColor = [UIColor whiteColor];
        _lb_unit.textAlignment = NSTextAlignmentCenter;
        _lb_unit.font = [UIFont systemFontOfSize:13 * WIDTHRADIU];
        _lb_unit.text = @"元";
    }
    return _lb_unit;
}

- (UILabel *)lb_bottomType
{
    if (!_lb_bottomType) {
        _lb_bottomType = [[UILabel alloc]init];
        _lb_bottomType.textAlignment = NSTextAlignmentCenter;
        _lb_bottomType.textColor = [UIColor whiteColor];
        _lb_bottomType.font = [UIFont systemFontOfSize:12 * WIDTHRADIU];
       // _lb_bottomType.text = @"微信红包";
    }
    return _lb_bottomType;
}

- (UILabel *)lb_content
{
    if (!_lb_content) {
        _lb_content = [[UILabel alloc]init];
        //_lb_content.text = @"2元微信红包";
        _lb_content.textColor = [UIColor colorWithHex:0x808080];
        _lb_content.font = [UIFont boldSystemFontOfSize:16 * WIDTHRADIU];
    }
    return _lb_content;
}

- (UILabel *)lb_date
{
    if (!_lb_date) {
        _lb_date = [[UILabel alloc]init];
        //_lb_date.text = @"有效期：2019.09.02-2019.10.02";
        _lb_date.textColor = [UIColor colorWithHex:0x808080];
        _lb_date.font = [UIFont systemFontOfSize:12 * WIDTHRADIU];
    }
    return _lb_date;
}

- (UIImageView *)img_failure
{
    if (!_img_failure) {
        _img_failure = [[UIImageView alloc]init];
    }
    return _img_failure;
}

- (UILabel *)lb_account
{
    if (!_lb_account) {
        _lb_account = [[UILabel alloc]init];
        //_lb_account.text = @"未绑定微信";
        _lb_account.textColor = [UIColor colorWithHex:0x808080];
        _lb_account.font = [UIFont systemFontOfSize:12 * WIDTHRADIU];
    }
    return _lb_account;
}


- (UIImageView *)img_rightState
{
    if (!_img_rightState) {
        _img_rightState = [[UIImageView alloc]init];
        //_img_rightState.image = [UIImage imageNamed:@"未领取"];
        
        
        
    }
    return _img_rightState;
}

- (UIButton *)btn_detail
{
    if (!_btn_detail) {
        _btn_detail = [UIButton buttonWithType:UIButtonTypeCustom];
        [_btn_detail setTitle:@"详情" forState:UIControlStateNormal];
        [_btn_detail setTitleColor:[UIColor colorWithHex:0xb2b2b2] forState:UIControlStateNormal];
        [_btn_detail setImage:[UIImage imageNamed:@"my_activity_prize_Details_normal"] forState:UIControlStateNormal];
        _btn_detail.titleLabel.font = [UIFont systemFontOfSize:12 * WIDTHRADIU];
        [_btn_detail layoutButtonWithEdgeInsetsStyle:GLButtonEdgeInsetsStyleRight imageTitleSpace:5];
        
    }
    return _btn_detail;
}


- (UIImageView *)img_listState
{    if (!_img_listState) {
        _img_listState = [[UIImageView alloc]init];
        _img_listState.image = [UIImage imageNamed:@"my_activity_prize_Rogerthat_normal"];
        
        
    }
    return _img_listState;
}

- (UILabel *)lb_download1
{
    if (!_lb_download1) {
        _lb_download1 = [[UILabel alloc]init];
        _lb_download1.text = @"下载最新版“看看生活”\n才能查看礼包";
        _lb_download1.textColor = [UIColor colorWithHex:0x808080];
        _lb_download1.font = [UIFont boldSystemFontOfSize:16 * WIDTHRADIU];
        _lb_download1.numberOfLines = 0;
    }
    return _lb_download1;
}

- (UILabel *)lb_download2
{
    if (!_lb_download2) {
        _lb_download2 = [[UILabel alloc]init];
        _lb_download2.text = @"“我的”-“设置”-“关于”-“版本更新”";
        _lb_download2.textColor = [UIColor colorWithHex:0x808080];
        _lb_download2.font = [UIFont systemFontOfSize:12 * WIDTHRADIU];
    }
    return _lb_download2;
}



- (void)setFrame:(CGRect)frame{
    frame.origin.x += 15 * WIDTHRADIU;
    frame.origin.y += 15 * WIDTHRADIU;
    frame.size.height -= 15 * WIDTHRADIU;
    frame.size.width -= 30 * WIDTHRADIU;
    [super setFrame:frame];
    
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
