CommonNoteVC.m 76 KB

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