czbtCell.m 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. //
  2. // czbtCell.m
  3. // iChatView
  4. //
  5. // Created by zzl on 16/6/12.
  6. // Copyright © 2016年 ldh. All rights reserved.
  7. //
  8. #import "czbtCell.h"
  9. @implementation RefBt
  10. @end
  11. @implementation czbtCell
  12. - (void)awakeFromNib
  13. {
  14. [super awakeFromNib];
  15. self.mleft.layer.cornerRadius = 5;
  16. self.mleft.layer.borderColor = [UIColor clearColor].CGColor;
  17. self.mleft.layer.borderWidth = 1;
  18. self.mright.layer.cornerRadius = 5;
  19. self.mright.layer.borderColor = [UIColor clearColor].CGColor;
  20. self.mright.layer.borderWidth = 1;
  21. }
  22. - (void)setLeftBt:(float)price goldcount:(int)goldcount count:(NSString *)count
  23. {
  24. UILabel* ll = [self.mleft viewWithTag:2];
  25. ll.text = [NSString stringWithFormat:@"%d",goldcount];
  26. ll = [self.mleft viewWithTag:3];
  27. ll.text = [NSString stringWithFormat:ASLocalizedString(@"售价:¥%.2f元"),price];
  28. if ([count isEqualToString:@"" ]|| count ==nil) {
  29. self.leftGivingCount.hidden =YES;
  30. self.firstImageLayout1.constant +=10;
  31. self.firstLabelLayout1.constant +=10;
  32. }else
  33. {
  34. self.leftGivingCount.hidden =NO;
  35. self.leftGivingCount.text =count;
  36. }
  37. }
  38. - (void)setRightBt:(float)price goldcount:(int)goldcount count:(NSString *)count
  39. {
  40. UILabel* ll = [self.mright viewWithTag:2];
  41. ll.text = [NSString stringWithFormat:@"%d",goldcount];
  42. ll = [self.mright viewWithTag:3];
  43. ll.text = [NSString stringWithFormat:ASLocalizedString(@"售价:¥%.2f元"),price];
  44. if ([count isEqualToString:@"" ]|| count ==nil) {
  45. self.rightGivingCount.hidden =YES;
  46. self.firstImageLayout.constant +=10;
  47. self.firstLabelLayout.constant +=10;
  48. self.secondLabelLayout.constant +=15;
  49. }else
  50. {
  51. self.rightGivingCount.hidden =NO;
  52. self.rightGivingCount.text =count;
  53. }
  54. }
  55. //v:0 正常 1:显示输入金额 2 隐藏
  56. - (void)setLeftVisable:(int)v
  57. {
  58. self.mleft.hidden = (v == 2);
  59. self.mleftinput.hidden = (v != 1);
  60. }
  61. - (void)setRightVisable:(int)v
  62. {
  63. self.mright.hidden = (v == 2);
  64. self.mrightinput.hidden = (v != 1);
  65. }
  66. - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
  67. [super setSelected:selected animated:animated];
  68. // Configure the view for the selected state
  69. }
  70. @end