CommonNoteVC.m 76 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333
  1. //
  2. // CommonNoteVC.m
  3. // smartRhino
  4. //
  5. // Created by niuzhen on 2020/4/29.
  6. // Copyright © 2020 tederen. All rights reserved.
  7. //
  8. #import "CommonNoteVC.h"
  9. #import "MyTDGroupView.h"
  10. #import "MyFavoriteViewCell.h"
  11. #import "YCMenuView.h"
  12. #import "ShowNewGroupAlert.h"
  13. #import "MyFavoriteNewFindVC.h"
  14. #import "MyCenterSearchVC.h"
  15. #import "MoveViewController.h"
  16. #import "NoteBookCell.h"
  17. #import "NoteBookDetailVC.h"
  18. #import "NoteBookCommentVC.h"
  19. #import "NoteBookShareVC.h"
  20. #import "MyTDGroupViewController.h"
  21. #import "MyTDTopicCreateVC.h"
  22. #import "MyTDTopicDetailVC.h"
  23. #import "MoveViewController.h"
  24. #import "HomeDetailController.h"
  25. #import "TDGroupInfoListVC.h"
  26. #import "WorkFlowDetailsController.h"
  27. #import "MyApprovalPageDetail.h"
  28. #import "DownFileViewController.h"
  29. #import "MyFavoriteVC.h"
  30. #import "NoteBookSearchVC.h"
  31. #import "OtherFavoriteVC.h"
  32. #import "OtherNoteBookVC.h"
  33. #import "MailListDetailVC.h"
  34. #import "ShareListVC.h"
  35. #import "NoteBookVC.h"
  36. @interface CommonNoteVC ()<UITableViewDelegate,UITableViewDataSource,NoteBookShareVCDelegate>
  37. @property (weak, nonatomic) IBOutlet UIButton *rightEditBtn;
  38. @property (weak, nonatomic) IBOutlet UITableView *tableView;
  39. @property (weak, nonatomic) IBOutlet UIView *headerView;
  40. @property (strong, nonatomic) MyTDGroupView *SearchView;
  41. @property (strong, nonatomic) UIView *noteView;
  42. @property (strong,nonatomic) NSMutableArray <MyNoteBookSubModel *>*noteBookArray;
  43. @property (nonatomic, assign) Boolean isFresh;
  44. @property (nonatomic,assign) NSInteger currentPage;
  45. @property (nonatomic,assign) NSInteger totalPage;
  46. @property (strong,nonatomic) NSMutableArray *taskActionArray;
  47. @property(strong,nonatomic)UIImageView *cellImage;
  48. @property(strong,nonatomic)NSIndexPath *currentPath;
  49. @property(assign,nonatomic)CGFloat orignY;
  50. @property (nonatomic,assign) BOOL isBarReturn;
  51. @property (strong, nonatomic) NoteBookShareVC *noteBookShareVC;
  52. @property (strong, nonatomic) NoteBookCommentVC *noteBookCommentVC;
  53. @property (strong, nonatomic) FlowAttachmentsModel * returnModel;
  54. @property (nonatomic,assign) NSInteger selectCount;
  55. @end
  56. @implementation CommonNoteVC
  57. +(CommonNoteVC *)initCommonNoteVC{
  58. CommonNoteVC *controller = [StoryboardManager.shared.Common instantiateViewControllerWithIdentifier:@"CommonNoteVC"];
  59. return controller;
  60. }
  61. #pragma mark -loay
  62. - (void)addHeaderSubView
  63. {
  64. [self.headerView addSubview:self.SearchView];
  65. [self.SearchView mas_makeConstraints:^(MASConstraintMaker *make) {
  66. make.left.top.right.mas_equalTo(self.headerView);
  67. make.height.mas_offset(36);
  68. }];
  69. [self.headerView addSubview:self.noteView];
  70. [self.noteView mas_makeConstraints:^(MASConstraintMaker *make) {
  71. make.top.mas_equalTo(self.SearchView.mas_bottom).offset(10);
  72. make.left.bottom.right.mas_equalTo(self.headerView);
  73. }];
  74. UIImageView * imgV = [UIImageView new];
  75. imgV.image = IMG(@"Common_note_icon");
  76. [self.noteView addSubview:imgV];
  77. [imgV mas_makeConstraints:^(MASConstraintMaker *make) {
  78. make.left.mas_offset(15);
  79. make.centerY.mas_equalTo(self.noteView);
  80. }];
  81. UILabel * lineL = [UILabel new];
  82. lineL.backgroundColor = LINEBGCOLOR;
  83. [self.noteView addSubview:lineL];
  84. [lineL mas_makeConstraints:^(MASConstraintMaker *make) {
  85. make.left.bottom.right.mas_equalTo(self.noteView);
  86. make.height.mas_offset(0.5);
  87. }];
  88. UILabel * titleL = [UILabel new];
  89. titleL.textColor = UIColorHex(0x0A0A0A);
  90. titleL.font = [UIFont systemFontOfSize:15];
  91. titleL.text = @"笔记本";
  92. [self.noteView addSubview:titleL];
  93. [titleL mas_makeConstraints:^(MASConstraintMaker *make) {
  94. make.centerY.mas_equalTo(self.noteView);
  95. make.left.mas_equalTo(imgV.mas_right).offset(15);
  96. }];
  97. UIImageView * rightImgV = [UIImageView new];
  98. rightImgV.image = IMG(@"chatmsg_rightArrow_icon");
  99. [self.noteView addSubview:rightImgV];
  100. [rightImgV mas_makeConstraints:^(MASConstraintMaker *make) {
  101. make.centerY.mas_equalTo(self.noteView);
  102. make.right.offset(-15);
  103. }];
  104. WS(weakSelf);
  105. UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithActionBlock:^(id _Nonnull sender) {
  106. [weakSelf pushNoteVC];
  107. }];
  108. self.noteView.userInteractionEnabled = YES;
  109. [self.noteView addGestureRecognizer:tap];
  110. }
  111. - (void)pushNoteVC
  112. {
  113. NoteBookVC *vc = [NoteBookVC initNoteBookVC];
  114. vc.listType = MyNoteBookListLevelTypeA;
  115. vc.FolderId = 0;
  116. vc.myTitle = @"我的笔记";
  117. vc.VisitUserId = 0;
  118. vc.operationStateEnum = OperationStateEnum0;
  119. [self.navigationController pushViewController:vc animated:YES];
  120. }
  121. - (MyTDGroupView *)SearchView
  122. {
  123. if (!_SearchView) {
  124. _SearchView = [[MyTDGroupView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 40)];
  125. }
  126. return _SearchView;
  127. }
  128. - (UIView *)noteView
  129. {
  130. if (!_noteView) {
  131. _noteView = [UIView new];
  132. }
  133. return _noteView;
  134. }
  135. #pragma mark - UItableView刷新
  136. - (void)setTableRefresh
  137. {
  138. WS(weakSelf);
  139. self.tableView.mj_header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{
  140. [weakSelf headRefresh];
  141. }];
  142. self.tableView.mj_footer = [MJRefreshAutoNormalFooter footerWithRefreshingBlock:^{
  143. [weakSelf footerRefresh];
  144. }];
  145. [self.tableView.mj_header beginRefreshing];
  146. }
  147. - (void)headRefresh{
  148. self.isFresh = YES;
  149. self.currentPage = 1;
  150. self.totalPage = 1;
  151. [self.noteBookArray removeAllObjects];
  152. [self getDataList];
  153. }
  154. - (void)footerRefresh{
  155. self.isFresh = NO;
  156. self.currentPage += 1;
  157. if (self.totalPage == self.noteBookArray.count) {
  158. self.currentPage --;
  159. [self.tableView.mj_footer resetNoMoreData];
  160. return ;
  161. }
  162. [self getDataList];
  163. }
  164. - (void)getDataList{
  165. WS(weakSelf);
  166. [[HttpManager sharedHttpManager] POSTUrl:Host(API_NoteBook) parameters:@{@"FolderId":@(0),@"Page":@(1),@"PerPage":@(99999999),@"VisitUserId":@(0),@"SearchKey":@"",@"Sort":@""} responseStyle:JOSN success:^(id _Nonnull responseObject) {
  167. NSLog(@"笔记列表数据 %@",responseObject);
  168. MyNoteBookModel *listModel = [[MyNoteBookModel alloc] initWithDictionary:responseObject error:nil];
  169. weakSelf.totalPage = listModel.Total;
  170. [weakSelf.noteBookArray addObjectsFromArray:listModel.Items];
  171. dispatch_async(dispatch_get_main_queue(), ^{
  172. [weakSelf.tableView.mj_header endRefreshing];
  173. [weakSelf.tableView.mj_footer endRefreshing];
  174. [weakSelf.tableView reloadData];
  175. });
  176. } failure:^(NSError * _Nonnull error) {
  177. }];
  178. }
  179. - (void)viewDidLoad {
  180. [super viewDidLoad];
  181. self.tableView.delegate = self;
  182. self.tableView.dataSource = self;
  183. self.fd_prefersNavigationBarHidden = YES;
  184. [self addHeaderSubView];
  185. WS(weakSelf);
  186. [self.rightEditBtn setAction:^{
  187. MyTDTopicCreateVC * vc = [MyTDTopicCreateVC initMyTDTopicCreateVC];
  188. vc.type = CollectModel_NoteBook;
  189. vc.FolderId = 0;
  190. vc.FolderName = @"根目录";
  191. [weakSelf.navigationController pushViewController:vc animated:YES];
  192. }];
  193. [self.SearchView.button setAction:^{
  194. NoteBookSearchVC * vc = [[NoteBookSearchVC alloc] init];
  195. vc.IsSelected = NO;
  196. [weakSelf.navigationController pushViewController:vc animated:YES];
  197. }];
  198. self.tableView.tableHeaderView = self.headerView;
  199. self.tableView.tableHeaderView.height = 90.f;
  200. [self setTableRefresh];
  201. [self.view addSubview:self.noteBookShareVC.view];
  202. }
  203. - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
  204. return 1;
  205. }
  206. - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
  207. return self.noteBookArray.count;
  208. }
  209. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
  210. WS(weakSelf);
  211. MyNoteBookSubModel *model = self.noteBookArray[indexPath.row];
  212. switch (model.AttributeValue) {
  213. case 1:{
  214. switch (model.DataType) {
  215. case TopiclistCellNone:
  216. {
  217. NoteBookCell *cell = [NoteBookCell configCell6:tableView indexPath:indexPath];
  218. [cell.cell1IconImage sd_setImageWithURL:[NSURL URLWithString:model.AvatarUrl] placeholderImage:[UIImage imageNamed:@"imagePlaceholder"]];
  219. cell.cell1Title.text = model.Name;
  220. cell.cell1readNumberLabel.text = [NSString stringWithFormat:@"阅读:%ld",(long)model.ReadCount];
  221. cell.cell1ShareType.text = [ZYCTool monthAndDayAndHoursAndMinutes:model.CreatedDate];
  222. cell.cell1contentContentLabel.attributedText = [self setTextWithStr:model.Content];
  223. cell.cell1contentTitleLabel.attributedText = [self setTitleWithStr:model.Title];
  224. cell.cellZanButton.selected = model.IsPraise;
  225. if (model.PraiseCount > 0) {
  226. [cell.cellZanButton setTitle:[NSString stringWithFormat:@"%ld",(long)model.PraiseCount] forState:UIControlStateNormal];
  227. }else{
  228. [cell.cellZanButton setTitle:@"赞" forState:UIControlStateNormal];
  229. }
  230. if (model.CommentCount > 0) {
  231. [cell.cellCommentButton setTitle:[NSString stringWithFormat:@"%ld",(long)model.CommentCount] forState:UIControlStateNormal];
  232. }else{
  233. [cell.cellCommentButton setTitle:@"评论" forState:UIControlStateNormal];
  234. }
  235. cell.IsTopV.hidden = !model.IsTop;
  236. [cell.cellCommentButton setAction:^{
  237. [weakSelf CommentHanderIndex:indexPath];
  238. }];
  239. [cell.cellZanButton setAction:^{
  240. [weakSelf zanHanderIndex:indexPath];
  241. }];
  242. [cell.cellShareButton setAction:^{
  243. [weakSelf shareHanderModel:model];
  244. }];
  245. cell.ClickUserBlock = ^{
  246. [weakSelf showUserInfo:model.UserId];
  247. };
  248. cell.selectionStyle = UITableViewCellSelectionStyleNone;
  249. return cell;
  250. }
  251. break;
  252. case TopiclistCellImage:
  253. {
  254. switch (model.Data.count) {
  255. case 1:
  256. {
  257. NoteBookCell *cell = [NoteBookCell configCell0:tableView indexPath:indexPath];
  258. [cell.cell1IconImage sd_setImageWithURL:[NSURL URLWithString:model.AvatarUrl] placeholderImage:[UIImage imageNamed:@"imagePlaceholder"] ];
  259. cell.cell1Title.text = model.Name;
  260. cell.cell1readNumberLabel.text = [NSString stringWithFormat:@"阅读:%ld",(long)model.ReadCount];
  261. cell.cell1ShareType.text = [ZYCTool monthAndDayAndHoursAndMinutes:model.CreatedDate];
  262. cell.cell1contentTitleLabel.attributedText = [self setTitleWithStr:model.Title];
  263. cell.IsTopV.hidden = !model.IsTop;
  264. cell.cell1contentContentLabel.attributedText = [self setTextWithStr:model.Content];
  265. MyNoteBookeDataModel * data0Model = model.Data[0];
  266. [cell.cell1IconImageView1 sd_setImageWithURL:[NSURL URLWithString:data0Model.File] placeholderImage:IMG(@"img_placeHolderVertical")];
  267. cell.cellZanButton.selected = model.IsPraise;
  268. if (model.PraiseCount > 0) {
  269. [cell.cellZanButton setTitle:[NSString stringWithFormat:@"%ld",(long)model.PraiseCount] forState:UIControlStateNormal];
  270. }else{
  271. [cell.cellZanButton setTitle:@"赞" forState:UIControlStateNormal];
  272. }
  273. if (model.CommentCount > 0) {
  274. [cell.cellCommentButton setTitle:[NSString stringWithFormat:@"%ld",(long)model.CommentCount] forState:UIControlStateNormal];
  275. }else{
  276. [cell.cellCommentButton setTitle:@"评论" forState:UIControlStateNormal];
  277. }
  278. [cell.cellCommentButton setAction:^{
  279. [weakSelf CommentHanderIndex:indexPath];
  280. }];
  281. [cell.cellZanButton setAction:^{
  282. [weakSelf zanHanderIndex:indexPath];
  283. }];
  284. [cell.cellShareButton setAction:^{
  285. [weakSelf shareHanderModel:model];
  286. }];
  287. cell.ClickUserBlock = ^{
  288. [weakSelf showUserInfo:model.UserId];
  289. };
  290. cell.selectionStyle = UITableViewCellSelectionStyleNone;
  291. return cell;
  292. }break;
  293. case 2:{
  294. NoteBookCell *cell = [NoteBookCell configCell1:tableView indexPath:indexPath];
  295. [cell.cell1IconImage sd_setImageWithURL:[NSURL URLWithString:model.AvatarUrl] placeholderImage:[UIImage imageNamed:@"imagePlaceholder"] ];
  296. cell.cell1contentTitleLabel.attributedText = [self setTitleWithStr:model.Title];
  297. cell.cell1contentContentLabel.attributedText = [self setTextWithStr:model.Content];
  298. cell.cell1Title.text = model.Name;
  299. cell.IsTopV.hidden = !model.IsTop;
  300. cell.cell1readNumberLabel.text = [NSString stringWithFormat:@"阅读:%ld",(long)model.ReadCount];
  301. cell.cell1ShareType.text = [ZYCTool monthAndDayAndHoursAndMinutes:model.CreatedDate];
  302. MyNoteBookeDataModel * data0Model = model.Data[0];
  303. MyNoteBookeDataModel * data1Model = model.Data[1];
  304. [cell.cell1IconImageView1 sd_setImageWithURL:[NSURL URLWithString:data0Model.File] placeholderImage:IMG(@"img_placeHolderVertical")];
  305. [cell.cell1IconImageView2 sd_setImageWithURL:[NSURL URLWithString:data1Model.File] placeholderImage:IMG(@"img_placeHolderVertical")];
  306. cell.cellZanButton.selected = model.IsPraise;
  307. if (model.PraiseCount > 0) {
  308. [cell.cellZanButton setTitle:[NSString stringWithFormat:@"%ld",(long)model.PraiseCount] forState:UIControlStateNormal];
  309. }else{
  310. [cell.cellZanButton setTitle:@"赞" forState:UIControlStateNormal];
  311. }
  312. if (model.CommentCount > 0) {
  313. [cell.cellCommentButton setTitle:[NSString stringWithFormat:@"%ld",(long)model.CommentCount] forState:UIControlStateNormal];
  314. }else{
  315. [cell.cellCommentButton setTitle:@"评论" forState:UIControlStateNormal];
  316. }
  317. [cell.cellCommentButton setAction:^{
  318. [weakSelf CommentHanderIndex:indexPath];
  319. }];
  320. [cell.cellZanButton setAction:^{
  321. [weakSelf zanHanderIndex:indexPath];
  322. }];
  323. [cell.cellShareButton setAction:^{
  324. [weakSelf shareHanderModel:model];
  325. }];
  326. cell.ClickUserBlock = ^{
  327. [weakSelf showUserInfo:model.UserId];
  328. };
  329. cell.selectionStyle = UITableViewCellSelectionStyleNone;
  330. return cell;
  331. }break;
  332. case 3:{
  333. NoteBookCell *cell = [NoteBookCell configCell2:tableView indexPath:indexPath];
  334. [cell.cell1IconImage sd_setImageWithURL:[NSURL URLWithString:model.AvatarUrl] placeholderImage:[UIImage imageNamed:@"imagePlaceholder"] ];
  335. cell.cell1Title.text = model.Name;
  336. cell.IsTopV.hidden = !model.IsTop;
  337. cell.cell1readNumberLabel.text = [NSString stringWithFormat:@"阅读:%ld",(long)model.ReadCount];
  338. cell.cell1ShareType.text = [ZYCTool monthAndDayAndHoursAndMinutes:model.CreatedDate];
  339. cell.cell1contentTitleLabel.attributedText = [self setTitleWithStr:model.Title];
  340. cell.cell1contentContentLabel.attributedText = [self setTextWithStr:model.Content];
  341. MyNoteBookeDataModel * data0Model = model.Data[0];
  342. MyNoteBookeDataModel * data1Model = model.Data[1];
  343. MyNoteBookeDataModel * data2Model = model.Data[2];
  344. [cell.cell1IconImageView1 sd_setImageWithURL:[NSURL URLWithString:data0Model.File] placeholderImage:IMG(@"img_placeHolderVertical")];
  345. [cell.cell1IconImageView2 sd_setImageWithURL:[NSURL URLWithString:data1Model.File] placeholderImage:IMG(@"img_placeHolderVertical")];
  346. [cell.cell1IconImageView3 sd_setImageWithURL:[NSURL URLWithString:data2Model.File] placeholderImage:IMG(@"img_placeHolderVertical")];
  347. cell.cellZanButton.selected = model.IsPraise;
  348. if (model.PraiseCount > 0) {
  349. [cell.cellZanButton setTitle:[NSString stringWithFormat:@"%ld",(long)model.PraiseCount] forState:UIControlStateNormal];
  350. }else{
  351. [cell.cellZanButton setTitle:@"赞" forState:UIControlStateNormal];
  352. }
  353. if (model.CommentCount > 0) {
  354. [cell.cellCommentButton setTitle:[NSString stringWithFormat:@"%ld",(long)model.CommentCount] forState:UIControlStateNormal];
  355. }else{
  356. [cell.cellCommentButton setTitle:@"评论" forState:UIControlStateNormal];
  357. }
  358. [cell.cellCommentButton setAction:^{
  359. [weakSelf CommentHanderIndex:indexPath];
  360. }];
  361. [cell.cellZanButton setAction:^{
  362. [weakSelf zanHanderIndex:indexPath];
  363. }];
  364. [cell.cellShareButton setAction:^{
  365. [weakSelf shareHanderModel:model];
  366. }];
  367. cell.ClickUserBlock = ^{
  368. [weakSelf showUserInfo:model.UserId];
  369. };
  370. cell.selectionStyle = UITableViewCellSelectionStyleNone;
  371. return cell;
  372. }break;
  373. case 4:{
  374. NoteBookCell *cell = [NoteBookCell configCell3:tableView indexPath:indexPath];
  375. [cell.cell1IconImage sd_setImageWithURL:[NSURL URLWithString:model.AvatarUrl] placeholderImage:[UIImage imageNamed:@"imagePlaceholder"] ];
  376. cell.cell1Title.text = model.Name;
  377. cell.IsTopV.hidden = !model.IsTop;
  378. cell.cell1readNumberLabel.text = [NSString stringWithFormat:@"阅读:%ld",(long)model.ReadCount];
  379. cell.cell1ShareType.text = [ZYCTool monthAndDayAndHoursAndMinutes:model.CreatedDate];
  380. cell.cell1contentTitleLabel.attributedText = [self setTitleWithStr:model.Title];
  381. cell.cell1contentContentLabel.attributedText = [self setTextWithStr:model.Content];
  382. MyNoteBookeDataModel * data0Model = model.Data[0];
  383. MyNoteBookeDataModel * data1Model = model.Data[1];
  384. MyNoteBookeDataModel * data2Model = model.Data[2];
  385. MyNoteBookeDataModel * data3Model = model.Data[3];
  386. [cell.cell1IconImageView1 sd_setImageWithURL:[NSURL URLWithString:data0Model.File] placeholderImage:IMG(@"img_placeHolderVertical")];
  387. [cell.cell1IconImageView2 sd_setImageWithURL:[NSURL URLWithString:data1Model.File] placeholderImage:IMG(@"img_placeHolderVertical")];
  388. [cell.cell1IconImageView3 sd_setImageWithURL:[NSURL URLWithString:data2Model.File] placeholderImage:IMG(@"img_placeHolderVertical")];
  389. [cell.cell1IconImageView4 sd_setImageWithURL:[NSURL URLWithString:data3Model.File] placeholderImage:IMG(@"img_placeHolderVertical")];
  390. cell.cellZanButton.selected = model.IsPraise;
  391. if (model.PraiseCount > 0) {
  392. [cell.cellZanButton setTitle:[NSString stringWithFormat:@"%ld",(long)model.PraiseCount] forState:UIControlStateNormal];
  393. }else{
  394. [cell.cellZanButton setTitle:@"赞" forState:UIControlStateNormal];
  395. }
  396. if (model.CommentCount > 0) {
  397. [cell.cellCommentButton setTitle:[NSString stringWithFormat:@"%ld",(long)model.CommentCount] forState:UIControlStateNormal];
  398. }else{
  399. [cell.cellCommentButton setTitle:@"评论" forState:UIControlStateNormal];
  400. }
  401. [cell.cellCommentButton setAction:^{
  402. [weakSelf CommentHanderIndex:indexPath];
  403. }];
  404. [cell.cellZanButton setAction:^{
  405. [weakSelf zanHanderIndex:indexPath];
  406. }];
  407. [cell.cellShareButton setAction:^{
  408. [weakSelf shareHanderModel:model];
  409. }];
  410. cell.ClickUserBlock = ^{
  411. [weakSelf showUserInfo:model.UserId];
  412. };
  413. cell.selectionStyle = UITableViewCellSelectionStyleNone;
  414. return cell;
  415. }break;
  416. case 5:{
  417. NoteBookCell *cell = [NoteBookCell configCell4:tableView indexPath:indexPath];
  418. cell.cell1Title.text = model.Name;
  419. cell.cell1readNumberLabel.text = [NSString stringWithFormat:@"阅读:%ld",(long)model.ReadCount];
  420. cell.cell1ShareType.text = [ZYCTool monthAndDayAndHoursAndMinutes:model.CreatedDate];
  421. [cell.cell1IconImage sd_setImageWithURL:[NSURL URLWithString:model.AvatarUrl] placeholderImage:[UIImage imageNamed:@"imagePlaceholder"] ];
  422. cell.cell1contentTitleLabel.attributedText = [self setTitleWithStr:model.Title];
  423. cell.IsTopV.hidden = !model.IsTop;
  424. cell.cell1contentContentLabel.attributedText = [self setTextWithStr:model.Content];
  425. MyNoteBookeDataModel * data0Model = model.Data[0];
  426. MyNoteBookeDataModel * data1Model = model.Data[1];
  427. MyNoteBookeDataModel * data2Model = model.Data[2];
  428. MyNoteBookeDataModel * data3Model = model.Data[3];
  429. MyNoteBookeDataModel * data4Model = model.Data[4];
  430. [cell.cell1IconImageView1 sd_setImageWithURL:[NSURL URLWithString:data0Model.File] placeholderImage:IMG(@"img_placeHolderVertical")];
  431. [cell.cell1IconImageView2 sd_setImageWithURL:[NSURL URLWithString:data1Model.File] placeholderImage:IMG(@"img_placeHolderVertical")];
  432. [cell.cell1IconImageView3 sd_setImageWithURL:[NSURL URLWithString:data2Model.File] placeholderImage:IMG(@"img_placeHolderVertical")];
  433. [cell.cell1IconImageView4 sd_setImageWithURL:[NSURL URLWithString:data3Model.File] placeholderImage:IMG(@"img_placeHolderVertical")];
  434. [cell.cell1IconImageView5 sd_setImageWithURL:[NSURL URLWithString:data4Model.File] placeholderImage:IMG(@"img_placeHolderVertical")];
  435. cell.cellZanButton.selected = model.IsPraise;
  436. if (model.PraiseCount > 0) {
  437. [cell.cellZanButton setTitle:[NSString stringWithFormat:@"%ld",(long)model.PraiseCount] forState:UIControlStateNormal];
  438. }else{
  439. [cell.cellZanButton setTitle:@"赞" forState:UIControlStateNormal];
  440. }
  441. if (model.CommentCount > 0) {
  442. [cell.cellCommentButton setTitle:[NSString stringWithFormat:@"%ld",(long)model.CommentCount] forState:UIControlStateNormal];
  443. }else{
  444. [cell.cellCommentButton setTitle:@"评论" forState:UIControlStateNormal];
  445. }
  446. [cell.cellCommentButton setAction:^{
  447. [weakSelf CommentHanderIndex:indexPath];
  448. }];
  449. [cell.cellZanButton setAction:^{
  450. [weakSelf zanHanderIndex:indexPath];
  451. }];
  452. [cell.cellShareButton setAction:^{
  453. [weakSelf shareHanderModel:model];
  454. }];
  455. cell.ClickUserBlock = ^{
  456. [weakSelf showUserInfo:model.UserId];
  457. };
  458. cell.cell1IconImageView6.hidden = YES;
  459. cell.selectionStyle = UITableViewCellSelectionStyleNone;
  460. return cell;
  461. }break;
  462. case 6:{
  463. NoteBookCell *cell = [NoteBookCell configCell4:tableView indexPath:indexPath];
  464. cell.cell1Title.text = model.Name;
  465. cell.IsTopV.hidden = !model.IsTop;
  466. cell.cell1readNumberLabel.text = [NSString stringWithFormat:@"阅读:%ld",(long)model.ReadCount];
  467. cell.cell1ShareType.text = [ZYCTool monthAndDayAndHoursAndMinutes:model.CreatedDate];
  468. [cell.cell1IconImage sd_setImageWithURL:[NSURL URLWithString:model.AvatarUrl] placeholderImage:[UIImage imageNamed:@"imagePlaceholder"] ];
  469. cell.cell1contentTitleLabel.attributedText = [self setTitleWithStr:model.Title];
  470. cell.cell1contentContentLabel.attributedText = [self setTextWithStr:model.Content];
  471. MyNoteBookeDataModel * data0Model = model.Data[0];
  472. MyNoteBookeDataModel * data1Model = model.Data[1];
  473. MyNoteBookeDataModel * data2Model = model.Data[2];
  474. MyNoteBookeDataModel * data3Model = model.Data[3];
  475. MyNoteBookeDataModel * data4Model = model.Data[4];
  476. MyNoteBookeDataModel * data5Model = model.Data[5];
  477. [cell.cell1IconImageView1 sd_setImageWithURL:[NSURL URLWithString:data0Model.File] placeholderImage:IMG(@"img_placeHolderVertical")];
  478. [cell.cell1IconImageView2 sd_setImageWithURL:[NSURL URLWithString:data1Model.File] placeholderImage:IMG(@"img_placeHolderVertical")];
  479. [cell.cell1IconImageView3 sd_setImageWithURL:[NSURL URLWithString:data2Model.File] placeholderImage:IMG(@"img_placeHolderVertical")];
  480. [cell.cell1IconImageView4 sd_setImageWithURL:[NSURL URLWithString:data3Model.File] placeholderImage:IMG(@"img_placeHolderVertical")];
  481. [cell.cell1IconImageView5 sd_setImageWithURL:[NSURL URLWithString:data4Model.File] placeholderImage:IMG(@"img_placeHolderVertical")];
  482. [cell.cell1IconImageView6 sd_setImageWithURL:[NSURL URLWithString:data5Model.File] placeholderImage:IMG(@"img_placeHolderVertical")];
  483. cell.cellZanButton.selected = model.IsPraise;
  484. if (model.PraiseCount > 0) {
  485. [cell.cellZanButton setTitle:[NSString stringWithFormat:@"%ld",(long)model.PraiseCount] forState:UIControlStateNormal];
  486. }else{
  487. [cell.cellZanButton setTitle:@"赞" forState:UIControlStateNormal];
  488. }
  489. if (model.CommentCount > 0) {
  490. [cell.cellCommentButton setTitle:[NSString stringWithFormat:@"%ld",(long)model.CommentCount] forState:UIControlStateNormal];
  491. }else{
  492. [cell.cellCommentButton setTitle:@"评论" forState:UIControlStateNormal];
  493. }
  494. [cell.cellCommentButton setAction:^{
  495. [weakSelf CommentHanderIndex:indexPath];
  496. }];
  497. [cell.cellZanButton setAction:^{
  498. [weakSelf zanHanderIndex:indexPath];
  499. }];
  500. [cell.cellShareButton setAction:^{
  501. [weakSelf shareHanderModel:model];
  502. }];
  503. cell.ClickUserBlock = ^{
  504. [weakSelf showUserInfo:model.UserId];
  505. };
  506. cell.selectionStyle = UITableViewCellSelectionStyleNone;
  507. return cell;
  508. }break;
  509. case 7:{
  510. NoteBookCell *cell = [NoteBookCell configCell5:tableView indexPath:indexPath];
  511. cell.cell1Title.text = model.Name;
  512. cell.IsTopV.hidden = !model.IsTop;
  513. cell.cell1readNumberLabel.text = [NSString stringWithFormat:@"阅读:%ld",(long)model.ReadCount];
  514. cell.cell1ShareType.text = [ZYCTool monthAndDayAndHoursAndMinutes:model.CreatedDate];
  515. [cell.cell1IconImage sd_setImageWithURL:[NSURL URLWithString:model.AvatarUrl]placeholderImage:[UIImage imageNamed:@"imagePlaceholder"] ];
  516. cell.cell1contentTitleLabel.attributedText = [self setTitleWithStr:model.Title];
  517. cell.cell1contentContentLabel.attributedText = [self setTextWithStr:model.Content];
  518. MyNoteBookeDataModel * data0Model = model.Data[0];
  519. MyNoteBookeDataModel * data1Model = model.Data[1];
  520. MyNoteBookeDataModel * data2Model = model.Data[2];
  521. MyNoteBookeDataModel * data3Model = model.Data[3];
  522. MyNoteBookeDataModel * data4Model = model.Data[4];
  523. MyNoteBookeDataModel * data5Model = model.Data[5];
  524. MyNoteBookeDataModel * data6Model = model.Data[6];
  525. [cell.cell1IconImageView1 sd_setImageWithURL:[NSURL URLWithString:data0Model.File] placeholderImage:IMG(@"img_placeHolderVertical")];
  526. [cell.cell1IconImageView2 sd_setImageWithURL:[NSURL URLWithString:data1Model.File] placeholderImage:IMG(@"img_placeHolderVertical")];
  527. [cell.cell1IconImageView3 sd_setImageWithURL:[NSURL URLWithString:data2Model.File] placeholderImage:IMG(@"img_placeHolderVertical")];
  528. [cell.cell1IconImageView4 sd_setImageWithURL:[NSURL URLWithString:data3Model.File] placeholderImage:IMG(@"img_placeHolderVertical")];
  529. [cell.cell1IconImageView5 sd_setImageWithURL:[NSURL URLWithString:data4Model.File] placeholderImage:IMG(@"img_placeHolderVertical")];
  530. [cell.cell1IconImageView6 sd_setImageWithURL:[NSURL URLWithString:data5Model.File] placeholderImage:IMG(@"img_placeHolderVertical")];
  531. [cell.cell1IconImageView7 sd_setImageWithURL:[NSURL URLWithString:data6Model.File] placeholderImage:IMG(@"img_placeHolderVertical")];
  532. cell.cellZanButton.selected = model.IsPraise;
  533. if (model.PraiseCount > 0) {
  534. [cell.cellZanButton setTitle:[NSString stringWithFormat:@"%ld",(long)model.PraiseCount] forState:UIControlStateNormal];
  535. }else{
  536. [cell.cellZanButton setTitle:@"赞" forState:UIControlStateNormal];
  537. }
  538. if (model.CommentCount > 0) {
  539. [cell.cellCommentButton setTitle:[NSString stringWithFormat:@"%ld",(long)model.CommentCount] forState:UIControlStateNormal];
  540. }else{
  541. [cell.cellCommentButton setTitle:@"评论" forState:UIControlStateNormal];
  542. }
  543. [cell.cellCommentButton setAction:^{
  544. [weakSelf CommentHanderIndex:indexPath];
  545. }];
  546. [cell.cellZanButton setAction:^{
  547. [weakSelf zanHanderIndex:indexPath];
  548. }];
  549. [cell.cellShareButton setAction:^{
  550. [weakSelf shareHanderModel:model];
  551. }];
  552. cell.ClickUserBlock = ^{
  553. [weakSelf showUserInfo:model.UserId];
  554. };
  555. cell.cell1IconImageView8.hidden = YES;
  556. cell.cell1IconImageView9.hidden = YES;
  557. cell.selectionStyle = UITableViewCellSelectionStyleNone;
  558. return cell;
  559. }break;
  560. case 8:{
  561. NoteBookCell *cell = [NoteBookCell configCell5:tableView indexPath:indexPath];
  562. [cell.cell1IconImage sd_setImageWithURL:[NSURL URLWithString:model.AvatarUrl] placeholderImage:[UIImage imageNamed:@"imagePlaceholder"] ];
  563. cell.cell1Title.text = model.Name;
  564. cell.IsTopV.hidden = !model.IsTop;
  565. cell.cell1readNumberLabel.text = [NSString stringWithFormat:@"阅读:%ld",(long)model.ReadCount];
  566. cell.cell1ShareType.text = [ZYCTool monthAndDayAndHoursAndMinutes:model.CreatedDate];
  567. cell.cell1contentTitleLabel.attributedText = [self setTitleWithStr:model.Title];
  568. cell.cell1contentContentLabel.attributedText = [self setTextWithStr:model.Content];
  569. MyNoteBookeDataModel * data0Model = model.Data[0];
  570. MyNoteBookeDataModel * data1Model = model.Data[1];
  571. MyNoteBookeDataModel * data2Model = model.Data[2];
  572. MyNoteBookeDataModel * data3Model = model.Data[3];
  573. MyNoteBookeDataModel * data4Model = model.Data[4];
  574. MyNoteBookeDataModel * data5Model = model.Data[5];
  575. MyNoteBookeDataModel * data6Model = model.Data[6];
  576. MyNoteBookeDataModel * data7Model = model.Data[7];
  577. [cell.cell1IconImageView1 sd_setImageWithURL:[NSURL URLWithString:data0Model.File] placeholderImage:IMG(@"img_placeHolderVertical")];
  578. [cell.cell1IconImageView2 sd_setImageWithURL:[NSURL URLWithString:data1Model.File] placeholderImage:IMG(@"img_placeHolderVertical")];
  579. [cell.cell1IconImageView3 sd_setImageWithURL:[NSURL URLWithString:data2Model.File] placeholderImage:IMG(@"img_placeHolderVertical")];
  580. [cell.cell1IconImageView4 sd_setImageWithURL:[NSURL URLWithString:data3Model.File] placeholderImage:IMG(@"img_placeHolderVertical")];
  581. [cell.cell1IconImageView5 sd_setImageWithURL:[NSURL URLWithString:data4Model.File] placeholderImage:IMG(@"img_placeHolderVertical")];
  582. [cell.cell1IconImageView6 sd_setImageWithURL:[NSURL URLWithString:data5Model.File] placeholderImage:IMG(@"img_placeHolderVertical")];
  583. [cell.cell1IconImageView7 sd_setImageWithURL:[NSURL URLWithString:data6Model.File] placeholderImage:IMG(@"img_placeHolderVertical")];
  584. [cell.cell1IconImageView8 sd_setImageWithURL:[NSURL URLWithString:data7Model.File] placeholderImage:IMG(@"img_placeHolderVertical")];
  585. cell.cellZanButton.selected = model.IsPraise;
  586. if (model.PraiseCount > 0) {
  587. [cell.cellZanButton setTitle:[NSString stringWithFormat:@"%ld",(long)model.PraiseCount] forState:UIControlStateNormal];
  588. }else{
  589. [cell.cellZanButton setTitle:@"赞" forState:UIControlStateNormal];
  590. }
  591. if (model.CommentCount > 0) {
  592. [cell.cellCommentButton setTitle:[NSString stringWithFormat:@"%ld",(long)model.CommentCount] forState:UIControlStateNormal];
  593. }else{
  594. [cell.cellCommentButton setTitle:@"评论" forState:UIControlStateNormal];
  595. }
  596. [cell.cellCommentButton setAction:^{
  597. [weakSelf CommentHanderIndex:indexPath];
  598. }];
  599. [cell.cellZanButton setAction:^{
  600. [weakSelf zanHanderIndex:indexPath];
  601. }];
  602. [cell.cellShareButton setAction:^{
  603. [weakSelf shareHanderModel:model];
  604. }];
  605. cell.ClickUserBlock = ^{
  606. [weakSelf showUserInfo:model.UserId];
  607. };
  608. cell.cell1IconImageView9.hidden = YES;
  609. cell.selectionStyle = UITableViewCellSelectionStyleNone;
  610. return cell;
  611. }break;
  612. default:{
  613. NoteBookCell *cell = [NoteBookCell configCell5:tableView indexPath:indexPath];
  614. [cell.cell1IconImage sd_setImageWithURL:[NSURL URLWithString:model.AvatarUrl] ];
  615. cell.cell1Title.text = model.Name;
  616. cell.IsTopV.hidden = !model.IsTop;
  617. cell.cell1readNumberLabel.text = [NSString stringWithFormat:@"阅读:%ld",(long)model.ReadCount];
  618. cell.cell1ShareType.text = [ZYCTool monthAndDayAndHoursAndMinutes:model.CreatedDate];
  619. cell.cell1contentTitleLabel.attributedText = [self setTitleWithStr:model.Title];
  620. cell.cell1contentContentLabel.attributedText = [self setTextWithStr:model.Content];
  621. MyNoteBookeDataModel * data0Model = model.Data[0];
  622. MyNoteBookeDataModel * data1Model = model.Data[1];
  623. MyNoteBookeDataModel * data2Model = model.Data[2];
  624. MyNoteBookeDataModel * data3Model = model.Data[3];
  625. MyNoteBookeDataModel * data4Model = model.Data[4];
  626. MyNoteBookeDataModel * data5Model = model.Data[5];
  627. MyNoteBookeDataModel * data6Model = model.Data[6];
  628. MyNoteBookeDataModel * data7Model = model.Data[7];
  629. MyNoteBookeDataModel * data8Model = model.Data[8];
  630. [cell.cell1IconImageView1 sd_setImageWithURL:[NSURL URLWithString:data0Model.File] placeholderImage:IMG(@"img_placeHolderVertical")];
  631. [cell.cell1IconImageView2 sd_setImageWithURL:[NSURL URLWithString:data1Model.File] placeholderImage:IMG(@"img_placeHolderVertical")];
  632. [cell.cell1IconImageView3 sd_setImageWithURL:[NSURL URLWithString:data2Model.File] placeholderImage:IMG(@"img_placeHolderVertical")];
  633. [cell.cell1IconImageView4 sd_setImageWithURL:[NSURL URLWithString:data3Model.File] placeholderImage:IMG(@"img_placeHolderVertical")];
  634. [cell.cell1IconImageView5 sd_setImageWithURL:[NSURL URLWithString:data4Model.File] placeholderImage:IMG(@"img_placeHolderVertical")];
  635. [cell.cell1IconImageView6 sd_setImageWithURL:[NSURL URLWithString:data5Model.File] placeholderImage:IMG(@"img_placeHolderVertical")];
  636. [cell.cell1IconImageView7 sd_setImageWithURL:[NSURL URLWithString:data6Model.File] placeholderImage:IMG(@"img_placeHolderVertical")];
  637. [cell.cell1IconImageView8 sd_setImageWithURL:[NSURL URLWithString:data7Model.File] placeholderImage:IMG(@"img_placeHolderVertical")];
  638. [cell.cell1IconImageView9 sd_setImageWithURL:[NSURL URLWithString:data8Model.File] placeholderImage:IMG(@"img_placeHolderVertical")];
  639. cell.cellZanButton.selected = model.IsPraise;
  640. if (model.PraiseCount > 0) {
  641. [cell.cellZanButton setTitle:[NSString stringWithFormat:@"%ld",(long)model.PraiseCount] forState:UIControlStateNormal];
  642. }else{
  643. [cell.cellZanButton setTitle:@"赞" forState:UIControlStateNormal];
  644. }
  645. if (model.CommentCount > 0) {
  646. [cell.cellCommentButton setTitle:[NSString stringWithFormat:@"%ld",(long)model.CommentCount] forState:UIControlStateNormal];
  647. }else{
  648. [cell.cellCommentButton setTitle:@"评论" forState:UIControlStateNormal];
  649. }
  650. [cell.cellCommentButton setAction:^{
  651. [weakSelf CommentHanderIndex:indexPath];
  652. }];
  653. [cell.cellZanButton setAction:^{
  654. [weakSelf zanHanderIndex:indexPath];
  655. }];
  656. [cell.cellShareButton setAction:^{
  657. [weakSelf shareHanderModel:model];
  658. }];
  659. cell.ClickUserBlock = ^{
  660. [weakSelf showUserInfo:model.UserId];
  661. };
  662. cell.selectionStyle = UITableViewCellSelectionStyleNone;
  663. return cell;
  664. }
  665. break;
  666. }
  667. }
  668. break;
  669. default:///TopiclistCellFile
  670. {
  671. MyNoteBookeDataModel * dataModel = model.Data.firstObject;
  672. NoteBookCell *cell = [NoteBookCell configCell7:tableView indexPath:indexPath];
  673. [cell.cell1IconImage sd_setImageWithURL:[NSURL URLWithString:model.AvatarUrl] placeholderImage:[UIImage imageNamed:@"imagePlaceholder"] ];
  674. [cell setDataWithCell:dataModel];
  675. cell.cell1Title.text = model.Name;
  676. cell.cell1contentTitleLabel.attributedText = [self setTitleWithStr:model.Title];
  677. cell.cell1contentContentLabel.attributedText = [self setTextWithStr:model.Content];
  678. cell.cell1readNumberLabel.text = [NSString stringWithFormat:@"阅读:%ld",(long)model.ReadCount];
  679. cell.cell1ShareType.text = [ZYCTool monthAndDayAndHoursAndMinutes:model.CreatedDate];
  680. cell.cellZanButton.selected = model.IsPraise;
  681. if (model.PraiseCount > 0) {
  682. [cell.cellZanButton setTitle:[NSString stringWithFormat:@"%ld",(long)model.PraiseCount] forState:UIControlStateNormal];
  683. }else{
  684. [cell.cellZanButton setTitle:@"赞" forState:UIControlStateNormal];
  685. }
  686. if (model.CommentCount > 0) {
  687. [cell.cellCommentButton setTitle:[NSString stringWithFormat:@"%ld",(long)model.CommentCount] forState:UIControlStateNormal];
  688. }else{
  689. [cell.cellCommentButton setTitle:@"评论" forState:UIControlStateNormal];
  690. }
  691. [cell.cellCommentButton setAction:^{
  692. [weakSelf CommentHanderIndex:indexPath];
  693. }];
  694. [cell.cellZanButton setAction:^{
  695. [weakSelf zanHanderIndex:indexPath];
  696. }];
  697. [cell.cellShareButton setAction:^{
  698. [weakSelf shareHanderModel:model];
  699. }];
  700. [cell.fileAction setAction:^{
  701. [weakSelf pushFileWithModel:dataModel];
  702. }];
  703. cell.ClickUserBlock = ^{
  704. [weakSelf showUserInfo:model.UserId];
  705. };
  706. cell.selectionStyle = UITableViewCellSelectionStyleNone;
  707. return cell;
  708. }
  709. break;
  710. }
  711. }break;
  712. default:{
  713. MyFavoriteViewCell *cell = [MyFavoriteViewCell configCell0:tableView indexPath:indexPath];
  714. switch (model.RoleId) {
  715. case 1:
  716. {
  717. cell.cell0IconImage.image = IMG(@"find_1");
  718. cell.cell0ShareType.text = @"公开";
  719. }
  720. break;
  721. case 2:
  722. {
  723. cell.cell0IconImage.image = IMG(@"find_0");
  724. cell.cell0ShareType.text = @"私有";
  725. }
  726. break;
  727. default:
  728. {
  729. cell.cell0IconImage.image = IMG(@"find_1");
  730. cell.cell0ShareType.text = [NSString stringWithFormat:@"共享给:%@",model.EnjoyUser];
  731. }
  732. break;
  733. }
  734. cell.cell0Number.text = [NSString stringWithFormat:@"%ld",(long)model.FileCount];
  735. cell.cell0Number.hidden = model.FileCount == 0 ? YES : NO;
  736. cell.cell0Title.text = model.FolderName;
  737. cell.cell0TopImageView.hidden = !model.IsTop;
  738. cell.selectionStyle = UITableViewCellSelectionStyleNone;
  739. return cell;
  740. }break;
  741. }
  742. }
  743. //
  744. //#pragma Mark 左滑按钮 iOS8以上
  745. //#if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_11_0
  746. //- (nullable UISwipeActionsConfiguration *)tableView:(UITableView *)tableView trailingSwipeActionsConfigurationForRowAtIndexPath:(NSIndexPath *)indexPath API_AVAILABLE(ios(11.0)) API_UNAVAILABLE(tvos){
  747. // MyNoteBookSubModel *model = self.noteBookArray[indexPath.row];
  748. // switch (model.AttributeValue) {
  749. // case 1:{
  750. // WEAKSELF
  751. // UIContextualAction *action1 = [UIContextualAction contextualActionWithStyle:UIContextualActionStyleDestructive title:@"删除" handler:^(UIContextualAction * _Nonnull action, __kindof UIView * _Nonnull sourceView, void (^ _Nonnull completionHandler)(BOOL)) {
  752. // [tableView setEditing:NO animated:YES];
  753. // UIAlertController *alertVC = [UIAlertController alertControllerWithTitle:nil message:@"确认删除" preferredStyle:UIAlertControllerStyleAlert];
  754. // UIAlertAction *ok = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) {
  755. //
  756. // }];
  757. // [ok setValue:k9 forKey:@"_titleTextColor"];
  758. // UIAlertAction *noOk = [UIAlertAction actionWithTitle:@"确认" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
  759. // [weakSelf deleteFind:@[model].mutableCopy];
  760. // }];
  761. // [alertVC addAction:ok];
  762. // [alertVC addAction:noOk];
  763. // completionHandler(YES);
  764. // [weakSelf presentViewController:alertVC animated:YES completion:nil];
  765. // }];
  766. // action1.backgroundColor = RGB(255, 59, 47);
  767. // UIContextualAction *action2 = [UIContextualAction contextualActionWithStyle:UIContextualActionStyleNormal title:@"编辑" handler:^(UIContextualAction * _Nonnull action, __kindof UIView * _Nonnull sourceView, void (^ _Nonnull completionHandler)(BOOL)) {
  768. // STRONGSELF
  769. // [tableView setEditing:NO animated:YES];
  770. // [strongSelf eidtorNoteBook:model];
  771. // }];
  772. // action2.backgroundColor = UIColorHex(#FF923A);
  773. // UIContextualAction *action3 = [UIContextualAction contextualActionWithStyle:UIContextualActionStyleNormal title:@"移动" handler:^(UIContextualAction * _Nonnull action, __kindof UIView * _Nonnull sourceView, void (^ _Nonnull completionHandler)(BOOL)) {
  774. // STRONGSELF
  775. // [tableView setEditing:NO animated:YES];
  776. // [strongSelf launchMoveVC:@[@(model.Id)].mutableCopy];
  777. // }];
  778. // action3.backgroundColor = UIColorHex(#589AF1);
  779. // UIContextualAction *action4 = [UIContextualAction contextualActionWithStyle:UIContextualActionStyleNormal title:model.IsTop ?@"取消置顶" :@"置顶" handler:^(UIContextualAction * _Nonnull action, __kindof UIView * _Nonnull sourceView, void (^ _Nonnull completionHandler)(BOOL)) {
  780. // STRONGSELF
  781. // [tableView setEditing:NO animated:YES];
  782. // [strongSelf topFind:model];
  783. // }];
  784. // action4.backgroundColor = UIColorHex(#9BA9CB);
  785. // UISwipeActionsConfiguration *actions = [UISwipeActionsConfiguration configurationWithActions:@[action1,action2,action3,action4]];
  786. // actions.performsFirstActionWithFullSwipe = NO;
  787. // return actions;
  788. // }break;
  789. // default:{
  790. // WEAKSELF
  791. // UIContextualAction *action1 = [UIContextualAction contextualActionWithStyle:UIContextualActionStyleDestructive title:@"删除" handler:^(UIContextualAction * _Nonnull action, __kindof UIView * _Nonnull sourceView, void (^ _Nonnull completionHandler)(BOOL)) {
  792. // [tableView setEditing:NO animated:YES];
  793. // UIAlertController *alertVC = [UIAlertController alertControllerWithTitle:nil message:@"确认删除" preferredStyle:UIAlertControllerStyleAlert];
  794. // UIAlertAction *ok = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
  795. //
  796. // }];
  797. // [ok setValue:k9 forKey:@"_titleTextColor"];
  798. // UIAlertAction *noOk = [UIAlertAction actionWithTitle:@"确认" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
  799. // [weakSelf deleteFind:@[model].mutableCopy];
  800. // }];
  801. // [alertVC addAction:ok];
  802. // [alertVC addAction:noOk];
  803. // [weakSelf presentViewController:alertVC animated:YES completion:nil];
  804. // }];
  805. // action1.backgroundColor = RGB(255, 59, 47);
  806. // UIContextualAction *action2 = [UIContextualAction contextualActionWithStyle:UIContextualActionStyleDestructive title:@"重命名" handler:^(UIContextualAction * _Nonnull action, __kindof UIView * _Nonnull sourceView, void (^ _Nonnull completionHandler)(BOOL)) {
  807. // MyFavoriteNewFindVC *vc = [MyFavoriteNewFindVC initMyFavoriteNewFindVC];
  808. // vc.ParentId = model.Id;
  809. // vc.foldId = model.Id;
  810. // vc.createFoldType = CreateNotesType;
  811. // vc.modifyTye = ModifyType;
  812. // vc.fileType = NewOtherFileType;
  813. // vc.titleStr = @"修改文件夹";
  814. // vc.roleId = model.RoleId;
  815. // vc.fileName = model.FolderName;
  816. // [tableView setEditing:NO animated:YES];
  817. // [weakSelf.navigationController pushViewController:vc animated:YES];
  818. // }];
  819. // action2.backgroundColor = UIColorHex(#FF923A);
  820. //
  821. // UIContextualAction *action3 = [UIContextualAction contextualActionWithStyle:UIContextualActionStyleDestructive title:@"移动" handler:^(UIContextualAction * _Nonnull action, __kindof UIView * _Nonnull sourceView, void (^ _Nonnull completionHandler)(BOOL)) {
  822. // [tableView setEditing:NO animated:YES];
  823. // [weakSelf launchMoveVC:@[@(model.Id)].mutableCopy];
  824. // }];
  825. // action3.backgroundColor = UIColorHex(#529DF8);
  826. //
  827. // UIContextualAction *action4 = [UIContextualAction contextualActionWithStyle:UIContextualActionStyleDestructive title:model.IsTop?@"取消置顶" :@"置顶" handler:^(UIContextualAction * _Nonnull action, __kindof UIView * _Nonnull sourceView, void (^ _Nonnull completionHandler)(BOOL)) {
  828. // [tableView setEditing:NO animated:YES];
  829. // [weakSelf topFind:model];
  830. // }];
  831. // action4.backgroundColor = UIColorHex(#9BA9CB);
  832. // UISwipeActionsConfiguration *actions = [UISwipeActionsConfiguration configurationWithActions:@[action1, action2, action3,action4]];
  833. // actions.performsFirstActionWithFullSwipe = NO;
  834. // return actions;
  835. // }break;
  836. // }
  837. //}
  838. //#else
  839. //- (NSArray<UITableViewRowAction *> *)tableView:(UITableView *)tableView editActionsForRowAtIndexPath:(NSIndexPath *)indexPath {
  840. // MyNoteBookSubModel *model = self.noteBookArray[indexPath.row];
  841. // switch (model.AttributeValue) {
  842. // case 1:{
  843. // WEAKSELF
  844. // UITableViewRowAction *action1 = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDestructive title:@"删除" handler:^(UITableViewRowAction * _Nonnull action, NSIndexPath * _Nonnull indexPath) {
  845. // UIAlertController *alertVC = [UIAlertController alertControllerWithTitle:nil message:@"确认删除" preferredStyle:UIAlertControllerStyleAlert];
  846. // UIAlertAction *ok = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
  847. //
  848. // }];
  849. // [ok setValue:k9 forKey:@"_titleTextColor"];
  850. // UIAlertAction *noOk = [UIAlertAction actionWithTitle:@"确认" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
  851. // [weakSelf deleteFind:@[model].mutableCopy];
  852. // }];
  853. // [alertVC addAction:ok];
  854. // [alertVC addAction:noOk];
  855. // [weakSelf presentViewController:alertVC animated:YES completion:nil];
  856. // }];
  857. //
  858. // action1.backgroundColor = RGB(255, 59, 47);
  859. // UITableViewRowAction *action2 = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDestructive title:@"编辑" handler:^(UITableViewRowAction * _Nonnull action, NSIndexPath * _Nonnull indexPath) {
  860. // [weakSelf eidtorNoteBook:model];
  861. // }];
  862. // action2.backgroundColor = UIColorHex(#FF923A);
  863. // UITableViewRowAction *action3 = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDestructive title:@"移动" handler:^(UITableViewRowAction * _Nonnull action, NSIndexPath * _Nonnull indexPath) {
  864. // [weakSelf launchMoveVC:@[@(model.Id)].mutableCopy];
  865. //
  866. // }];
  867. // action3.backgroundColor = UIColorHex(#589AF1);
  868. // UITableViewRowAction *action4 = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDestructive title:model.IsTop ?@"取消置顶" :@"置顶" handler:^(UITableViewRowAction * _Nonnull action, NSIndexPath * _Nonnull indexPath) {
  869. // [weakSelf topFind:model];
  870. // }];
  871. // action4.backgroundColor =UIColorHex(#9BA9CB);
  872. //
  873. // return @[action1, action2, action3,action4];
  874. // }break;
  875. // default:{
  876. // WEAKSELF
  877. // UITableViewRowAction *action1 = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDestructive title:@"删除" handler:^(UITableViewRowAction * _Nonnull action, NSIndexPath * _Nonnull indexPath) {
  878. // UIAlertController *alertVC = [UIAlertController alertControllerWithTitle:nil message:@"确认删除" preferredStyle:UIAlertControllerStyleAlert];
  879. // UIAlertAction *ok = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
  880. //
  881. // }];
  882. // [ok setValue:k9 forKey:@"_titleTextColor"];
  883. // UIAlertAction *noOk = [UIAlertAction actionWithTitle:@"确认" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
  884. // [weakSelf deleteFind:@[model].mutableCopy];
  885. // }];
  886. // [alertVC addAction:ok];
  887. // [alertVC addAction:noOk];
  888. // [weakSelf presentViewController:alertVC animated:YES completion:nil];
  889. // }];
  890. // action1.backgroundColor = RGB(255, 59, 47);
  891. //
  892. // UITableViewRowAction *action2 = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDestructive title:@"重命名" handler:^(UITableViewRowAction * _Nonnull action, NSIndexPath * _Nonnull indexPath) {
  893. // MyFavoriteNewFindVC *vc = [MyFavoriteNewFindVC initMyFavoriteNewFindVC];
  894. // vc.ParentId = model.Id;
  895. // vc.foldId = model.Id;
  896. // vc.createFoldType = CreateNotesType;
  897. // vc.modifyTye = ModifyType;
  898. // vc.fileType = NewOtherFileType;
  899. // vc.titleStr = @"修改文件夹";
  900. // vc.roleId = model.RoleId;
  901. // vc.fileName = model.FolderName;
  902. // [weakSelf.navigationController pushViewController:vc animated:YES];
  903. //
  904. // }];
  905. // action2.backgroundColor = UIColorHex(#FF923A);
  906. // UITableViewRowAction *action3 = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDestructive title:@"移动" handler:^(UITableViewRowAction * _Nonnull action, NSIndexPath * _Nonnull indexPath) {
  907. // [weakSelf launchMoveVC:@[@(model.Id)].mutableCopy];
  908. // }];
  909. // action3.backgroundColor = UIColorHex(#529DF8);
  910. // UITableViewRowAction *action4 = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDestructive title: model.IsTop?@"取消置顶" :@"置顶" handler:^(UITableViewRowAction * _Nonnull action, NSIndexPath * _Nonnull indexPath) {
  911. // [weakSelf topFind:model];
  912. // }];
  913. // action4.backgroundColor = UIColorHex(#9BA9CB);
  914. // return @[action1, action2, action3,action4];
  915. // }break;
  916. // }
  917. //}
  918. //#endif
  919. //- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath
  920. //{
  921. // return YES;
  922. //}
  923. //- (void)tableView:(UITableView*)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath*)indexPath
  924. //{
  925. //}
  926. - (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath
  927. {
  928. return UITableViewCellEditingStyleNone;
  929. }
  930. - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
  931. [tableView deselectRowAtIndexPath:indexPath animated:YES];
  932. MyNoteBookSubModel *model = self.noteBookArray[indexPath.row];
  933. switch (model.AttributeValue) {
  934. case 1:{
  935. MyTDTopicDetailVC * vc = [MyTDTopicDetailVC initMyTDTopicDetailVC];
  936. vc.Id = model.MiddleId;
  937. vc.type = CollectModel_NoteBook;
  938. [self.navigationController pushViewController:vc animated:YES];
  939. }break;
  940. case 2:{
  941. NoteBookVC *vc = [NoteBookVC initNoteBookVC];
  942. if (model.ParentId == 0) {
  943. vc.listType = MyFavoriteListLevelTypeB;
  944. }else{
  945. vc.listType = MyFavoriteListLevelTypeC;
  946. }
  947. vc.ParentId = model.ParentId;
  948. vc.FolderId = model.Id;
  949. vc.RoleId = model.RoleId;
  950. vc.myTitle = model.FolderName;
  951. vc.isSubVC = YES;
  952. [self.navigationController pushViewController:vc animated:YES];
  953. }break;
  954. default:
  955. break;
  956. }
  957. }
  958. - (void)showUserInfo:(NSInteger)userId
  959. {
  960. MailListDetailVC * vc = [MailListDetailVC initMailListDetailVC];
  961. vc.indexId = userId;
  962. [self.navigationController pushViewController:vc animated:YES];
  963. }
  964. - (NSMutableArray <MyNoteBookSubModel*>*)noteBookArray{
  965. if (!_noteBookArray) {
  966. _noteBookArray = [NSMutableArray array];
  967. }
  968. return _noteBookArray;
  969. }
  970. //MARK:截图
  971. - (UIImage *)getImageWithCell:(UITableViewCell*)cell {
  972. UIGraphicsBeginImageContextWithOptions(CGSizeMake(kGXScreenWidth, 60), NO, 1.0);
  973. CGContextRef context=UIGraphicsGetCurrentContext();
  974. CGContextDrawImage(context, CGRectMake(0, 3, kGXScreenWidth, 60), [UIImage new].CGImage);
  975. [cell.contentView.layer renderInContext:context];
  976. UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
  977. UIGraphicsEndImageContext();
  978. return image;
  979. }
  980. #pragma -mark 点赞
  981. - (void)zanHanderIndex:(NSIndexPath *)indexPath{
  982. MyNoteBookSubModel *mdoel = self.noteBookArray[indexPath.row];
  983. SHOWLOADING
  984. NSMutableDictionary *dic = [NSMutableDictionary dictionary];
  985. [dic setValue:@(mdoel.MiddleId) forKey:@"SourceId"];
  986. [dic setValue:@([AppUserModel sharedAppUserModel].Id) forKey:@"UserId"];
  987. [dic setValue:@(1) forKey:@"AnalyzeType"];//详情点赞
  988. [dic setValue:@(0) forKey:@"CommentId"];
  989. [dic setValue:@(3) forKey:@"TypeValue"];//笔记 3
  990. WS(weakSelf);
  991. [[HttpManager sharedHttpManager] POSTUrl:Host(API_APP_Analyze_Set) parameters:dic responseStyle:DATA success:^(id _Nonnull responseObject) {
  992. mdoel.IsPraise = !mdoel.IsPraise;
  993. if (mdoel.IsPraise) {
  994. SHOWSUCCESS(@"点赞成功");
  995. ++ mdoel.PraiseCount;
  996. }else{
  997. SHOWSUCCESS(@"取消点赞");
  998. -- mdoel.PraiseCount;
  999. }
  1000. dispatch_async(dispatch_get_main_queue(), ^{
  1001. [weakSelf.tableView reloadRow:indexPath.row inSection:indexPath.section withRowAnimation:UITableViewRowAnimationNone];
  1002. });
  1003. } failure:^(NSError * _Nonnull error) {
  1004. SHOWERROR([ZYCTool handerResultData:error]);
  1005. }];
  1006. }
  1007. #pragma -mark 评论
  1008. - (void)CommentHanderIndex:(NSIndexPath *)indexPath{
  1009. MyNoteBookSubModel *model = self.noteBookArray[indexPath.row];
  1010. MyTDTopicDetailVC * vc = [MyTDTopicDetailVC initMyTDTopicDetailVC];
  1011. vc.Id = model.MiddleId;
  1012. vc.type = CollectModel_NoteBook;
  1013. [self.navigationController pushViewController:vc animated:YES];
  1014. }
  1015. #pragma mark - 点击文件跳转
  1016. - (void)pushFileWithModel:(MyNoteBookeDataModel *)model
  1017. {
  1018. WS(weakSelf);
  1019. switch (model.Type) {
  1020. case CollectModel_Aritle:
  1021. {
  1022. SHOWLOADING
  1023. [[HttpManager sharedHttpManager] GETWithUrl:[NSString stringWithFormat:@"%@%ld",Article_Detail_Get,(long)model.Id] parameters:@{} success:^(id _Nonnull responseObject) {
  1024. REMOVESHOW;
  1025. Item *itemModel = [[Item alloc]initWithDictionary:responseObject error:nil];
  1026. // HomeDetailController *homeDetail = [[HomeDetailController alloc] init];
  1027. // [homeDetail loadCurrentModel:itemModel];
  1028. // [weakSelf.navigationController pushViewController:homeDetail animated:YES];
  1029. MyTDTopicDetailVC * vc = [MyTDTopicDetailVC initMyTDTopicDetailVC];
  1030. vc.type = CollectModel_Aritle;
  1031. vc.Id = itemModel.Id;
  1032. [weakSelf.navigationController pushViewController:vc animated:YES];
  1033. } failure:^(NSError * _Nonnull error) {
  1034. SHOWERROR([ZYCTool handerResultData:error]);
  1035. }];
  1036. }
  1037. break;
  1038. case CollectModel_Toipc:
  1039. {
  1040. MyTDTopicDetailVC * vc = [MyTDTopicDetailVC initMyTDTopicDetailVC];
  1041. vc.type = CollectModel_Toipc;
  1042. vc.Id = model.Id;
  1043. [self.navigationController pushViewController:vc animated:YES];
  1044. }
  1045. break;
  1046. case CollectModel_NewTopic:
  1047. {
  1048. MyTDTopicDetailVC * vc = [MyTDTopicDetailVC initMyTDTopicDetailVC];
  1049. vc.type = CollectModel_NewTopic;
  1050. vc.Id = model.Id;
  1051. [self.navigationController pushViewController:vc animated:YES];
  1052. }
  1053. break;
  1054. case CollectModel_Collect:
  1055. {
  1056. }
  1057. break;
  1058. case CollectModel_CollectFile:{
  1059. OtherFavoriteVC * vc = [OtherFavoriteVC initOtherFavoriteVC];
  1060. vc.listType = model.Id == 0 ? MyFavoriteListLevelTypeA : MyFavoriteListLevelTypeB;
  1061. vc.FolderId = model.Id;
  1062. vc.Author = model.Author;
  1063. vc.myTitle = model.Title;
  1064. vc.VisitUserId = model.SourceUserId;
  1065. [self.navigationController pushViewController:vc animated:YES];
  1066. }break;
  1067. case CollectModel_NoteFile: {
  1068. OtherNoteBookVC * vc = [OtherNoteBookVC initOtherNoteBookVC];
  1069. vc.listType = model.Id == 0 ? MyFavoriteListLevelTypeA : MyFavoriteListLevelTypeB;
  1070. vc.FolderId = model.Id;
  1071. vc.Author = model.Author;
  1072. vc.myTitle = model.Title;
  1073. vc.VisitUserId = model.SourceUserId;
  1074. [self.navigationController pushViewController:vc animated:YES];
  1075. }break;
  1076. case CollectModel_NoteBook:
  1077. {
  1078. MyTDTopicDetailVC * vc = [MyTDTopicDetailVC initMyTDTopicDetailVC];
  1079. vc.type = CollectModel_NoteBook;
  1080. vc.Id = model.Id;
  1081. [self.navigationController pushViewController:vc animated:YES];
  1082. }
  1083. break;
  1084. case CollectModel_Notice:
  1085. {
  1086. MyTDTopicDetailVC * vc = [MyTDTopicDetailVC initMyTDTopicDetailVC];
  1087. vc.type = CollectModel_Notice;
  1088. vc.Id = model.Id;
  1089. [self.navigationController pushViewController:vc animated:YES];
  1090. }
  1091. break;
  1092. case CollectModel_InterMail:
  1093. {
  1094. MyTDTopicDetailVC * vc = [MyTDTopicDetailVC initMyTDTopicDetailVC];
  1095. vc.type = CollectModel_InterMail;
  1096. vc.Id = model.Id;
  1097. [self.navigationController pushViewController:vc animated:YES];
  1098. }
  1099. break;
  1100. case CollectModel_Group:
  1101. {
  1102. TDGroupInfoListVC * vc = [TDGroupInfoListVC initTDGroupInfoListVC];
  1103. vc.GroupId = model.Id;
  1104. vc.titleStr = model.Title;
  1105. [self.navigationController pushViewController:vc animated:YES];
  1106. }
  1107. break;
  1108. case CollectModel_meetMian:
  1109. {
  1110. MyTDTopicDetailVC * vc = [MyTDTopicDetailVC initMyTDTopicDetailVC];
  1111. vc.type = CollectModel_meetMian;
  1112. vc.Id = model.Id;
  1113. [self.navigationController pushViewController:vc animated:YES];
  1114. }
  1115. break;
  1116. case CollectModel_meetDetail:
  1117. {
  1118. WorkFlowDetailsController * vc = [[WorkFlowDetailsController alloc] initWithId:model.Id];
  1119. [self.navigationController pushViewController:vc animated:YES];
  1120. }
  1121. break;
  1122. case CollectModel_work:
  1123. {
  1124. MyApprovalPageDetail * vc = [[MyApprovalPageDetail alloc]init];
  1125. vc.pageType = Type_ONEC;
  1126. vc.indexId = model.Id;
  1127. vc.title = model.Title;
  1128. vc.TodoId = model.Id;
  1129. [self.navigationController pushViewController:vc animated:YES];
  1130. }
  1131. break;
  1132. default:
  1133. {
  1134. DownFileViewController *vc = [[DownFileViewController alloc]init];
  1135. FlowAttachmentsModel * fmodel = [[FlowAttachmentsModel alloc] init];
  1136. fmodel.SoureId = model.Id;
  1137. fmodel.Title = model.Title;
  1138. fmodel.Url = model.File;
  1139. vc.model = fmodel;
  1140. [self.navigationController pushViewController:vc animated:YES];
  1141. }
  1142. break;
  1143. }
  1144. }
  1145. #pragma -mark 转发
  1146. - (NoteBookCommentVC *)noteBookCommentVC{
  1147. if (_noteBookCommentVC == nil) {
  1148. _noteBookCommentVC = [NoteBookCommentVC initNoteBookCommentVC];
  1149. [_noteBookCommentVC.view setFrame:CGRectMake(0,0, SCREEN_WIDTH, SCREEN_HEIGHT)];
  1150. [_noteBookCommentVC.view setHidden:YES];
  1151. }
  1152. return _noteBookCommentVC;
  1153. }
  1154. - (void)shareHanderModel:(MyNoteBookSubModel *)model{
  1155. [self.noteBookShareVC initNoteBookShareData];
  1156. FlowAttachmentsModel * fmodel = [[FlowAttachmentsModel alloc] init];
  1157. fmodel.SoureTypeId = CollectModel_NoteBook;
  1158. fmodel.Title = model.Title;
  1159. fmodel.SoureId = model.MiddleId;
  1160. fmodel.Author = model.Name;
  1161. fmodel.SourceUserId = model.SourceUserId;
  1162. self.isBarReturn = NO;
  1163. self.returnModel = fmodel;
  1164. self.noteBookShareVC.view.hidden = !self.noteBookShareVC.view.hidden;
  1165. }
  1166. - (NoteBookShareVC *)noteBookShareVC{
  1167. if (_noteBookShareVC == nil) {
  1168. _noteBookShareVC = [NoteBookShareVC initNoteBookShareVC];
  1169. [_noteBookShareVC.view setFrame:CGRectMake(0,0, SCREEN_WIDTH, SCREEN_HEIGHT)];
  1170. [_noteBookShareVC.view setHidden:YES];
  1171. _noteBookShareVC.delegate = self;
  1172. }
  1173. return _noteBookShareVC;
  1174. }
  1175. - (void)userSelectType:(NSString *)typeName WithIndexPath:(NSIndexPath *)indexPath
  1176. {
  1177. self.noteBookShareVC.view.hidden = !self.noteBookShareVC.view.hidden;
  1178. if ([typeName isEqualToString:@"发给微信好友"]) {
  1179. [self returnToWechatSession];
  1180. }else if ([typeName isEqualToString:@"发到朋友圈"]){
  1181. [self returnToWechatTimeLine];
  1182. }else if ([typeName isEqualToString:@"发到微博"]){
  1183. [self returnToSina];
  1184. }else if ([typeName isEqualToString:@"发给QQ好友"]){
  1185. [self returnToQQ];
  1186. }else if ([typeName isEqualToString:@"发到消息"]){
  1187. [self returnToMessage];
  1188. }else if ([typeName isEqualToString:@"发到小组"]){
  1189. [self returnToGroup];
  1190. }else if ([typeName isEqualToString:@"发到笔记"]){
  1191. [self returnToNote];
  1192. }else if ([typeName isEqualToString:@"发到话题"]){
  1193. [self returnToTopic];
  1194. }else{
  1195. }
  1196. }
  1197. - (void)shareWebPageToPlatformType:(UMSocialPlatformType)platformType title:(NSString *)title desc:(NSString *)desc url:(NSString *)url
  1198. {
  1199. //创建分享消息对象
  1200. UMSocialMessageObject *messageObject = [UMSocialMessageObject messageObject];
  1201. messageObject.title = title;
  1202. //创建网页内容对象
  1203. UMShareWebpageObject *shareObject = [UMShareWebpageObject shareObjectWithTitle:title descr:desc thumImage:IMG(@"logo_60")];
  1204. //设置网页地址
  1205. shareObject.webpageUrl = url;
  1206. //分享消息对象设置分享内容对象
  1207. messageObject.shareObject = shareObject;
  1208. //调用分享接口
  1209. [[UMSocialManager defaultManager] shareToPlatform:platformType messageObject:messageObject currentViewController:self completion:^(id data, NSError *error) {
  1210. if (error) {
  1211. NSLog(@"************Share fail with error %@*********",error);
  1212. }else{
  1213. NSLog(@"response data is %@",data);
  1214. }
  1215. }];
  1216. }
  1217. - (void)returnToWechatSession
  1218. {
  1219. [self shareWebPageToPlatformType:UMSocialPlatformType_WechatSession title:self.returnModel.Title desc:[NSString stringWithFormat:@"来自-%@",self.returnModel.Author] url:[self returnUrl]];
  1220. }
  1221. - (void)returnToWechatTimeLine
  1222. {
  1223. [self shareWebPageToPlatformType:UMSocialPlatformType_WechatTimeLine title:self.returnModel.Title desc:[NSString stringWithFormat:@"来自-%@",self.returnModel.Author] url:[self returnUrl]];
  1224. }
  1225. - (void)returnToSina
  1226. {
  1227. [self shareWebPageToPlatformType:UMSocialPlatformType_Sina title:self.returnModel.Title desc:[NSString stringWithFormat:@"来自-%@",self.returnModel.Author] url:[self returnUrl]];
  1228. }
  1229. - (void)returnToQQ
  1230. {
  1231. [self shareWebPageToPlatformType:UMSocialPlatformType_QQ title:self.returnModel.Title desc:[NSString stringWithFormat:@"来自-%@",self.returnModel.Author] url:[self returnUrl]];
  1232. }
  1233. - (NSString *)returnUrl
  1234. {
  1235. if (self.isBarReturn) {
  1236. NSString * url = [NSString stringWithFormat:@"%@id=%ld&type=%d&userId=%ld&name=%@&describe=%@",Host(@"/admin/mobile/folderWx?"),(long)self.returnModel.SoureId,CollectModel_NoteFile,(long)self.returnModel.SourceUserId,self.returnModel.Title,self.returnModel.Author];
  1237. return url;
  1238. }else{
  1239. NSString * url = [NSString stringWithFormat:@"%@%ld",Host(@"/admin/mobile/noteDetailsWx?"),(long)self.returnModel.SoureId];
  1240. return url;
  1241. }
  1242. }
  1243. #pragma mark - 分享功能
  1244. - (void)returnToMessage
  1245. {
  1246. ShareListVC * vc = [ShareListVC initShareListVC];
  1247. vc.sendModel = self.returnModel;
  1248. vc.isReturn = YES;
  1249. [self.navigationController pushViewController:vc animated:YES];
  1250. }
  1251. - (void)returnToGroup
  1252. {
  1253. MyTDGroupViewController * vc = [[MyTDGroupViewController alloc] init];
  1254. vc.sendModel = self.returnModel;
  1255. vc.type = CollectModel_Group;
  1256. vc.isReturn = YES;
  1257. [self.navigationController pushViewController:vc animated:YES];
  1258. }
  1259. - (void)returnToNote
  1260. {
  1261. MyTDTopicCreateVC * vc = [MyTDTopicCreateVC initMyTDTopicCreateVC];
  1262. vc.type = CollectModel_NoteBook;
  1263. vc.sendModel = self.returnModel;
  1264. vc.isReturn = YES;
  1265. [self.navigationController pushViewController:vc animated:YES];
  1266. }
  1267. - (void)returnToTopic
  1268. {
  1269. MyTDTopicCreateVC * vc = [MyTDTopicCreateVC initMyTDTopicCreateVC];
  1270. vc.sendModel = self.returnModel;
  1271. vc.type = CollectModel_NewTopic;
  1272. vc.isReturn = YES;
  1273. [self.navigationController pushViewController:vc animated:YES];
  1274. }
  1275. - (NSAttributedString *)setTextWithStr:(NSString *)str
  1276. {
  1277. NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc] initWithString:str];
  1278. [attributedString addAttribute:NSFontAttributeName value:[UIFont fontWithName:@"PingFang SC" size:16] range:NSMakeRange(0, str.length)];
  1279. [attributedString addAttribute:NSForegroundColorAttributeName value:UIColorHex(#484848) range:NSMakeRange(0, str.length)];
  1280. NSMutableParagraphStyle *paraStyle = [[NSMutableParagraphStyle alloc]init];
  1281. paraStyle.alignment = NSTextAlignmentJustified;//两端对齐
  1282. [paraStyle setLineSpacing:5];//行间距
  1283. [attributedString addAttribute:NSParagraphStyleAttributeName value:paraStyle range:NSMakeRange(0, str.length)];
  1284. [attributedString addAttribute:NSUnderlineStyleAttributeName value:[NSNumber numberWithInteger:NSUnderlineStyleNone] range:NSMakeRange(0, str.length)];
  1285. return attributedString;
  1286. }
  1287. - (NSAttributedString *)setTitleWithStr:(NSString *)str
  1288. {
  1289. NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc] initWithString:str];
  1290. [attributedString addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:18] range:NSMakeRange(0, str.length)];
  1291. [attributedString addAttribute:NSForegroundColorAttributeName value:UIColorHex(0x0a0a0a) range:NSMakeRange(0, str.length)];
  1292. NSMutableParagraphStyle *paraStyle = [[NSMutableParagraphStyle alloc]init];
  1293. paraStyle.alignment = NSTextAlignmentJustified;//两端对齐
  1294. [paraStyle setLineSpacing:5];//行间距
  1295. [attributedString addAttribute:NSParagraphStyleAttributeName value:paraStyle range:NSMakeRange(0, str.length)];
  1296. [attributedString addAttribute:NSUnderlineStyleAttributeName value:[NSNumber numberWithInteger:NSUnderlineStyleNone] range:NSMakeRange(0, str.length)];
  1297. return attributedString;
  1298. }
  1299. @end