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

#import "AddressPrizeNameBasicView.h"

@interface AddressPrizeNameBasicView ()
{
    CTListPrizeType _type;
}

@property (nonatomic, strong)UILabel*lb_leftName;

@property (nonatomic, strong)UILabel*lb_rightName;

@end

@implementation AddressPrizeNameBasicView

- (instancetype)initWithFrame:(CGRect)frame type:(CTListPrizeType)type
{
    self = [super initWithFrame:frame];
    if (self) {
        _type = type;
        [self addSubview:self.lb_leftName];
        [self addSubview:self.lb_rightName];
        
        self.lb_leftName.text = @"奖品名称:";
        
        NSDictionary * underAttribtDic  = @{NSUnderlineStyleAttributeName:[NSNumber numberWithInteger:NSUnderlineStyleSingle],NSForegroundColorAttributeName:[UIColor colorWithHex:0x666666],NSFontAttributeName:[UIFont systemFontOfSize:18]
                                            
        };
        NSString *str = nil;
        if (_type == CTListPrizeTypeSmartCup) {
            str = @"保温杯一个";
        }else if (_type == CTListPrizeTypeShoe){
            str = @"居家棉拖鞋一双";
        }else if (_type == CTListPrizeTypeToyCar){
            str = @"玩具遥控赛车一辆";
        }else if (_type == CTListPrizeTypeElectricFan){
            str = @"迷你暖风机一台";
        }else if (_type == CTListPrizeTypeMedicalMask){
            str = @"医疗口罩一包";
        }else if (_type == CTListPrizeTypeDisinfectant){
            str = @"抗病毒一瓶";
        }else if (_type ==  CTListPrizeTypeTissue){
            str = @"消毒湿纸巾";
        }else if (_type ==  CTListPrizeTypeFan){
            str = @"桌面电风扇";
        }else if (_type == CTListPrizeTypeWashbasin){
            str = @"家用脸盆";
        }else if (_type == CTListPrizeTypeSandals){
            str = @"家居凉拖鞋";
        }else if (_type == CTListPrizeTypeTeaSet){
            str = @"功夫茶具";
        }else if (_type == CTListPrizeTypeTeaMassageStick){
            str = @"按摩棒";
        }else if (_type == CTListPrizeTypeMiniHumidifier){
            str = @"迷你加湿器";
        }else if (_type == CTListPrizeTypeRazor){
            str = @"黑金色剃须刀";
        }else if (_type == CTListPrizeTypeCookerTool){
            str = @"厨具五件套";
        }else if (_type == CTListPrizeTypeWashingLiquid){
            str = @"洗衣液";
        }else if (_type == CTListPrizeTypeStorageBox){
            str = @"内衣收纳箱";
        }else if (_type == CTListPrizeTypeUSBElectronicScale){
            str = @"USB电子秤";
        }else if (_type == CTListPrizeTypeAutoFoldUmbrella){
            str = @"自动折叠晴雨伞";
        }else if (_type == CTListPrizeTypeMosquitoKillingLamp){
            str = @"灭蚊灯";
        } else if (_type == CTListPrizeTypeHUAWeiMate40){
            str = @"华为Mate40";
        }else if (_type == CTListPrizeTypeHoldFan){
            str = @"手持风扇";
        }else if (_type == CTListPrizeTypequalityDrawing){
            str = @"品质抽纸";
        }else if (_type == CTListPrizeTypeTeapot){
            str = @"饮茶水壶";
        }else if (_type == CTListPrizeTypeiPhone12Pro){
            str = @"iPhone12 Pro";
        }else if (_type == CTListPrizeTypeUglyOrange){
            str = @"甘甜丑橘";
        }else if (_type == CTListPrizeTypeRedmi9A){
            str = @"红米9A";
        }else if (_type == CTListPrizeTypeSummerSleepingMat){
            str = @"夏日凉席";
        }else if (_type == CTListPrizeTypeChineseWolfberry){
            str = @"养生枸杞";
        }else if (_type == CTListPrizeTypeSummerQuilt){
            str = @"空调被";
        }else if (_type == CTListPrizeTypeWashingMachine){
            str = @"洗衣机";
        }else if (_type == CTListPrizeTypeDisposableMop){
            str = @"免洗拖把";
        }else if (_type == CTListPrizeTypeHairDrier){
            str = @"吹风机";
        }else if (_type == CTListPrizeTypeKitchenRack){
            str = @"厨房置物架";
        }else if (_type == CTListPrizeTypeMultifunctionalPluginBoard){
            str = @"多功能插板";
        }else if (_type == CTListPrizeTypeCervicalSpineMassager){
            str = @"颈椎按摩器";
        }else if (_type == CTListPrizeTypeWirelessBluetoothHeadset){
            str = @"无线蓝牙耳机";
        }else if (_type == CTListPrizeTypeWinterCup){
            str = @"冬季水杯";
        }else if (_type == CTListPrizeTypeBin){
            str = @"收纳箱";
        }else if (_type == CTListPrizeTypeAirHumidifier){
            str = @"空气加湿器";
        }else if (_type == CTListPrizeTypeCreativeLaundryBasket){
            str = @"创意洗菜篮";
        }else if (_type == CTListPrizeTypeBathroomMat){
            str = @"浴室防滑垫";
        }else if (_type == CTListPrizeTypeIpadMini){
            str = @"ipad mini";
        }else if (_type == CTListPrizeTypeCeramicCasserole){
            str = @"陶瓷砂锅";
        }else if (_type == CTListPrizeTypeBedDesk){
            str = @"床上书桌";
        }else if (_type == CTListPrizeTypeHairBallTrimmer){
            str = @"毛球修剪器";
        }else if (_type == CTListPrizeTypePlushCushions){
            str = @"毛绒坐垫";
        }else if (_type == CTListPrizeTypeSolidWoodHangers){
            str = @"实木衣架";
        }else if (_type == CTListPrizeTypeTopCup){
            str = @"高档保温杯";
        }else if (_type == CTListPrizeTypeVirginPulpPaper){
            str = @"原浆抽纸";
        }else if (_type == CTListPrizeTypeAbsorbent){
            str = @"吸水防滑垫";
        }else if (_type == CTListPrizeTypeElectronicScale){
            str = @"电子秤";
        }else if (_type == CTListPrizeTypeWirelessMouse){
            str = @"充电无线鼠标";
        }else if (_type == CTListPrizeTypeDishwashingGloves){
            str = @"洗碗手套";
        }else if (_type == CTListPrizeTypeNewYearHanged){
            str = @"新春挂件";
        }else if (_type == CTListPrizeTypeNewYearCandy){
            str = @"过年糖果盘";
        }else if (_type == CTListPrizeTypeLogNapkins){
            str = @"原木餐巾纸";
        }else if (_type == CTListPrizeTypeHighTempCup){
            str = @"耐高温水杯";
        }else if (_type == CTListPrizeTypeHeavyAbsorbentTowel){
            str = @"吸水厚毛巾";
        }else if (_type == CTListPrizeTypeHackTechBroom){
            str = @"黑科技扫把";
        }else if (_type == CTListPrizeTypeHeadScratcherMassager){
            str = @"头部抓痒按摩器";
        }else if (_type == CTListPrizeTypeChineseRedMaskr){
            str = @"中国红口罩";
        }else if (_type == CTListPrizeTypeBOLIBEI){
            str = @"玻璃杯";
        }else if (_type == CTListPrizeTypeKONGQI){
            str = @"空气净化器";
        }else if (_type == CTListPrizeTypeLIANGTUOXIE){
            str = @"凉拖鞋";
        }else if (_type == CTListPrizeTypeXISHUIMAOPJIN){
            str = @"吸水毛巾";
        }
        NSMutableAttributedString * underAttr = [[NSMutableAttributedString alloc] initWithString:str attributes:underAttribtDic];
        self.lb_rightName.attributedText = underAttr;
        
        [self setupUI];
    }
    return self;
}

- (void)setupUI
{
    [self.lb_leftName mas_makeConstraints:^(MASConstraintMaker *make) {
        [self.lb_leftName mas_makeConstraints:^(MASConstraintMaker *make) {
            make.bottom.equalTo(self);
            make.left.offset(20);
            make.width.offset(80);
        }];
    }];
    
    [self.lb_rightName mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.equalTo(self);
        make.left.equalTo(self.lb_leftName.mas_right).offset(4);
        make.right.offset(-20);
    }];
}




#pragma mark - getters and setters
- (UILabel *)lb_leftName
{
    if (!_lb_leftName) {
        _lb_leftName = [[UILabel alloc]init];
        _lb_leftName.textColor = [UIColor colorWithHex:0x666666];
        _lb_leftName.font = [UIFont systemFontOfSize:17];
    }
    return _lb_leftName;
}

#pragma mark - getters and setters
- (UILabel *)lb_rightName
{
    if (!_lb_rightName) {
        _lb_rightName = [[UILabel alloc]init];
        _lb_rightName.textColor = [UIColor colorWithHex:0x666666];
        _lb_rightName.font = [UIFont systemFontOfSize:17];
    }
    return _lb_rightName;
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
