JSXQdetailCell.m 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. //
  2. // JSXQdetailCell.m
  3. // jitao
  4. //
  5. // Created by 罗云飞 on 2018/8/17.
  6. // Copyright © 2018年 罗云飞. All rights reserved.
  7. //
  8. #import "JSXQdetailCell.h"
  9. @implementation JSXQdetailCell
  10. - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
  11. self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
  12. if (self) {
  13. _biaoti = [UILabel new];
  14. _biaoti.text = @"一种新型的美肤宝技术一种新型的美肤宝技术一电费水电费术水电费水电费术水电费水电费";
  15. _biaoti.lineBreakMode = NSLineBreakByTruncatingTail;
  16. _biaoti.numberOfLines = 2;
  17. _biaoti.font = NewFont(fitScreenWidth(16));
  18. _biaoti.textColor = NewBlackColor;
  19. [self.contentView addSubview:_biaoti];
  20. _biaoti.sd_layout
  21. .leftSpaceToView(self.contentView, 15)
  22. .rightSpaceToView(self.contentView, 15)
  23. .topSpaceToView(self.contentView, 20)
  24. .autoHeightRatio(0)
  25. .maxHeightIs(fitScreenWidth(40));
  26. _shouchangBT = [UIButton new];
  27. [_shouchangBT setBackgroundColor:NewRedColor];
  28. [self.contentView addSubview:_shouchangBT];
  29. _shouchangBT.sd_layout
  30. .rightSpaceToView(self.contentView, 15)
  31. .topSpaceToView(_biaoti, 17)
  32. .heightIs(15)
  33. .widthIs(15);
  34. _shouchangNumber = [UILabel new];
  35. _shouchangNumber.text = [NSString stringWithFormat:@"%@次收藏",@"3"];
  36. _shouchangNumber.font = NewFont(13);
  37. [_shouchangNumber setSingleLineAutoResizeWithMaxWidth:0];
  38. _shouchangNumber.textColor = [UIColor colorWithString:@"#AEAEAE"];
  39. [self.contentView addSubview:_shouchangNumber];
  40. _shouchangNumber.sd_layout
  41. .centerYEqualToView(_shouchangBT)
  42. .heightIs(14)
  43. .rightSpaceToView(_shouchangBT, 10);
  44. UILabel *line = [UILabel new];
  45. line.backgroundColor = NewLineGrayColor;
  46. [self.contentView addSubview:line];
  47. line.sd_layout
  48. .leftEqualToView(self.contentView)
  49. .heightIs(0.8)
  50. .rightEqualToView(self.contentView)
  51. .topSpaceToView(_shouchangBT, 15);
  52. UILabel *xuqiu = [UILabel new];
  53. xuqiu.text = @"需求类型";
  54. xuqiu.font = NewFont(fitScreenWidth(13));
  55. [xuqiu setSingleLineAutoResizeWithMaxWidth:0];
  56. xuqiu.textColor = [UIColor colorWithString:@"#AEAEAE"];
  57. [self.contentView addSubview:xuqiu];
  58. xuqiu.sd_layout
  59. .leftSpaceToView(self.contentView, 15)
  60. .topSpaceToView(line, 15)
  61. .heightIs(fitScreenWidth(13));
  62. _xuqiuleixing = [UILabel new];
  63. _xuqiuleixing.text = @"航空航天";
  64. _xuqiuleixing.font = NewFont(13);
  65. _xuqiuleixing.textColor = NewBlackColor;
  66. [_xuqiuleixing setSingleLineAutoResizeWithMaxWidth:0];
  67. [self.contentView addSubview:_xuqiuleixing];
  68. _xuqiuleixing.sd_layout
  69. .leftSpaceToView(xuqiu, 15)
  70. .centerYEqualToView(xuqiu)
  71. .heightIs(fitScreenWidth(13));
  72. UILabel *hangye = [UILabel new];
  73. hangye.text = @"所属行业";
  74. hangye.font = NewFont(fitScreenWidth(13));
  75. [hangye setSingleLineAutoResizeWithMaxWidth:0];
  76. hangye.textColor = [UIColor colorWithString:@"#AEAEAE"];
  77. [self.contentView addSubview:hangye];
  78. hangye.sd_layout
  79. .leftSpaceToView(self.contentView, 15)
  80. .topSpaceToView(xuqiu, 15)
  81. .heightIs(fitScreenWidth(13));
  82. _suoshuhangye = [UILabel new];
  83. _suoshuhangye.text = @"生物医药";
  84. _suoshuhangye.font = NewFont(13);
  85. _suoshuhangye.textColor = NewBlackColor;
  86. [_suoshuhangye setSingleLineAutoResizeWithMaxWidth:0];
  87. [self.contentView addSubview:_suoshuhangye];
  88. _suoshuhangye.sd_layout
  89. .leftSpaceToView(hangye, 15)
  90. .centerYEqualToView(hangye)
  91. .heightIs(fitScreenWidth(13));
  92. UILabel *guanjianci = [UILabel new];
  93. guanjianci.text = @"关键词";
  94. guanjianci.font = NewFont(fitScreenWidth(13));
  95. [guanjianci setSingleLineAutoResizeWithMaxWidth:0];
  96. guanjianci.textColor = [UIColor colorWithString:@"#AEAEAE"];
  97. [self.contentView addSubview:guanjianci];
  98. guanjianci.sd_layout
  99. .leftSpaceToView(self.contentView, 15)
  100. .topSpaceToView(hangye, 15)
  101. .heightIs(fitScreenWidth(13));
  102. _guanjianci = [UILabel new];
  103. _guanjianci.text = @"生物制药";
  104. _guanjianci.font = NewFont(13);
  105. _guanjianci.textColor = NewBlackColor;
  106. [_guanjianci setSingleLineAutoResizeWithMaxWidth:0];
  107. [self.contentView addSubview:_guanjianci];
  108. _guanjianci.sd_layout
  109. .leftEqualToView(_suoshuhangye)
  110. .centerYEqualToView(guanjianci)
  111. .heightIs(fitScreenWidth(13));
  112. UILabel *jiage = [UILabel new];
  113. jiage.text = @"交易价格";
  114. jiage.font = NewFont(fitScreenWidth(13));
  115. [jiage setSingleLineAutoResizeWithMaxWidth:0];
  116. jiage.textColor = [UIColor colorWithString:@"#AEAEAE"];
  117. [self.contentView addSubview:jiage];
  118. jiage.sd_layout
  119. .leftSpaceToView(_guanjianci, 55)
  120. .topSpaceToView(hangye, 15)
  121. .heightIs(fitScreenWidth(13));
  122. _jiaoyijiage = [UILabel new];
  123. _jiaoyijiage.font = NewFont(fitScreenWidth(13));
  124. _jiaoyijiage.text = @"¥4500";
  125. [_jiaoyijiage setSingleLineAutoResizeWithMaxWidth:0];
  126. _jiaoyijiage.textColor = NewButtonColor;
  127. [self.contentView addSubview:_jiaoyijiage];
  128. _jiaoyijiage.sd_layout
  129. .leftSpaceToView(jiage, 15)
  130. .heightIs(fitScreenWidth(13))
  131. .centerYEqualToView(jiage);
  132. UILabel *line1 = [UILabel new];
  133. line1.backgroundColor = NewLineGrayColor;
  134. [self.contentView addSubview:line1];
  135. line1.sd_layout
  136. .leftEqualToView(self.contentView)
  137. .heightIs(10)
  138. .rightEqualToView(self.contentView)
  139. .topSpaceToView(jiage, 15);
  140. UILabel *xuqiujieshao = [UILabel new];
  141. xuqiujieshao.text = @"需求介绍";
  142. xuqiujieshao.font = NewFont(fitScreenWidth(14));
  143. [xuqiujieshao setSingleLineAutoResizeWithMaxWidth:0];
  144. [self.contentView addSubview:xuqiujieshao];
  145. xuqiujieshao.sd_layout
  146. .leftSpaceToView(self.contentView, 15)
  147. .topSpaceToView(line1, 15)
  148. .heightIs(fitScreenWidth(14));
  149. _xuqiuneirong = [UILabel new];
  150. CGFloat height = [NewUtils heightforString:@"全景网,图片库,中国领先的图片库和正版图片素材网站;为个人提供正版图片素材,图片搜索,高清图片下载;为企业提供正版图片素材和影像传播解决方案。全景网,读图时代,美好全景网,图片库,中国领先的图片库和正版图片素材网站;为个人提供正版图片素材,图片搜索,高清图片下载;为企业提供正版图片素材和影像传播解决方案。全景网,读图时代,美好。" andWidth:SCREEN_WIDTH-30 fontSize:fitScreenWidth(13)];
  151. _xuqiuneirong.text = @"全景网,图片库,中国领先的图片库和正版图片素材网站;为个人提供正版图片素材,图片搜索,高清图片下载;为企业提供正版图片素材和影像传播解决方案。全景网,读图时代,美好全景网,图片库,中国领先的图片库和正版图片素材网站;为个人提供正版图片素材,图片搜索,高清图片下载;为企业提供正版图片素材和影像传播解决方案。全景网,读图时代,美好。";
  152. _xuqiuneirong.textColor = [UIColor colorWithString:@"#6C6C6C"];
  153. _xuqiuneirong.font = NewFont(fitScreenWidth(13));
  154. _xuqiuneirong.numberOfLines = 0;
  155. [self.contentView addSubview:_xuqiuneirong];
  156. _xuqiuneirong.sd_layout
  157. .leftSpaceToView(self.contentView, 15)
  158. .rightSpaceToView(self.contentView, 15)
  159. .topSpaceToView(xuqiujieshao, 15)
  160. .heightIs(height);
  161. }
  162. return self;
  163. }
  164. - (void)awakeFromNib {
  165. [super awakeFromNib];
  166. // Initialization code
  167. }
  168. - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
  169. [super setSelected:selected animated:animated];
  170. // Configure the view for the selected state
  171. }
  172. @end