SourceGroupVC.m 45 KB

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