No Description

FKBasketPriceView.m 2.2KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. //
  2. // FKBasketWeightView.m
  3. // FirstLink
  4. //
  5. // Created by jack on 16/6/16.
  6. // Copyright © 2016年 FirstLink. All rights reserved.
  7. //
  8. #import "FKBasketPriceView.h"
  9. @interface FKBasketPriceView ()
  10. @property (nonatomic, strong) UIView *containerView;
  11. //@property (nonatomic, strong) UIImageView *iconImgView;
  12. @end
  13. @implementation FKBasketPriceView
  14. - (instancetype)init {
  15. if (self = [super init]) {
  16. [self addAllSubviews];
  17. }
  18. return self;
  19. }
  20. - (void)addAllSubviews {
  21. UIView *topLine = [[UIView alloc]init];
  22. topLine.backgroundColor = UIColorFromRGB(0xe5e5e5);
  23. [self addSubview:self.containerView];
  24. [self.containerView mas_makeConstraints:^(MASConstraintMaker *make) {
  25. make.edges.equalTo(self);
  26. }];
  27. [self.containerView addSubview:self.postageLabel];
  28. [self.postageLabel mas_makeConstraints:^(MASConstraintMaker *make) {
  29. make.right.equalTo(self.containerView).offset(- 15);
  30. make.centerY.equalTo(self.containerView);
  31. }];
  32. [self.containerView addSubview:self.weightLabel];
  33. [self.weightLabel mas_makeConstraints:^(MASConstraintMaker *make) {
  34. make.right.equalTo(self.postageLabel.mas_left).offset(- 20);
  35. make.centerY.equalTo(self.containerView);
  36. }];
  37. [self.containerView addSubview:topLine];
  38. [topLine mas_makeConstraints:^(MASConstraintMaker *make) {
  39. make.left.top.right.equalTo(self.containerView);
  40. make.height.mas_equalTo(1.0/[UIScreen mainScreen].scale);
  41. }];
  42. }
  43. + (CGFloat)weightViewHeight {
  44. return 55;
  45. }
  46. - (UILabel *)weightLabel {
  47. if (_weightLabel == nil) {
  48. _weightLabel = [[UILabel alloc] init];
  49. _weightLabel.font = [UIFont systemFontOfSize:13];
  50. _weightLabel.textColor = UIColorFromRGB(0x666666);
  51. }
  52. return _weightLabel;
  53. }
  54. - (UILabel *)postageLabel {
  55. if (_postageLabel == nil) {
  56. _postageLabel = [[UILabel alloc] init];
  57. _postageLabel.font = [UIFont systemFontOfSize:13];
  58. _postageLabel.textColor = UIColorFromRGB(0x666666);
  59. }
  60. return _postageLabel;
  61. }
  62. - (UIView *)containerView {
  63. if (_containerView == nil) {
  64. _containerView = [[UIView alloc] init];
  65. _containerView.backgroundColor = [UIColor whiteColor];
  66. }
  67. return _containerView;
  68. }
  69. @end