StoreInfoView.m 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. //
  2. // StoreInfoView.m
  3. // yunbaolive
  4. //
  5. // Created by ybRRR on 2020/3/3.
  6. // Copyright © 2020 cat. All rights reserved.
  7. //
  8. #import "StoreInfoView.h"
  9. @implementation StoreInfoView
  10. -(instancetype)initWithFrame:(CGRect)frame
  11. {
  12. self = [super initWithFrame:frame];
  13. if (self) {
  14. self.backgroundColor = RGB(250, 250, 250);
  15. [self creatUI];
  16. }
  17. return self;
  18. }
  19. -(void)creatUI{
  20. NSArray *data = @[@"1.1万件",@"4.8 高",@"4.8 高",@"4.8 高"];
  21. NSArray *arr = @[YZMsg(@"总销量"),YZMsg(@"商品质量"),YZMsg(@"服务态度"),YZMsg(@"物流服务")];
  22. for (int i = 0; i < arr.count; i ++) {
  23. UILabel *lb = [[UILabel alloc]init];
  24. lb.frame = CGRectMake(i * (self.width/4), self.height/2-20, (self.width/4), 20);
  25. lb.textAlignment = NSTextAlignmentCenter;
  26. lb.font = [UIFont boldSystemFontOfSize:13];
  27. lb.text = data[i];
  28. [self addSubview:lb];
  29. UILabel *title = [[UILabel alloc]init];
  30. title.frame = CGRectMake(i * (self.width/4), self.height/2, (self.width/4), 20);
  31. if (![lagType isEqual:ZH_CN]) {
  32. title.frame = CGRectMake(i * (self.width/4), self.height/2-5, (self.width/4-5), 40);
  33. }
  34. title.textAlignment = NSTextAlignmentCenter;
  35. title.text = arr[i];
  36. title.textColor = [UIColor grayColor];
  37. title.font = [UIFont systemFontOfSize:13];
  38. title.numberOfLines = 0;
  39. [self addSubview:title];
  40. if (i < 2) {
  41. lb.textColor = [UIColor darkGrayColor];
  42. }else{
  43. lb.textColor = [UIColor darkGrayColor];
  44. }
  45. if (i == 0) {
  46. numsLb = lb;
  47. }else if (i == 1){
  48. qualityLb = lb;
  49. }else if (i == 2){
  50. serviceLb = lb;
  51. }else if (i == 3){
  52. expressLb = lb;
  53. }
  54. }
  55. [PublicObj lineViewWithFrame:CGRectMake(self.width/4, self.height/2-10, 1, 20) andColor:[UIColor lightGrayColor] andView:self];
  56. }
  57. -(void)setStoreModels:(CommodityDetailModel *)storeModels
  58. {
  59. numsLb.text = [NSString stringWithFormat:@"%@%@",storeModels.shop_sale_nums,YZMsg(@"件")];
  60. qualityLb.text = storeModels.quality_points;
  61. serviceLb.text = storeModels.service_points;
  62. expressLb.text = storeModels.express_points;
  63. }
  64. @end