1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333 |
- //
- // CommonNoteVC.m
- // smartRhino
- //
- // Created by niuzhen on 2020/4/29.
- // Copyright © 2020 tederen. All rights reserved.
- //
- #import "CommonNoteVC.h"
- #import "MyTDGroupView.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 "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 "NoteBookVC.h"
- @interface CommonNoteVC ()<UITableViewDelegate,UITableViewDataSource,NoteBookShareVCDelegate>
- @property (weak, nonatomic) IBOutlet UIButton *rightEditBtn;
- @property (weak, nonatomic) IBOutlet UITableView *tableView;
- @property (weak, nonatomic) IBOutlet UIView *headerView;
- @property (strong, nonatomic) MyTDGroupView *SearchView;
- @property (strong, nonatomic) UIView *noteView;
- @property (strong,nonatomic) NSMutableArray <MyNoteBookSubModel *>*noteBookArray;
- @property (nonatomic, assign) Boolean isFresh;
- @property (nonatomic,assign) NSInteger currentPage;
- @property (nonatomic,assign) NSInteger totalPage;
- @property (strong,nonatomic) NSMutableArray *taskActionArray;
- @property(strong,nonatomic)UIImageView *cellImage;
- @property(strong,nonatomic)NSIndexPath *currentPath;
- @property(assign,nonatomic)CGFloat orignY;
- @property (nonatomic,assign) BOOL isBarReturn;
- @property (strong, nonatomic) NoteBookShareVC *noteBookShareVC;
- @property (strong, nonatomic) NoteBookCommentVC *noteBookCommentVC;
- @property (strong, nonatomic) FlowAttachmentsModel * returnModel;
- @property (nonatomic,assign) NSInteger selectCount;
- @end
- @implementation CommonNoteVC
- +(CommonNoteVC *)initCommonNoteVC{
- CommonNoteVC *controller = [StoryboardManager.shared.Common instantiateViewControllerWithIdentifier:@"CommonNoteVC"];
- return controller;
- }
- #pragma mark -loay
- - (void)addHeaderSubView
- {
- [self.headerView addSubview:self.SearchView];
- [self.SearchView mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.top.right.mas_equalTo(self.headerView);
- make.height.mas_offset(36);
- }];
- [self.headerView addSubview:self.noteView];
- [self.noteView mas_makeConstraints:^(MASConstraintMaker *make) {
- make.top.mas_equalTo(self.SearchView.mas_bottom).offset(10);
- make.left.bottom.right.mas_equalTo(self.headerView);
- }];
- UIImageView * imgV = [UIImageView new];
- imgV.image = IMG(@"Common_note_icon");
- [self.noteView addSubview:imgV];
- [imgV mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.mas_offset(15);
- make.centerY.mas_equalTo(self.noteView);
- }];
-
- UILabel * lineL = [UILabel new];
- lineL.backgroundColor = LINEBGCOLOR;
- [self.noteView addSubview:lineL];
- [lineL mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.bottom.right.mas_equalTo(self.noteView);
- make.height.mas_offset(0.5);
- }];
-
- UILabel * titleL = [UILabel new];
- titleL.textColor = UIColorHex(0x0A0A0A);
- titleL.font = [UIFont systemFontOfSize:15];
- titleL.text = @"笔记本";
- [self.noteView addSubview:titleL];
- [titleL mas_makeConstraints:^(MASConstraintMaker *make) {
- make.centerY.mas_equalTo(self.noteView);
- make.left.mas_equalTo(imgV.mas_right).offset(15);
- }];
- UIImageView * rightImgV = [UIImageView new];
- rightImgV.image = IMG(@"chatmsg_rightArrow_icon");
- [self.noteView addSubview:rightImgV];
- [rightImgV mas_makeConstraints:^(MASConstraintMaker *make) {
- make.centerY.mas_equalTo(self.noteView);
- make.right.offset(-15);
- }];
- WS(weakSelf);
- UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithActionBlock:^(id _Nonnull sender) {
- [weakSelf pushNoteVC];
- }];
- self.noteView.userInteractionEnabled = YES;
- [self.noteView addGestureRecognizer:tap];
- }
- - (void)pushNoteVC
- {
- NoteBookVC *vc = [NoteBookVC initNoteBookVC];
- vc.listType = MyNoteBookListLevelTypeA;
- vc.FolderId = 0;
- vc.myTitle = @"我的笔记";
- vc.VisitUserId = 0;
- vc.operationStateEnum = OperationStateEnum0;
- [self.navigationController pushViewController:vc animated:YES];
- }
- - (MyTDGroupView *)SearchView
- {
- if (!_SearchView) {
- _SearchView = [[MyTDGroupView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 40)];
- }
- return _SearchView;
- }
- - (UIView *)noteView
- {
- if (!_noteView) {
- _noteView = [UIView new];
- }
- return _noteView;
- }
- #pragma mark - UItableView刷新
- - (void)setTableRefresh
- {
- 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 ;
- }
- [self getDataList];
- }
- - (void)getDataList{
- WS(weakSelf);
- [[HttpManager sharedHttpManager] POSTUrl:Host(API_NoteBook) parameters:@{@"FolderId":@(0),@"Page":@(1),@"PerPage":@(99999999),@"VisitUserId":@(0),@"SearchKey":@"",@"Sort":@""} responseStyle:JOSN success:^(id _Nonnull responseObject) {
- NSLog(@"笔记列表数据 %@",responseObject);
- 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) {
-
- }];
- }
- - (void)viewDidLoad {
- [super viewDidLoad];
- self.tableView.delegate = self;
- self.tableView.dataSource = self;
- self.fd_prefersNavigationBarHidden = YES;
- [self addHeaderSubView];
- WS(weakSelf);
- [self.rightEditBtn setAction:^{
- MyTDTopicCreateVC * vc = [MyTDTopicCreateVC initMyTDTopicCreateVC];
- vc.type = CollectModel_NoteBook;
- vc.FolderId = 0;
- vc.FolderName = @"根目录";
- [weakSelf.navigationController pushViewController:vc animated:YES];
- }];
- [self.SearchView.button setAction:^{
- NoteBookSearchVC * vc = [[NoteBookSearchVC alloc] init];
- vc.IsSelected = NO;
- [weakSelf.navigationController pushViewController:vc animated:YES];
- }];
- self.tableView.tableHeaderView = self.headerView;
- self.tableView.tableHeaderView.height = 90.f;
- [self setTableRefresh];
- [self.view addSubview:self.noteBookShareVC.view];
- }
- - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
- return 1;
- }
- - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
- return self.noteBookArray.count;
- }
- - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
- WS(weakSelf);
- 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.cell1contentContentLabel.attributedText = [self setTextWithStr:model.Content];
- cell.cell1contentTitleLabel.attributedText = [self setTitleWithStr:model.Title];
- 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;
- [cell.cellCommentButton setAction:^{
- [weakSelf CommentHanderIndex:indexPath];
- }];
- [cell.cellZanButton setAction:^{
- [weakSelf zanHanderIndex:indexPath];
- }];
- [cell.cellShareButton setAction:^{
- [weakSelf shareHanderModel:model];
- }];
- cell.ClickUserBlock = ^{
- [weakSelf showUserInfo:model.UserId];
- };
- cell.selectionStyle = UITableViewCellSelectionStyleNone;
- 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.cell1contentTitleLabel.attributedText = [self setTitleWithStr:model.Title];
- cell.IsTopV.hidden = !model.IsTop;
- 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];
- }
- [cell.cellCommentButton setAction:^{
- [weakSelf CommentHanderIndex:indexPath];
- }];
- [cell.cellZanButton setAction:^{
- [weakSelf zanHanderIndex:indexPath];
- }];
- [cell.cellShareButton setAction:^{
- [weakSelf shareHanderModel:model];
- }];
- cell.ClickUserBlock = ^{
- [weakSelf showUserInfo:model.UserId];
- };
- cell.selectionStyle = UITableViewCellSelectionStyleNone;
- return cell;
- }break;
- case 2:{
- NoteBookCell *cell = [NoteBookCell configCell1:tableView indexPath:indexPath];
- [cell.cell1IconImage sd_setImageWithURL:[NSURL URLWithString:model.AvatarUrl] placeholderImage:[UIImage imageNamed:@"imagePlaceholder"] ];
- cell.cell1contentTitleLabel.attributedText = [self setTitleWithStr:model.Title];
- 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];
- }
- [cell.cellCommentButton setAction:^{
- [weakSelf CommentHanderIndex:indexPath];
- }];
- [cell.cellZanButton setAction:^{
- [weakSelf zanHanderIndex:indexPath];
- }];
- [cell.cellShareButton setAction:^{
- [weakSelf shareHanderModel:model];
- }];
- cell.ClickUserBlock = ^{
- [weakSelf showUserInfo:model.UserId];
- };
- cell.selectionStyle = UITableViewCellSelectionStyleNone;
- 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];
- cell.cell1contentTitleLabel.attributedText = [self setTitleWithStr:model.Title];
- 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];
- }
- [cell.cellCommentButton setAction:^{
- [weakSelf CommentHanderIndex:indexPath];
- }];
- [cell.cellZanButton setAction:^{
- [weakSelf zanHanderIndex:indexPath];
- }];
- [cell.cellShareButton setAction:^{
- [weakSelf shareHanderModel:model];
- }];
- cell.ClickUserBlock = ^{
- [weakSelf showUserInfo:model.UserId];
- };
- cell.selectionStyle = UITableViewCellSelectionStyleNone;
- 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];
- cell.cell1contentTitleLabel.attributedText = [self setTitleWithStr:model.Title];
- 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];
- }
- [cell.cellCommentButton setAction:^{
- [weakSelf CommentHanderIndex:indexPath];
- }];
- [cell.cellZanButton setAction:^{
- [weakSelf zanHanderIndex:indexPath];
- }];
- [cell.cellShareButton setAction:^{
- [weakSelf shareHanderModel:model];
- }];
- cell.ClickUserBlock = ^{
- [weakSelf showUserInfo:model.UserId];
- };
- cell.selectionStyle = UITableViewCellSelectionStyleNone;
- 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.cell1contentTitleLabel.attributedText = [self setTitleWithStr:model.Title];
- cell.IsTopV.hidden = !model.IsTop;
- 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];
- }
- [cell.cellCommentButton setAction:^{
- [weakSelf CommentHanderIndex:indexPath];
- }];
- [cell.cellZanButton setAction:^{
- [weakSelf zanHanderIndex:indexPath];
- }];
- [cell.cellShareButton setAction:^{
- [weakSelf shareHanderModel:model];
- }];
- cell.ClickUserBlock = ^{
- [weakSelf showUserInfo:model.UserId];
- };
- cell.cell1IconImageView6.hidden = YES;
- cell.selectionStyle = UITableViewCellSelectionStyleNone;
- 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"] ];
- cell.cell1contentTitleLabel.attributedText = [self setTitleWithStr:model.Title];
- 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];
- }
- [cell.cellCommentButton setAction:^{
- [weakSelf CommentHanderIndex:indexPath];
- }];
- [cell.cellZanButton setAction:^{
- [weakSelf zanHanderIndex:indexPath];
- }];
- [cell.cellShareButton setAction:^{
- [weakSelf shareHanderModel:model];
- }];
- cell.ClickUserBlock = ^{
- [weakSelf showUserInfo:model.UserId];
- };
- cell.selectionStyle = UITableViewCellSelectionStyleNone;
- 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"] ];
- cell.cell1contentTitleLabel.attributedText = [self setTitleWithStr:model.Title];
- 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];
- }
- [cell.cellCommentButton setAction:^{
- [weakSelf CommentHanderIndex:indexPath];
- }];
- [cell.cellZanButton setAction:^{
- [weakSelf zanHanderIndex:indexPath];
- }];
- [cell.cellShareButton setAction:^{
- [weakSelf shareHanderModel:model];
- }];
- cell.ClickUserBlock = ^{
- [weakSelf showUserInfo:model.UserId];
- };
- cell.cell1IconImageView8.hidden = YES;
- cell.cell1IconImageView9.hidden = YES;
- cell.selectionStyle = UITableViewCellSelectionStyleNone;
- 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];
- cell.cell1contentTitleLabel.attributedText = [self setTitleWithStr:model.Title];
- 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];
- }
- [cell.cellCommentButton setAction:^{
- [weakSelf CommentHanderIndex:indexPath];
- }];
- [cell.cellZanButton setAction:^{
- [weakSelf zanHanderIndex:indexPath];
- }];
- [cell.cellShareButton setAction:^{
- [weakSelf shareHanderModel:model];
- }];
- cell.ClickUserBlock = ^{
- [weakSelf showUserInfo:model.UserId];
- };
- cell.cell1IconImageView9.hidden = YES;
- cell.selectionStyle = UITableViewCellSelectionStyleNone;
- 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];
- cell.cell1contentTitleLabel.attributedText = [self setTitleWithStr:model.Title];
- 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];
- }
- [cell.cellCommentButton setAction:^{
- [weakSelf CommentHanderIndex:indexPath];
- }];
- [cell.cellZanButton setAction:^{
- [weakSelf zanHanderIndex:indexPath];
- }];
- [cell.cellShareButton setAction:^{
- [weakSelf shareHanderModel:model];
- }];
- cell.ClickUserBlock = ^{
- [weakSelf showUserInfo:model.UserId];
- };
- cell.selectionStyle = UITableViewCellSelectionStyleNone;
- 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];
- 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];
- }
- [cell.cellCommentButton setAction:^{
- [weakSelf CommentHanderIndex:indexPath];
- }];
- [cell.cellZanButton setAction:^{
- [weakSelf zanHanderIndex:indexPath];
- }];
- [cell.cellShareButton setAction:^{
- [weakSelf shareHanderModel:model];
- }];
- [cell.fileAction setAction:^{
- [weakSelf pushFileWithModel:dataModel];
- }];
- cell.ClickUserBlock = ^{
- [weakSelf showUserInfo:model.UserId];
- };
- cell.selectionStyle = UITableViewCellSelectionStyleNone;
- 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.cell0Number.text = [NSString stringWithFormat:@"%ld",(long)model.FileCount];
- cell.cell0Number.hidden = model.FileCount == 0 ? YES : NO;
- cell.cell0Title.text = model.FolderName;
- cell.cell0TopImageView.hidden = !model.IsTop;
- cell.selectionStyle = UITableViewCellSelectionStyleNone;
- return cell;
- }break;
- }
- }
- //
- //#pragma Mark 左滑按钮 iOS8以上
- //#if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_11_0
- //- (nullable UISwipeActionsConfiguration *)tableView:(UITableView *)tableView trailingSwipeActionsConfigurationForRowAtIndexPath:(NSIndexPath *)indexPath API_AVAILABLE(ios(11.0)) API_UNAVAILABLE(tvos){
- // MyNoteBookSubModel *model = self.noteBookArray[indexPath.row];
- // switch (model.AttributeValue) {
- // case 1:{
- // 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];
- // }];
- // [alertVC addAction:ok];
- // [alertVC addAction:noOk];
- // completionHandler(YES);
- // [weakSelf presentViewController:alertVC animated:YES completion:nil];
- // }];
- // action1.backgroundColor = RGB(255, 59, 47);
- // UIContextualAction *action2 = [UIContextualAction contextualActionWithStyle:UIContextualActionStyleNormal title:@"编辑" handler:^(UIContextualAction * _Nonnull action, __kindof UIView * _Nonnull sourceView, void (^ _Nonnull completionHandler)(BOOL)) {
- // STRONGSELF
- // [tableView setEditing:NO animated:YES];
- // [strongSelf eidtorNoteBook:model];
- // }];
- // action2.backgroundColor = UIColorHex(#FF923A);
- // UIContextualAction *action3 = [UIContextualAction contextualActionWithStyle:UIContextualActionStyleNormal title:@"移动" handler:^(UIContextualAction * _Nonnull action, __kindof UIView * _Nonnull sourceView, void (^ _Nonnull completionHandler)(BOOL)) {
- // STRONGSELF
- // [tableView setEditing:NO animated:YES];
- // [strongSelf launchMoveVC:@[@(model.Id)].mutableCopy];
- // }];
- // action3.backgroundColor = UIColorHex(#589AF1);
- // UIContextualAction *action4 = [UIContextualAction contextualActionWithStyle:UIContextualActionStyleNormal title:model.IsTop ?@"取消置顶" :@"置顶" handler:^(UIContextualAction * _Nonnull action, __kindof UIView * _Nonnull sourceView, void (^ _Nonnull completionHandler)(BOOL)) {
- // STRONGSELF
- // [tableView setEditing:NO animated:YES];
- // [strongSelf topFind:model];
- // }];
- // action4.backgroundColor = UIColorHex(#9BA9CB);
- // UISwipeActionsConfiguration *actions = [UISwipeActionsConfiguration configurationWithActions:@[action1,action2,action3,action4]];
- // actions.performsFirstActionWithFullSwipe = NO;
- // return actions;
- // }break;
- // default:{
- // 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:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
- //
- // }];
- // [ok setValue:k9 forKey:@"_titleTextColor"];
- // UIAlertAction *noOk = [UIAlertAction actionWithTitle:@"确认" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
- // [weakSelf deleteFind:@[model].mutableCopy];
- // }];
- // [alertVC addAction:ok];
- // [alertVC addAction:noOk];
- // [weakSelf presentViewController:alertVC animated:YES completion:nil];
- // }];
- // action1.backgroundColor = RGB(255, 59, 47);
- // UIContextualAction *action2 = [UIContextualAction contextualActionWithStyle:UIContextualActionStyleDestructive title:@"重命名" handler:^(UIContextualAction * _Nonnull action, __kindof UIView * _Nonnull sourceView, void (^ _Nonnull completionHandler)(BOOL)) {
- // MyFavoriteNewFindVC *vc = [MyFavoriteNewFindVC initMyFavoriteNewFindVC];
- // vc.ParentId = model.Id;
- // vc.foldId = model.Id;
- // vc.createFoldType = CreateNotesType;
- // vc.modifyTye = ModifyType;
- // vc.fileType = NewOtherFileType;
- // vc.titleStr = @"修改文件夹";
- // vc.roleId = model.RoleId;
- // vc.fileName = model.FolderName;
- // [tableView setEditing:NO animated:YES];
- // [weakSelf.navigationController pushViewController:vc animated:YES];
- // }];
- // action2.backgroundColor = UIColorHex(#FF923A);
- //
- // UIContextualAction *action3 = [UIContextualAction contextualActionWithStyle:UIContextualActionStyleDestructive title:@"移动" handler:^(UIContextualAction * _Nonnull action, __kindof UIView * _Nonnull sourceView, void (^ _Nonnull completionHandler)(BOOL)) {
- // [tableView setEditing:NO animated:YES];
- // [weakSelf launchMoveVC:@[@(model.Id)].mutableCopy];
- // }];
- // action3.backgroundColor = UIColorHex(#529DF8);
- //
- // UIContextualAction *action4 = [UIContextualAction contextualActionWithStyle:UIContextualActionStyleDestructive title:model.IsTop?@"取消置顶" :@"置顶" handler:^(UIContextualAction * _Nonnull action, __kindof UIView * _Nonnull sourceView, void (^ _Nonnull completionHandler)(BOOL)) {
- // [tableView setEditing:NO animated:YES];
- // [weakSelf topFind:model];
- // }];
- // action4.backgroundColor = UIColorHex(#9BA9CB);
- // UISwipeActionsConfiguration *actions = [UISwipeActionsConfiguration configurationWithActions:@[action1, action2, action3,action4]];
- // actions.performsFirstActionWithFullSwipe = NO;
- // return actions;
- // }break;
- // }
- //}
- //#else
- //- (NSArray<UITableViewRowAction *> *)tableView:(UITableView *)tableView editActionsForRowAtIndexPath:(NSIndexPath *)indexPath {
- // MyNoteBookSubModel *model = self.noteBookArray[indexPath.row];
- // switch (model.AttributeValue) {
- // case 1:{
- // WEAKSELF
- // UITableViewRowAction *action1 = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDestructive title:@"删除" handler:^(UITableViewRowAction * _Nonnull action, NSIndexPath * _Nonnull indexPath) {
- // UIAlertController *alertVC = [UIAlertController alertControllerWithTitle:nil message:@"确认删除" preferredStyle:UIAlertControllerStyleAlert];
- // UIAlertAction *ok = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
- //
- // }];
- // [ok setValue:k9 forKey:@"_titleTextColor"];
- // UIAlertAction *noOk = [UIAlertAction actionWithTitle:@"确认" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
- // [weakSelf deleteFind:@[model].mutableCopy];
- // }];
- // [alertVC addAction:ok];
- // [alertVC addAction:noOk];
- // [weakSelf presentViewController:alertVC animated:YES completion:nil];
- // }];
- //
- // action1.backgroundColor = RGB(255, 59, 47);
- // UITableViewRowAction *action2 = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDestructive title:@"编辑" handler:^(UITableViewRowAction * _Nonnull action, NSIndexPath * _Nonnull indexPath) {
- // [weakSelf eidtorNoteBook:model];
- // }];
- // action2.backgroundColor = UIColorHex(#FF923A);
- // UITableViewRowAction *action3 = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDestructive title:@"移动" handler:^(UITableViewRowAction * _Nonnull action, NSIndexPath * _Nonnull indexPath) {
- // [weakSelf launchMoveVC:@[@(model.Id)].mutableCopy];
- //
- // }];
- // action3.backgroundColor = UIColorHex(#589AF1);
- // UITableViewRowAction *action4 = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDestructive title:model.IsTop ?@"取消置顶" :@"置顶" handler:^(UITableViewRowAction * _Nonnull action, NSIndexPath * _Nonnull indexPath) {
- // [weakSelf topFind:model];
- // }];
- // action4.backgroundColor =UIColorHex(#9BA9CB);
- //
- // return @[action1, action2, action3,action4];
- // }break;
- // default:{
- // WEAKSELF
- // UITableViewRowAction *action1 = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDestructive title:@"删除" handler:^(UITableViewRowAction * _Nonnull action, NSIndexPath * _Nonnull indexPath) {
- // UIAlertController *alertVC = [UIAlertController alertControllerWithTitle:nil message:@"确认删除" preferredStyle:UIAlertControllerStyleAlert];
- // UIAlertAction *ok = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
- //
- // }];
- // [ok setValue:k9 forKey:@"_titleTextColor"];
- // UIAlertAction *noOk = [UIAlertAction actionWithTitle:@"确认" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
- // [weakSelf deleteFind:@[model].mutableCopy];
- // }];
- // [alertVC addAction:ok];
- // [alertVC addAction:noOk];
- // [weakSelf presentViewController:alertVC animated:YES completion:nil];
- // }];
- // action1.backgroundColor = RGB(255, 59, 47);
- //
- // UITableViewRowAction *action2 = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDestructive title:@"重命名" handler:^(UITableViewRowAction * _Nonnull action, NSIndexPath * _Nonnull indexPath) {
- // MyFavoriteNewFindVC *vc = [MyFavoriteNewFindVC initMyFavoriteNewFindVC];
- // vc.ParentId = model.Id;
- // vc.foldId = model.Id;
- // vc.createFoldType = CreateNotesType;
- // vc.modifyTye = ModifyType;
- // vc.fileType = NewOtherFileType;
- // vc.titleStr = @"修改文件夹";
- // vc.roleId = model.RoleId;
- // vc.fileName = model.FolderName;
- // [weakSelf.navigationController pushViewController:vc animated:YES];
- //
- // }];
- // action2.backgroundColor = UIColorHex(#FF923A);
- // UITableViewRowAction *action3 = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDestructive title:@"移动" handler:^(UITableViewRowAction * _Nonnull action, NSIndexPath * _Nonnull indexPath) {
- // [weakSelf launchMoveVC:@[@(model.Id)].mutableCopy];
- // }];
- // action3.backgroundColor = UIColorHex(#529DF8);
- // UITableViewRowAction *action4 = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDestructive title: model.IsTop?@"取消置顶" :@"置顶" handler:^(UITableViewRowAction * _Nonnull action, NSIndexPath * _Nonnull indexPath) {
- // [weakSelf topFind:model];
- // }];
- // action4.backgroundColor = UIColorHex(#9BA9CB);
- // return @[action1, action2, action3,action4];
- // }break;
- // }
- //}
- //#endif
- //- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath
- //{
- // return YES;
- //}
- //- (void)tableView:(UITableView*)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath*)indexPath
- //{
- //}
- - (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath
- {
- return UITableViewCellEditingStyleNone;
- }
- - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
- [tableView deselectRowAtIndexPath:indexPath animated:YES];
- MyNoteBookSubModel *model = self.noteBookArray[indexPath.row];
- switch (model.AttributeValue) {
- case 1:{
- MyTDTopicDetailVC * vc = [MyTDTopicDetailVC initMyTDTopicDetailVC];
- vc.Id = model.MiddleId;
- vc.type = CollectModel_NoteBook;
- [self.navigationController pushViewController:vc animated:YES];
- }break;
- case 2:{
- NoteBookVC *vc = [NoteBookVC initNoteBookVC];
- if (model.ParentId == 0) {
- vc.listType = MyFavoriteListLevelTypeB;
- }else{
- vc.listType = MyFavoriteListLevelTypeC;
- }
- vc.ParentId = model.ParentId;
- vc.FolderId = model.Id;
- vc.RoleId = model.RoleId;
- vc.myTitle = model.FolderName;
- vc.isSubVC = YES;
- [self.navigationController pushViewController:vc animated:YES];
- }break;
- default:
- break;
- }
- }
- - (void)showUserInfo:(NSInteger)userId
- {
- MailListDetailVC * vc = [MailListDetailVC initMailListDetailVC];
- vc.indexId = userId;
- [self.navigationController pushViewController:vc animated:YES];
- }
- - (NSMutableArray <MyNoteBookSubModel*>*)noteBookArray{
- if (!_noteBookArray) {
- _noteBookArray = [NSMutableArray array];
- }
- return _noteBookArray;
- }
- //MARK:截图
- - (UIImage *)getImageWithCell:(UITableViewCell*)cell {
-
- UIGraphicsBeginImageContextWithOptions(CGSizeMake(kGXScreenWidth, 60), NO, 1.0);
- CGContextRef context=UIGraphicsGetCurrentContext();
-
- CGContextDrawImage(context, CGRectMake(0, 3, kGXScreenWidth, 60), [UIImage new].CGImage);
-
- [cell.contentView.layer renderInContext:context];
-
- UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
-
- UIGraphicsEndImageContext();
-
- return image;
-
- }
- #pragma -mark 点赞
- - (void)zanHanderIndex:(NSIndexPath *)indexPath{
- MyNoteBookSubModel *mdoel = self.noteBookArray[indexPath.row];
- SHOWLOADING
- NSMutableDictionary *dic = [NSMutableDictionary dictionary];
- [dic setValue:@(mdoel.MiddleId) forKey:@"SourceId"];
- [dic setValue:@([AppUserModel sharedAppUserModel].Id) forKey:@"UserId"];
- [dic setValue:@(1) forKey:@"AnalyzeType"];//详情点赞
- [dic setValue:@(0) forKey:@"CommentId"];
- [dic setValue:@(3) forKey:@"TypeValue"];//笔记 3
- WS(weakSelf);
-
- [[HttpManager sharedHttpManager] POSTUrl:Host(API_APP_Analyze_Set) parameters:dic responseStyle:DATA success:^(id _Nonnull responseObject) {
-
- mdoel.IsPraise = !mdoel.IsPraise;
- if (mdoel.IsPraise) {
- SHOWSUCCESS(@"点赞成功");
- ++ mdoel.PraiseCount;
- }else{
- SHOWSUCCESS(@"取消点赞");
- -- mdoel.PraiseCount;
- }
- dispatch_async(dispatch_get_main_queue(), ^{
- [weakSelf.tableView reloadRow:indexPath.row inSection:indexPath.section withRowAnimation:UITableViewRowAnimationNone];
- });
- } failure:^(NSError * _Nonnull error) {
- SHOWERROR([ZYCTool handerResultData:error]);
- }];
- }
- #pragma -mark 评论
- - (void)CommentHanderIndex:(NSIndexPath *)indexPath{
- MyNoteBookSubModel *model = self.noteBookArray[indexPath.row];
- MyTDTopicDetailVC * vc = [MyTDTopicDetailVC initMyTDTopicDetailVC];
- vc.Id = model.MiddleId;
- vc.type = CollectModel_NoteBook;
- [self.navigationController pushViewController:vc animated:YES];
- }
- #pragma mark - 点击文件跳转
- - (void)pushFileWithModel:(MyNoteBookeDataModel *)model
- {
- WS(weakSelf);
- switch (model.Type) {
- case CollectModel_Aritle:
- {
- SHOWLOADING
- [[HttpManager sharedHttpManager] GETWithUrl:[NSString stringWithFormat:@"%@%ld",Article_Detail_Get,(long)model.Id] parameters:@{} success:^(id _Nonnull responseObject) {
- REMOVESHOW;
- 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.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;
- }
- }
- #pragma -mark 转发
- - (NoteBookCommentVC *)noteBookCommentVC{
- if (_noteBookCommentVC == nil) {
- _noteBookCommentVC = [NoteBookCommentVC initNoteBookCommentVC];
- [_noteBookCommentVC.view setFrame:CGRectMake(0,0, SCREEN_WIDTH, SCREEN_HEIGHT)];
- [_noteBookCommentVC.view setHidden:YES];
- }
- return _noteBookCommentVC;
- }
- - (void)shareHanderModel:(MyNoteBookSubModel *)model{
- [self.noteBookShareVC initNoteBookShareData];
- FlowAttachmentsModel * fmodel = [[FlowAttachmentsModel alloc] init];
- fmodel.SoureTypeId = CollectModel_NoteBook;
- fmodel.Title = model.Title;
- fmodel.SoureId = model.MiddleId;
- fmodel.Author = model.Name;
- fmodel.SourceUserId = model.SourceUserId;
- self.isBarReturn = NO;
- self.returnModel = fmodel;
- self.noteBookShareVC.view.hidden = !self.noteBookShareVC.view.hidden;
- }
- - (NoteBookShareVC *)noteBookShareVC{
- if (_noteBookShareVC == nil) {
- _noteBookShareVC = [NoteBookShareVC initNoteBookShareVC];
- [_noteBookShareVC.view setFrame:CGRectMake(0,0, SCREEN_WIDTH, SCREEN_HEIGHT)];
- [_noteBookShareVC.view setHidden:YES];
- _noteBookShareVC.delegate = self;
- }
- return _noteBookShareVC;
- }
- - (void)userSelectType:(NSString *)typeName WithIndexPath:(NSIndexPath *)indexPath
- {
- self.noteBookShareVC.view.hidden = !self.noteBookShareVC.view.hidden;
- if ([typeName isEqualToString:@"发给微信好友"]) {
- [self returnToWechatSession];
- }else if ([typeName isEqualToString:@"发到朋友圈"]){
- [self returnToWechatTimeLine];
- }else if ([typeName isEqualToString:@"发到微博"]){
- [self returnToSina];
- }else if ([typeName isEqualToString:@"发给QQ好友"]){
- [self returnToQQ];
- }else if ([typeName isEqualToString:@"发到消息"]){
- [self returnToMessage];
- }else if ([typeName isEqualToString:@"发到小组"]){
- [self returnToGroup];
- }else if ([typeName isEqualToString:@"发到笔记"]){
- [self returnToNote];
- }else if ([typeName isEqualToString:@"发到话题"]){
- [self returnToTopic];
- }else{
-
- }
- }
- - (void)shareWebPageToPlatformType:(UMSocialPlatformType)platformType title:(NSString *)title desc:(NSString *)desc url:(NSString *)url
- {
- //创建分享消息对象
- UMSocialMessageObject *messageObject = [UMSocialMessageObject messageObject];
-
- messageObject.title = title;
- //创建网页内容对象
- UMShareWebpageObject *shareObject = [UMShareWebpageObject shareObjectWithTitle:title descr:desc thumImage:IMG(@"logo_60")];
- //设置网页地址
- shareObject.webpageUrl = url;
-
- //分享消息对象设置分享内容对象
- messageObject.shareObject = shareObject;
-
- //调用分享接口
- [[UMSocialManager defaultManager] shareToPlatform:platformType messageObject:messageObject currentViewController:self completion:^(id data, NSError *error) {
- if (error) {
- NSLog(@"************Share fail with error %@*********",error);
- }else{
- NSLog(@"response data is %@",data);
- }
- }];
- }
- - (void)returnToWechatSession
- {
- [self shareWebPageToPlatformType:UMSocialPlatformType_WechatSession title:self.returnModel.Title desc:[NSString stringWithFormat:@"来自-%@",self.returnModel.Author] url:[self returnUrl]];
- }
- - (void)returnToWechatTimeLine
- {
- [self shareWebPageToPlatformType:UMSocialPlatformType_WechatTimeLine title:self.returnModel.Title desc:[NSString stringWithFormat:@"来自-%@",self.returnModel.Author] url:[self returnUrl]];
- }
- - (void)returnToSina
- {
- [self shareWebPageToPlatformType:UMSocialPlatformType_Sina title:self.returnModel.Title desc:[NSString stringWithFormat:@"来自-%@",self.returnModel.Author] url:[self returnUrl]];
- }
- - (void)returnToQQ
- {
- [self shareWebPageToPlatformType:UMSocialPlatformType_QQ title:self.returnModel.Title desc:[NSString stringWithFormat:@"来自-%@",self.returnModel.Author] url:[self returnUrl]];
- }
- - (NSString *)returnUrl
- {
- if (self.isBarReturn) {
- 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];
- return url;
- }else{
- NSString * url = [NSString stringWithFormat:@"%@%ld",Host(@"/admin/mobile/noteDetailsWx?"),(long)self.returnModel.SoureId];
- return url;
- }
- }
- #pragma mark - 分享功能
- - (void)returnToMessage
- {
- ShareListVC * vc = [ShareListVC initShareListVC];
- vc.sendModel = self.returnModel;
- vc.isReturn = YES;
- [self.navigationController pushViewController:vc animated:YES];
- }
- - (void)returnToGroup
- {
- MyTDGroupViewController * vc = [[MyTDGroupViewController alloc] init];
- vc.sendModel = self.returnModel;
- vc.type = CollectModel_Group;
- vc.isReturn = YES;
- [self.navigationController pushViewController:vc animated:YES];
- }
- - (void)returnToNote
- {
- MyTDTopicCreateVC * vc = [MyTDTopicCreateVC initMyTDTopicCreateVC];
- vc.type = CollectModel_NoteBook;
- vc.sendModel = self.returnModel;
- vc.isReturn = YES;
- [self.navigationController pushViewController:vc animated:YES];
- }
- - (void)returnToTopic
- {
- MyTDTopicCreateVC * vc = [MyTDTopicCreateVC initMyTDTopicCreateVC];
- vc.sendModel = self.returnModel;
- vc.type = CollectModel_NewTopic;
- vc.isReturn = YES;
- [self.navigationController pushViewController:vc animated:YES];
- }
- - (NSAttributedString *)setTextWithStr:(NSString *)str
- {
- 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
- {
- 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;
- }
- @end
|