SalesPaymentRankFrame.m 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. //
  2. // SalesPaymentRankFrame.m
  3. // IBOSS
  4. //
  5. // Created by guan hong hou on 2017/8/23.
  6. // Copyright © 2017年 elongtian. All rights reserved.
  7. //
  8. // 功能描述:销售回款排行frame
  9. #import "SalesPaymentRankFrame.h"
  10. #import "NSString+Tools.h"
  11. @implementation SalesPaymentRankFrame
  12. #pragma 私有函数
  13. /**
  14. 设置销售回款排行frame
  15. @param rankModel <#rankModel description#>
  16. */
  17. - (void)setSalesPaymentListFrame:(SalesPaymentRankModel *)rankModel{
  18. _paymentRankModel = rankModel;
  19. NSString *salerName = _paymentRankModel.objectName;
  20. CGFloat xpadding = 20;
  21. CGFloat ypadding = 15;
  22. CGRect lblSalesNameFrame = [salerName textRectWithSize:CGSizeMake(MAXFLOAT, MAXFLOAT) attributes: FontAttributeNameDic14];
  23. lblSalesNameFrame.origin.x = xpadding;
  24. lblSalesNameFrame.origin.y = ypadding;
  25. _salerNameF = lblSalesNameFrame;
  26. NSInteger orderOrder = _paymentRankModel.orderSort;
  27. NSString *orderSortStr= [NSString stringWithFormat:@"%ld",(long)orderOrder];
  28. CGRect lblOrderSortFrame = [orderSortStr textRectWithSize:CGSizeMake(MAXFLOAT, MAXFLOAT) attributes: FontAttributeNameDic14];
  29. lblOrderSortFrame.origin.x = Screen_Width - CGRectGetWidth(lblOrderSortFrame)-20;
  30. lblOrderSortFrame.origin.y = ypadding;
  31. _lblRankF=lblOrderSortFrame;
  32. NSString *titleRank = @"排行:";
  33. CGRect lblTitleRankFrame = [titleRank textRectWithSize:CGSizeMake(MAXFLOAT, MAXFLOAT) attributes: FontAttributeNameDic14];
  34. lblTitleRankFrame.origin.x = CGRectGetMinX(_lblRankF)-CGRectGetWidth(lblTitleRankFrame)-5;
  35. lblTitleRankFrame.origin.y = 15;
  36. _lblTitleRankF=lblTitleRankFrame;
  37. NSString *titleBackAmount=@"回款金额:";
  38. CGRect lblTitleBackAmountFrame = [titleBackAmount textRectWithSize:CGSizeMake(MAXFLOAT, MAXFLOAT) attributes: FontAttributeNameDic13];
  39. lblTitleBackAmountFrame.origin.x = xpadding;
  40. lblTitleBackAmountFrame.origin.y = CGRectGetMaxY(_salerNameF)+ypadding;
  41. _lblTitleBackAmountF = lblTitleBackAmountFrame;
  42. NSString *backAmount = [NSString stringWithFormat:@"¥%.2f",[_paymentRankModel paymentAmount]];
  43. CGRect lblBackAmountFrame = [backAmount textRectWithSize:CGSizeMake(MAXFLOAT, MAXFLOAT) attributes: FontAttributeNameDic13];
  44. lblBackAmountFrame.origin.x = CGRectGetMaxX(_lblTitleBackAmountF)+3;
  45. lblBackAmountFrame.origin.y = CGRectGetMaxY(_salerNameF)+ypadding;
  46. _lblBackAmountF=lblBackAmountFrame;
  47. NSString *percent=[NSString stringWithFormat:@"%@%s" ,[_paymentRankModel backPercent],"%"];
  48. CGRect lblPercentFrame = [percent textRectWithSize:CGSizeMake(MAXFLOAT, MAXFLOAT) attributes: FontAttributeNameDic13];
  49. lblPercentFrame.origin.x = Screen_Width -CGRectGetWidth(lblPercentFrame)-20;
  50. lblPercentFrame.origin.y = CGRectGetMaxY(_salerNameF) + ypadding;
  51. _lblPercentF = lblPercentFrame;
  52. NSString *titlePercentCount = @"所占比重:";
  53. CGRect lblTitlePercentCountFrame = [titlePercentCount textRectWithSize:CGSizeMake(MAXFLOAT, MAXFLOAT) attributes: FontAttributeNameDic13];
  54. lblTitlePercentCountFrame.origin.x = CGRectGetMinX(_lblPercentF) - CGRectGetWidth(lblTitlePercentCountFrame) - 5;
  55. lblTitlePercentCountFrame.origin.y = CGRectGetMaxY(_salerNameF) + ypadding;
  56. _lblTitlePercentF=lblTitlePercentCountFrame;
  57. _separatorF = CGRectMake(0,CGRectGetMaxY(_lblTitleBackAmountF) + 15, Screen_Width, 1);
  58. _cellHeight = CGRectGetMaxY(_separatorF);
  59. }
  60. @end