// // NoteDraftVC.m // smartRhino // // Created by niuzhen on 2020/8/4. // Copyright © 2020 tederen. All rights reserved. // #import "NoteDraftVC.h" #import "MyFavoriteViewCell.h" #import "YCMenuView.h" #import "ShowNewGroupAlert.h" #import "MyFavoriteNewFindVC.h" #import "MyCenterSearchVC.h" #import "MoveViewController.h" #import "NoteBookCell.h" #import "NoteBookDetailVC.h" #import "NoteBookCommentVC.h" #import "ZFReOrderTableView.h" #import "NoteBookShareVC.h" #import "MyTDGroupViewController.h" #import "MyTDTopicCreateVC.h" #import "MyTDTopicDetailVC.h" #import "MoveViewController.h" #import "HomeDetailController.h" #import "TDGroupInfoListVC.h" #import "WorkFlowDetailsController.h" #import "MyApprovalPageDetail.h" #import "DownFileViewController.h" #import "MyFavoriteVC.h" #import "NoteBookSearchVC.h" #import "OtherFavoriteVC.h" #import "OtherNoteBookVC.h" #import "MailListDetailVC.h" #import "ShareListVC.h" #import "MyTDGroupView.h" @interface NoteDraftVC () @property (weak, nonatomic) IBOutlet UIButton *rightAddButton; @property (weak, nonatomic) IBOutlet UIButton *rightEditBtn; @property (strong, nonatomic) UITableView *tableView; @property (weak, nonatomic) IBOutlet UIView *HeadView; @property (weak, nonatomic) IBOutlet UIButton *operationAllSelectButton; @property (strong, nonatomic) MyTDGroupView *SearchView; @property (weak, nonatomic) IBOutlet UILabel *vcTitleLabel; @property (strong,nonatomic) NSMutableArray *noteBookArray; @property (nonatomic, assign) Boolean isFresh; @property (nonatomic,assign) NSInteger currentPage; @property (nonatomic,assign) NSInteger totalPage; @property (nonatomic,assign) BOOL iSViewEditor; @property (nonatomic,assign) BOOL isRefresh; @property (strong,nonatomic) NSMutableArray *taskActionArray; @property (nonatomic,strong) UIView * operationBottomBgView; @property(strong,nonatomic)UIImageView *cellImage; @property(strong,nonatomic)NSIndexPath *currentPath; @property(strong,nonatomic)MyFavoriteViewCell *currentCell; @property(assign,nonatomic)CGFloat orignY; @property (nonatomic,assign) BOOL isBarReturn; @property (strong, nonatomic) FlowAttachmentsModel * returnModel; @end @implementation NoteDraftVC +(NoteDraftVC *)initNoteDraftVC{ NoteDraftVC *controller = [StoryboardManager.shared.Common instantiateViewControllerWithIdentifier:@"NoteDraftVC"]; return controller; } - (MyTDGroupView *)SearchView { if (!_SearchView) { _SearchView = [[MyTDGroupView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 36)]; } return _SearchView; } #pragma mark - UItableView刷新 - (void)addRefresh { WS(weakSelf); self.tableView.mj_header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{ [weakSelf headRefresh]; }]; self.tableView.mj_footer = [MJRefreshAutoNormalFooter footerWithRefreshingBlock:^{ [weakSelf footerRefresh]; }]; [self.tableView.mj_header beginRefreshing]; } - (void)headRefresh{ self.isFresh = YES; self.currentPage = 1; self.totalPage = 1; [self.noteBookArray removeAllObjects]; [self getDataList]; } - (void)footerRefresh{ self.isFresh = NO; self.currentPage += 1; if (self.totalPage == self.noteBookArray.count) { self.currentPage --; [self.tableView.mj_footer resetNoMoreData]; return ; } } - (void)getDataList{ WS(weakSelf); SHOWLOADING [[HttpManager sharedHttpManager] POSTUrl:Host(API_APP_Note_Draft_List) parameters:@{@"FolderId":@(0),@"Page":@(self.currentPage),@"PerPage":@(20),@"VisitUserId":@(0),@"SearchKey":@"",@"Sort":@"",@"TypeValue":@(self.TypeValue)} responseStyle:JOSN success:^(id _Nonnull responseObject) { NSLog(@"笔记列表数据 %@",responseObject); REMOVESHOW MyNoteBookModel *listModel = [[MyNoteBookModel alloc] initWithDictionary:responseObject error:nil]; weakSelf.totalPage = listModel.Total; [weakSelf.noteBookArray addObjectsFromArray:listModel.Items]; dispatch_async(dispatch_get_main_queue(), ^{ [weakSelf.tableView.mj_header endRefreshing]; [weakSelf.tableView.mj_footer endRefreshing]; [weakSelf.tableView reloadData]; }); } failure:^(NSError * _Nonnull error) { REMOVESHOW }]; } - (UITableView *)tableView { if (!_tableView) { _tableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStylePlain]; _tableView.separatorStyle = UITableViewCellSeparatorStyleNone; } return _tableView; } - (void)viewDidLoad { [super viewDidLoad]; WS(weakSelf); self.tableView.showsVerticalScrollIndicator= NO; self.fd_prefersNavigationBarHidden = YES; [self.HeadView addSubview:self.SearchView]; [self.SearchView mas_makeConstraints:^(MASConstraintMaker *make) { make.top.mas_offset(6); make.left.right.mas_equalTo(self.HeadView); make.height.mas_offset(36); }]; self.tableView.delegate = self; self.tableView.dataSource = self; [self.view addSubview:self.tableView]; [self.tableView mas_makeConstraints:^(MASConstraintMaker *make) { make.left.right.mas_equalTo(self.view); make.top.mas_equalTo(self.SearchView.mas_bottom); if (@available(iOS 11.0, *)) { make.bottom.equalTo(self.view.mas_safeAreaLayoutGuideBottom); } else { make.bottom.equalTo(self.view.mas_bottom); } }]; [self.rightAddButton setAction:^{ NSLog(@"rightAddButton"); }]; [self.SearchView.button setAction:^{ NoteBookSearchVC * vc = [[NoteBookSearchVC alloc] init]; vc.IsSelected = NO; vc.TypeValue = weakSelf.TypeValue; [weakSelf.navigationController pushViewController:vc animated:YES]; }]; [self addRefresh]; } - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{ return 1; } - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{ return self.noteBookArray.count; } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ MyNoteBookSubModel *model = self.noteBookArray[indexPath.row]; switch (model.AttributeValue) { case 1:{ switch (model.DataType) { case TopiclistCellNone: { NoteBookCell *cell = [NoteBookCell configCell6:tableView indexPath:indexPath]; [cell.cell1IconImage sd_setImageWithURL:[NSURL URLWithString:model.AvatarUrl] placeholderImage:[UIImage imageNamed:@"imagePlaceholder"]]; cell.cell1Title.text = model.Name; cell.cell1readNumberLabel.text = [NSString stringWithFormat:@"阅读:%ld",(long)model.ReadCount]; cell.cell1ShareType.text = [ZYCTool monthAndDayAndHoursAndMinutes:model.CreatedDate]; cell.cell1contentTitleLabel.attributedText = [self setTitleWithStr:model.Title]; cell.cell1contentContentLabel.attributedText = [self setTextWithStr:model.Content]; if ([[self setTitleWithStr:model.Title] length] == 0) { cell.cell1contentTitleLabel.hidden = YES; cell.titleHeight.constant = 0.f; }else{ cell.cell1contentTitleLabel.hidden = NO; cell.titleHeight.constant = 10.f; } if ([[self setTitleWithStr:model.Content] length] == 0) { cell.cell1contentContentLabel.hidden = YES; cell.contentHeight.constant = 0.f; }else{ cell.cell1contentContentLabel.hidden = NO; cell.contentHeight.constant = 10.f; } cell.cellZanButton.selected = model.IsPraise; if (model.PraiseCount > 0) { [cell.cellZanButton setTitle:[NSString stringWithFormat:@"%ld",(long)model.PraiseCount] forState:UIControlStateNormal]; }else{ [cell.cellZanButton setTitle:@"赞" forState:UIControlStateNormal]; } if (model.CommentCount > 0) { [cell.cellCommentButton setTitle:[NSString stringWithFormat:@"%ld",(long)model.CommentCount] forState:UIControlStateNormal]; }else{ [cell.cellCommentButton setTitle:@"评论" forState:UIControlStateNormal]; } cell.IsTopV.hidden = !model.IsTop; WS(weakSelf); cell.ClickUserBlock = ^{ [weakSelf showUserInfo:model.UserId]; }; cell.selectionStyle = UITableViewCellSelectionStyleNone; cell.bottomView.hidden = YES; cell.bottomHeight.constant = 0.f; cell.selectionStyle = UITableViewCellSelectionStyleNone; cell.cell1readNumberLabel.hidden = YES; return cell; } break; case TopiclistCellImage: { switch (model.Data.count) { case 1: { NoteBookCell *cell = [NoteBookCell configCell0:tableView indexPath:indexPath]; [cell.cell1IconImage sd_setImageWithURL:[NSURL URLWithString:model.AvatarUrl] placeholderImage:[UIImage imageNamed:@"imagePlaceholder"] ]; cell.cell1Title.text = model.Name; cell.cell1readNumberLabel.text = [NSString stringWithFormat:@"阅读:%ld",(long)model.ReadCount]; cell.cell1ShareType.text = [ZYCTool monthAndDayAndHoursAndMinutes:model.CreatedDate]; cell.IsTopV.hidden = !model.IsTop; if ([[self setTitleWithStr:model.Title] length] == 0) { cell.cell1contentTitleLabel.hidden = YES; }else{ cell.cell1contentTitleLabel.attributedText = [self setTitleWithStr:model.Title]; } if ([[self setTitleWithStr:model.Content] length] == 0) { cell.cell1contentContentLabel.hidden = YES; }else{ cell.cell1contentContentLabel.attributedText = [self setTextWithStr:model.Content]; } MyNoteBookeDataModel * data0Model = model.Data[0]; [cell.cell1IconImageView1 sd_setImageWithURL:[NSURL URLWithString:data0Model.File] placeholderImage:IMG(@"img_placeHolderVertical")]; cell.cellZanButton.selected = model.IsPraise; if (model.PraiseCount > 0) { [cell.cellZanButton setTitle:[NSString stringWithFormat:@"%ld",(long)model.PraiseCount] forState:UIControlStateNormal]; }else{ [cell.cellZanButton setTitle:@"赞" forState:UIControlStateNormal]; } if (model.CommentCount > 0) { [cell.cellCommentButton setTitle:[NSString stringWithFormat:@"%ld",(long)model.CommentCount] forState:UIControlStateNormal]; }else{ [cell.cellCommentButton setTitle:@"评论" forState:UIControlStateNormal]; } WS(weakSelf); cell.ClickUserBlock = ^{ [weakSelf showUserInfo:model.UserId]; }; cell.selectionStyle = UITableViewCellSelectionStyleNone; cell.bottomView.hidden = YES; cell.bottomHeight.constant = 0.f; cell.cell1readNumberLabel.hidden = YES; return cell; }break; case 2:{ NoteBookCell *cell = [NoteBookCell configCell1:tableView indexPath:indexPath]; [cell.cell1IconImage sd_setImageWithURL:[NSURL URLWithString:model.AvatarUrl] placeholderImage:[UIImage imageNamed:@"imagePlaceholder"] ]; if ([[self setTitleWithStr:model.Title] length] == 0) { cell.cell1contentTitleLabel.hidden = YES; }else{ cell.cell1contentTitleLabel.attributedText = [self setTitleWithStr:model.Title]; } if ([[self setTitleWithStr:model.Content] length] == 0) { cell.cell1contentContentLabel.hidden = YES; }else{ cell.cell1contentContentLabel.attributedText = [self setTextWithStr:model.Content]; } cell.cell1Title.text = model.Name; cell.IsTopV.hidden = !model.IsTop; cell.cell1readNumberLabel.text = [NSString stringWithFormat:@"阅读:%ld",(long)model.ReadCount]; cell.cell1ShareType.text = [ZYCTool monthAndDayAndHoursAndMinutes:model.CreatedDate]; MyNoteBookeDataModel * data0Model = model.Data[0]; MyNoteBookeDataModel * data1Model = model.Data[1]; [cell.cell1IconImageView1 sd_setImageWithURL:[NSURL URLWithString:data0Model.File] placeholderImage:IMG(@"img_placeHolderVertical")]; [cell.cell1IconImageView2 sd_setImageWithURL:[NSURL URLWithString:data1Model.File] placeholderImage:IMG(@"img_placeHolderVertical")]; cell.cellZanButton.selected = model.IsPraise; if (model.PraiseCount > 0) { [cell.cellZanButton setTitle:[NSString stringWithFormat:@"%ld",(long)model.PraiseCount] forState:UIControlStateNormal]; }else{ [cell.cellZanButton setTitle:@"赞" forState:UIControlStateNormal]; } if (model.CommentCount > 0) { [cell.cellCommentButton setTitle:[NSString stringWithFormat:@"%ld",(long)model.CommentCount] forState:UIControlStateNormal]; }else{ [cell.cellCommentButton setTitle:@"评论" forState:UIControlStateNormal]; } WS(weakSelf); cell.ClickUserBlock = ^{ [weakSelf showUserInfo:model.UserId]; }; cell.selectionStyle = UITableViewCellSelectionStyleNone; cell.bottomView.hidden = YES; cell.bottomHeight.constant = 0.f; cell.cell1readNumberLabel.hidden = YES; return cell; }break; case 3:{ NoteBookCell *cell = [NoteBookCell configCell2:tableView indexPath:indexPath]; [cell.cell1IconImage sd_setImageWithURL:[NSURL URLWithString:model.AvatarUrl] placeholderImage:[UIImage imageNamed:@"imagePlaceholder"] ]; cell.cell1Title.text = model.Name; cell.IsTopV.hidden = !model.IsTop; cell.cell1readNumberLabel.text = [NSString stringWithFormat:@"阅读:%ld",(long)model.ReadCount]; cell.cell1ShareType.text = [ZYCTool monthAndDayAndHoursAndMinutes:model.CreatedDate]; if ([[self setTitleWithStr:model.Title] length] == 0) { cell.cell1contentTitleLabel.hidden = YES; }else{ cell.cell1contentTitleLabel.attributedText = [self setTitleWithStr:model.Title]; } if ([[self setTitleWithStr:model.Content] length] == 0) { cell.cell1contentContentLabel.hidden = YES; }else{ cell.cell1contentContentLabel.attributedText = [self setTextWithStr:model.Content]; } MyNoteBookeDataModel * data0Model = model.Data[0]; MyNoteBookeDataModel * data1Model = model.Data[1]; MyNoteBookeDataModel * data2Model = model.Data[2]; [cell.cell1IconImageView1 sd_setImageWithURL:[NSURL URLWithString:data0Model.File] placeholderImage:IMG(@"img_placeHolderVertical")]; [cell.cell1IconImageView2 sd_setImageWithURL:[NSURL URLWithString:data1Model.File] placeholderImage:IMG(@"img_placeHolderVertical")]; [cell.cell1IconImageView3 sd_setImageWithURL:[NSURL URLWithString:data2Model.File] placeholderImage:IMG(@"img_placeHolderVertical")]; cell.cellZanButton.selected = model.IsPraise; if (model.PraiseCount > 0) { [cell.cellZanButton setTitle:[NSString stringWithFormat:@"%ld",(long)model.PraiseCount] forState:UIControlStateNormal]; }else{ [cell.cellZanButton setTitle:@"赞" forState:UIControlStateNormal]; } if (model.CommentCount > 0) { [cell.cellCommentButton setTitle:[NSString stringWithFormat:@"%ld",(long)model.CommentCount] forState:UIControlStateNormal]; }else{ [cell.cellCommentButton setTitle:@"评论" forState:UIControlStateNormal]; } WS(weakSelf); cell.ClickUserBlock = ^{ [weakSelf showUserInfo:model.UserId]; }; cell.selectionStyle = UITableViewCellSelectionStyleNone; cell.bottomView.hidden = YES; cell.bottomHeight.constant = 0.f; cell.cell1readNumberLabel.hidden = YES; return cell; }break; case 4:{ NoteBookCell *cell = [NoteBookCell configCell3:tableView indexPath:indexPath]; [cell.cell1IconImage sd_setImageWithURL:[NSURL URLWithString:model.AvatarUrl] placeholderImage:[UIImage imageNamed:@"imagePlaceholder"] ]; cell.cell1Title.text = model.Name; cell.IsTopV.hidden = !model.IsTop; cell.cell1readNumberLabel.text = [NSString stringWithFormat:@"阅读:%ld",(long)model.ReadCount]; cell.cell1ShareType.text = [ZYCTool monthAndDayAndHoursAndMinutes:model.CreatedDate]; if ([[self setTitleWithStr:model.Title] length] == 0) { cell.cell1contentTitleLabel.hidden = YES; }else{ cell.cell1contentTitleLabel.attributedText = [self setTitleWithStr:model.Title]; } if ([[self setTitleWithStr:model.Content] length] == 0) { cell.cell1contentContentLabel.hidden = YES; }else{ cell.cell1contentContentLabel.attributedText = [self setTextWithStr:model.Content]; } MyNoteBookeDataModel * data0Model = model.Data[0]; MyNoteBookeDataModel * data1Model = model.Data[1]; MyNoteBookeDataModel * data2Model = model.Data[2]; MyNoteBookeDataModel * data3Model = model.Data[3]; [cell.cell1IconImageView1 sd_setImageWithURL:[NSURL URLWithString:data0Model.File] placeholderImage:IMG(@"img_placeHolderVertical")]; [cell.cell1IconImageView2 sd_setImageWithURL:[NSURL URLWithString:data1Model.File] placeholderImage:IMG(@"img_placeHolderVertical")]; [cell.cell1IconImageView3 sd_setImageWithURL:[NSURL URLWithString:data2Model.File] placeholderImage:IMG(@"img_placeHolderVertical")]; [cell.cell1IconImageView4 sd_setImageWithURL:[NSURL URLWithString:data3Model.File] placeholderImage:IMG(@"img_placeHolderVertical")]; cell.cellZanButton.selected = model.IsPraise; if (model.PraiseCount > 0) { [cell.cellZanButton setTitle:[NSString stringWithFormat:@"%ld",(long)model.PraiseCount] forState:UIControlStateNormal]; }else{ [cell.cellZanButton setTitle:@"赞" forState:UIControlStateNormal]; } if (model.CommentCount > 0) { [cell.cellCommentButton setTitle:[NSString stringWithFormat:@"%ld",(long)model.CommentCount] forState:UIControlStateNormal]; }else{ [cell.cellCommentButton setTitle:@"评论" forState:UIControlStateNormal]; } WS(weakSelf); cell.ClickUserBlock = ^{ [weakSelf showUserInfo:model.UserId]; }; cell.selectionStyle = UITableViewCellSelectionStyleNone; cell.bottomView.hidden = YES; cell.bottomHeight.constant = 0.f; cell.cell1readNumberLabel.hidden = YES; return cell; }break; case 5:{ NoteBookCell *cell = [NoteBookCell configCell4:tableView indexPath:indexPath]; cell.cell1Title.text = model.Name; cell.cell1readNumberLabel.text = [NSString stringWithFormat:@"阅读:%ld",(long)model.ReadCount]; cell.cell1ShareType.text = [ZYCTool monthAndDayAndHoursAndMinutes:model.CreatedDate]; [cell.cell1IconImage sd_setImageWithURL:[NSURL URLWithString:model.AvatarUrl] placeholderImage:[UIImage imageNamed:@"imagePlaceholder"] ]; cell.IsTopV.hidden = !model.IsTop; if ([[self setTitleWithStr:model.Title] length] == 0) { cell.cell1contentTitleLabel.hidden = YES; }else{ cell.cell1contentTitleLabel.attributedText = [self setTitleWithStr:model.Title]; } if ([[self setTitleWithStr:model.Content] length] == 0) { cell.cell1contentContentLabel.hidden = YES; }else{ cell.cell1contentContentLabel.attributedText = [self setTextWithStr:model.Content]; } MyNoteBookeDataModel * data0Model = model.Data[0]; MyNoteBookeDataModel * data1Model = model.Data[1]; MyNoteBookeDataModel * data2Model = model.Data[2]; MyNoteBookeDataModel * data3Model = model.Data[3]; MyNoteBookeDataModel * data4Model = model.Data[4]; [cell.cell1IconImageView1 sd_setImageWithURL:[NSURL URLWithString:data0Model.File] placeholderImage:IMG(@"img_placeHolderVertical")]; [cell.cell1IconImageView2 sd_setImageWithURL:[NSURL URLWithString:data1Model.File] placeholderImage:IMG(@"img_placeHolderVertical")]; [cell.cell1IconImageView3 sd_setImageWithURL:[NSURL URLWithString:data2Model.File] placeholderImage:IMG(@"img_placeHolderVertical")]; [cell.cell1IconImageView4 sd_setImageWithURL:[NSURL URLWithString:data3Model.File] placeholderImage:IMG(@"img_placeHolderVertical")]; [cell.cell1IconImageView5 sd_setImageWithURL:[NSURL URLWithString:data4Model.File] placeholderImage:IMG(@"img_placeHolderVertical")]; cell.cellZanButton.selected = model.IsPraise; if (model.PraiseCount > 0) { [cell.cellZanButton setTitle:[NSString stringWithFormat:@"%ld",(long)model.PraiseCount] forState:UIControlStateNormal]; }else{ [cell.cellZanButton setTitle:@"赞" forState:UIControlStateNormal]; } if (model.CommentCount > 0) { [cell.cellCommentButton setTitle:[NSString stringWithFormat:@"%ld",(long)model.CommentCount] forState:UIControlStateNormal]; }else{ [cell.cellCommentButton setTitle:@"评论" forState:UIControlStateNormal]; } WS(weakSelf); cell.ClickUserBlock = ^{ [weakSelf showUserInfo:model.UserId]; }; cell.cell1IconImageView6.hidden = YES; cell.selectionStyle = UITableViewCellSelectionStyleNone; cell.bottomView.hidden = YES; cell.bottomHeight.constant = 0.f; cell.cell1readNumberLabel.hidden = YES; return cell; }break; case 6:{ NoteBookCell *cell = [NoteBookCell configCell4:tableView indexPath:indexPath]; cell.cell1Title.text = model.Name; cell.IsTopV.hidden = !model.IsTop; cell.cell1readNumberLabel.text = [NSString stringWithFormat:@"阅读:%ld",(long)model.ReadCount]; cell.cell1ShareType.text = [ZYCTool monthAndDayAndHoursAndMinutes:model.CreatedDate]; [cell.cell1IconImage sd_setImageWithURL:[NSURL URLWithString:model.AvatarUrl] placeholderImage:[UIImage imageNamed:@"imagePlaceholder"] ]; if ([[self setTitleWithStr:model.Title] length] == 0) { cell.cell1contentTitleLabel.hidden = YES; }else{ cell.cell1contentTitleLabel.attributedText = [self setTitleWithStr:model.Title]; } if ([[self setTitleWithStr:model.Content] length] == 0) { cell.cell1contentContentLabel.hidden = YES; }else{ cell.cell1contentContentLabel.attributedText = [self setTextWithStr:model.Content]; } MyNoteBookeDataModel * data0Model = model.Data[0]; MyNoteBookeDataModel * data1Model = model.Data[1]; MyNoteBookeDataModel * data2Model = model.Data[2]; MyNoteBookeDataModel * data3Model = model.Data[3]; MyNoteBookeDataModel * data4Model = model.Data[4]; MyNoteBookeDataModel * data5Model = model.Data[5]; [cell.cell1IconImageView1 sd_setImageWithURL:[NSURL URLWithString:data0Model.File] placeholderImage:IMG(@"img_placeHolderVertical")]; [cell.cell1IconImageView2 sd_setImageWithURL:[NSURL URLWithString:data1Model.File] placeholderImage:IMG(@"img_placeHolderVertical")]; [cell.cell1IconImageView3 sd_setImageWithURL:[NSURL URLWithString:data2Model.File] placeholderImage:IMG(@"img_placeHolderVertical")]; [cell.cell1IconImageView4 sd_setImageWithURL:[NSURL URLWithString:data3Model.File] placeholderImage:IMG(@"img_placeHolderVertical")]; [cell.cell1IconImageView5 sd_setImageWithURL:[NSURL URLWithString:data4Model.File] placeholderImage:IMG(@"img_placeHolderVertical")]; [cell.cell1IconImageView6 sd_setImageWithURL:[NSURL URLWithString:data5Model.File] placeholderImage:IMG(@"img_placeHolderVertical")]; cell.cellZanButton.selected = model.IsPraise; if (model.PraiseCount > 0) { [cell.cellZanButton setTitle:[NSString stringWithFormat:@"%ld",(long)model.PraiseCount] forState:UIControlStateNormal]; }else{ [cell.cellZanButton setTitle:@"赞" forState:UIControlStateNormal]; } if (model.CommentCount > 0) { [cell.cellCommentButton setTitle:[NSString stringWithFormat:@"%ld",(long)model.CommentCount] forState:UIControlStateNormal]; }else{ [cell.cellCommentButton setTitle:@"评论" forState:UIControlStateNormal]; } WS(weakSelf); cell.ClickUserBlock = ^{ [weakSelf showUserInfo:model.UserId]; }; cell.selectionStyle = UITableViewCellSelectionStyleNone; cell.bottomView.hidden = YES; cell.bottomHeight.constant = 0.f; cell.cell1readNumberLabel.hidden = YES; return cell; }break; case 7:{ NoteBookCell *cell = [NoteBookCell configCell5:tableView indexPath:indexPath]; cell.cell1Title.text = model.Name; cell.IsTopV.hidden = !model.IsTop; cell.cell1readNumberLabel.text = [NSString stringWithFormat:@"阅读:%ld",(long)model.ReadCount]; cell.cell1ShareType.text = [ZYCTool monthAndDayAndHoursAndMinutes:model.CreatedDate]; [cell.cell1IconImage sd_setImageWithURL:[NSURL URLWithString:model.AvatarUrl]placeholderImage:[UIImage imageNamed:@"imagePlaceholder"] ]; if ([[self setTitleWithStr:model.Title] length] == 0) { cell.cell1contentTitleLabel.hidden = YES; }else{ cell.cell1contentTitleLabel.attributedText = [self setTitleWithStr:model.Title]; } if ([[self setTitleWithStr:model.Content] length] == 0) { cell.cell1contentContentLabel.hidden = YES; }else{ cell.cell1contentContentLabel.attributedText = [self setTextWithStr:model.Content]; } MyNoteBookeDataModel * data0Model = model.Data[0]; MyNoteBookeDataModel * data1Model = model.Data[1]; MyNoteBookeDataModel * data2Model = model.Data[2]; MyNoteBookeDataModel * data3Model = model.Data[3]; MyNoteBookeDataModel * data4Model = model.Data[4]; MyNoteBookeDataModel * data5Model = model.Data[5]; MyNoteBookeDataModel * data6Model = model.Data[6]; [cell.cell1IconImageView1 sd_setImageWithURL:[NSURL URLWithString:data0Model.File] placeholderImage:IMG(@"img_placeHolderVertical")]; [cell.cell1IconImageView2 sd_setImageWithURL:[NSURL URLWithString:data1Model.File] placeholderImage:IMG(@"img_placeHolderVertical")]; [cell.cell1IconImageView3 sd_setImageWithURL:[NSURL URLWithString:data2Model.File] placeholderImage:IMG(@"img_placeHolderVertical")]; [cell.cell1IconImageView4 sd_setImageWithURL:[NSURL URLWithString:data3Model.File] placeholderImage:IMG(@"img_placeHolderVertical")]; [cell.cell1IconImageView5 sd_setImageWithURL:[NSURL URLWithString:data4Model.File] placeholderImage:IMG(@"img_placeHolderVertical")]; [cell.cell1IconImageView6 sd_setImageWithURL:[NSURL URLWithString:data5Model.File] placeholderImage:IMG(@"img_placeHolderVertical")]; [cell.cell1IconImageView7 sd_setImageWithURL:[NSURL URLWithString:data6Model.File] placeholderImage:IMG(@"img_placeHolderVertical")]; cell.cellZanButton.selected = model.IsPraise; if (model.PraiseCount > 0) { [cell.cellZanButton setTitle:[NSString stringWithFormat:@"%ld",(long)model.PraiseCount] forState:UIControlStateNormal]; }else{ [cell.cellZanButton setTitle:@"赞" forState:UIControlStateNormal]; } if (model.CommentCount > 0) { [cell.cellCommentButton setTitle:[NSString stringWithFormat:@"%ld",(long)model.CommentCount] forState:UIControlStateNormal]; }else{ [cell.cellCommentButton setTitle:@"评论" forState:UIControlStateNormal]; } WS(weakSelf); cell.ClickUserBlock = ^{ [weakSelf showUserInfo:model.UserId]; }; cell.cell1IconImageView8.hidden = YES; cell.cell1IconImageView9.hidden = YES; cell.selectionStyle = UITableViewCellSelectionStyleNone; cell.bottomView.hidden = YES; cell.bottomHeight.constant = 0.f; cell.cell1readNumberLabel.hidden = YES; return cell; }break; case 8:{ NoteBookCell *cell = [NoteBookCell configCell5:tableView indexPath:indexPath]; [cell.cell1IconImage sd_setImageWithURL:[NSURL URLWithString:model.AvatarUrl] placeholderImage:[UIImage imageNamed:@"imagePlaceholder"] ]; cell.cell1Title.text = model.Name; cell.IsTopV.hidden = !model.IsTop; cell.cell1readNumberLabel.text = [NSString stringWithFormat:@"阅读:%ld",(long)model.ReadCount]; cell.cell1ShareType.text = [ZYCTool monthAndDayAndHoursAndMinutes:model.CreatedDate]; if ([[self setTitleWithStr:model.Title] length] == 0) { cell.cell1contentTitleLabel.hidden = YES; }else{ cell.cell1contentTitleLabel.attributedText = [self setTitleWithStr:model.Title]; } if ([[self setTitleWithStr:model.Content] length] == 0) { cell.cell1contentContentLabel.hidden = YES; }else{ cell.cell1contentContentLabel.attributedText = [self setTextWithStr:model.Content]; } MyNoteBookeDataModel * data0Model = model.Data[0]; MyNoteBookeDataModel * data1Model = model.Data[1]; MyNoteBookeDataModel * data2Model = model.Data[2]; MyNoteBookeDataModel * data3Model = model.Data[3]; MyNoteBookeDataModel * data4Model = model.Data[4]; MyNoteBookeDataModel * data5Model = model.Data[5]; MyNoteBookeDataModel * data6Model = model.Data[6]; MyNoteBookeDataModel * data7Model = model.Data[7]; [cell.cell1IconImageView1 sd_setImageWithURL:[NSURL URLWithString:data0Model.File] placeholderImage:IMG(@"img_placeHolderVertical")]; [cell.cell1IconImageView2 sd_setImageWithURL:[NSURL URLWithString:data1Model.File] placeholderImage:IMG(@"img_placeHolderVertical")]; [cell.cell1IconImageView3 sd_setImageWithURL:[NSURL URLWithString:data2Model.File] placeholderImage:IMG(@"img_placeHolderVertical")]; [cell.cell1IconImageView4 sd_setImageWithURL:[NSURL URLWithString:data3Model.File] placeholderImage:IMG(@"img_placeHolderVertical")]; [cell.cell1IconImageView5 sd_setImageWithURL:[NSURL URLWithString:data4Model.File] placeholderImage:IMG(@"img_placeHolderVertical")]; [cell.cell1IconImageView6 sd_setImageWithURL:[NSURL URLWithString:data5Model.File] placeholderImage:IMG(@"img_placeHolderVertical")]; [cell.cell1IconImageView7 sd_setImageWithURL:[NSURL URLWithString:data6Model.File] placeholderImage:IMG(@"img_placeHolderVertical")]; [cell.cell1IconImageView8 sd_setImageWithURL:[NSURL URLWithString:data7Model.File] placeholderImage:IMG(@"img_placeHolderVertical")]; cell.cellZanButton.selected = model.IsPraise; if (model.PraiseCount > 0) { [cell.cellZanButton setTitle:[NSString stringWithFormat:@"%ld",(long)model.PraiseCount] forState:UIControlStateNormal]; }else{ [cell.cellZanButton setTitle:@"赞" forState:UIControlStateNormal]; } if (model.CommentCount > 0) { [cell.cellCommentButton setTitle:[NSString stringWithFormat:@"%ld",(long)model.CommentCount] forState:UIControlStateNormal]; }else{ [cell.cellCommentButton setTitle:@"评论" forState:UIControlStateNormal]; } WS(weakSelf); cell.ClickUserBlock = ^{ [weakSelf showUserInfo:model.UserId]; }; cell.cell1IconImageView9.hidden = YES; cell.selectionStyle = UITableViewCellSelectionStyleNone; cell.bottomView.hidden = YES; cell.bottomHeight.constant = 0.f; cell.cell1readNumberLabel.hidden = YES; return cell; }break; default:{ NoteBookCell *cell = [NoteBookCell configCell5:tableView indexPath:indexPath]; [cell.cell1IconImage sd_setImageWithURL:[NSURL URLWithString:model.AvatarUrl] ]; cell.cell1Title.text = model.Name; cell.IsTopV.hidden = !model.IsTop; cell.cell1readNumberLabel.text = [NSString stringWithFormat:@"阅读:%ld",(long)model.ReadCount]; cell.cell1ShareType.text = [ZYCTool monthAndDayAndHoursAndMinutes:model.CreatedDate]; if ([[self setTitleWithStr:model.Title] length] == 0) { cell.cell1contentTitleLabel.hidden = YES; }else{ cell.cell1contentTitleLabel.attributedText = [self setTitleWithStr:model.Title]; } if ([[self setTitleWithStr:model.Content] length] == 0) { cell.cell1contentContentLabel.hidden = YES; }else{ cell.cell1contentContentLabel.attributedText = [self setTextWithStr:model.Content]; } MyNoteBookeDataModel * data0Model = model.Data[0]; MyNoteBookeDataModel * data1Model = model.Data[1]; MyNoteBookeDataModel * data2Model = model.Data[2]; MyNoteBookeDataModel * data3Model = model.Data[3]; MyNoteBookeDataModel * data4Model = model.Data[4]; MyNoteBookeDataModel * data5Model = model.Data[5]; MyNoteBookeDataModel * data6Model = model.Data[6]; MyNoteBookeDataModel * data7Model = model.Data[7]; MyNoteBookeDataModel * data8Model = model.Data[8]; [cell.cell1IconImageView1 sd_setImageWithURL:[NSURL URLWithString:data0Model.File] placeholderImage:IMG(@"img_placeHolderVertical")]; [cell.cell1IconImageView2 sd_setImageWithURL:[NSURL URLWithString:data1Model.File] placeholderImage:IMG(@"img_placeHolderVertical")]; [cell.cell1IconImageView3 sd_setImageWithURL:[NSURL URLWithString:data2Model.File] placeholderImage:IMG(@"img_placeHolderVertical")]; [cell.cell1IconImageView4 sd_setImageWithURL:[NSURL URLWithString:data3Model.File] placeholderImage:IMG(@"img_placeHolderVertical")]; [cell.cell1IconImageView5 sd_setImageWithURL:[NSURL URLWithString:data4Model.File] placeholderImage:IMG(@"img_placeHolderVertical")]; [cell.cell1IconImageView6 sd_setImageWithURL:[NSURL URLWithString:data5Model.File] placeholderImage:IMG(@"img_placeHolderVertical")]; [cell.cell1IconImageView7 sd_setImageWithURL:[NSURL URLWithString:data6Model.File] placeholderImage:IMG(@"img_placeHolderVertical")]; [cell.cell1IconImageView8 sd_setImageWithURL:[NSURL URLWithString:data7Model.File] placeholderImage:IMG(@"img_placeHolderVertical")]; [cell.cell1IconImageView9 sd_setImageWithURL:[NSURL URLWithString:data8Model.File] placeholderImage:IMG(@"img_placeHolderVertical")]; cell.cellZanButton.selected = model.IsPraise; if (model.PraiseCount > 0) { [cell.cellZanButton setTitle:[NSString stringWithFormat:@"%ld",(long)model.PraiseCount] forState:UIControlStateNormal]; }else{ [cell.cellZanButton setTitle:@"赞" forState:UIControlStateNormal]; } if (model.CommentCount > 0) { [cell.cellCommentButton setTitle:[NSString stringWithFormat:@"%ld",(long)model.CommentCount] forState:UIControlStateNormal]; }else{ [cell.cellCommentButton setTitle:@"评论" forState:UIControlStateNormal]; } WS(weakSelf); cell.ClickUserBlock = ^{ [weakSelf showUserInfo:model.UserId]; }; cell.selectionStyle = UITableViewCellSelectionStyleNone; cell.bottomView.hidden = YES; cell.bottomHeight.constant = 0.f; cell.cell1readNumberLabel.hidden = YES; return cell; } break; } } break; default:///TopiclistCellFile { MyNoteBookeDataModel * dataModel = model.Data.firstObject; NoteBookCell *cell = [NoteBookCell configCell7:tableView indexPath:indexPath]; [cell.cell1IconImage sd_setImageWithURL:[NSURL URLWithString:model.AvatarUrl] placeholderImage:[UIImage imageNamed:@"imagePlaceholder"] ]; [cell setDataWithCell:dataModel]; cell.cell1Title.text = model.Name; cell.cell1contentTitleLabel.attributedText = [self setTitleWithStr:model.Title]; cell.cell1contentContentLabel.attributedText = [self setTextWithStr:model.Content]; if ([[self setTitleWithStr:model.Title] length] == 0) { cell.cell1contentTitleLabel.hidden = YES; cell.titleHeight.constant = 0.f; }else{ cell.cell1contentTitleLabel.hidden = NO; cell.titleHeight.constant = 10.f; } if ([[self setTitleWithStr:model.Content] length] == 0) { cell.cell1contentContentLabel.hidden = YES; cell.contentHeight.constant = 0.f; }else{ cell.cell1contentContentLabel.hidden = NO; cell.contentHeight.constant = 10.f; } cell.IsTopV.hidden = !model.IsTop; cell.cell1readNumberLabel.text = [NSString stringWithFormat:@"阅读:%ld",(long)model.ReadCount]; cell.cell1ShareType.text = [ZYCTool monthAndDayAndHoursAndMinutes:model.CreatedDate]; cell.cellZanButton.selected = model.IsPraise; if (model.PraiseCount > 0) { [cell.cellZanButton setTitle:[NSString stringWithFormat:@"%ld",(long)model.PraiseCount] forState:UIControlStateNormal]; }else{ [cell.cellZanButton setTitle:@"赞" forState:UIControlStateNormal]; } if (model.CommentCount > 0) { [cell.cellCommentButton setTitle:[NSString stringWithFormat:@"%ld",(long)model.CommentCount] forState:UIControlStateNormal]; }else{ [cell.cellCommentButton setTitle:@"评论" forState:UIControlStateNormal]; } WS(weakSelf); [cell.fileAction setAction:^{ [weakSelf pushFileWithModel:dataModel]; }]; cell.ClickUserBlock = ^{ [weakSelf showUserInfo:model.UserId]; }; cell.selectionStyle = UITableViewCellSelectionStyleNone; cell.bottomView.hidden = YES; cell.bottomHeight.constant = 0.f; cell.cell1readNumberLabel.hidden = YES; return cell; } break; } }break; default:{ MyFavoriteViewCell *cell = [MyFavoriteViewCell configCell0:tableView indexPath:indexPath]; switch (model.RoleId) { case 1: { cell.cell0IconImage.image = IMG(@"find_1"); cell.cell0ShareType.text = @"公开"; } break; case 2: { cell.cell0IconImage.image = IMG(@"find_0"); cell.cell0ShareType.text = @"私有"; } break; default: { cell.cell0IconImage.image = IMG(@"find_1"); cell.cell0ShareType.text = [NSString stringWithFormat:@"共享给:%@",model.EnjoyUser]; } break; } cell.IsTopV.hidden = !model.IsTop; cell.cell0Number.text = [NSString stringWithFormat:@"%ld",(long)model.FileCount]; cell.cell0Number.hidden = model.FileCount == 0 ? YES : NO; cell.cell0Title.text = model.FolderName; cell.selectionStyle = UITableViewCellSelectionStyleNone; return cell; }break; } } #pragma Mark 左滑按钮 iOS8以上 - (nullable UISwipeActionsConfiguration *)tableView:(UITableView *)tableView trailingSwipeActionsConfigurationForRowAtIndexPath:(NSIndexPath *)indexPath API_AVAILABLE(ios(11.0)) API_UNAVAILABLE(tvos){ MyNoteBookSubModel *model = self.noteBookArray[indexPath.row]; WS(weakSelf); UIContextualAction *action1 = [UIContextualAction contextualActionWithStyle:UIContextualActionStyleDestructive title:@"删除" handler:^(UIContextualAction * _Nonnull action, __kindof UIView * _Nonnull sourceView, void (^ _Nonnull completionHandler)(BOOL)) { [tableView setEditing:NO animated:YES]; UIAlertController *alertVC = [UIAlertController alertControllerWithTitle:nil message:@"确认删除" preferredStyle:UIAlertControllerStyleAlert]; UIAlertAction *ok = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) { }]; [ok setValue:k9 forKey:@"_titleTextColor"]; UIAlertAction *noOk = [UIAlertAction actionWithTitle:@"确认" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { [weakSelf deleteFind:@[model].mutableCopy indexPath:indexPath]; }]; [alertVC addAction:ok]; [alertVC addAction:noOk]; completionHandler(YES); [weakSelf presentViewController:alertVC animated:YES completion:nil]; }]; action1.backgroundColor = RGB(255, 59, 47); UISwipeActionsConfiguration *actions = [UISwipeActionsConfiguration configurationWithActions:@[action1]]; actions.performsFirstActionWithFullSwipe = NO; return actions; } - (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath { return tableView.editing; } - (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)sourceIndexPath toIndexPath:(NSIndexPath *)destinationIndexPath { MyNoteBookSubModel *model = self.noteBookArray[sourceIndexPath.row]; MyNoteBookSubModel *toModel = self.noteBookArray[destinationIndexPath.row]; WS(weakSelf); if (model.AttributeValue == toModel.AttributeValue && model.IsTop == toModel.IsTop) { [[HttpManager sharedHttpManager] POSTUrl:Host(API_Find_Sort) parameters:@{@"MiddleIdFirst":@(model.Id),@"MiddleIdSecond":@(toModel.Id)} responseStyle:DATA success:^(id _Nonnull responseObject) { [weakSelf.noteBookArray removeObject:model]; [weakSelf.noteBookArray insertObject:model atIndex:destinationIndexPath.row]; dispatch_async(dispatch_get_main_queue(), ^{ [weakSelf.tableView reloadData]; }); } failure:^(NSError * _Nonnull error) { }]; }else{ [weakSelf.noteBookArray removeObject:model]; [weakSelf.noteBookArray insertObject:model atIndex:sourceIndexPath.row]; dispatch_async(dispatch_get_main_queue(), ^{ [weakSelf.tableView reloadData]; }); } } - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{ [tableView deselectRowAtIndexPath:indexPath animated:YES]; MyNoteBookSubModel *model = self.noteBookArray[indexPath.row]; MyTDTopicCreateVC * vc = [MyTDTopicCreateVC initMyTDTopicCreateVC]; vc.type = self.TypeValue == 1 ? CollectModel_NewTopic : CollectModel_NoteBook; vc.FolderId = 0; vc.FolderName = model.FolderName; vc.Id = model.MiddleId; vc.isEdit = YES; [self.navigationController pushViewController:vc animated:YES]; } - (void)showUserInfo:(NSInteger)userId { MailListDetailVC * vc = [MailListDetailVC initMailListDetailVC]; vc.indexId = userId; [self.navigationController pushViewController:vc animated:YES]; } /// 删除文件夹 - (void)deleteFind:(NSMutableArray*)findModelArray indexPath:(NSIndexPath *)indexPath{ NSMutableArray *MiddleIds = [NSMutableArray array]; for (MyNoteBookSubModel *model in findModelArray) { [MiddleIds addObject:@(model.Id)]; } NSMutableDictionary *dic = [[NSMutableDictionary alloc]init]; [dic setValue:MiddleIds forKey:@"MiddleIds"]; [dic setValue:@(4) forKey:@"FolderType"]; WEAKSELF [[HttpManager sharedHttpManager] POSTUrl:Host(API_Find_DeleteRecord) parameters:dic responseStyle:DATA success:^(id _Nonnull responseObject) { [weakSelf.noteBookArray removeObjectAtIndex:indexPath.row]; dispatch_async(dispatch_get_main_queue(), ^{ [weakSelf.tableView reloadData]; }); } failure:^(NSError * _Nonnull error) { SHOWERROR([ZYCTool handerResultData:error]); }]; } - (void)backAction:(id)sender{ [super backAction:sender]; } - (void)menuAction:(id)sender{ [super menuAction:sender]; } - (NSMutableArray *)noteBookArray{ if (!_noteBookArray) { _noteBookArray = [NSMutableArray array]; } return _noteBookArray; } #pragma mark - 点击文件跳转 - (void)pushFileWithModel:(MyNoteBookeDataModel *)model { WS(weakSelf); switch (model.Type) { case CollectModel_Aritle: { [[HttpManager sharedHttpManager] GETWithUrl:[NSString stringWithFormat:@"%@%ld",Article_Detail_Get,(long)model.Id] parameters:@{} success:^(id _Nonnull responseObject) { Item *itemModel = [[Item alloc]initWithDictionary:responseObject error:nil]; // HomeDetailController *homeDetail = [[HomeDetailController alloc] init]; // [homeDetail loadCurrentModel:itemModel]; // [weakSelf.navigationController pushViewController:homeDetail animated:YES]; MyTDTopicDetailVC * vc = [MyTDTopicDetailVC initMyTDTopicDetailVC]; vc.type = CollectModel_Aritle; vc.Id = itemModel.Id; [weakSelf.navigationController pushViewController:vc animated:YES]; } failure:^(NSError * _Nonnull error) { SHOWERROR([ZYCTool handerResultData:error]); }]; } break; case CollectModel_Toipc: { MyTDTopicDetailVC * vc = [MyTDTopicDetailVC initMyTDTopicDetailVC]; vc.type = CollectModel_Toipc; vc.Id = model.Id; [self.navigationController pushViewController:vc animated:YES]; } break; case CollectModel_NewTopic: { MyTDTopicDetailVC * vc = [MyTDTopicDetailVC initMyTDTopicDetailVC]; vc.type = CollectModel_NewTopic; vc.Id = model.Id; [self.navigationController pushViewController:vc animated:YES]; } break; case CollectModel_Collect: { } break; case CollectModel_CollectFile:{ OtherFavoriteVC * vc = [OtherFavoriteVC initOtherFavoriteVC]; vc.listType = model.Id == 0 ? MyFavoriteListLevelTypeA : MyFavoriteListLevelTypeB; vc.FolderId = model.Id; vc.Author = model.Author; vc.myTitle = model.Title; vc.VisitUserId = model.SourceUserId; [self.navigationController pushViewController:vc animated:YES]; }break; case CollectModel_NoteFile: { OtherNoteBookVC * vc = [OtherNoteBookVC initOtherNoteBookVC]; vc.listType = model.Id == 0 ? MyFavoriteListLevelTypeA : MyFavoriteListLevelTypeB; vc.FolderId = model.Id; vc.Author = model.Author; vc.myTitle = model.Title; vc.TypeValue = 1; vc.VisitUserId = model.SourceUserId; [self.navigationController pushViewController:vc animated:YES]; }break; case CollectModel_NoteBook: { MyTDTopicDetailVC * vc = [MyTDTopicDetailVC initMyTDTopicDetailVC]; vc.type = CollectModel_NoteBook; vc.Id = model.Id; [self.navigationController pushViewController:vc animated:YES]; } break; case CollectModel_Notice: { MyTDTopicDetailVC * vc = [MyTDTopicDetailVC initMyTDTopicDetailVC]; vc.type = CollectModel_Notice; vc.Id = model.Id; [self.navigationController pushViewController:vc animated:YES]; } break; case CollectModel_InterMail: { MyTDTopicDetailVC * vc = [MyTDTopicDetailVC initMyTDTopicDetailVC]; vc.type = CollectModel_InterMail; vc.Id = model.Id; [self.navigationController pushViewController:vc animated:YES]; } break; case CollectModel_Group: { TDGroupInfoListVC * vc = [TDGroupInfoListVC initTDGroupInfoListVC]; vc.GroupId = model.Id; vc.titleStr = model.Title; [self.navigationController pushViewController:vc animated:YES]; } break; case CollectModel_meetMian: { MyTDTopicDetailVC * vc = [MyTDTopicDetailVC initMyTDTopicDetailVC]; vc.type = CollectModel_meetMian; vc.Id = model.Id; [self.navigationController pushViewController:vc animated:YES]; } break; case CollectModel_meetDetail: { WorkFlowDetailsController * vc = [[WorkFlowDetailsController alloc] initWithId:model.Id]; [self.navigationController pushViewController:vc animated:YES]; } break; case CollectModel_work: { MyApprovalPageDetail * vc = [[MyApprovalPageDetail alloc]init]; vc.pageType = Type_ONEC; vc.indexId = model.Id; vc.title = model.Title; vc.TodoId = model.Id; [self.navigationController pushViewController:vc animated:YES]; } break; default: { DownFileViewController *vc = [[DownFileViewController alloc]init]; FlowAttachmentsModel * fmodel = [[FlowAttachmentsModel alloc] init]; fmodel.SoureId = model.Id; fmodel.Title = model.Title; fmodel.Url = model.File; vc.model = fmodel; [self.navigationController pushViewController:vc animated:YES]; } break; } } - (NSAttributedString *)setTextWithStr:(NSString *)str { if (str.length == 0) { return [[NSAttributedString alloc] initWithString:@""]; } NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc] initWithString:str]; [attributedString addAttribute:NSFontAttributeName value:[UIFont fontWithName:@"PingFang SC" size:16] range:NSMakeRange(0, str.length)]; [attributedString addAttribute:NSForegroundColorAttributeName value:UIColorHex(#484848) range:NSMakeRange(0, str.length)]; NSMutableParagraphStyle *paraStyle = [[NSMutableParagraphStyle alloc]init]; paraStyle.alignment = NSTextAlignmentJustified;//两端对齐 [paraStyle setLineSpacing:5];//行间距 [attributedString addAttribute:NSParagraphStyleAttributeName value:paraStyle range:NSMakeRange(0, str.length)]; [attributedString addAttribute:NSUnderlineStyleAttributeName value:[NSNumber numberWithInteger:NSUnderlineStyleNone] range:NSMakeRange(0, str.length)]; return attributedString; } - (NSAttributedString *)setTitleWithStr:(NSString *)str { if (str.length == 0) { return [[NSAttributedString alloc] initWithString:@""]; } NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc] initWithString:str]; [attributedString addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:18] range:NSMakeRange(0, str.length)]; [attributedString addAttribute:NSForegroundColorAttributeName value:UIColorHex(0x0a0a0a) range:NSMakeRange(0, str.length)]; NSMutableParagraphStyle *paraStyle = [[NSMutableParagraphStyle alloc]init]; paraStyle.alignment = NSTextAlignmentJustified;//两端对齐 [paraStyle setLineSpacing:5];//行间距 [attributedString addAttribute:NSParagraphStyleAttributeName value:paraStyle range:NSMakeRange(0, str.length)]; [attributedString addAttribute:NSUnderlineStyleAttributeName value:[NSNumber numberWithInteger:NSUnderlineStyleNone] range:NSMakeRange(0, str.length)]; return attributedString; } //-(void)tableView:(UITableView*)tableView willBeginEditingRowAtIndexPath:(NSIndexPath*)indexPath{ // if (__IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_11_0) { // [self makeSwipeButton]; // } //} //- (void)makeSwipeButton //{ // for (UIView *subview in self.tableView.subviews) // { // if ([subview isKindOfClass:NSClassFromString(@"UISwipeActionPullView")] ) // { // [subview layoutIfNeeded]; // for (UIView * view in subview.subviews) { // NSLog(@"view== %@",NSStringFromCGRect(view.frame)); // if (view.frame.size.height > 65) { // [view setFrame:CGRectMake(0, (view.frame.size.height - 65) * 0.5,view.frame.size.width, 65)]; // } // } // } // } //} @end