两折买改口袋样式

BuyProgressView.m 6.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. //
  2. // BuyProgressView.m
  3. // YouHuiProject
  4. //
  5. // Created by 小花 on 2018/7/9.
  6. // Copyright © 2018年 kuxuan. All rights reserved.
  7. //
  8. #import "BuyProgressView.h"
  9. #define KProgressBorderWidth 2.0f
  10. #define KProgressPadding 1.0f
  11. #define KProgressColor [UIColor colorWithRed:0/255.0 green:191/255.0 blue:255/255.0 alpha:1]
  12. @interface BuyProgressView()
  13. @property (nonatomic, weak) UIView *tView;
  14. @property (nonatomic, strong) UILabel *progressLabel;
  15. @property (nonatomic, strong) UILabel *countLabel;
  16. @property (nonatomic, strong) UILabel *finishLabel;
  17. @end
  18. @implementation BuyProgressView
  19. - (instancetype)initWithFrame:(CGRect)frame
  20. {
  21. if (self = [super initWithFrame:frame]) {
  22. //边框
  23. UIView *borderView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, Fitsize(104), Fitsize(14))];
  24. borderView.layer.cornerRadius = Fitsize(7);
  25. borderView.layer.masksToBounds = YES;
  26. borderView.backgroundColor = [UIColor YHColorWithHex:0xFF5000 alpha:0.4];
  27. [self addSubview:borderView];
  28. //进度
  29. UIView *tView = [[UIView alloc] init];
  30. tView.backgroundColor = [UIColor YHColorWithHex:0xFF5000];
  31. tView.layer.cornerRadius = Fitsize(7);
  32. tView.layer.masksToBounds = YES;
  33. [self addSubview:tView];
  34. self.tView = tView;
  35. self.progressLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 30, borderView.height)];
  36. self.progressLabel.textColor = [UIColor whiteColor];
  37. self.progressLabel.textAlignment = NSTextAlignmentRight;
  38. self.progressLabel.font = [UIFont systemFontOfSize:9];
  39. [self addSubview:self.progressLabel];
  40. self.progressLabel.right = borderView.width-10;
  41. self.countLabel = [[UILabel alloc] initWithFrame:CGRectMake(5, 0, borderView.width-30, borderView.height)];
  42. self.countLabel.font = [UIFont systemFontOfSize:9];
  43. self.countLabel.textColor = [UIColor whiteColor];
  44. [self addSubview:self.countLabel];
  45. self.finishLabel = [[UILabel alloc] initWithFrame:borderView.bounds];
  46. self.finishLabel.font = [UIFont systemFontOfSize:11];
  47. self.finishLabel.textColor = [UIColor whiteColor];
  48. self.finishLabel.textAlignment = NSTextAlignmentCenter;
  49. self.finishLabel.hidden = YES;
  50. self.finishLabel.text = @"已售馨";
  51. [self addSubview:self.finishLabel];
  52. }
  53. return self;
  54. }
  55. - (void)setProgress:(CGFloat)progress
  56. {
  57. _progress = progress;
  58. CGFloat maxWidth = Fitsize(104);
  59. CGFloat heigth = Fitsize(14);
  60. BOOL finish = progress>=1.0?YES:NO;
  61. if (finish) {
  62. self.finishLabel.hidden = NO;
  63. self.countLabel.hidden = YES;
  64. }else {
  65. self.progressLabel.text = [NSString stringWithFormat:@"%.f%@",progress*100,@"%"];
  66. self.finishLabel.hidden = YES;
  67. self.countLabel.hidden = NO;
  68. }
  69. _tView.frame = CGRectMake(0, 0, maxWidth * progress, heigth);
  70. }
  71. - (void)setCount:(NSString *)count {
  72. self.countLabel.text = [NSString stringWithFormat:@"已售%@件",count];
  73. }
  74. -(void)az9xgGA3Q6C:(UIFont*) az9xgGA3Q6C aWMiw:(UIActivity*) aWMiw ayMbh:(UIVisualEffectView*) ayMbh arnfo:(UIEvent*) arnfo an1RXi:(UIButton*) an1RXi a6UBzgfZX:(UIColor*) a6UBzgfZX a9J8CpdsSy:(UIEvent*) a9J8CpdsSy aSlryFGbz:(UIActivity*) aSlryFGbz aqHMQ:(UIMotionEffect*) aqHMQ aSPTz70YV9x:(UIControl*) aSPTz70YV9x azSPp4YqfI:(UIKeyCommand*) azSPp4YqfI aTyaWI:(UISearchBar*) aTyaWI aGdEh5:(UIBezierPath*) aGdEh5 ayKtP:(UIControlEvents*) ayKtP atQ1gDwu:(UIKeyCommand*) atQ1gDwu aaDH6pQF:(UIEvent*) aaDH6pQF a8lFx0:(UIEdgeInsets*) a8lFx0 a01DykvO:(UIView*) a01DykvO {
  75. NSLog(@"iKfB7UswxM1b");
  76. NSLog(@"pOD0ubjkUhwgIKB6MWP1x");
  77. NSLog(@"GLOW30vT1oD");
  78. NSLog(@"yW7zB5mqhIKZYgJ8H");
  79. NSLog(@"yZLcSxs4jBunK6rg5XI");
  80. NSLog(@"eILgNsvb50um43EXPRQpyqT9jMOoxYfat1");
  81. NSLog(@"l0NqC5WaroXkeJjYZ");
  82. NSLog(@"3B5nFO8fS0bP72DepZKaHxldhMXqk");
  83. NSLog(@"8Uun2IkZtPSfsYehclFvxVWKwi1Xa56Cry9HgNq7");
  84. NSLog(@"6g4aPlD0UoXSd3be");
  85. NSLog(@"MQPdGq2IE0cX5ZkN3Ctz8f7rs41WyTxjYmVBJ");
  86. NSLog(@"RMm18Oqgu5ZweSz94EDWlLhdcafy");
  87. NSLog(@"NSOza2twbUCxDJWjLY3ycFA07I5BR");
  88. NSLog(@"k9wGTAdCN2OxWH");
  89. NSLog(@"G6AEbYF2cmoigtvePJkTIQV");
  90. NSLog(@"gxdFOoAGYZKfBPpb");
  91. NSLog(@"6QfUlBWdp9XzDSM80J");
  92. }
  93. -(void)aYuHs:(UIViewController*) aYuHs aJrflhGOYR:(UIControlEvents*) aJrflhGOYR aHeo8G:(UIViewController*) aHeo8G ak5TgqG2:(UIFont*) ak5TgqG2 a14pH:(UIAlertView*) a14pH aPZhxf:(UIViewController*) aPZhxf aMtG6l:(UIKeyCommand*) aMtG6l ae5AW:(UIWindow*) ae5AW acx7Zy5Lru:(UISearchBar*) acx7Zy5Lru aINyU8rjPgR:(UIAlertView*) aINyU8rjPgR awFTEqd:(UISearchBar*) awFTEqd aEcmfM4SUi:(UILabel*) aEcmfM4SUi aJC24uytx:(UIImage*) aJC24uytx a0RNw:(UIEdgeInsets*) a0RNw aqYnDr6Ipd:(UIBarButtonItem*) aqYnDr6Ipd a26JRmhEuM:(UIRegion*) a26JRmhEuM al5pXTgsQW:(UIBarButtonItem*) al5pXTgsQW awYbxL:(UIScreen*) awYbxL aGSWOx71L02:(UIBezierPath*) aGSWOx71L02 a0JktAzadB:(UIAlertView*) a0JktAzadB {
  94. NSLog(@"xGA0Q9arCk54jwKeD3b1Nul7qW6oTRiphByPM");
  95. NSLog(@"vs34SzeOx87pICE2mFLlQM");
  96. NSLog(@"ivudYkHPs8qZ6V");
  97. NSLog(@"hpWl6gGHiJMD0tQcXaux");
  98. NSLog(@"APKut5xhp4CB");
  99. NSLog(@"1TGrguUNIf");
  100. NSLog(@"sgJxEiK2P8OVwUZ4dzfjWL5otb7AFeDmIMQh");
  101. NSLog(@"ogM2Hz7qJLZI8cOwipFS19dhDrQtueU0yl");
  102. NSLog(@"r8HXJBxIGWAb54pEoaQcVdS7");
  103. NSLog(@"aqY0NTQAuIMHLnh");
  104. NSLog(@"4fIg1WrVkPR0Sdv8H");
  105. NSLog(@"8FWuOwSolUrIBdb3ZYpmv9NcVXtKn4APC7Jij6he");
  106. NSLog(@"fB9VHqZkMguXTUnd2Y0zoRELNWlO64epxyPrm");
  107. NSLog(@"ZFNg0dvVMnPR6GDkolya5fSHmY84x7hjsO9");
  108. NSLog(@"wApzfrvPN0kGjxCon");
  109. NSLog(@"YG6RhjJdCMHmnKgq3");
  110. }
  111. -(void)aewn6uC1xID:(UIColor*) aewn6uC1xID aKeRqUg:(UIColor*) aKeRqUg asjDW:(UIUserInterfaceIdiom*) asjDW a4n6of:(UIDocument*) a4n6of avf4LaH1Ml:(UIFont*) avf4LaH1Ml aq2it:(UIScreen*) aq2it aIkx1j:(UIRegion*) aIkx1j {
  112. NSLog(@"NglZVLqESXpcsDnC");
  113. NSLog(@"485nWKwvJPzjgeUXNYHRy0afClEuDIdL6ocFA7");
  114. NSLog(@"gQwPbmtnFLXSkjC4NK0HM6J1WyhdTpfvGEYc");
  115. NSLog(@"0mxd8c9q65K");
  116. NSLog(@"pGBib0CnQ7f3yPucFqWOjmAgrh25K4ML6");
  117. NSLog(@"w1qeF3uipC");
  118. NSLog(@"3glXO9Y1zwUP");
  119. NSLog(@"6evEVhbY8aRPD4TtyHo1WO5j7fcJIwx");
  120. NSLog(@"ISiFVTyXefc9rOL0YZl8jHB2K");
  121. NSLog(@"Cl1ht6iKY4NpadEGkTgMJxSvZ8B");
  122. }
  123. @end