SourceGroupVC.m 45 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947
  1. //
  2. // SourceGroupVC.m
  3. // smartRhino
  4. //
  5. // Created by niuzhen on 2020/5/7.
  6. // Copyright © 2020 tederen. All rights reserved.
  7. //
  8. #import "SourceGroupVC.h"
  9. #import "MyTDGroupView.h"
  10. #import "TDGroupInfoListCell.h"
  11. #import "ChatMsgListCell.h"
  12. #import "TDGroupInfoListModel.h"
  13. #import "NoteBookVC.h"
  14. #import "OtherNoteBookVC.h"
  15. #import "MailListDetailVC.h"
  16. #import "MyFavoriteVC.h"
  17. #import "MyTDGroupViewController.h"
  18. #import "MoveViewController.h"
  19. #import "OtherFavoriteVC.h"
  20. #import "TDGroupInfoListVC.h"
  21. #import "WorkFlowDetailsController.h"
  22. #import "MyApprovalPageDetail.h"
  23. #import "DownFileViewController.h"
  24. #import "ShareListVC.h"
  25. #import "TDInterLeterHomeViewController.h"
  26. #import "MailListVC.h"
  27. #import "WaitWorkVC.h"
  28. #import "MyTDTopicSearchVC.h"
  29. #import "NoteBookShareVC.h"
  30. #import "GroupSquareVC.h"
  31. @interface SourceGroupVC ()<UITableViewDelegate,UITableViewDataSource,NoteBookShareVCDelegate>
  32. @property (weak, nonatomic) IBOutlet UIButton *editBtn;
  33. @property (weak, nonatomic) IBOutlet UIButton *squareBtn;
  34. @property (weak, nonatomic) IBOutlet UIView *HeadView;
  35. @property (weak, nonatomic) IBOutlet UITableView *tableView;
  36. @property (strong, nonatomic) MyTDGroupView *SearchView;
  37. @property (copy, nonatomic) NSMutableArray *dataArray;
  38. @property (strong, nonatomic) UIView *groupView;
  39. @property (strong, nonatomic) NoteBookShareVC *noteBookShareVC;
  40. @property (copy, nonatomic) FlowAttachmentsModel *sendModel;
  41. @property (assign, nonatomic) BOOL isReturn;
  42. @end
  43. @implementation SourceGroupVC
  44. +(SourceGroupVC *)initSourceGroupVC{
  45. SourceGroupVC *controller = [StoryboardManager.shared.Source instantiateViewControllerWithIdentifier:@"SourceGroupVC"];
  46. return controller;
  47. }
  48. - (void)viewDidLoad {
  49. [super viewDidLoad];
  50. self.fd_prefersNavigationBarHidden = YES;
  51. [self addHeaderSubView];
  52. self.tableView.delegate = self;
  53. self.tableView.dataSource = self;
  54. WS(weakSelf);
  55. [self.squareBtn setAction:^{
  56. GroupSquareVC * vc = [GroupSquareVC initGroupSquareVC];
  57. [weakSelf.navigationController pushViewController:vc animated:YES];
  58. }];
  59. [self.editBtn setAction:^{
  60. MyTDTopicCreateVC * vc = [MyTDTopicCreateVC initMyTDTopicCreateVC];
  61. vc.type = CollectModel_NewTopic;
  62. vc.upDateBlock = ^{
  63. [weakSelf getData];
  64. };
  65. [weakSelf.navigationController pushViewController:vc animated:YES];
  66. }];
  67. [self getData];
  68. }
  69. - (void)addHeaderSubView
  70. {
  71. [self.HeadView addSubview:self.SearchView];
  72. [self.SearchView mas_makeConstraints:^(MASConstraintMaker *make) {
  73. make.left.top.right.mas_equalTo(self.HeadView);
  74. make.height.mas_offset(36);
  75. }];
  76. [self.HeadView addSubview:self.groupView];
  77. [self.groupView mas_makeConstraints:^(MASConstraintMaker *make) {
  78. make.top.mas_equalTo(self.SearchView.mas_bottom);
  79. make.left.bottom.right.mas_equalTo(self.HeadView);
  80. }];
  81. UIImageView * imgV = [UIImageView new];
  82. imgV.image = IMG(@"Source_Group_Icon");
  83. [self.groupView addSubview:imgV];
  84. [imgV mas_makeConstraints:^(MASConstraintMaker *make) {
  85. make.left.mas_offset(15);
  86. make.centerY.mas_equalTo(self.groupView);
  87. }];
  88. UILabel * lineL = [UILabel new];
  89. lineL.backgroundColor = LINEBGCOLOR;
  90. [self.groupView addSubview:lineL];
  91. [lineL mas_makeConstraints:^(MASConstraintMaker *make) {
  92. make.left.bottom.right.mas_equalTo(self.groupView);
  93. make.height.mas_offset(0.5);
  94. }];
  95. UILabel * titleL = [UILabel new];
  96. titleL.textColor = UIColorHex(0x0A0A0A);
  97. titleL.font = [UIFont systemFontOfSize:15];
  98. titleL.text = @"小组";
  99. [self.groupView addSubview:titleL];
  100. [titleL mas_makeConstraints:^(MASConstraintMaker *make) {
  101. make.centerY.mas_equalTo(self.groupView);
  102. make.left.mas_equalTo(imgV.mas_right).offset(15);
  103. }];
  104. UIImageView * rightImgV = [UIImageView new];
  105. rightImgV.image = IMG(@"chatmsg_rightArrow_icon");
  106. [self.groupView addSubview:rightImgV];
  107. [rightImgV mas_makeConstraints:^(MASConstraintMaker *make) {
  108. make.centerY.mas_equalTo(self.groupView);
  109. make.right.offset(-15);
  110. }];
  111. WS(weakSelf);
  112. UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithActionBlock:^(id _Nonnull sender) {
  113. [weakSelf pushGroupVC];
  114. }];
  115. self.groupView.userInteractionEnabled = YES;
  116. [self.groupView addGestureRecognizer:tap];
  117. }
  118. - (void)pushGroupVC
  119. {
  120. MyTDGroupViewController * vc = [[MyTDGroupViewController alloc] init];
  121. [self.navigationController pushViewController:vc animated:YES];
  122. }
  123. - (void)getData
  124. {
  125. WS(weakSelf);
  126. NSDictionary * paraDict = @{@"ParentId":@(0),
  127. @"UserId":@([AppUserModel sharedAppUserModel].Id),
  128. @"Keyword": @"",
  129. @"Page":@(1),
  130. @"TopicGroupIds": @[],
  131. @"PerPage": @(99999999),
  132. @"Sort":@""
  133. };
  134. [[HttpManager sharedHttpManager] POSTUrl:Host(APP_Topic_Topic_List_Page) parameters:paraDict responseStyle:JOSN success:^(id _Nonnull responseObject) {
  135. NSLog(@"%@",responseObject);
  136. [weakSelf.tableView.mj_header endRefreshing];
  137. [weakSelf.tableView.mj_footer endRefreshing];
  138. TopicListModel * model = [TopicListModel modelWithDictionary:responseObject];
  139. [weakSelf.dataArray addObjectsFromArray:model.Items];
  140. dispatch_async(dispatch_get_main_queue(), ^{
  141. [weakSelf.tableView reloadData];
  142. });
  143. } failure:^(NSError * _Nonnull error) {
  144. [weakSelf.tableView.mj_header endRefreshing];
  145. [weakSelf.tableView.mj_footer endRefreshing];
  146. }];
  147. }
  148. #pragma mark - UITableViewDelegate
  149. - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
  150. return 1;
  151. }
  152. - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
  153. return self.dataArray.count;
  154. }
  155. - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
  156. return UITableViewAutomaticDimension;
  157. }
  158. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
  159. WS(weakSelf);
  160. TopicListItemModel * model = [self.dataArray objectAtIndex:indexPath.row];
  161. switch (model.DataType) {
  162. case TopiclistCellImage:
  163. {
  164. TDGroupInfoListCell * cell;
  165. switch (model.Data.count) {
  166. case 1:
  167. {
  168. cell = [TDGroupInfoListCell configCell1:tableView indexPath:indexPath];
  169. cell.cellImagV1.hidden = NO;
  170. cell.cellImagV2.hidden = YES;
  171. cell.cellImagV3.hidden = YES;
  172. cell.cellImagV4.hidden = YES;
  173. cell.cellImagV5.hidden = YES;
  174. cell.cellImagV6.hidden = YES;
  175. cell.cellImagV7.hidden = YES;
  176. cell.cellImagV8.hidden = YES;
  177. cell.cellImagV9.hidden = YES;
  178. TopicListSubModel * subModel0 = model.Data[0];
  179. [cell.cellImagV1 sd_setImageWithURL:[NSURL URLWithString:subModel0.File] placeholderImage:IMG(@"img_placeHolderVertical")];
  180. }
  181. break;
  182. case 2:
  183. {
  184. cell = [TDGroupInfoListCell configCell1:tableView indexPath:indexPath];
  185. cell.cellImagV1.hidden = NO;
  186. cell.cellImagV2.hidden = NO;
  187. cell.cellImagV3.hidden = YES;
  188. cell.cellImagV4.hidden = YES;
  189. cell.cellImagV5.hidden = YES;
  190. cell.cellImagV6.hidden = YES;
  191. cell.cellImagV7.hidden = YES;
  192. cell.cellImagV8.hidden = YES;
  193. cell.cellImagV9.hidden = YES;
  194. TopicListSubModel * subModel0 = model.Data[0];
  195. [cell.cellImagV1 sd_setImageWithURL:[NSURL URLWithString:subModel0.File] placeholderImage:IMG(@"img_placeHolderVertical")];
  196. TopicListSubModel * subModel1 = model.Data[1];
  197. [cell.cellImagV2 sd_setImageWithURL:[NSURL URLWithString:subModel1.File] placeholderImage:IMG(@"img_placeHolderVertical")];
  198. }
  199. break;
  200. case 3:
  201. {
  202. cell = [TDGroupInfoListCell configCell2:tableView indexPath:indexPath];
  203. cell.cellImagV1.hidden = NO;
  204. cell.cellImagV2.hidden = NO;
  205. cell.cellImagV3.hidden = NO;
  206. cell.cellImagV4.hidden = YES;
  207. cell.cellImagV5.hidden = YES;
  208. cell.cellImagV6.hidden = YES;
  209. cell.cellImagV7.hidden = YES;
  210. cell.cellImagV8.hidden = YES;
  211. cell.cellImagV9.hidden = YES;
  212. TopicListSubModel * subModel0 = model.Data[0];
  213. [cell.cellImagV1 sd_setImageWithURL:[NSURL URLWithString:subModel0.File] placeholderImage:IMG(@"img_placeHolderVertical")];
  214. TopicListSubModel * subModel1 = model.Data[1];
  215. [cell.cellImagV2 sd_setImageWithURL:[NSURL URLWithString:subModel1.File] placeholderImage:IMG(@"img_placeHolderVertical")];
  216. TopicListSubModel * subModel2 = model.Data[2];
  217. [cell.cellImagV3 sd_setImageWithURL:[NSURL URLWithString:subModel2.File] placeholderImage:IMG(@"img_placeHolderVertical")];
  218. }
  219. break;
  220. case 4:
  221. {
  222. cell = [TDGroupInfoListCell configCell3:tableView indexPath:indexPath];
  223. cell.cellImagV1.hidden = NO;
  224. cell.cellImagV2.hidden = NO;
  225. cell.cellImagV3.hidden = NO;
  226. cell.cellImagV4.hidden = NO;
  227. cell.cellImagV5.hidden = YES;
  228. cell.cellImagV6.hidden = YES;
  229. cell.cellImagV7.hidden = YES;
  230. cell.cellImagV8.hidden = YES;
  231. cell.cellImagV9.hidden = YES;
  232. TopicListSubModel * subModel0 = model.Data[0];
  233. [cell.cellImagV1 sd_setImageWithURL:[NSURL URLWithString:subModel0.File] placeholderImage:IMG(@"img_placeHolderVertical")];
  234. TopicListSubModel * subModel1 = model.Data[1];
  235. [cell.cellImagV2 sd_setImageWithURL:[NSURL URLWithString:subModel1.File] placeholderImage:IMG(@"img_placeHolderVertical")];
  236. TopicListSubModel * subModel2 = model.Data[2];
  237. [cell.cellImagV3 sd_setImageWithURL:[NSURL URLWithString:subModel2.File] placeholderImage:IMG(@"img_placeHolderVertical")];
  238. TopicListSubModel * subModel3 = model.Data[3];
  239. [cell.cellImagV4 sd_setImageWithURL:[NSURL URLWithString:subModel3.File] placeholderImage:IMG(@"img_placeHolderVertical")];
  240. }
  241. break;
  242. case 5:
  243. {
  244. cell = [TDGroupInfoListCell configCell4:tableView indexPath:indexPath];
  245. cell.cellImagV1.hidden = NO;
  246. cell.cellImagV2.hidden = NO;
  247. cell.cellImagV3.hidden = NO;
  248. cell.cellImagV4.hidden = NO;
  249. cell.cellImagV5.hidden = NO;
  250. cell.cellImagV6.hidden = YES;
  251. cell.cellImagV7.hidden = YES;
  252. cell.cellImagV8.hidden = YES;
  253. cell.cellImagV9.hidden = YES;
  254. TopicListSubModel * subModel0 = model.Data[0];
  255. [cell.cellImagV1 sd_setImageWithURL:[NSURL URLWithString:subModel0.File] placeholderImage:IMG(@"img_placeHolderVertical")];
  256. TopicListSubModel * subModel1 = model.Data[1];
  257. [cell.cellImagV2 sd_setImageWithURL:[NSURL URLWithString:subModel1.File] placeholderImage:IMG(@"img_placeHolderVertical")];
  258. TopicListSubModel * subModel2 = model.Data[2];
  259. [cell.cellImagV3 sd_setImageWithURL:[NSURL URLWithString:subModel2.File] placeholderImage:IMG(@"img_placeHolderVertical")];
  260. TopicListSubModel * subModel3 = model.Data[3];
  261. [cell.cellImagV4 sd_setImageWithURL:[NSURL URLWithString:subModel3.File] placeholderImage:IMG(@"img_placeHolderVertical")];
  262. TopicListSubModel * subModel4 = model.Data[4];
  263. [cell.cellImagV5 sd_setImageWithURL:[NSURL URLWithString:subModel4.File] placeholderImage:IMG(@"img_placeHolderVertical")];
  264. }
  265. break;
  266. case 6:
  267. {
  268. cell = [TDGroupInfoListCell configCell4:tableView indexPath:indexPath];
  269. cell.cellImagV1.hidden = NO;
  270. cell.cellImagV2.hidden = NO;
  271. cell.cellImagV3.hidden = NO;
  272. cell.cellImagV4.hidden = NO;
  273. cell.cellImagV5.hidden = NO;
  274. cell.cellImagV6.hidden = NO;
  275. cell.cellImagV7.hidden = YES;
  276. cell.cellImagV8.hidden = YES;
  277. cell.cellImagV9.hidden = YES;
  278. TopicListSubModel * subModel0 = model.Data[0];
  279. [cell.cellImagV1 sd_setImageWithURL:[NSURL URLWithString:subModel0.File] placeholderImage:IMG(@"img_placeHolderVertical")];
  280. TopicListSubModel * subModel1 = model.Data[1];
  281. [cell.cellImagV2 sd_setImageWithURL:[NSURL URLWithString:subModel1.File] placeholderImage:IMG(@"img_placeHolderVertical")];
  282. TopicListSubModel * subModel2 = model.Data[2];
  283. [cell.cellImagV3 sd_setImageWithURL:[NSURL URLWithString:subModel2.File] placeholderImage:IMG(@"img_placeHolderVertical")];
  284. TopicListSubModel * subModel3 = model.Data[3];
  285. [cell.cellImagV4 sd_setImageWithURL:[NSURL URLWithString:subModel3.File] placeholderImage:IMG(@"img_placeHolderVertical")];
  286. TopicListSubModel * subModel4 = model.Data[4];
  287. [cell.cellImagV5 sd_setImageWithURL:[NSURL URLWithString:subModel4.File] placeholderImage:IMG(@"img_placeHolderVertical")];
  288. TopicListSubModel * subModel5 = model.Data[5];
  289. [cell.cellImagV6 sd_setImageWithURL:[NSURL URLWithString:subModel5.File] placeholderImage:IMG(@"img_placeHolderVertical")];
  290. }
  291. break;
  292. case 7:
  293. {
  294. cell = [TDGroupInfoListCell configCell5:tableView indexPath:indexPath];
  295. cell.cellImagV1.hidden = NO;
  296. cell.cellImagV2.hidden = NO;
  297. cell.cellImagV3.hidden = NO;
  298. cell.cellImagV4.hidden = NO;
  299. cell.cellImagV5.hidden = NO;
  300. cell.cellImagV6.hidden = NO;
  301. cell.cellImagV7.hidden = NO;
  302. cell.cellImagV8.hidden = YES;
  303. cell.cellImagV9.hidden = YES;
  304. TopicListSubModel * subModel0 = model.Data[0];
  305. [cell.cellImagV1 sd_setImageWithURL:[NSURL URLWithString:subModel0.File] placeholderImage:IMG(@"img_placeHolderVertical")];
  306. TopicListSubModel * subModel1 = model.Data[1];
  307. [cell.cellImagV2 sd_setImageWithURL:[NSURL URLWithString:subModel1.File] placeholderImage:IMG(@"img_placeHolderVertical")];
  308. TopicListSubModel * subModel2 = model.Data[2];
  309. [cell.cellImagV3 sd_setImageWithURL:[NSURL URLWithString:subModel2.File] placeholderImage:IMG(@"img_placeHolderVertical")];
  310. TopicListSubModel * subModel3 = model.Data[3];
  311. [cell.cellImagV4 sd_setImageWithURL:[NSURL URLWithString:subModel3.File] placeholderImage:IMG(@"img_placeHolderVertical")];
  312. TopicListSubModel * subModel4 = model.Data[4];
  313. [cell.cellImagV5 sd_setImageWithURL:[NSURL URLWithString:subModel4.File] placeholderImage:IMG(@"img_placeHolderVertical")];
  314. TopicListSubModel * subModel5 = model.Data[5];
  315. [cell.cellImagV6 sd_setImageWithURL:[NSURL URLWithString:subModel5.File] placeholderImage:IMG(@"img_placeHolderVertical")];
  316. TopicListSubModel * subModel6 = model.Data[6];
  317. [cell.cellImagV7 sd_setImageWithURL:[NSURL URLWithString:subModel6.File] placeholderImage:IMG(@"img_placeHolderVertical")];
  318. }
  319. break;
  320. case 8:
  321. {
  322. cell = [TDGroupInfoListCell configCell5:tableView indexPath:indexPath];
  323. cell.cellImagV1.hidden = NO;
  324. cell.cellImagV2.hidden = NO;
  325. cell.cellImagV3.hidden = NO;
  326. cell.cellImagV4.hidden = NO;
  327. cell.cellImagV5.hidden = NO;
  328. cell.cellImagV6.hidden = NO;
  329. cell.cellImagV7.hidden = NO;
  330. cell.cellImagV8.hidden = NO;
  331. cell.cellImagV9.hidden = YES;
  332. TopicListSubModel * subModel0 = model.Data[0];
  333. [cell.cellImagV1 sd_setImageWithURL:[NSURL URLWithString:subModel0.File] placeholderImage:IMG(@"img_placeHolderVertical")];
  334. TopicListSubModel * subModel1 = model.Data[1];
  335. [cell.cellImagV2 sd_setImageWithURL:[NSURL URLWithString:subModel1.File] placeholderImage:IMG(@"img_placeHolderVertical")];
  336. TopicListSubModel * subModel2 = model.Data[2];
  337. [cell.cellImagV3 sd_setImageWithURL:[NSURL URLWithString:subModel2.File] placeholderImage:IMG(@"img_placeHolderVertical")];
  338. TopicListSubModel * subModel3 = model.Data[3];
  339. [cell.cellImagV4 sd_setImageWithURL:[NSURL URLWithString:subModel3.File] placeholderImage:IMG(@"img_placeHolderVertical")];
  340. TopicListSubModel * subModel4 = model.Data[4];
  341. [cell.cellImagV5 sd_setImageWithURL:[NSURL URLWithString:subModel4.File] placeholderImage:IMG(@"img_placeHolderVertical")];
  342. TopicListSubModel * subModel5 = model.Data[5];
  343. [cell.cellImagV6 sd_setImageWithURL:[NSURL URLWithString:subModel5.File] placeholderImage:IMG(@"img_placeHolderVertical")];
  344. TopicListSubModel * subModel6 = model.Data[6];
  345. [cell.cellImagV7 sd_setImageWithURL:[NSURL URLWithString:subModel6.File] placeholderImage:IMG(@"img_placeHolderVertical")];
  346. TopicListSubModel * subModel7 = model.Data[7];
  347. [cell.cellImagV8 sd_setImageWithURL:[NSURL URLWithString:subModel7.File] placeholderImage:IMG(@"img_placeHolderVertical")];
  348. }
  349. break;
  350. default:
  351. {
  352. cell = [TDGroupInfoListCell configCell5:tableView indexPath:indexPath];
  353. cell.cellImagV1.hidden = NO;
  354. cell.cellImagV2.hidden = NO;
  355. cell.cellImagV3.hidden = NO;
  356. cell.cellImagV4.hidden = NO;
  357. cell.cellImagV5.hidden = NO;
  358. cell.cellImagV6.hidden = NO;
  359. cell.cellImagV7.hidden = NO;
  360. cell.cellImagV8.hidden = NO;
  361. cell.cellImagV9.hidden = NO;
  362. TopicListSubModel * subModel0 = model.Data[0];
  363. [cell.cellImagV1 sd_setImageWithURL:[NSURL URLWithString:subModel0.File] placeholderImage:IMG(@"img_placeHolderVertical")];
  364. TopicListSubModel * subModel1 = model.Data[1];
  365. [cell.cellImagV2 sd_setImageWithURL:[NSURL URLWithString:subModel1.File] placeholderImage:IMG(@"img_placeHolderVertical")];
  366. TopicListSubModel * subModel2 = model.Data[2];
  367. [cell.cellImagV3 sd_setImageWithURL:[NSURL URLWithString:subModel2.File] placeholderImage:IMG(@"img_placeHolderVertical")];
  368. TopicListSubModel * subModel3 = model.Data[3];
  369. [cell.cellImagV4 sd_setImageWithURL:[NSURL URLWithString:subModel3.File] placeholderImage:IMG(@"img_placeHolderVertical")];
  370. TopicListSubModel * subModel4 = model.Data[4];
  371. [cell.cellImagV5 sd_setImageWithURL:[NSURL URLWithString:subModel4.File] placeholderImage:IMG(@"img_placeHolderVertical")];
  372. TopicListSubModel * subModel5 = model.Data[5];
  373. [cell.cellImagV6 sd_setImageWithURL:[NSURL URLWithString:subModel5.File] placeholderImage:IMG(@"img_placeHolderVertical")];
  374. TopicListSubModel * subModel6 = model.Data[6];
  375. [cell.cellImagV7 sd_setImageWithURL:[NSURL URLWithString:subModel6.File] placeholderImage:IMG(@"img_placeHolderVertical")];
  376. TopicListSubModel * subModel7 = model.Data[7];
  377. [cell.cellImagV8 sd_setImageWithURL:[NSURL URLWithString:subModel7.File] placeholderImage:IMG(@"img_placeHolderVertical")];
  378. TopicListSubModel * subModel8 = model.Data[8];
  379. [cell.cellImagV9 sd_setImageWithURL:[NSURL URLWithString:subModel8.File] placeholderImage:IMG(@"img_placeHolderVertical")];
  380. }
  381. break;
  382. }
  383. [cell.cellIconV sd_setImageWithURL:[NSURL URLWithString:model.AvatarUrl] placeholderImage:kUserDefaultHeadImage];
  384. [cell.fileBtn setTitle:model.FolderResult.FolderName forState:UIControlStateNormal];
  385. [cell.fileBtn setAction:^{
  386. [weakSelf enterFileWithModel:model];
  387. }];
  388. cell.ClickUserBlock = ^{
  389. [weakSelf showUserInfo:model.UserId];
  390. };
  391. cell.cellTimeL.text = [model.CreatedDate substringWithRange:NSMakeRange(5, 11)];
  392. cell.celltitleL.attributedText = [self setTitleWithStr:model.Title];
  393. cell.cellContentL.attributedText = [self setTextWithStr:model.Content];
  394. cell.cellNameL.text = model.UserName;
  395. cell.cellReadNumL.text = [NSString stringWithFormat:@"阅读:%ld",(long)model.ReadCount];
  396. [cell.cellLikeBtn setAction:^{
  397. [weakSelf likeAction:model withBtn:cell.cellLikeBtn index:indexPath];
  398. }];
  399. if (model.CommentCount > 0) {
  400. [cell.cellPingBtn setTitle:[NSString stringWithFormat:@"%ld",(long)model.CommentCount] forState:UIControlStateNormal];
  401. }else{
  402. [cell.cellPingBtn setTitle:@"评论" forState:UIControlStateNormal];
  403. }
  404. if (model.PraiseCount > 0) {
  405. [cell.cellLikeBtn setTitle:[NSString stringWithFormat:@"%ld",(long)model.PraiseCount] forState:UIControlStateNormal];
  406. }else{
  407. [cell.cellLikeBtn setTitle:@"赞" forState:UIControlStateNormal];
  408. }
  409. if (model.IsPraise) {
  410. [cell.cellLikeBtn setTitleColor:UIColorHex(#009AFF) forState:UIControlStateNormal];
  411. [cell.cellLikeBtn setImage:[UIImage imageNamed:@"收藏_赞_select"] forState:UIControlStateNormal];
  412. }else{
  413. [cell.cellLikeBtn setTitleColor:UIColorHex(#999999) forState:UIControlStateNormal];
  414. [cell.cellLikeBtn setImage:[UIImage imageNamed:@"收藏_赞"] forState:UIControlStateNormal];
  415. }
  416. [cell.cellPingBtn setAction:^{
  417. [weakSelf CommentPush:model];
  418. }];
  419. [cell.cellSendBtn setAction:^{
  420. [weakSelf reSend:model];
  421. }];
  422. if (model.Title.length == 0) {
  423. cell.TitleConstant.constant = 0;
  424. }else{
  425. cell.TitleConstant.constant = 10.f;
  426. }
  427. if (model.Content.length == 0) {
  428. cell.subTitleContant.constant = 0.f;
  429. }else{
  430. cell.subTitleContant.constant = 7.5f;
  431. }
  432. cell.fileContant.constant = 0.f;
  433. return cell;
  434. }
  435. break;
  436. case TopiclistCellFile:
  437. {
  438. TDGroupInfoListCell * cell = [TDGroupInfoListCell configCell6:tableView indexPath:indexPath];
  439. [cell.cellIconV sd_setImageWithURL:[NSURL URLWithString:model.AvatarUrl] placeholderImage:kUserDefaultHeadImage];
  440. [cell.fileBtn setTitle:model.FolderResult.FolderName forState:UIControlStateNormal];
  441. [cell.fileBtn setAction:^{
  442. [weakSelf enterFileWithModel:model];
  443. }];
  444. [cell.ClickFileAction setAction:^{
  445. [weakSelf pushFileWithModel:model.Data.firstObject];
  446. }];
  447. cell.cellNameL.text = model.UserName;
  448. cell.cellTimeL.text = [model.CreatedDate substringWithRange:NSMakeRange(5, 11)];
  449. cell.celltitleL.attributedText = [self setTitleWithStr:model.Title];
  450. cell.cellContentL.attributedText = [self setTextWithStr:model.Content];
  451. [cell setDataWithCell6:model.Data.firstObject];
  452. cell.cellReadNumL.text = [NSString stringWithFormat:@"阅读:%ld",(long)model.ReadCount];
  453. [cell.cellLikeBtn setAction:^{
  454. [weakSelf likeAction:model withBtn:cell.cellLikeBtn index:indexPath];
  455. }];
  456. if (model.CommentCount > 0) {
  457. [cell.cellPingBtn setTitle:[NSString stringWithFormat:@"%ld",(long)model.CommentCount] forState:UIControlStateNormal];
  458. }else{
  459. [cell.cellPingBtn setTitle:@"评论" forState:UIControlStateNormal];
  460. }
  461. if (model.PraiseCount > 0) {
  462. [cell.cellLikeBtn setTitle:[NSString stringWithFormat:@"%ld",(long)model.PraiseCount] forState:UIControlStateNormal];
  463. }else{
  464. [cell.cellLikeBtn setTitle:@"赞" forState:UIControlStateNormal];
  465. }
  466. if (model.IsPraise) {
  467. [cell.cellLikeBtn setTitleColor:UIColorHex(#009AFF) forState:UIControlStateNormal];
  468. [cell.cellLikeBtn setImage:[UIImage imageNamed:@"收藏_赞_select"] forState:UIControlStateNormal];
  469. }else{
  470. [cell.cellLikeBtn setTitleColor:UIColorHex(#999999) forState:UIControlStateNormal];
  471. [cell.cellLikeBtn setImage:[UIImage imageNamed:@"收藏_赞"] forState:UIControlStateNormal];
  472. }
  473. [cell.cellPingBtn setAction:^{
  474. [weakSelf CommentPush:model];
  475. }];
  476. [cell.cellSendBtn setAction:^{
  477. [weakSelf reSend:model];
  478. }];
  479. if (model.Title.length == 0) {
  480. cell.TitleConstant.constant = 0;
  481. }else{
  482. cell.TitleConstant.constant = 10.f;
  483. }
  484. if (model.Content.length == 0) {
  485. cell.subTitleContant.constant = 0.f;
  486. }else{
  487. cell.subTitleContant.constant = 7.5f;
  488. }
  489. cell.ClickUserBlock = ^{
  490. [weakSelf showUserInfo:model.UserId];
  491. };
  492. return cell;
  493. }
  494. break;
  495. default:///TopiclistCellNone
  496. {
  497. TDGroupInfoListCell * cell = [TDGroupInfoListCell configCell0:tableView indexPath:indexPath];
  498. [cell.cellIconV sd_setImageWithURL:[NSURL URLWithString:model.AvatarUrl] placeholderImage:kUserDefaultHeadImage];
  499. [cell.fileBtn setTitle:model.FolderResult.FolderName forState:UIControlStateNormal];
  500. [cell.fileBtn setAction:^{
  501. [weakSelf enterFileWithModel:model];
  502. }];
  503. cell.cellNameL.text = model.UserName;
  504. cell.cellTimeL.text = [model.CreatedDate substringWithRange:NSMakeRange(5, 11)];
  505. cell.celltitleL.attributedText = [self setTitleWithStr:model.Title];
  506. cell.cellContentL.attributedText = [self setTextWithStr:model.Content];
  507. cell.cellReadNumL.text = [NSString stringWithFormat:@"阅读:%ld",(long)model.ReadCount];
  508. [cell.cellLikeBtn setAction:^{
  509. [weakSelf likeAction:model withBtn:cell.cellLikeBtn index:indexPath];
  510. }];
  511. if (model.CommentCount > 0) {
  512. [cell.cellPingBtn setTitle:[NSString stringWithFormat:@"%ld",(long)model.CommentCount] forState:UIControlStateNormal];
  513. }else{
  514. [cell.cellPingBtn setTitle:@"评论" forState:UIControlStateNormal];
  515. }
  516. if (model.PraiseCount > 0) {
  517. [cell.cellLikeBtn setTitle:[NSString stringWithFormat:@"%ld",(long)model.PraiseCount] forState:UIControlStateNormal];
  518. }else{
  519. [cell.cellLikeBtn setTitle:@"赞" forState:UIControlStateNormal];
  520. }
  521. if (model.IsPraise) {
  522. [cell.cellLikeBtn setTitleColor:UIColorHex(#009AFF) forState:UIControlStateNormal];
  523. [cell.cellLikeBtn setImage:[UIImage imageNamed:@"收藏_赞_select"] forState:UIControlStateNormal];
  524. }else{
  525. [cell.cellLikeBtn setTitleColor:UIColorHex(#999999) forState:UIControlStateNormal];
  526. [cell.cellLikeBtn setImage:[UIImage imageNamed:@"收藏_赞"] forState:UIControlStateNormal];
  527. }
  528. [cell.cellPingBtn setAction:^{
  529. [weakSelf CommentPush:model];
  530. }];
  531. [cell.cellSendBtn setAction:^{
  532. [weakSelf reSend:model];
  533. }];
  534. if (model.Title.length == 0) {
  535. cell.TitleConstant.constant = 0;
  536. }else{
  537. cell.TitleConstant.constant = 10.f;
  538. }
  539. if (model.Content.length == 0) {
  540. cell.subTitleContant.constant = 0.f;
  541. }else{
  542. cell.subTitleContant.constant = 7.5f;
  543. }
  544. cell.ClickUserBlock = ^{
  545. [weakSelf showUserInfo:model.UserId];
  546. };
  547. return cell;
  548. }
  549. break;
  550. }
  551. }
  552. - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
  553. [tableView deselectRowAtIndexPath:indexPath animated:YES];
  554. }
  555. - (void)enterFileWithModel:(TopicListItemModel *)model
  556. {
  557. if (model.UserId == [AppUserModel sharedAppUserModel].Id) {
  558. NoteBookVC *vc = [NoteBookVC initNoteBookVC];
  559. vc.listType = MyFavoriteListLevelTypeB;
  560. vc.FolderId = model.FolderResult.Id;
  561. vc.ParentId = model.FolderResult.Id;
  562. vc.myTitle = model.FolderResult.FolderName;
  563. vc.VisitUserId = model.UserId;
  564. [self.navigationController pushViewController:vc animated:YES];
  565. }else{
  566. OtherNoteBookVC *vc = [OtherNoteBookVC initOtherNoteBookVC];
  567. vc.listType = MyFavoriteListLevelTypeB;
  568. vc.FolderId = model.FolderResult.Id;
  569. vc.Author = model.UserName;
  570. vc.myTitle = model.FolderResult.FolderName;
  571. vc.VisitUserId = model.UserId;
  572. [self.navigationController pushViewController:vc animated:YES];
  573. }
  574. }
  575. - (void)showUserInfo:(NSInteger)userId
  576. {
  577. MailListDetailVC * vc = [MailListDetailVC initMailListDetailVC];
  578. vc.indexId = userId;
  579. [self.navigationController pushViewController:vc animated:YES];
  580. }
  581. #pragma mark - 点击评论
  582. - (void)likeAction:(TopicListItemModel *)model withBtn:(UIButton *)btn index:(NSIndexPath *)indexPath
  583. {
  584. WS(weakSelf);
  585. NSDictionary * paraDict = @{@"SourceId":@(model.Id),
  586. @"TypeValue":@(3),///3 笔记
  587. @"AnalyzeType":@(1)
  588. };
  589. btn.enabled = NO;
  590. [[HttpManager sharedHttpManager] POSTUrl:Host(API_APP_Analyze_Set) parameters:paraDict responseStyle:DATA success:^(id _Nonnull responseObject) {
  591. btn.enabled = YES;
  592. model.IsPraise = !model.IsPraise;
  593. model.PraiseCount = model.IsPraise ? (model.PraiseCount + 1) : (model.PraiseCount - 1);
  594. dispatch_async(dispatch_get_main_queue(), ^{
  595. [weakSelf.tableView reloadRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationNone];
  596. });
  597. } failure:^(NSError * _Nonnull error) {
  598. btn.enabled = YES;
  599. }];
  600. }
  601. - (void)CommentPush:(TopicListItemModel *)model
  602. {
  603. MyTDTopicDetailVC * vc = [MyTDTopicDetailVC initMyTDTopicDetailVC];
  604. vc.type = CollectModel_NewTopic;
  605. vc.deleteTopicBlock = ^{
  606. };
  607. vc.Id = model.Id;
  608. vc.isComment = YES;
  609. [self.navigationController pushViewController:vc animated:YES];
  610. }
  611. - (void)reSend:(TopicListItemModel *)model
  612. {
  613. FlowAttachmentsModel * topicModel = [[FlowAttachmentsModel alloc] init];
  614. topicModel.SoureTypeId = CollectModel_NewTopic;
  615. topicModel.Title = model.Title;
  616. topicModel.SoureId = model.Id;
  617. topicModel.Title = model.Title;
  618. topicModel.Author = model.UserName;
  619. self.sendModel = topicModel;
  620. [self.noteBookShareVC initNoteBookShareData];
  621. self.noteBookShareVC.view.hidden = !self.noteBookShareVC.view.hidden;
  622. }
  623. - (NoteBookShareVC *)noteBookShareVC{
  624. if (_noteBookShareVC == nil) {
  625. _noteBookShareVC = [NoteBookShareVC initNoteBookShareVC];
  626. [_noteBookShareVC.view setFrame:CGRectMake(0,0, SCREEN_WIDTH, SCREEN_HEIGHT)];
  627. [_noteBookShareVC.view setHidden:YES];
  628. _noteBookShareVC.delegate = self;
  629. }
  630. return _noteBookShareVC;
  631. }
  632. - (void)userSelectType:(NSString *)typeName WithIndexPath:(NSIndexPath *)indexPath
  633. {
  634. self.noteBookShareVC.view.hidden = !self.noteBookShareVC.view.hidden;
  635. if ([typeName isEqualToString:@"发给微信好友"]) {
  636. [self returnToWechatSession];
  637. }else if ([typeName isEqualToString:@"发到朋友圈"]){
  638. [self returnToWechatTimeLine];
  639. }else if ([typeName isEqualToString:@"发到微博"]){
  640. [self returnToSina];
  641. }else if ([typeName isEqualToString:@"发给QQ好友"]){
  642. [self returnToQQ];
  643. }else if ([typeName isEqualToString:@"发到消息"]){
  644. [self returnToMessage];
  645. }else if ([typeName isEqualToString:@"发到小组"]){
  646. [self returnToGroup];
  647. }else if ([typeName isEqualToString:@"发到笔记"]){
  648. [self returnToNote];
  649. }else if ([typeName isEqualToString:@"发到话题"]){
  650. [self returnToTopic];
  651. }else{
  652. }
  653. }
  654. - (void)shareWebPageToPlatformType:(UMSocialPlatformType)platformType title:(NSString *)title desc:(NSString *)desc url:(NSString *)url
  655. {
  656. //创建分享消息对象
  657. UMSocialMessageObject *messageObject = [UMSocialMessageObject messageObject];
  658. messageObject.title = title;
  659. //创建网页内容对象
  660. UMShareWebpageObject *shareObject = [UMShareWebpageObject shareObjectWithTitle:title descr:desc thumImage:IMG(@"logo_60")];
  661. //设置网页地址
  662. shareObject.webpageUrl = url;
  663. //分享消息对象设置分享内容对象
  664. messageObject.shareObject = shareObject;
  665. //调用分享接口
  666. [[UMSocialManager defaultManager] shareToPlatform:platformType messageObject:messageObject currentViewController:self completion:^(id data, NSError *error) {
  667. if (error) {
  668. NSLog(@"************Share fail with error %@*********",error);
  669. }else{
  670. NSLog(@"response data is %@",data);
  671. }
  672. }];
  673. }
  674. - (void)returnToWechatSession
  675. {
  676. [self shareWebPageToPlatformType:UMSocialPlatformType_WechatSession title:self.sendModel.Title desc:[NSString stringWithFormat:@"来自-%@",self.sendModel.Author] url:[self returnUrl]];
  677. }
  678. - (void)returnToWechatTimeLine
  679. {
  680. [self shareWebPageToPlatformType:UMSocialPlatformType_WechatTimeLine title:self.sendModel.Title desc:[NSString stringWithFormat:@"来自-%@",self.sendModel.Author] url:[self returnUrl]];
  681. }
  682. - (void)returnToSina
  683. {
  684. [self shareWebPageToPlatformType:UMSocialPlatformType_Sina title:self.sendModel.Title desc:[NSString stringWithFormat:@"来自-%@",self.sendModel.Author] url:[self returnUrl]];
  685. }
  686. - (void)returnToQQ
  687. {
  688. [self shareWebPageToPlatformType:UMSocialPlatformType_QQ title:self.sendModel.Title desc:[NSString stringWithFormat:@"来自-%@",self.sendModel.Author] url:[self returnUrl]];
  689. }
  690. - (NSString *)returnUrl
  691. {
  692. NSString * url = [NSString stringWithFormat:@"%@%ld",Host(@"/admin/mobile/noteDetailsWx?"),(long)self.sendModel.Id];
  693. return url;
  694. }
  695. #pragma mark - 分享功能
  696. - (void)returnToMessage
  697. {
  698. ShareListVC * vc = [ShareListVC initShareListVC];
  699. vc.sendModel = self.sendModel;
  700. vc.isReturn = YES;
  701. [self.navigationController pushViewController:vc animated:YES];
  702. }
  703. - (void)returnToGroup
  704. {
  705. MyTDGroupViewController * vc = [[MyTDGroupViewController alloc] init];
  706. vc.type = CollectModel_Group;
  707. vc.sendModel = self.sendModel;
  708. vc.isReturn = YES;
  709. [self.navigationController pushViewController:vc animated:YES];
  710. }
  711. - (void)returnToNote
  712. {
  713. MyTDTopicCreateVC * vc = [MyTDTopicCreateVC initMyTDTopicCreateVC];
  714. vc.type = CollectModel_NoteBook;
  715. vc.sendModel = self.sendModel;
  716. vc.isReturn = YES;
  717. [self.navigationController pushViewController:vc animated:YES];
  718. }
  719. - (void)returnToTopic
  720. {
  721. MyTDTopicCreateVC * vc = [MyTDTopicCreateVC initMyTDTopicCreateVC];
  722. vc.type = CollectModel_NewTopic;
  723. vc.sendModel = self.sendModel;
  724. vc.isReturn = YES;
  725. [self.navigationController pushViewController:vc animated:YES];
  726. }
  727. #pragma mark - 点击文件跳转
  728. - (void)pushFileWithModel:(TopicListSubModel *)model
  729. {
  730. WS(weakSelf);
  731. switch (model.Type) {
  732. case CollectModel_Aritle:
  733. {
  734. SHOWLOADING
  735. [[HttpManager sharedHttpManager] GETWithUrl:[NSString stringWithFormat:@"%@%ld",Article_Detail_Get,(long)model.Id] parameters:@{} success:^(id _Nonnull responseObject) {
  736. REMOVESHOW;
  737. Item *itemModel = [[Item alloc]initWithDictionary:responseObject error:nil];
  738. MyTDTopicDetailVC * vc = [MyTDTopicDetailVC initMyTDTopicDetailVC];
  739. vc.type = CollectModel_Aritle;
  740. vc.Id = itemModel.Id;
  741. [weakSelf.navigationController pushViewController:vc animated:YES];
  742. } failure:^(NSError * _Nonnull error) {
  743. SHOWERROR([ZYCTool handerResultData:error]);
  744. }];
  745. }
  746. break;
  747. case CollectModel_Toipc:
  748. {
  749. MyTDTopicDetailVC * vc = [MyTDTopicDetailVC initMyTDTopicDetailVC];
  750. vc.type = CollectModel_Toipc;
  751. vc.Id = model.Id;
  752. [self.navigationController pushViewController:vc animated:YES];
  753. }
  754. break;
  755. case CollectModel_NewTopic:
  756. {
  757. MyTDTopicDetailVC * vc = [MyTDTopicDetailVC initMyTDTopicDetailVC];
  758. vc.type = CollectModel_NewTopic;
  759. vc.Id = model.Id;
  760. [self.navigationController pushViewController:vc animated:YES];
  761. }
  762. break;
  763. case CollectModel_Collect:
  764. {
  765. }
  766. break;
  767. case CollectModel_NoteBook:
  768. {
  769. MyTDTopicDetailVC * vc = [MyTDTopicDetailVC initMyTDTopicDetailVC];
  770. vc.type = CollectModel_NoteBook;
  771. vc.Id = model.Id;
  772. [self.navigationController pushViewController:vc animated:YES];
  773. }
  774. break;
  775. case CollectModel_CollectFile:{
  776. if (model.SourceUserId == [AppUserModel sharedAppUserModel].Id) {
  777. MyFavoriteVC *vc = [MyFavoriteVC initMyFavoriteVC];
  778. vc.listType = model.Id == 0 ? MyFavoriteListLevelTypeA : MyFavoriteListLevelTypeB;
  779. vc.ParentId = 0;
  780. vc.FolderId = model.Id;
  781. vc.myTitle = model.Title;
  782. [self.navigationController pushViewController:vc animated:YES];
  783. }else{
  784. OtherFavoriteVC *vc = [OtherFavoriteVC initOtherFavoriteVC];
  785. vc.listType = model.Id == 0 ? MyFavoriteListLevelTypeA : MyFavoriteListLevelTypeB;
  786. vc.ParentId = 0;
  787. vc.FolderId = model.Id;
  788. vc.myTitle = model.Title;
  789. vc.VisitUserId = model.SourceUserId;
  790. [self.navigationController pushViewController:vc animated:YES];
  791. }
  792. }break;
  793. case CollectModel_NoteFile:{
  794. if (model.SourceUserId == [AppUserModel sharedAppUserModel].Id) {
  795. NoteBookVC *vc = [NoteBookVC initNoteBookVC];
  796. vc.listType = model.Id == 0 ? MyFavoriteListLevelTypeA : MyFavoriteListLevelTypeB;
  797. vc.ParentId = 0;
  798. vc.FolderId = model.Id;
  799. vc.myTitle = model.Title;
  800. vc.VisitUserId = 0;
  801. [self.navigationController pushViewController:vc animated:YES];
  802. }else{
  803. OtherNoteBookVC *vc = [OtherNoteBookVC initOtherNoteBookVC];
  804. vc.listType = model.Id == 0 ? MyFavoriteListLevelTypeA : MyFavoriteListLevelTypeB;
  805. vc.ParentId = 0;
  806. vc.FolderId = model.Id;
  807. vc.myTitle = model.Title;
  808. vc.VisitUserId = model.SourceUserId;
  809. [self.navigationController pushViewController:vc animated:YES];
  810. }
  811. }break;
  812. case CollectModel_Notice:
  813. {
  814. MyTDTopicDetailVC * vc = [MyTDTopicDetailVC initMyTDTopicDetailVC];
  815. vc.type = CollectModel_Notice;
  816. vc.Id = model.Id;
  817. [self.navigationController pushViewController:vc animated:YES];
  818. }
  819. break;
  820. case CollectModel_InterMail:
  821. {
  822. MyTDTopicDetailVC * vc = [MyTDTopicDetailVC initMyTDTopicDetailVC];
  823. vc.type = CollectModel_InterMail;
  824. vc.Id = model.Id;
  825. [self.navigationController pushViewController:vc animated:YES];
  826. }
  827. break;
  828. case CollectModel_Group:
  829. {
  830. TDGroupInfoListVC * vc = [TDGroupInfoListVC initTDGroupInfoListVC];
  831. vc.GroupId = model.Id;
  832. vc.titleStr = model.Title;
  833. [self.navigationController pushViewController:vc animated:YES];
  834. }
  835. break;
  836. case CollectModel_meetMian:
  837. {
  838. MyTDTopicDetailVC * vc = [MyTDTopicDetailVC initMyTDTopicDetailVC];
  839. vc.type = CollectModel_meetMian;
  840. vc.Id = model.Id;
  841. [self.navigationController pushViewController:vc animated:YES];
  842. }
  843. break;
  844. case CollectModel_meetDetail:
  845. {
  846. WorkFlowDetailsController * vc = [[WorkFlowDetailsController alloc] initWithId:model.Id];
  847. [self.navigationController pushViewController:vc animated:YES];
  848. }
  849. break;
  850. case CollectModel_work:
  851. {
  852. MyApprovalPageDetail * vc = [[MyApprovalPageDetail alloc]init];
  853. vc.pageType = Type_ONEC;
  854. vc.indexId = model.Id;
  855. vc.title = model.Title;
  856. vc.TodoId = model.Id;
  857. [self.navigationController pushViewController:vc animated:YES];
  858. }
  859. break;
  860. default:
  861. {
  862. DownFileViewController *vc = [[DownFileViewController alloc]init];
  863. FlowAttachmentsModel * fmodel = [[FlowAttachmentsModel alloc] init];
  864. fmodel.SoureId = model.Id;
  865. fmodel.Title = model.Title;
  866. fmodel.Url = model.File;
  867. vc.model = fmodel;
  868. [self.navigationController pushViewController:vc animated:YES];
  869. }
  870. break;
  871. }
  872. }
  873. - (void)pushSearchVC
  874. {
  875. MyTDTopicSearchVC * vc = [[MyTDTopicSearchVC alloc] init];
  876. vc.searchType = TDTopicSearch;
  877. [self.navigationController pushViewController:vc animated:YES];
  878. }
  879. - (NSAttributedString *)setTextWithStr:(NSString *)str
  880. {
  881. NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc] initWithString:str];
  882. [attributedString addAttribute:NSFontAttributeName value:[UIFont fontWithName:@"PingFang SC" size:16] range:NSMakeRange(0, str.length)];
  883. [attributedString addAttribute:NSForegroundColorAttributeName value:UIColorHex(#484848) range:NSMakeRange(0, str.length)];
  884. NSMutableParagraphStyle *paraStyle = [[NSMutableParagraphStyle alloc]init];
  885. paraStyle.alignment = NSTextAlignmentJustified;//两端对齐
  886. [paraStyle setLineSpacing:5];//行间距
  887. [attributedString addAttribute:NSParagraphStyleAttributeName value:paraStyle range:NSMakeRange(0, str.length)];
  888. [attributedString addAttribute:NSUnderlineStyleAttributeName value:[NSNumber numberWithInteger:NSUnderlineStyleNone] range:NSMakeRange(0, str.length)];
  889. return attributedString;
  890. }
  891. - (NSAttributedString *)setTitleWithStr:(NSString *)str
  892. {
  893. NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc] initWithString:str];
  894. [attributedString addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:18] range:NSMakeRange(0, str.length)];
  895. [attributedString addAttribute:NSForegroundColorAttributeName value:UIColorHex(0x0a0a0a) range:NSMakeRange(0, str.length)];
  896. NSMutableParagraphStyle *paraStyle = [[NSMutableParagraphStyle alloc]init];
  897. paraStyle.alignment = NSTextAlignmentJustified;//两端对齐
  898. [paraStyle setLineSpacing:5];//行间距
  899. [attributedString addAttribute:NSParagraphStyleAttributeName value:paraStyle range:NSMakeRange(0, str.length)];
  900. [attributedString addAttribute:NSUnderlineStyleAttributeName value:[NSNumber numberWithInteger:NSUnderlineStyleNone] range:NSMakeRange(0, str.length)];
  901. return attributedString;
  902. }
  903. #pragma mark - Load On Demand
  904. - (NSMutableArray *)dataArray
  905. {
  906. if (!_dataArray) {
  907. _dataArray = [NSMutableArray array];
  908. }
  909. return _dataArray;
  910. }
  911. - (MyTDGroupView *)SearchView
  912. {
  913. if (!_SearchView) {
  914. _SearchView = [[MyTDGroupView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 36)];
  915. }
  916. return _SearchView;
  917. }
  918. - (UIView *)groupView
  919. {
  920. if (!_groupView) {
  921. _groupView = [UIView new];
  922. }
  923. return _groupView;
  924. }
  925. @end