AchievementsdetailCell.m 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317
  1. //
  2. // AchievementsdetailCell.m
  3. // jitao
  4. //
  5. // Created by 罗云飞 on 2017/12/16.
  6. // Copyright © 2017年 罗云飞. All rights reserved.
  7. //
  8. #import "AchievementsdetailCell.h"
  9. @implementation AchievementsdetailCell
  10. - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
  11. self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
  12. if (self) {
  13. UILabel *line = [UILabel new];
  14. line.backgroundColor = NewButtonColor;
  15. ViewRadius(line, 1);
  16. [self.contentView addSubview:line];
  17. line.sd_layout
  18. .leftSpaceToView(self.contentView, 15)
  19. .topSpaceToView(self.contentView, 15)
  20. .heightIs(18)
  21. .widthIs(3);
  22. _title = [UILabel new];
  23. _title.font = NewFont(fitScreenWidth(14));
  24. [self.contentView addSubview:_title];
  25. _title.sd_layout
  26. .leftSpaceToView(self.contentView, 24)
  27. .heightIs(14)
  28. .rightSpaceToView(self.contentView, 15)
  29. .centerYEqualToView(line);
  30. UILabel *line1 = [UILabel new];
  31. line1.backgroundColor = NewLineGrayColor;
  32. [self.contentView addSubview:line1];
  33. line1.sd_layout
  34. .leftEqualToView(self.contentView)
  35. .rightEqualToView(self.contentView)
  36. .heightIs(0.8)
  37. .topSpaceToView(self.contentView, 44);
  38. _technicaltype = [UILabel new];
  39. _technicaltype.font = NewFont(fitScreenWidth(11));
  40. _technicaltype.textColor = NewButtonColor;
  41. [_technicaltype setSingleLineAutoResizeWithMaxWidth:0];
  42. [self.contentView addSubview:_technicaltype];
  43. _technicaltype.sd_layout
  44. .leftSpaceToView(self.contentView, 15)
  45. .topSpaceToView(line1, 15)
  46. .heightIs(11);
  47. _industry = [UILabel new];
  48. _industry.font = NewFont(fitScreenWidth(11));
  49. [_industry setSingleLineAutoResizeWithMaxWidth:0];
  50. [self.contentView addSubview:_industry];
  51. _industry.sd_layout
  52. .leftSpaceToView(self.contentView, 15)
  53. .topSpaceToView(_technicaltype, 15)
  54. .heightIs(11);
  55. _maturity = [UILabel new];
  56. [_maturity setSingleLineAutoResizeWithMaxWidth:0];
  57. _maturity.font = NewFont(fitScreenWidth(11));
  58. [self.contentView addSubview:_maturity];
  59. _maturity.sd_layout
  60. .leftEqualToView(_industry)
  61. .heightIs(11)
  62. .topSpaceToView(_industry, 15);
  63. _transactionmode = [UILabel new];
  64. _transactionmode.font = NewFont(fitScreenWidth(11));
  65. [_transactionmode setSingleLineAutoResizeWithMaxWidth:0];
  66. [self.contentView addSubview:_transactionmode];
  67. _transactionmode.sd_layout
  68. .leftSpaceToView(_maturity, fitScreenWidth(27))
  69. .heightIs(11)
  70. .topEqualToView(_maturity);
  71. _price = [UILabel new];
  72. _price.font = NewFont(11);
  73. [_price setSingleLineAutoResizeWithMaxWidth:0];
  74. [self.contentView addSubview:_price];
  75. _price.sd_layout
  76. .leftSpaceToView(_transactionmode, fitScreenWidth(27))
  77. .heightIs(11)
  78. .topEqualToView(_transactionmode);
  79. UIView *view = [UIView new];
  80. view.backgroundColor = [UIColor colorWithString:@"#f8f8f8"];
  81. [self.contentView addSubview:view];
  82. view.sd_layout
  83. .leftEqualToView(self.contentView)
  84. .heightIs(104)
  85. .rightEqualToView(self.contentView)
  86. .topSpaceToView(_price, 15);
  87. _fieldapplication = [UILabel new];
  88. _fieldapplication.font = NewFont(fitScreenWidth(11));
  89. [_fieldapplication setSingleLineAutoResizeWithMaxWidth:0];
  90. [view addSubview:_fieldapplication];
  91. _fieldapplication.sd_layout
  92. .leftSpaceToView(view, 15)
  93. .heightIs(11)
  94. .topSpaceToView(view, 15);
  95. _label = [UILabel new];
  96. _label.font = NewFont(11);
  97. [_label setSingleLineAutoResizeWithMaxWidth:0];
  98. [view addSubview:_label];
  99. _label.sd_layout
  100. .leftEqualToView(_fieldapplication)
  101. .heightIs(11)
  102. .topSpaceToView(_fieldapplication, 15);
  103. _place = [UILabel new];
  104. _place.font = NewFont(fitScreenWidth(11));
  105. [_place setSingleLineAutoResizeWithMaxWidth:70];
  106. _place.textColor = [UIColor colorWithString:@"#9A9A9A"];
  107. // [view addSubview:_place];
  108. _place.sd_layout
  109. .rightSpaceToView(view, 10)
  110. .heightIs(11)
  111. .centerYEqualToView(_label);
  112. UIImageView *image = [UIImageView new];
  113. image.backgroundColor = NewClearColor;
  114. [image setImage:[UIImage imageNamed:@"Check"]];
  115. [view addSubview:image];
  116. image.sd_layout
  117. .leftSpaceToView(view, 15)
  118. .heightIs(16)
  119. .widthIs(16)
  120. .topSpaceToView(_label, 18);
  121. _follow = [UILabel new];
  122. _follow.textColor = [UIColor colorWithString:@"#9A9A9A"];
  123. _follow.font = NewFont(fitScreenWidth(11));
  124. [_follow setSingleLineAutoResizeWithMaxWidth:0];
  125. [view addSubview:_follow];
  126. _follow.sd_layout
  127. .leftSpaceToView(image, 5)
  128. .heightIs(11)
  129. .centerYEqualToView(image);
  130. UIImageView *image1 = [UIImageView new];
  131. image1.backgroundColor = NewClearColor;
  132. [image1 setImage:[UIImage imageNamed:@"Check"]];
  133. [view addSubview:image1];
  134. image1.sd_layout
  135. .leftSpaceToView(_follow, 15)
  136. .heightIs(16)
  137. .widthIs(16)
  138. .centerYEqualToView(image);
  139. _orderintention = [UILabel new];
  140. _orderintention.textColor = [UIColor colorWithString:@"#9A9A9A"];
  141. _orderintention.font = NewFont(fitScreenWidth(11));
  142. [_orderintention setSingleLineAutoResizeWithMaxWidth:0];
  143. [view addSubview:_orderintention];
  144. _orderintention.sd_layout
  145. .leftSpaceToView(image1, 5)
  146. .heightIs(11)
  147. .centerYEqualToView(image);
  148. UIImageView *image2 = [UIImageView new];
  149. image2.backgroundColor = NewClearColor;
  150. [image2 setImage:[UIImage imageNamed:@"Check"]];
  151. [view addSubview:image2];
  152. image2.sd_layout
  153. .leftSpaceToView(_orderintention, 15)
  154. .heightIs(16)
  155. .widthIs(16)
  156. .centerYEqualToView(image);
  157. _ordersnumber = [UILabel new];
  158. _ordersnumber.textColor = [UIColor colorWithString:@"#9A9A9A"];
  159. _ordersnumber.font = NewFont(fitScreenWidth(11));
  160. [_ordersnumber setSingleLineAutoResizeWithMaxWidth:0];
  161. [view addSubview:_ordersnumber];
  162. _ordersnumber.sd_layout
  163. .leftSpaceToView(image2, 5)
  164. .heightIs(11)
  165. .centerYEqualToView(image);
  166. _place1 = [UILabel new];
  167. _place1.font = NewFont(fitScreenWidth(11));
  168. [_place1 setSingleLineAutoResizeWithMaxWidth:70];
  169. _place1.textColor = [UIColor colorWithString:@"#9A9A9A"];
  170. [view addSubview:_place1];
  171. _place1.sd_layout
  172. .rightSpaceToView(view, 10)
  173. .heightIs(11)
  174. .centerYEqualToView(image);
  175. }
  176. return self;
  177. }
  178. - (void)assignment:(ResultsDetailsModel *)model {
  179. _title.text = model.name;
  180. /*
  181. (0--专利, 1--软著, 2--项目, 3--版权, 4--工业设计, 5--配方, 6--非标)
  182. */
  183. if ([model.category isEqualToString:@"0"]) {
  184. _technicaltype.text = [NSString stringWithFormat:@"技术类型:%@",@"专利"];
  185. }else if ([model.category isEqualToString:@"1"]){
  186. _technicaltype.text = [NSString stringWithFormat:@"技术类型:%@",@"软著"];
  187. }else if ([model.category isEqualToString:@"2"]){
  188. _technicaltype.text = [NSString stringWithFormat:@"技术类型:%@",@"项目"];
  189. }else if ([model.category isEqualToString:@"3"]){
  190. _technicaltype.text = [NSString stringWithFormat:@"技术类型:%@",@"版权"];
  191. }else if ([model.category isEqualToString:@"4"]){
  192. _technicaltype.text = [NSString stringWithFormat:@"技术类型:%@",@"工业设计"];
  193. }else if ([model.category isEqualToString:@"5"]){
  194. _technicaltype.text = [NSString stringWithFormat:@"技术类型:%@",@"配方"];
  195. }else if ([model.category isEqualToString:@"6"]){
  196. _technicaltype.text = [NSString stringWithFormat:@"技术类型:%@",@"非标"];
  197. }
  198. /*
  199. (0--正在研发, 1-- 已有样品, 2-- 通过小试, 3-- 通过中试, 4-- 可以量产)
  200. */
  201. if ([model.maturity isEqualToString:@"0"]) {
  202. _maturity.text = [NSString stringWithFormat:@"成熟度:%@",@"正在研发"];
  203. }else if ([model.maturity isEqualToString:@"1"]){
  204. _maturity.text = [NSString stringWithFormat:@"成熟度:%@",@"已有样品"];
  205. }else if ([model.maturity isEqualToString:@"2"]){
  206. _maturity.text = [NSString stringWithFormat:@"成熟度:%@",@"通过小试"];
  207. }else if ([model.maturity isEqualToString:@"3"]){
  208. _maturity.text = [NSString stringWithFormat:@"成熟度:%@",@"通过中试"];
  209. }else if ([model.maturity isEqualToString:@"4"]){
  210. _maturity.text = [NSString stringWithFormat:@"成熟度:%@",@"可以量产"];
  211. }else{
  212. _maturity.text = [NSString stringWithFormat:@"成熟度:%@",@""];
  213. }
  214. if (model.field1 == NULL&&model.field2 == NULL) {
  215. _industry.text = @"";
  216. _fieldapplication.text = @"";
  217. }else if (model.field1 == NULL){
  218. _industry.text = [NSString stringWithFormat:@"行业:%@",model.field2];
  219. _fieldapplication.text = [NSString stringWithFormat:@"行业:%@",model.field2];
  220. }else if(model.field2 == NULL){
  221. _industry.text = [NSString stringWithFormat:@"行业:%@",model.field1];
  222. _fieldapplication.text = [NSString stringWithFormat:@"行业:%@",model.field1];
  223. }else{
  224. _industry.text = [NSString stringWithFormat:@"行业:%@ %@",model.field1,model.field2];
  225. _fieldapplication.text = [NSString stringWithFormat:@"适用领域:%@/%@",model.field1,model.field2];
  226. }
  227. if ([model.cooperationMode isEqualToString:@"0"]) {
  228. _transactionmode.text = [NSString stringWithFormat:@"交易方式:%@",@"技术转让"];
  229. }else{
  230. _transactionmode.text = [NSString stringWithFormat:@"交易方式:%@",@"授权生产"];
  231. }
  232. if ([model.bargainingMode isEqualToString:@"0"]) {
  233. _price.text = [NSString stringWithFormat:@"价格:%@",@"面议"];
  234. }else{
  235. if (model.transferPrice == NULL) {
  236. _price.text = [NSString stringWithFormat:@"价格:%@",@""];
  237. }else{
  238. _price.text = [NSString stringWithFormat:@"价格:%@万",model.transferPrice];
  239. }
  240. }
  241. NSString *keyword = [model.keyword stringByReplacingOccurrencesOfString:@"," withString:@" "];
  242. _label.text = [NSString stringWithFormat:@"标签:%@",keyword];
  243. _place.text = model.ownerPostalAddress;
  244. _place1.text = model.ownerPostalAddress;
  245. _follow.text = [NSString stringWithFormat:@"%@次关注",model.countInterest];
  246. if (model.orderIntentionCount == NULL) {
  247. _orderintention.text = [NSString stringWithFormat:@"%@次接单意向",@"0"];
  248. }else{
  249. _orderintention.text = [NSString stringWithFormat:@"%@次接单意向",model.orderIntentionCount];
  250. }
  251. if (model.orderCount == NULL) {
  252. _ordersnumber.text = [NSString stringWithFormat:@"%@次接单",@"0"];
  253. }else{
  254. _ordersnumber.text = [NSString stringWithFormat:@"%@次接单",model.orderCount];
  255. }
  256. }
  257. - (void)awakeFromNib {
  258. [super awakeFromNib];
  259. // Initialization code
  260. }
  261. - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
  262. [super setSelected:selected animated:animated];
  263. // Configure the view for the selected state
  264. }
  265. @end