TrainPriceListCell.m 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. //
  2. // TrainPriceListCell.m
  3. // LN_School
  4. //
  5. // Created by EchoShacolee on 2017/4/19.
  6. // Copyright © 2017年 Danson. All rights reserved.
  7. //
  8. #import "TrainPriceListCell.h"
  9. @implementation TrainPriceListCell
  10. - (void)awakeFromNib {
  11. [super awakeFromNib];
  12. // Initialization code
  13. }
  14. - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
  15. [super setSelected:selected animated:animated];
  16. // Configure the view for the selected state
  17. }
  18. -(void)upDataWithDic:(NSDictionary *)dic{
  19. _type.text = [NSString stringWithFormat:@"培训车型:%@",dic[@"CSI_VEHICLETYPE"]];
  20. NSString *priceStr = [NSString stringWithFormat:@"培训价格:%@元",dic[@"CSI_PRICE"]];
  21. NSMutableAttributedString *hintString=[[NSMutableAttributedString alloc]initWithString:priceStr];
  22. //获取要调整颜色的文字位置,调整颜色
  23. NSRange range1={5,priceStr.length-5};
  24. [hintString addAttribute:NSForegroundColorAttributeName value:[UIColor redColor] range:range1];
  25. _price.attributedText=hintString;
  26. _record.text = [NSString stringWithFormat:@"备案日期:%@",dic[@"CSI_RECORD_DATE"]];
  27. //@"一次性收费",@"计时收费",@"分段式收费",@"其他",
  28. switch ([[NSString stringWithFormat:@"%@",dic[@"CSI_CHARGEMODE"]] integerValue]) {
  29. case 1:
  30. {
  31. _shoufei.text = @"收费模式:一次性收费";
  32. }
  33. break;
  34. case 2:
  35. {
  36. _shoufei.text = @"收费模式:计时收费";
  37. }
  38. break;
  39. case 3:
  40. {
  41. _shoufei.text = @"收费模式:分段式收费";
  42. }
  43. break;
  44. case 9:
  45. {
  46. _shoufei.text = @"收费模式:其它";
  47. }
  48. break;
  49. default:
  50. break;
  51. }
  52. //@"普通时段",@"高峰时段",@"节假日时段"
  53. switch ([[NSString stringWithFormat:@"%@",dic[@"CSI_TRAINNINGTIME"]] integerValue]) {
  54. case 1:
  55. {
  56. _trainTime.text = @"培训时段:普通时段";
  57. }
  58. break;
  59. case 2:
  60. {
  61. _trainTime.text = @"培训时段:高峰时段";
  62. }
  63. break;
  64. case 3:
  65. {
  66. _trainTime.text = @"培训时段:节假日时段";
  67. }
  68. break;
  69. default:
  70. break;
  71. }
  72. //@[@"定时培训",@"预约培训",@"其它"]
  73. switch ([[NSString stringWithFormat:@"%@",dic[@"CSI_TRAINNINGMODE"]] integerValue]) {
  74. case 1:
  75. {
  76. _train.text = @"培训模式:定时培训";
  77. }
  78. break;
  79. case 2:
  80. {
  81. _train.text = @"培训模式:预约培训";
  82. }
  83. break;
  84. case 9:
  85. {
  86. _train.text = @"培训模式:其它";
  87. }
  88. break;
  89. default:
  90. break;
  91. }
  92. switch ([[NSString stringWithFormat:@"%@",dic[@"CSI_SUBJECT"]] integerValue]) {
  93. case 1:
  94. {
  95. _subject.text = @"培训部分及方式:第一部份集中教学";
  96. }
  97. break;
  98. case 2:
  99. {
  100. _subject.text = @"培训部分及方式:第一部份网络教学";
  101. }
  102. break;
  103. case 3:
  104. {
  105. _subject.text = @"培训部分及方式:第四部份集中教学";
  106. }
  107. break;
  108. case 4:
  109. {
  110. _subject.text = @"培训部分及方式:第四部份网络教学";
  111. }
  112. break;
  113. case 5:
  114. {
  115. _subject.text = @"培训部分及方式:模拟器教学";
  116. }
  117. break;
  118. case 6:
  119. {
  120. _subject.text = @"培训部分及方式:第二部份普通教学";
  121. }
  122. break;
  123. case 7:
  124. {
  125. _subject.text = @"培训部分及方式:第二部份智能教学";
  126. }
  127. break;
  128. case 8:
  129. {
  130. _subject.text = @"培训部分及方式:第三部份普通教学";
  131. }
  132. break;
  133. case 9:
  134. {
  135. _subject.text = @"培训部分及方式:第三部份智能教学";
  136. }
  137. break;
  138. default:
  139. break;
  140. }
  141. }
  142. - (void)layoutSubviews
  143. {
  144. [super layoutSubviews];
  145. for (UIControl *control in self.subviews) {
  146. if (![control isMemberOfClass:NSClassFromString(@"UITableViewCellEditControl")]){
  147. continue;
  148. }
  149. for (UIView *subView in control.subviews) {
  150. if (![subView isKindOfClass: [UIImageView class]]) {
  151. continue;
  152. }
  153. //
  154. [subView setValue:RQMianColor forKey:@"tintColor"];
  155. // UIImageView *imageView = (UIImageView *)subView;
  156. // if (self.selected) {
  157. // imageView.image = [UIImage imageNamed:@"ic_squSelect_h"]; // 选中时的图片
  158. // } else {
  159. // imageView.image = [UIImage imageNamed:@"ic_squSelect"]; // 未选中时的图片
  160. // }
  161. }
  162. }
  163. }
  164. @end