MyTDTopicSearchVC.m 42 KB

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