// // LDAchievementHeader.m // YouHuiProject // // Created by 小花 on 2018/8/2. // Copyright © 2018年 kuxuan. All rights reserved. // #import "LDAchievementHeader.h" @interface LDAchievementHeader () @property (nonatomic, strong) UILabel *titleLb; @property (nonatomic, strong) UILabel *totalNum; @property (nonatomic, strong) UIButton *nextBtn; @property(nonatomic,strong)UILabel *carrylabel; @property (nonatomic, strong) UIButton *carryBtn; @end @implementation LDAchievementHeader - (instancetype)initWithFrame:(CGRect)frame { self = [super initWithFrame:frame]; if (self) { self.backgroundColor = [UIColor changeColor]; [self initSubViews]; } return self; } - (void)initSubViews { // self.totalNum = [[UILabel alloc] initWithFrame:CGRectMake(15, Fitsize(15), SCREEN_WIDTH-30, 40)]; self.totalNum.font = [UIFont boldSystemFontOfSize:48]; self.totalNum.textColor = [UIColor whiteColor]; self.totalNum.textAlignment=NSTextAlignmentCenter; self.totalNum.text = @"¥--"; [self addSubview:self.totalNum]; self.carrylabel = [[UILabel alloc] initWithFrame:CGRectMake(15, self.bottom-FITSIZE(30), Fitsize(200), Fitsize(20))]; self.carrylabel.font = [UIFont systemFontOfSize:Fitsize(13)]; self.carrylabel.textColor = [UIColor whiteColor]; self.carrylabel.text = @"可提现 ¥--"; [self addSubview:self.carrylabel]; self.carryBtn = [[UIButton alloc] initWithFrame:CGRectMake(self.width-Fitsize(75), self.bottom-FITSIZE(30), Fitsize(57), Fitsize(20))]; self.carryBtn.contentHorizontalAlignment = UIControlContentHorizontalAlignmentCenter; [self.carryBtn setTitle:@"提现" forState:UIControlStateNormal]; self.carryBtn.layer.cornerRadius=4; self.carryBtn.titleLabel.font=[UIFont systemFontOfSize:FITSIZE(10)]; [self.carryBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; self.carryBtn.layer.borderColor=[UIColor whiteColor].CGColor; self.carryBtn.layer.borderWidth=0.5; self.carryBtn.layer.masksToBounds=YES; [self addSubview:self.carryBtn]; [self.carryBtn addTarget:self action:@selector(carrtClickBtn) forControlEvents:UIControlEventTouchUpInside]; } - (void)setAllCommission:(NSString *)AllComm orderNum:(NSString *)orderNum { NSString *discount_price = [NSString stringWithFormat:@"¥%.2f",[AllComm floatValue]]; NSMutableAttributedString *disAttr = [[NSMutableAttributedString alloc] initWithString:discount_price]; [disAttr yy_setFont:[UIFont systemFontOfSize:18] range:NSMakeRange(0, 1)]; [disAttr yy_setFont:[UIFont systemFontOfSize:48] range:NSMakeRange(1, discount_price.length-1)]; self.totalNum.attributedText =disAttr; self.carrylabel.text= [NSString stringWithFormat:@"可提现¥%.2f",[orderNum floatValue]]; } #pragma mark---提现 -(void)carrtClickBtn { if (self.carryOrderClick) { self.carryOrderClick(); } } - (void)nextBtnAction { if (self.allEndOrderClick) { self.allEndOrderClick(); } } @end