SellOrderPublicView.m 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. //
  2. // SellOrderPublicView.m
  3. // yunbaolive
  4. //
  5. // Created by ybRRR on 2020/2/19.
  6. // Copyright © 2020 cat. All rights reserved.
  7. //
  8. #import "SellOrderPublicView.h"
  9. @implementation SellOrderPublicView
  10. -(instancetype)init{
  11. self = [super init];
  12. if (self) {
  13. self.backgroundColor = UIColor.whiteColor;
  14. [self creatUI];
  15. }
  16. return self;
  17. }
  18. -(void)creatUI{
  19. _orderImg = [[UIImageView alloc]init];
  20. _orderImg.backgroundColor = [UIColor lightGrayColor];
  21. _orderImg.contentMode = UIViewContentModeScaleAspectFill;
  22. _orderImg.layer.cornerRadius = 5;
  23. _orderImg.layer.masksToBounds = YES;
  24. [self addSubview:_orderImg];
  25. [_orderImg mas_makeConstraints:^(MASConstraintMaker *make) {
  26. make.left.equalTo(self).offset(12);
  27. make.top.equalTo(self).offset(10);
  28. make.width.height.mas_equalTo(90);
  29. }];
  30. _orderTitleLb = [[UILabel alloc]init];
  31. _orderTitleLb.textColor = [UIColor blackColor];
  32. _orderTitleLb.font = [UIFont systemFontOfSize:14];
  33. _orderTitleLb.text = @"大猪蹄子";
  34. [self addSubview:_orderTitleLb];
  35. [_orderTitleLb mas_makeConstraints:^(MASConstraintMaker *make) {
  36. make.left.equalTo(_orderImg.mas_right).offset(5);
  37. make.top.equalTo(_orderImg).offset(8);
  38. make.height.mas_equalTo(18);
  39. }];
  40. _orderPriceLb = [[UILabel alloc]init];
  41. _orderPriceLb.textColor = [UIColor blackColor];
  42. _orderPriceLb.font = [UIFont systemFontOfSize:14];
  43. _orderPriceLb.text = @"¥188.00";
  44. _orderPriceLb.textAlignment = NSTextAlignmentRight;
  45. [self addSubview:_orderPriceLb];
  46. [_orderPriceLb mas_makeConstraints:^(MASConstraintMaker *make) {
  47. make.right.equalTo(self).offset(-10);
  48. make.centerY.height.equalTo(_orderTitleLb);
  49. }];
  50. _orderContentLb = [[UILabel alloc]init];
  51. _orderContentLb.textColor = Normal_TextColor;
  52. _orderContentLb.font = [UIFont systemFontOfSize:14];
  53. _orderContentLb.text = @"麻辣鲜香味";
  54. [self addSubview:_orderContentLb];
  55. [_orderContentLb mas_makeConstraints:^(MASConstraintMaker *make) {
  56. make.left.equalTo(_orderTitleLb);
  57. make.top.equalTo(_orderTitleLb.mas_bottom).offset(5);
  58. make.height.equalTo(_orderTitleLb);
  59. }];
  60. _orderCountLb = [[UILabel alloc]init];
  61. _orderCountLb.textColor = Normal_TextColor;
  62. _orderCountLb.font = [UIFont systemFontOfSize:14];
  63. _orderCountLb.text = @"x1";
  64. _orderCountLb.textAlignment = NSTextAlignmentRight;
  65. [self addSubview:_orderCountLb];
  66. [_orderCountLb mas_makeConstraints:^(MASConstraintMaker *make) {
  67. make.right.equalTo(self).offset(-10);
  68. make.centerY.height.equalTo(_orderContentLb);
  69. }];
  70. UILabel *yunfeiLb = [[UILabel alloc]init];
  71. yunfeiLb.textColor = Normal_TextColor;
  72. yunfeiLb.font = [UIFont systemFontOfSize:14];
  73. yunfeiLb.text = YZMsg(@"运费");
  74. [self addSubview:yunfeiLb];
  75. [yunfeiLb mas_makeConstraints:^(MASConstraintMaker *make) {
  76. make.left.equalTo(_orderImg);
  77. make.top.equalTo(_orderImg.mas_bottom).offset(10);
  78. make.height.mas_equalTo(18);
  79. }];
  80. UILabel *priceTitle = [[UILabel alloc]init];
  81. priceTitle.textColor = [UIColor blackColor];
  82. priceTitle.font = [UIFont systemFontOfSize:14];
  83. priceTitle.text = YZMsg(@"需付款/实付款");
  84. [self addSubview:priceTitle];
  85. [priceTitle mas_makeConstraints:^(MASConstraintMaker *make) {
  86. make.left.equalTo(yunfeiLb);
  87. make.top.equalTo(yunfeiLb.mas_bottom).offset(10);
  88. make.height.mas_equalTo(18);
  89. }];
  90. _freightLb = [[UILabel alloc]init];
  91. _freightLb.textColor = Normal_TextColor;
  92. _freightLb.font = [UIFont systemFontOfSize:14];
  93. _freightLb.text = @"¥0.00";
  94. [self addSubview:_freightLb];
  95. [_freightLb mas_makeConstraints:^(MASConstraintMaker *make) {
  96. make.right.equalTo(self).offset(-12);
  97. make.centerY.equalTo(yunfeiLb);
  98. make.height.mas_equalTo(18);
  99. }];
  100. _priceLb= [[UILabel alloc]init];
  101. _priceLb.textColor = Pink_Cor;
  102. _priceLb.font = [UIFont systemFontOfSize:14];
  103. _priceLb.text = @"¥188.00";
  104. [self addSubview:_priceLb];
  105. [_priceLb mas_makeConstraints:^(MASConstraintMaker *make) {
  106. make.right.equalTo(_freightLb);
  107. make.centerY.equalTo(priceTitle);
  108. make.height.mas_equalTo(18);
  109. }];
  110. }
  111. -(void)setOrderModel:(SellOrderDetailModel *)model
  112. {
  113. [_orderImg sd_setImageWithURL:[NSURL URLWithString:model.spec_thumb_format]];
  114. _orderTitleLb.text = model.goods_name;
  115. _orderPriceLb.text =[NSString stringWithFormat:@"%@%@",YZMsg(@"¥"),model.price];
  116. _orderContentLb.text = model.spec_name;
  117. _orderCountLb.text = [NSString stringWithFormat:@"x%@",model.nums];
  118. _freightLb.text =[NSString stringWithFormat:@"%@%@",YZMsg(@"¥"), model.postage];
  119. _priceLb.text =[NSString stringWithFormat:@"%@%@",YZMsg(@"¥"), model.total];
  120. }
  121. @end