CommonCollectVC.m 42 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003
  1. //
  2. // CommonCollectVC.m
  3. // smartRhino
  4. //
  5. // Created by niuzhen on 2020/4/29.
  6. // Copyright © 2020 tederen. All rights reserved.
  7. //
  8. #import "CommonCollectVC.h"
  9. #import "CommonListCell.h"
  10. #import "CommonBarCell.h"
  11. #import "CommonBarModel.h"
  12. #import "CommonWorkVC.h"
  13. #import "CommonToolVC.h"
  14. #import "MyFavoriteVC.h"
  15. #import "CommonNoteVC.h"
  16. #import "ChatMsgListCell.h"
  17. #import "ChatMsgCollectionCell.h"
  18. #import "MoveViewController.h"
  19. #import "NoteBookVC.h"
  20. #import "OtherFavoriteVC.h"
  21. #import "OtherNoteBookVC.h"
  22. #import "DownFileViewController.h"
  23. #import "WorkFlowDetailsController.h"
  24. #import "MyApprovalPageDetail.h"
  25. #import "CountDataVC.h"
  26. #import "CommomSearchVC.h"
  27. #import "NoteBookShareVC.h"
  28. #import "MyTDGroupViewController.h"
  29. #import "TDGroupInfoListVC.h"
  30. #import "MailListVC.h"
  31. #import "ShareListVC.h"
  32. #import "BookWCDetailVC.h"
  33. #import "BookListenVC.h"
  34. #import "BookTeacherDetailVC.h"
  35. #import "HomeSCDetailVC.h"
  36. #import "BookMingDetailVC.h"
  37. #import "BookPeriodicaDetailVC.h"
  38. #import "BookListDetailVC.h"
  39. @interface CommonCollectVC ()<UITableViewDelegate,UITableViewDataSource,NoteBookShareVCDelegate>
  40. @property (strong, nonatomic) UITableView *tableView;
  41. @property (strong, nonatomic) NSMutableArray *collectionDataSource;
  42. @property (strong, nonatomic) NSMutableArray *dataArray;
  43. @property (strong, nonatomic) NoteBookShareVC *noteBookShareVC;
  44. @property (strong, nonatomic) MyFavoriteSubModel *sendModel;
  45. @property (nonatomic,assign) NSInteger currentPage;
  46. @property (nonatomic,assign) NSInteger totalPage;
  47. @property (nonatomic,strong) NSData *fileData;
  48. @end
  49. @implementation CommonCollectVC
  50. #pragma mark -loay
  51. - (UITableView *)tableView
  52. {
  53. if (!_tableView) {
  54. _tableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStylePlain];
  55. _tableView.delegate = self;
  56. _tableView.dataSource = self;
  57. _tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
  58. }
  59. return _tableView;
  60. }
  61. - (void)viewWillAppear:(BOOL)animated
  62. {
  63. [super viewWillAppear:animated];
  64. [self getDataList];
  65. }
  66. - (void)viewDidLoad {
  67. [super viewDidLoad];
  68. [self.view addSubview:self.tableView];
  69. [self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
  70. make.edges.mas_offset(UIEdgeInsetsZero);
  71. }];
  72. [[UtilsTools getWindow] addSubview:self.noteBookShareVC.view];
  73. [[UtilsTools getWindow] bringSubviewToFront:self.noteBookShareVC.view];
  74. }
  75. - (void)getDataList {
  76. WS(weakSelf);
  77. SHOWLOADING
  78. [[HttpManager sharedHttpManager] POSTUrl:Host(API_Collection_List) parameters:@{@"FolderId":@(0),@"Page":@(1),@"PerPage":@(99999999),@"VisitUserId":@(0)} responseStyle:JOSN success:^(id _Nonnull responseObject) {
  79. REMOVESHOW
  80. [weakSelf.dataArray removeAllObjects];
  81. NSLog(@"%@",responseObject);
  82. MyFavoriteModel *listModel = [[MyFavoriteModel alloc] initWithDictionary:responseObject error:nil];
  83. weakSelf.totalPage = listModel.Total;
  84. [weakSelf.dataArray addObjectsFromArray:listModel.Items];
  85. for (MyFavoriteSubModel *model in weakSelf.dataArray) {
  86. if (model.CollectionType == CollectModel_Text) {
  87. model.CollectionType = CollectModel_Aritle;
  88. }
  89. }
  90. dispatch_async(dispatch_get_main_queue(), ^{
  91. [weakSelf.tableView reloadData];
  92. });
  93. } failure:^(NSError * _Nonnull error) {
  94. REMOVESHOW
  95. }];
  96. }
  97. - (BOOL)hidesBottomBarWhenPushed{
  98. return NO;
  99. }
  100. #pragma mark - UITableViewDelegate
  101. - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
  102. return 1;
  103. }
  104. - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
  105. return self.dataArray.count;
  106. }
  107. - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
  108. return UITableViewAutomaticDimension;
  109. }
  110. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
  111. MyFavoriteSubModel * model = [self.dataArray objectAtIndex:indexPath.row];
  112. if (model.CollectionType == CollectModel_TopicBooK) {
  113. CommonListCell *cell = [CommonListCell configCell2:tableView indexPath:indexPath];
  114. [cell setCellTopicBookData:model];
  115. WS(weakSelf);
  116. [cell.desBtn setAction:^{
  117. MyFavoriteVC * vc = [MyFavoriteVC initMyFavoriteVC];
  118. vc.listType = model.FolderId == 0 ? MyFavoriteListLevelTypeA : MyFavoriteListLevelTypeB;
  119. vc.FolderId = model.FolderId;
  120. vc.myTitle = model.FolderName;
  121. [weakSelf.navigationController pushViewController:vc animated:YES];
  122. }];
  123. return cell;
  124. }else{
  125. switch (model.CollectionType) {
  126. case CollectModel_Teacher:
  127. {
  128. CommonListCell *cell = [CommonListCell configCell2:tableView indexPath:indexPath];
  129. [cell setCellNoAuthorData:model];
  130. WS(weakSelf);
  131. [cell.desBtn setAction:^{
  132. MyFavoriteVC * vc = [MyFavoriteVC initMyFavoriteVC];
  133. vc.listType = model.FolderId == 0 ? MyFavoriteListLevelTypeA : MyFavoriteListLevelTypeB;
  134. vc.FolderId = model.FolderId;
  135. vc.myTitle = model.FolderName;
  136. [weakSelf.navigationController pushViewController:vc animated:YES];
  137. }];
  138. return cell;
  139. }
  140. break;
  141. case CollectModel_Organization:
  142. {
  143. CommonListCell *cell = [CommonListCell configCell2:tableView indexPath:indexPath];
  144. [cell setCellNoAuthorData:model];
  145. WS(weakSelf);
  146. [cell.desBtn setAction:^{
  147. MyFavoriteVC * vc = [MyFavoriteVC initMyFavoriteVC];
  148. vc.listType = model.FolderId == 0 ? MyFavoriteListLevelTypeA : MyFavoriteListLevelTypeB;
  149. vc.FolderId = model.FolderId;
  150. vc.myTitle = model.FolderName;
  151. [weakSelf.navigationController pushViewController:vc animated:YES];
  152. }];
  153. return cell;
  154. }
  155. break;
  156. default:
  157. {
  158. if (model.CollectionType != CollectModel_Toipc && model.Data.Author.length == 0) {
  159. CommonListCell *cell = [CommonListCell configCell2:tableView indexPath:indexPath];
  160. [cell setCellNoAuthorData:model];
  161. WS(weakSelf);
  162. [cell.desBtn setAction:^{
  163. MyFavoriteVC * vc = [MyFavoriteVC initMyFavoriteVC];
  164. vc.listType = model.FolderId == 0 ? MyFavoriteListLevelTypeA : MyFavoriteListLevelTypeB;
  165. vc.FolderId = model.FolderId;
  166. vc.myTitle = model.FolderName;
  167. [weakSelf.navigationController pushViewController:vc animated:YES];
  168. }];
  169. return cell;
  170. }else{
  171. CommonListCell *cell = [CommonListCell configCell1:tableView indexPath:indexPath];
  172. [cell setCell1Data:model];
  173. WS(weakSelf);
  174. [cell.desBtn setAction:^{
  175. MyFavoriteVC * vc = [MyFavoriteVC initMyFavoriteVC];
  176. vc.listType = model.FolderId == 0 ? MyFavoriteListLevelTypeA : MyFavoriteListLevelTypeB;
  177. vc.FolderId = model.FolderId;
  178. vc.myTitle = model.FolderName;
  179. [weakSelf.navigationController pushViewController:vc animated:YES];
  180. }];
  181. if (model.CollectionType == CollectModel_Toipc) {
  182. [cell.comeBtn setAction:^{
  183. TDGroupInfoListVC * vc = [TDGroupInfoListVC initTDGroupInfoListVC];
  184. vc.GroupId = model.Data.GroupId;
  185. vc.titleStr = model.Data.GroupName;
  186. [weakSelf.navigationController pushViewController:vc animated:YES];
  187. }];
  188. }
  189. return cell;
  190. }
  191. }
  192. break;
  193. }
  194. }
  195. }
  196. - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
  197. [tableView deselectRowAtIndexPath:indexPath animated:YES];
  198. MyFavoriteSubModel * model = [self.dataArray objectAtIndex:indexPath.row];
  199. switch (model.CollectionType) {
  200. case CollectModel_Aritle:{
  201. MyTDTopicDetailVC * vc = [MyTDTopicDetailVC initMyTDTopicDetailVC];
  202. vc.type = CollectModel_Aritle;
  203. vc.Id = model.CollectionDataId;
  204. vc.hidesBottomBarWhenPushed = YES;
  205. [self.navigationController pushViewController:vc animated:YES];
  206. }break;
  207. case CollectModel_MediaAritle:{
  208. MyTDTopicDetailVC * vc = [MyTDTopicDetailVC initMyTDTopicDetailVC];
  209. vc.type = CollectModel_MediaAritle;
  210. vc.Id = model.CollectionDataId;
  211. vc.hidesBottomBarWhenPushed = YES;
  212. [self.navigationController pushViewController:vc animated:YES];
  213. }break;
  214. case CollectModel_Toipc:
  215. {
  216. MyTDTopicDetailVC * vc = [MyTDTopicDetailVC initMyTDTopicDetailVC];
  217. vc.type = CollectModel_Toipc;
  218. vc.Id = model.CollectionDataId;
  219. vc.hidesBottomBarWhenPushed = YES;
  220. [self.navigationController pushViewController:vc animated:YES];
  221. }break;
  222. case CollectModel_NewTopic:
  223. {
  224. MyTDTopicDetailVC * vc = [MyTDTopicDetailVC initMyTDTopicDetailVC];
  225. vc.type = CollectModel_NewTopic;
  226. vc.Id = model.CollectionDataId;
  227. vc.hidesBottomBarWhenPushed = YES;
  228. [self.navigationController pushViewController:vc animated:YES];
  229. }break;
  230. case CollectModel_Collect:{
  231. }break;
  232. case CollectModel_NoteBook:{
  233. MyTDTopicDetailVC * vc = [MyTDTopicDetailVC initMyTDTopicDetailVC];
  234. vc.type = CollectModel_NoteBook;
  235. vc.Id = model.CollectionDataId;
  236. vc.isNoteBook = YES;
  237. vc.hidesBottomBarWhenPushed = YES;
  238. [self.navigationController pushViewController:vc animated:YES];
  239. }break;
  240. case CollectModel_CollectFile:{
  241. if (model.SourceUserId == [AppUserModel sharedAppUserModel].Id || model.SourceUserId == 0) {
  242. MyFavoriteVC * vc = [MyFavoriteVC initMyFavoriteVC];
  243. vc.listType = model.CollectionDataId == 0 ? MyFavoriteListLevelTypeA : MyFavoriteListLevelTypeB;
  244. vc.FolderId = model.CollectionDataId;
  245. vc.myTitle = model.Title;
  246. vc.hidesBottomBarWhenPushed = YES;
  247. [self.navigationController pushViewController:vc animated:YES];
  248. }else{
  249. OtherFavoriteVC * vc = [OtherFavoriteVC initOtherFavoriteVC];
  250. vc.listType = model.CollectionDataId == 0 ? MyFavoriteListLevelTypeA : MyFavoriteListLevelTypeB;
  251. vc.FolderId = model.CollectionDataId;
  252. vc.CollectionDataId = model.CollectionDataId;
  253. vc.CollectionType = model.CollectionType;
  254. vc.Author = model.Data.Author;
  255. vc.myTitle = model.Title;
  256. vc.VisitUserId = model.SourceUserId;
  257. vc.hidesBottomBarWhenPushed = YES;
  258. [self.navigationController pushViewController:vc animated:YES];
  259. }
  260. }break;
  261. case CollectModel_NoteFile: {
  262. if (model.SourceUserId == [AppUserModel sharedAppUserModel].Id || model.SourceUserId == 0) {
  263. NoteBookVC * vc = [NoteBookVC initNoteBookVC];
  264. vc.listType = model.CollectionDataId == 0 ? MyFavoriteListLevelTypeA : MyFavoriteListLevelTypeB;
  265. vc.FolderId = model.CollectionDataId;
  266. vc.myTitle = model.Title;
  267. vc.hidesBottomBarWhenPushed = YES;
  268. [self.navigationController pushViewController:vc animated:YES];
  269. }else{
  270. OtherNoteBookVC * vc = [OtherNoteBookVC initOtherNoteBookVC];
  271. vc.listType = model.CollectionDataId == 0 ? MyFavoriteListLevelTypeA : MyFavoriteListLevelTypeB;
  272. vc.FolderId = model.CollectionDataId;
  273. vc.CollectionDataId = model.CollectionDataId;
  274. vc.CollectionType = model.CollectionType;
  275. vc.Author = model.Data.Author;
  276. vc.myTitle = model.Title;
  277. vc.VisitUserId = model.SourceUserId;
  278. vc.hidesBottomBarWhenPushed = YES;
  279. [self.navigationController pushViewController:vc animated:YES];
  280. }
  281. }break;
  282. case CollectModel_TopicBooK:{
  283. if (model.SourceUserId == [AppUserModel sharedAppUserModel].Id || model.SourceUserId == 0) {
  284. NoteBookVC * vc = [NoteBookVC initNoteBookVC];
  285. vc.listType = MyFavoriteListLevelTypeA;
  286. vc.FolderId = model.CollectionDataId;
  287. vc.TypeValue = 1;
  288. vc.myTitle = model.Title;
  289. vc.hidesBottomBarWhenPushed = YES;
  290. [self.navigationController pushViewController:vc animated:YES];
  291. }else{
  292. OtherNoteBookVC * vc = [OtherNoteBookVC initOtherNoteBookVC];
  293. vc.listType = MyFavoriteListLevelTypeA ;
  294. vc.FolderId = model.CollectionDataId;
  295. vc.CollectionDataId = model.CollectionDataId;
  296. vc.CollectionType = model.CollectionType;
  297. vc.Author = model.Data.Author;
  298. vc.TypeValue = 1;
  299. vc.myTitle = model.Title;
  300. vc.VisitUserId = model.SourceUserId;
  301. vc.hidesBottomBarWhenPushed = YES;
  302. [self.navigationController pushViewController:vc animated:YES];
  303. }
  304. }break;
  305. case CollectModel_TopicSubBooK:{
  306. if (model.SourceUserId == [AppUserModel sharedAppUserModel].Id || model.SourceUserId == 0) {
  307. NoteBookVC * vc = [NoteBookVC initNoteBookVC];
  308. vc.listType = MyFavoriteListLevelTypeB;
  309. vc.FolderId = model.CollectionDataId;
  310. vc.TypeValue = 1;
  311. vc.myTitle = model.Title;
  312. vc.hidesBottomBarWhenPushed = YES;
  313. [self.navigationController pushViewController:vc animated:YES];
  314. }else{
  315. OtherNoteBookVC * vc = [OtherNoteBookVC initOtherNoteBookVC];
  316. vc.listType = MyFavoriteListLevelTypeB;
  317. vc.FolderId = model.CollectionDataId;
  318. vc.CollectionDataId = model.CollectionDataId;
  319. vc.CollectionType = model.CollectionType;
  320. vc.Author = model.Data.Author;
  321. vc.TypeValue = 1;
  322. vc.myTitle = model.Title;
  323. vc.VisitUserId = model.SourceUserId;
  324. vc.hidesBottomBarWhenPushed = YES;
  325. [self.navigationController pushViewController:vc animated:YES];
  326. }
  327. }break;
  328. case CollectModel_Notice:{
  329. MyTDTopicDetailVC * vc = [MyTDTopicDetailVC initMyTDTopicDetailVC];
  330. vc.type = CollectModel_Notice;
  331. vc.Id = model.CollectionDataId;
  332. vc.hidesBottomBarWhenPushed = YES;
  333. [self.navigationController pushViewController:vc animated:YES];
  334. }break;
  335. case CollectModel_InterMail:{
  336. MyTDTopicDetailVC * vc = [MyTDTopicDetailVC initMyTDTopicDetailVC];
  337. vc.type = CollectModel_InterMail;
  338. vc.Id = model.CollectionDataId;
  339. vc.hidesBottomBarWhenPushed = YES;
  340. [self.navigationController pushViewController:vc animated:YES];
  341. }break;
  342. case CollectModel_file:{
  343. FlowAttachmentsModel *wMdoel = [[FlowAttachmentsModel alloc]init];
  344. wMdoel.Url = model.Data.File;
  345. wMdoel.MinUrl = model.Data.File;
  346. wMdoel.Title = model.Data.FileName;
  347. wMdoel.SoureId = model.Data.Id;
  348. wMdoel.SoureTypeId = CollectModel_file;
  349. wMdoel.Size = model.Data.FileSize;
  350. DownFileViewController *downFileViewController = [[DownFileViewController alloc]init];
  351. downFileViewController.model = wMdoel;
  352. downFileViewController.hidesBottomBarWhenPushed = YES;
  353. [self.navigationController pushViewController:downFileViewController animated:YES];
  354. }break;
  355. case CollectModel_meetDetail:
  356. {
  357. WorkFlowDetailsController * vc = [[WorkFlowDetailsController alloc] initWithId:model.CollectionDataId];
  358. vc.hidesBottomBarWhenPushed = YES;
  359. [self.navigationController pushViewController:vc animated:YES];
  360. }
  361. break;
  362. case CollectModel_work:
  363. {
  364. MyApprovalPageDetail * vc = [[MyApprovalPageDetail alloc]init];
  365. vc.pageType = Type_ONEC;
  366. vc.indexId = model.CollectionDataId;
  367. vc.title = model.Data.Title;
  368. vc.TodoId = model.CollectionDataId;
  369. vc.hidesBottomBarWhenPushed = YES;
  370. [self.navigationController pushViewController:vc animated:YES];
  371. }
  372. break;
  373. case CollectModel_StoreSound:
  374. {
  375. BookListenVC * vc = [BookListenVC initBookListenVC];
  376. vc.Id = model.CollectionDataId;
  377. vc.MediaType = MediaMusicType;
  378. vc.hidesBottomBarWhenPushed = YES;
  379. [self.navigationController pushViewController:vc animated:YES];
  380. }
  381. break;
  382. case CollectModel_StoreVideo:
  383. {
  384. BookWCDetailVC * vc = [BookWCDetailVC initBookWCDetailVC];
  385. vc.Id = model.CollectionDataId;
  386. vc.hidesBottomBarWhenPushed = YES;
  387. [self.navigationController pushViewController:vc animated:YES];
  388. }
  389. break;
  390. case CollectModel_Teacher:
  391. {
  392. BookTeacherDetailVC * vc = [BookTeacherDetailVC initBookTeacherDetailVC];
  393. vc.Id = model.CollectionDataId;
  394. vc.hidesBottomBarWhenPushed = YES;
  395. [self.navigationController pushViewController:vc animated:YES];
  396. }
  397. break;
  398. case CollectModel_Organization:
  399. {
  400. HomeSCDetailVC * vc = [[HomeSCDetailVC alloc] init];
  401. vc.Id = model.CollectionDataId;
  402. vc.hidesBottomBarWhenPushed = YES;
  403. vc.hidesBottomBarWhenPushed = YES;
  404. [self.navigationController pushViewController:vc animated:YES];
  405. }
  406. break;
  407. case CollectModel_meetMian:{
  408. MyTDTopicDetailVC * vc = [MyTDTopicDetailVC initMyTDTopicDetailVC];
  409. vc.Id = model.CollectionDataId;
  410. vc.type = CollectModel_meetMian;
  411. vc.hidesBottomBarWhenPushed = YES;
  412. [self.navigationController pushViewController:vc animated:YES];
  413. }break;
  414. case CollectModel_financeCount:{
  415. CountDataVC *vc = [CountDataVC initCountDataVC];
  416. vc.index = 0;
  417. vc.titleStr = @"财务统计";
  418. vc.hidesBottomBarWhenPushed = YES;
  419. [self.navigationController pushViewController:vc animated:YES];
  420. }break;
  421. case CollectModel_affairsCount:{
  422. CountDataVC *vc = [CountDataVC initCountDataVC];
  423. vc.index = 1;
  424. vc.titleStr = @"人事统计";
  425. vc.hidesBottomBarWhenPushed = YES;
  426. [self.navigationController pushViewController:vc animated:YES];
  427. }break;
  428. case CollectModel_publishCount:{
  429. CountDataVC *vc = [CountDataVC initCountDataVC];
  430. vc.index = 2;
  431. vc.titleStr = @"出版统计";
  432. vc.hidesBottomBarWhenPushed = YES;
  433. [self.navigationController pushViewController:vc animated:YES];
  434. }break;
  435. case CollectModel_StoreBook:{
  436. BookListDetailVC * vc = [BookListDetailVC initBookListDetailVC];
  437. vc.Id = model.CollectionDataId;
  438. vc.hidesBottomBarWhenPushed = YES;
  439. vc.hidesBottomBarWhenPushed = YES;
  440. [self.navigationController pushViewController:vc animated:YES];
  441. }break;
  442. case CollectModel_StoreMing:
  443. {
  444. BookMingDetailVC * vc = [BookMingDetailVC initBookMingDetailVC];
  445. vc.gzId = model.CollectionDataId;
  446. vc.type = model.CollectionType;
  447. vc.titleStr = model.Data.Title;
  448. vc.hidesBottomBarWhenPushed = YES;
  449. vc.hidesBottomBarWhenPushed = YES;
  450. [self.navigationController pushViewController:vc animated:YES];
  451. }break;
  452. case CollectModel_StoreQiKan:
  453. {
  454. BookPeriodicaDetailVC * vc = [BookPeriodicaDetailVC initBookPeriodicaDetailVC];
  455. vc.Id = model.CollectionDataId;
  456. vc.titleStr = model.Title;
  457. vc.hidesBottomBarWhenPushed = YES;
  458. vc.hidesBottomBarWhenPushed = YES;
  459. [self.navigationController pushViewController:vc animated:YES];
  460. }break;
  461. case CollectModel_StoreGongzh:
  462. {
  463. BookMingDetailVC * vc = [BookMingDetailVC initBookMingDetailVC];
  464. vc.gzId = model.CollectionDataId;
  465. vc.type = model.CollectionType;
  466. vc.titleStr = model.Data.Title;
  467. vc.hidesBottomBarWhenPushed = YES;
  468. vc.hidesBottomBarWhenPushed = YES;
  469. [self.navigationController pushViewController:vc animated:YES];
  470. }break;
  471. default:
  472. {
  473. MyTDTopicDetailVC * vc = [MyTDTopicDetailVC initMyTDTopicDetailVC];
  474. vc.Id = model.CollectionDataId;
  475. vc.type = CollectModel_Toipc;
  476. vc.hidesBottomBarWhenPushed = YES;
  477. [self.navigationController pushViewController:vc animated:YES];
  478. }
  479. break;
  480. }
  481. }
  482. -(NSMutableArray *)dataArray{
  483. if(!_dataArray){
  484. _dataArray = [[NSMutableArray alloc] init];
  485. }
  486. return _dataArray;
  487. }
  488. #pragma Mark 左滑按钮 iOS8以上
  489. - (nullable UISwipeActionsConfiguration *)tableView:(UITableView *)tableView trailingSwipeActionsConfigurationForRowAtIndexPath:(NSIndexPath *)indexPath API_AVAILABLE(ios(11.0)) API_UNAVAILABLE(tvos){
  490. WEAKSELF
  491. MyFavoriteSubModel * model = [self.dataArray objectAtIndex:indexPath.row];
  492. UIContextualAction *action1 = [UIContextualAction contextualActionWithStyle:UIContextualActionStyleNormal title:@"转发" handler:^(UIContextualAction * _Nonnull action, __kindof UIView * _Nonnull sourceView, void (^ _Nonnull completionHandler)(BOOL)) {
  493. [tableView setEditing:NO animated:YES];
  494. weakSelf.sendModel = model;
  495. if (model.CollectionType == CollectModel_StoreSound || weakSelf.sendModel.CollectionType == CollectModel_StoreVideo) {
  496. weakSelf.sendModel.Data.MinFile = weakSelf.sendModel.Data.ArticleImgUrl.firstObject;
  497. weakSelf.sendModel.Data.File = weakSelf.sendModel.Data.ArticleImgUrl.firstObject;
  498. }
  499. [weakSelf shareHander];
  500. }];
  501. action1.backgroundColor = UIColorHex(#FF923A);
  502. UIContextualAction *action2 = [UIContextualAction contextualActionWithStyle:UIContextualActionStyleNormal title:model.IsTop ? @"取消置顶" :@"置顶" handler:^(UIContextualAction * _Nonnull action, __kindof UIView * _Nonnull sourceView, void (^ _Nonnull completionHandler)(BOOL)) {
  503. [weakSelf topFind:model];
  504. }];
  505. action2.backgroundColor = UIColorHex(#9BA9CB);
  506. UIContextualAction *action3 = [UIContextualAction contextualActionWithStyle:UIContextualActionStyleNormal title:@"移动" handler:^(UIContextualAction * _Nonnull action, __kindof UIView * _Nonnull sourceView, void (^ _Nonnull completionHandler)(BOOL)) {
  507. [weakSelf launchMoveVC:@[@(model.Id)].mutableCopy];
  508. completionHandler(YES);
  509. }];
  510. action3.backgroundColor = UIColorHex(#589AF1);
  511. UIContextualAction *action4 = [UIContextualAction contextualActionWithStyle:UIContextualActionStyleDestructive title:@"删除" handler:^(UIContextualAction * _Nonnull action, __kindof UIView * _Nonnull sourceView, void (^ _Nonnull completionHandler)(BOOL)) {
  512. [tableView setEditing:NO animated:YES];
  513. UIAlertController *alertVC = [UIAlertController alertControllerWithTitle:nil message:@"确认删除" preferredStyle:UIAlertControllerStyleAlert];
  514. UIAlertAction *ok = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) {
  515. [weakSelf.tableView reloadData];
  516. }];
  517. [ok setValue:k9 forKey:@"_titleTextColor"];
  518. UIAlertAction *noOk = [UIAlertAction actionWithTitle:@"确认" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
  519. [weakSelf deleteFind:@[model].mutableCopy indexPath:indexPath];
  520. }];
  521. [alertVC addAction:ok];
  522. [alertVC addAction:noOk];
  523. completionHandler(YES);
  524. [weakSelf presentViewController:alertVC animated:YES completion:nil];
  525. }];
  526. action4.backgroundColor = UIColorHex(#F64A33);
  527. UISwipeActionsConfiguration *actions = [UISwipeActionsConfiguration configurationWithActions:@[action4,action3,action2,action1]];
  528. actions.performsFirstActionWithFullSwipe = NO;
  529. return actions;
  530. }
  531. - (void)topFind:(MyFavoriteSubModel*)findModel{
  532. WEAKSELF
  533. [[HttpManager sharedHttpManager] PUTUrl:[NSString stringWithFormat:@"%@%@%ld",BaseUrl,API_Find_Top,(long)findModel.Id] parameters:@{} success:^(id _Nonnull responseObject) {
  534. [weakSelf getDataList];
  535. } failure:^(NSError * _Nonnull error) {
  536. SHOWERROR([ZYCTool handerResultData:error]);
  537. }];
  538. }
  539. - (void)deleteFind:(NSMutableArray<MyFavoriteSubModel *>*)findModelArray indexPath:(NSIndexPath *)indexPath{
  540. NSMutableArray *MiddleIds = [NSMutableArray array];
  541. for (MyFavoriteSubModel *model in findModelArray) {
  542. [MiddleIds addObject:@(model.Id)];
  543. }
  544. NSMutableDictionary *dic = [[NSMutableDictionary alloc]init];
  545. [dic setValue:MiddleIds forKey:@"MiddleIds"];
  546. [dic setValue:@(3) forKey:@"FolderType"];
  547. WS(weakSelf);
  548. [[HttpManager sharedHttpManager] POSTUrl:Host(API_Find_DeleteRecord) parameters:dic responseStyle:DATA success:^(id _Nonnull responseObject) {
  549. [weakSelf.dataArray removeObjectAtIndex:indexPath.row];
  550. dispatch_async(dispatch_get_main_queue(), ^{
  551. [weakSelf.tableView reloadData];
  552. });
  553. } failure:^(NSError * _Nonnull error) {
  554. SHOWERROR([ZYCTool handerResultData:error]);
  555. }];
  556. }
  557. - (void)launchMoveVC:(NSMutableArray<NSNumber*>*)selectIDArray{
  558. MoveViewController * vc = [MoveViewController initMoveViewController];
  559. vc.TypeId = CreateCollectionType;
  560. vc.collectType = CollectHanderType_Move;
  561. vc.CollectionType = CollectModel_Collect;
  562. vc.ParentId = 0;
  563. vc.FolderIds = selectIDArray;
  564. vc.titleStr = @"移动";
  565. vc.hidesBottomBarWhenPushed = YES;
  566. [self.navigationController pushViewController:vc animated:YES];
  567. }
  568. #pragma mark - 转发
  569. - (void)shareHander{
  570. [self.noteBookShareVC initNoteBookShareData];
  571. self.noteBookShareVC.view.hidden = !self.noteBookShareVC.view.hidden;
  572. }
  573. - (NoteBookShareVC *)noteBookShareVC{
  574. if (_noteBookShareVC == nil) {
  575. _noteBookShareVC = [NoteBookShareVC initNoteBookShareVC];
  576. [_noteBookShareVC.view setFrame:CGRectMake(0,0, SCREEN_WIDTH, SCREEN_HEIGHT)];
  577. [_noteBookShareVC.view setHidden:YES];
  578. _noteBookShareVC.delegate = self;
  579. }
  580. return _noteBookShareVC;
  581. }
  582. -(void)userSelectType:(NSString *)typeName WithIndexPath:(NSIndexPath *)indexPath{
  583. self.noteBookShareVC.view.hidden = !self.noteBookShareVC.view.hidden;
  584. if ([typeName isEqualToString:@"发给微信好友"]) {
  585. [self returnToWechatSession];
  586. }else if ([typeName isEqualToString:@"发到朋友圈"]){
  587. [self returnToWechatTimeLine];
  588. }else if ([typeName isEqualToString:@"发到微博"]){
  589. [self returnToSina];
  590. }else if ([typeName isEqualToString:@"发给QQ好友"]){
  591. [self returnToQQ];
  592. }else if ([typeName isEqualToString:@"发到消息"]){
  593. [self returnToMessage];
  594. }else if ([typeName isEqualToString:@"发到小组"]){
  595. [self returnToGroup];
  596. }else if ([typeName isEqualToString:@"发到笔记"]){
  597. [self returnToNote];
  598. }else if ([typeName isEqualToString:@"发到话题"]){
  599. [self returnToTopic];
  600. }else{
  601. }
  602. }
  603. - (void)shareWebPageToPlatformType:(UMSocialPlatformType)platformType
  604. {
  605. NSString * url = [self.sendModel.Data.File stringByRemovingPercentEncoding];
  606. UMSocialMessageObject *messageObject = [UMSocialMessageObject messageObject];
  607. messageObject.title = self.sendModel.Title;
  608. //创建文件内容对象
  609. UMShareFileObject * fileObject = [UMShareFileObject shareObjectWithTitle:self.sendModel.Title descr:@"" thumImage:[UIImage imageNamed:[ZYCTool getFileNameImage:self.sendModel.Title]]];
  610. fileObject.fileData = [NSData dataWithContentsOfURL:[NSURL URLWithString:url]];
  611. fileObject.fileExtension = [self.sendModel.Title pathExtension];
  612. //分享消息对象设置分享内容对象
  613. messageObject.shareObject = fileObject;
  614. //调用分享接口
  615. [[UMSocialManager defaultManager] shareToPlatform:platformType messageObject:messageObject currentViewController:self completion:^(id data, NSError *error) {
  616. if (error) {
  617. SHOWERROR([ZYCTool handerResultData:error]);
  618. NSLog(@"************Share fail with error %@*********",error);
  619. }else{
  620. NSLog(@"response data is %@",data);
  621. }
  622. }];
  623. }
  624. - (void)shareWebPageToPlatformType:(UMSocialPlatformType)platformType title:(NSString *)title desc:(NSString *)desc url:(NSString *)url image:(NSString *)image
  625. {
  626. //创建分享消息对象
  627. UMSocialMessageObject *messageObject = [UMSocialMessageObject messageObject];
  628. messageObject.title = title;
  629. //创建网页内容对象
  630. UMShareWebpageObject *shareObject = [UMShareWebpageObject shareObjectWithTitle:title descr:desc thumImage:IMG(image)];
  631. //设置网页地址
  632. shareObject.webpageUrl = url;
  633. //分享消息对象设置分享内容对象
  634. messageObject.shareObject = shareObject;
  635. //调用分享接口
  636. [[UMSocialManager defaultManager] shareToPlatform:platformType messageObject:messageObject currentViewController:self completion:^(id data, NSError *error) {
  637. if (error) {
  638. NSLog(@"************Share fail with error %@*********",error);
  639. }else{
  640. NSLog(@"response data is %@",data);
  641. }
  642. }];
  643. }
  644. - (void)returnToWechatSession
  645. {
  646. NSString * name = self.sendModel.Data.Author;
  647. if (self.sendModel.CollectionType == CollectModel_Toipc) {
  648. name = [NSString stringWithFormat:@"%@ 来自-%@",self.sendModel.Data.Author, self.sendModel.GroupName];
  649. }
  650. if (self.sendModel.CollectionType == CollectModel_file) {
  651. [self shareWebPageToPlatformType:UMSocialPlatformType_WechatSession];
  652. }else{
  653. [self shareWebPageToPlatformType:UMSocialPlatformType_WechatSession title:self.sendModel.Title desc:name url:[self returnUrl] image:[self returnImage]];
  654. }
  655. }
  656. - (void)returnToWechatTimeLine
  657. {
  658. NSString * name = self.sendModel.Data.Author;
  659. if (self.sendModel.CollectionType == CollectModel_Toipc) {
  660. name = [NSString stringWithFormat:@"%@ 来自-%@",self.sendModel.Data.Author, self.sendModel.GroupName];
  661. }
  662. if (self.sendModel.CollectionType == CollectModel_file) {
  663. [self shareWebPageToPlatformType:UMSocialPlatformType_WechatTimeLine];
  664. }else{
  665. [self shareWebPageToPlatformType:UMSocialPlatformType_WechatTimeLine title:self.sendModel.Title desc:name url:[self returnUrl] image:[self returnImage]];
  666. }
  667. }
  668. - (void)returnToSina
  669. {
  670. NSString * name = self.sendModel.Data.Author;
  671. if (self.sendModel.CollectionType == CollectModel_Toipc) {
  672. name = [NSString stringWithFormat:@"%@ 来自-%@",self.sendModel.Data.Author, self.sendModel.GroupName];
  673. }
  674. if (self.sendModel.CollectionType == CollectModel_file) {
  675. [self shareWebPageToPlatformType:UMSocialPlatformType_Sina];
  676. }else{
  677. [self shareWebPageToPlatformType:UMSocialPlatformType_Sina title:self.sendModel.Title desc:name url:[self returnUrl] image:[self returnImage]];
  678. }
  679. }
  680. - (void)returnToQQ
  681. {
  682. NSString * name = self.sendModel.Data.Author;
  683. if (self.sendModel.CollectionType == CollectModel_Toipc) {
  684. name = [NSString stringWithFormat:@"%@ 来自-%@",self.sendModel.Data.Author, self.sendModel.GroupName];
  685. }
  686. if (self.sendModel.CollectionType == CollectModel_file) {
  687. [self shareWebPageToPlatformType:UMSocialPlatformType_QQ];
  688. }else{
  689. [self shareWebPageToPlatformType:UMSocialPlatformType_QQ title:self.sendModel.Title desc:name url:[self returnUrl] image:[self returnImage]];
  690. }
  691. }
  692. - (NSString *)returnUrl
  693. {
  694. switch (self.sendModel.Data.Type) {
  695. case CollectModel_Group:
  696. {
  697. NSString * url = [NSString stringWithFormat:@"%@%ld",Host(@"/admin/mobile/topicDetailsWx?"),(long)self.sendModel.CollectionDataId];
  698. return url;
  699. }
  700. break;
  701. case CollectModel_Toipc:
  702. {
  703. NSString * url = [NSString stringWithFormat:@"%@%ld",Host(@"/admin/mobile/topicDetailsWx?"),(long)self.sendModel.CollectionDataId];
  704. return url;
  705. }
  706. break;
  707. case CollectModel_NewTopic:
  708. {
  709. NSString * url = [NSString stringWithFormat:@"%@%ld",Host(@"/admin/mobile/noteDetailsWx?"),(long)self.sendModel.CollectionDataId];
  710. return url;
  711. }
  712. break;
  713. case CollectModel_Notice:
  714. {
  715. // NSString * url = [NSString stringWithFormat:@"%@%ld",@"http://192.168.0.119:8080/admin/mobile/noticeDetailsWx?",(long)self.currentNoteModel.Id];
  716. NSString * url = [NSString stringWithFormat:@"%@%ld",Host(@"/admin/mobile/noticeDetailsWx?"),(long)self.sendModel.CollectionDataId];
  717. return url;
  718. }
  719. break;
  720. case CollectModel_NoteBook:
  721. {
  722. NSString * url = [NSString stringWithFormat:@"%@%ld",Host(@"/admin/mobile/noteDetailsWx?"),(long)self.sendModel.CollectionDataId];
  723. return url;
  724. }
  725. break;
  726. case CollectModel_InterMail:
  727. {
  728. NSString * url = [NSString stringWithFormat:@"%@%ld",Host(@"/admin/mobile/mailWx?"),(long)self.sendModel.CollectionDataId];
  729. return url;
  730. }
  731. break;
  732. case CollectModel_NoSignMail:
  733. {
  734. NSString * url = [NSString stringWithFormat:@"%@%ld",Host(@"/admin/mobile/mailWx?"),(long)self.sendModel.CollectionDataId];
  735. return url;
  736. }
  737. break;
  738. case CollectModel_meetMian:
  739. {
  740. NSString * url = [NSString stringWithFormat:@"%@%ld",ShareHost(@"mobile/minutesMeetingWx?"),(long)self.sendModel.CollectionDataId];
  741. return url;
  742. }
  743. break;
  744. case CollectModel_meetDetail:
  745. {
  746. NSString * url = [NSString stringWithFormat:@"%@%ld",ShareHost(@"mobile/meetingWx?"),(long)self.sendModel.CollectionDataId];
  747. return url;
  748. }
  749. break;
  750. case CollectModel_NoteFile:
  751. {
  752. NSString * url = [NSString stringWithFormat:@"%@id=%ld&type=13&userId=%ld&name=%@&describe=%@",ShareHost(@"mobile/folderWx?"),(long)self.sendModel.CollectionDataId,self.sendModel.SourceUserId,self.sendModel.Title,@"笔记文件夹"];
  753. return url;
  754. }
  755. break;
  756. case CollectModel_CollectFile:
  757. {
  758. NSString * url = [NSString stringWithFormat:@"%@id=%ld&type=12&userId=%ld&name=%@&describe=%@",ShareHost(@"mobile/folderWx?"),(long)self.sendModel.CollectionDataId,self.sendModel.SourceUserId,self.sendModel.Title,@"收藏文件夹"];
  759. return url;
  760. }
  761. break;
  762. case CollectModel_TopicBooK:
  763. {
  764. NSString * url = [NSString stringWithFormat:@"%@id=%ld&type=41&userId=%ld&name=%@&describe=%@",ShareHost(@"mobile/folderWx?"),(long)self.sendModel.CollectionDataId,self.sendModel.SourceUserId,self.sendModel.Title,@"话题本"];
  765. return url;
  766. }
  767. break;
  768. case CollectModel_TopicSubBooK:
  769. {
  770. NSString * url = [NSString stringWithFormat:@"%@id=%ld&type=42&userId=%ld&name=%@&describe=%@",ShareHost(@"mobile/folderWx?"),(long)self.sendModel.CollectionDataId,self.sendModel.SourceUserId,self.sendModel.Title,@"话题文件夹"];
  771. return url;
  772. }
  773. break;
  774. case CollectModel_work:
  775. {
  776. NSString * url = [NSString stringWithFormat:@"%@%ld",ShareHost(@"mobile/approvalWx?"),(long)self.sendModel.CollectionDataId];
  777. return url;
  778. }
  779. break;
  780. case CollectModel_Aritle:
  781. {
  782. NSString * url = [NSString stringWithFormat:@"%@%ld",Host(@"/admin/mobile/mainText?"),(long)self.sendModel.CollectionDataId];
  783. return url;
  784. }
  785. break;
  786. default:
  787. {
  788. NSString * url = [NSString stringWithFormat:@"%@%ld",Host(@"/admin/mobile/noticeDetailsWx?"),(long)self.sendModel.CollectionDataId];
  789. return url;
  790. }
  791. break;
  792. }
  793. }
  794. - (NSString *)returnImage
  795. {
  796. switch (self.sendModel.CollectionType) {
  797. case CollectModel_Group:
  798. {
  799. NSString * url = @"笔记小组";
  800. return url;
  801. }
  802. break;
  803. case CollectModel_Toipc:
  804. {
  805. NSString * url = @"话题";
  806. return url;
  807. }
  808. break;
  809. case CollectModel_NewTopic:
  810. {
  811. NSString * url = @"话题";
  812. return url;
  813. }
  814. break;
  815. case CollectModel_Notice:
  816. {
  817. NSString * url = @"通知图标";
  818. return url;
  819. }
  820. break;
  821. case CollectModel_NoteBook:
  822. {
  823. NSString * url = @"noteBook_icon";
  824. return url;
  825. }
  826. break;
  827. case CollectModel_NoteFile:
  828. {
  829. NSString * url = @"share_file";
  830. return url;
  831. }
  832. break;
  833. case CollectModel_CollectFile:
  834. {
  835. NSString * url = @"share_file";
  836. return url;
  837. }
  838. break;
  839. case CollectModel_InterMail:
  840. {
  841. NSString * url = @"站内信";
  842. return url;
  843. }
  844. break;
  845. case CollectModel_NoSignMail:
  846. {
  847. NSString * url = @"站内信";
  848. return url;
  849. }
  850. break;
  851. case CollectModel_meetMian:
  852. {
  853. NSString * url = @"会议纪要";
  854. return url;
  855. }
  856. break;
  857. case CollectModel_meetDetail:
  858. {
  859. NSString * url = @"会议";
  860. return url;
  861. }
  862. break;
  863. case CollectModel_Aritle:
  864. {
  865. NSString * url = @"文章";
  866. return url;
  867. }
  868. break;
  869. case CollectModel_TopicBooK:
  870. {
  871. NSString * url = @"topicBook";
  872. return url;
  873. }
  874. break;
  875. case CollectModel_TopicSubBooK:
  876. {
  877. NSString * url = @"share_file";
  878. return url;
  879. }
  880. break;
  881. default:
  882. {
  883. NSString * url = @"笔记文章";
  884. return url;
  885. }
  886. break;
  887. }
  888. }
  889. #pragma mark - 分享功能
  890. - (void)returnToMessage
  891. {
  892. ShareListVC * vc = [ShareListVC initShareListVC];
  893. FlowAttachmentsModel * model = [[FlowAttachmentsModel alloc] init];
  894. model.SoureId = self.sendModel.CollectionDataId;
  895. model.SoureTypeId = self.sendModel.CollectionType;
  896. model.Title = self.sendModel.Title;
  897. model.Author = self.sendModel.Data.Author;
  898. model.SourceUserId = self.sendModel.SourceUserId;
  899. model.GroupId = self.sendModel.Data.GroupId;
  900. model.GroupName = self.sendModel.Data.GroupName;
  901. model.MinUrl = self.sendModel.Data.MinFile;
  902. model.Url = self.sendModel.Data.File;
  903. vc.sendModel = model;
  904. vc.isReturn = YES;
  905. vc.hidesBottomBarWhenPushed = YES;
  906. vc.hidesBottomBarWhenPushed = YES;
  907. [self.navigationController pushViewController:vc animated:YES];
  908. }
  909. - (void)returnToGroup
  910. {
  911. MyTDGroupViewController * vc = [[MyTDGroupViewController alloc] init];
  912. vc.type = CollectModel_Toipc;
  913. FlowAttachmentsModel * model = [[FlowAttachmentsModel alloc] init];
  914. model.SoureId = self.sendModel.CollectionDataId;
  915. model.SoureTypeId = self.sendModel.CollectionType;
  916. model.Title = self.sendModel.Title;
  917. model.Author = self.sendModel.Data.Author;
  918. model.SourceUserId = self.sendModel.SourceUserId;
  919. model.GroupId = self.sendModel.Data.GroupId;
  920. model.GroupName = self.sendModel.Data.GroupName;
  921. model.MinUrl = self.sendModel.Data.MinFile;
  922. model.Url = self.sendModel.Data.File;
  923. vc.sendModel = model;
  924. vc.isReturn = YES;
  925. vc.hidesBottomBarWhenPushed = YES;
  926. [self.navigationController pushViewController:vc animated:YES];
  927. }
  928. - (void)returnToNote
  929. {
  930. MoveViewController * vc = [MoveViewController initMoveViewController];
  931. vc.isFromCreateBookVc = YES;
  932. vc.TypeId = CreateNotesType;
  933. vc.CollectionType = CollectModel_NoteBook;
  934. vc.titleStr = @"我的笔记";
  935. vc.ParentId = 0;
  936. FlowAttachmentsModel * model = [[FlowAttachmentsModel alloc] init];
  937. model.SoureId = self.sendModel.CollectionDataId;
  938. model.SoureTypeId = self.sendModel.CollectionType;
  939. model.Title = self.sendModel.Title;
  940. model.Author = self.sendModel.Data.Author;
  941. model.SourceUserId = self.sendModel.SourceUserId;
  942. model.GroupId = self.sendModel.Data.GroupId;
  943. model.GroupName = self.sendModel.Data.GroupName;
  944. model.MinUrl = self.sendModel.Data.MinFile;
  945. model.Url = self.sendModel.Data.File;
  946. vc.type = CollectModel_NoteBook;
  947. vc.sendModel = model;
  948. vc.isReturn = YES;
  949. vc.hidesBottomBarWhenPushed = YES;
  950. [self.navigationController pushViewController:vc animated:YES];
  951. }
  952. - (void)returnToTopic
  953. {
  954. MyTDTopicCreateVC * vc = [MyTDTopicCreateVC initMyTDTopicCreateVC];
  955. vc.type = CollectModel_NewTopic;
  956. FlowAttachmentsModel * model = [[FlowAttachmentsModel alloc] init];
  957. model.SoureId = self.sendModel.CollectionDataId;
  958. model.SoureTypeId = self.sendModel.CollectionType;
  959. model.Title = self.sendModel.Title;
  960. model.Author = self.sendModel.Data.Author;
  961. model.SourceUserId = self.sendModel.SourceUserId;
  962. model.GroupId = self.sendModel.Data.GroupId;
  963. model.GroupName = self.sendModel.Data.GroupName;
  964. model.MinUrl = self.sendModel.Data.MinFile;
  965. model.Url = self.sendModel.Data.File;
  966. vc.type = CollectModel_NewTopic;
  967. vc.sendModel = model;
  968. vc.isReturn = YES;
  969. vc.hidesBottomBarWhenPushed = YES;
  970. [self.navigationController pushViewController:vc animated:YES];
  971. }
  972. @end