SourceGroupSearchVC.m 47 KB

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