猎豆优选

LDAchievementHeader.m 3.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. //
  2. // LDAchievementHeader.m
  3. // YouHuiProject
  4. //
  5. // Created by 小花 on 2018/8/2.
  6. // Copyright © 2018年 kuxuan. All rights reserved.
  7. //
  8. #import "LDAchievementHeader.h"
  9. @interface LDAchievementHeader ()
  10. @property (nonatomic, strong) UILabel *titleLb;
  11. @property (nonatomic, strong) UILabel *totalNum;
  12. @property (nonatomic, strong) UIButton *nextBtn;
  13. @property(nonatomic,strong)UILabel *carrylabel;
  14. @property (nonatomic, strong) UIButton *carryBtn;
  15. @end
  16. @implementation LDAchievementHeader
  17. - (instancetype)initWithFrame:(CGRect)frame {
  18. self = [super initWithFrame:frame];
  19. if (self) {
  20. self.backgroundColor = [UIColor changeColor];
  21. [self initSubViews];
  22. }
  23. return self;
  24. }
  25. - (void)initSubViews {
  26. //
  27. self.totalNum = [[UILabel alloc] initWithFrame:CGRectMake(15, Fitsize(15), SCREEN_WIDTH-30, 40)];
  28. self.totalNum.font = [UIFont boldSystemFontOfSize:48];
  29. self.totalNum.textColor = [UIColor whiteColor];
  30. self.totalNum.textAlignment=NSTextAlignmentCenter;
  31. self.totalNum.text = @"¥--";
  32. [self addSubview:self.totalNum];
  33. self.carrylabel = [[UILabel alloc] initWithFrame:CGRectMake(15, self.bottom-FITSIZE(30), Fitsize(200), Fitsize(20))];
  34. self.carrylabel.font = [UIFont systemFontOfSize:Fitsize(13)];
  35. self.carrylabel.textColor = [UIColor whiteColor];
  36. self.carrylabel.text = @"可提现 ¥--";
  37. [self addSubview:self.carrylabel];
  38. self.carryBtn = [[UIButton alloc] initWithFrame:CGRectMake(self.width-Fitsize(75), self.bottom-FITSIZE(30), Fitsize(57), Fitsize(20))];
  39. self.carryBtn.contentHorizontalAlignment = UIControlContentHorizontalAlignmentCenter;
  40. [self.carryBtn setTitle:@"提现" forState:UIControlStateNormal];
  41. self.carryBtn.layer.cornerRadius=4;
  42. self.carryBtn.titleLabel.font=[UIFont systemFontOfSize:FITSIZE(10)];
  43. [self.carryBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
  44. self.carryBtn.layer.borderColor=[UIColor whiteColor].CGColor;
  45. self.carryBtn.layer.borderWidth=0.5;
  46. self.carryBtn.layer.masksToBounds=YES;
  47. [self addSubview:self.carryBtn];
  48. [self.carryBtn addTarget:self action:@selector(carrtClickBtn) forControlEvents:UIControlEventTouchUpInside];
  49. }
  50. - (void)setAllCommission:(NSString *)AllComm orderNum:(NSString *)orderNum {
  51. NSString *discount_price = [NSString stringWithFormat:@"¥%.2f",[AllComm floatValue]];
  52. NSMutableAttributedString *disAttr = [[NSMutableAttributedString alloc] initWithString:discount_price];
  53. [disAttr yy_setFont:[UIFont systemFontOfSize:18] range:NSMakeRange(0, 1)];
  54. [disAttr yy_setFont:[UIFont systemFontOfSize:48] range:NSMakeRange(1, discount_price.length-1)];
  55. self.totalNum.attributedText =disAttr;
  56. self.carrylabel.text= [NSString stringWithFormat:@"可提现¥%.2f",[orderNum floatValue]];
  57. }
  58. #pragma mark---提现
  59. -(void)carrtClickBtn
  60. {
  61. if (self.carryOrderClick) {
  62. self.carryOrderClick();
  63. }
  64. }
  65. - (void)nextBtnAction {
  66. if (self.allEndOrderClick) {
  67. self.allEndOrderClick();
  68. }
  69. }
  70. @end