123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314 |
- //
- // CommonHomeVC.m
- // smartRhino
- //
- // Created by niuzhen on 2020/4/28.
- // Copyright © 2020 tederen. All rights reserved.
- //
- #import "CommonHomeVC.h"
- #import "CommonListCell.h"
- #import "MyTDGroupView.h"
- #import "GHRefreshCollectionView.h"
- #import "CommonBarCell.h"
- #import "CommonBarModel.h"
- #import "CommonWorkVC.h"
- #import "CommonToolVC.h"
- #import "MyFavoriteVC.h"
- #import "CommonNoteVC.h"
- #import "ChatMsgListCell.h"
- #import "ChatMsgCollectionCell.h"
- #import "MoveViewController.h"
- #import "MyFavoriteVC.h"
- #import "CommonNoteVC.h"
- #import "MyFavoriteVC.h"
- #import "NoteBookVC.h"
- #import "OtherFavoriteVC.h"
- #import "OtherNoteBookVC.h"
- #import "DownFileViewController.h"
- #import "WorkFlowDetailsController.h"
- #import "MyApprovalPageDetail.h"
- #import "CountDataVC.h"
- #import "CommomSearchVC.h"
- #import "NoteBookShareVC.h"
- #import "MyTDGroupViewController.h"
- #import "TDGroupInfoListVC.h"
- #import "MailListVC.h"
- #import "ShareListVC.h"
- #import "BookWCDetailVC.h"
- #import "BookListenVC.h"
- #import "BookTeacherDetailVC.h"
- #import "HomeSCDetailVC.h"
- #import "BookMingDetailVC.h"
- #import "BookPeriodicaDetailVC.h"
- #import "BookListDetailVC.h"
- @interface CommonHomeVC ()<UITableViewDelegate,UITableViewDataSource,UICollectionViewDelegate,UICollectionViewDataSource,NoteBookShareVCDelegate>
- @property (weak, nonatomic) IBOutlet UIView *NavBar;
- @property (strong, nonatomic) UIView *HeadView;
- @property (strong, nonatomic) UITableView *tableView;
- @property (strong, nonatomic) MyTDGroupView *SearchView;
- @property (strong, nonatomic) GHRefreshCollectionView *collectionView;
- @property (strong, nonatomic) NSMutableArray *collectionDataSource;
- @property (strong, nonatomic) NSMutableArray *dataArray;
- @property (strong, nonatomic) NoteBookShareVC *noteBookShareVC;
- @property (strong, nonatomic) MyFavoriteSubModel *sendModel;
- @property (nonatomic,assign) NSInteger currentPage;
- @property (nonatomic,assign) NSInteger totalPage;
- @property (nonatomic,strong) NSData *fileData;
- @end
- @implementation CommonHomeVC
- - (UIView *)HeadView
- {
- if (!_HeadView) {
- _HeadView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 46)];
- _HeadView.backgroundColor = [UIColor whiteColor];
- }
- return _HeadView;
- }
- //- (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.currentPage = 1;
- // self.totalPage = 1;
- // [self.dataArray removeAllObjects];
- // [self getDataList];
- //}
- //- (void)footerRefresh{
- // self.currentPage += 1;
- // if (self.totalPage == self.dataArray.count) {
- // self.currentPage --;
- // [self.tableView.mj_footer resetNoMoreData];
- // return ;
- // }
- // [self getDataList];
- //}
- - (void)viewWillAppear:(BOOL)animated
- {
- [super viewWillAppear:animated];
- self.tabBarController.tabBar.hidden = NO;
- [self getDataList];
- }
- - (void)viewDidLoad {
- [super viewDidLoad];
- // [self setTableRefresh];
- self.fd_prefersNavigationBarHidden = YES;
- self.view.backgroundColor = UIColorHex(0xffffff);
- self.tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
- [self.HeadView addSubview:self.SearchView];
- [self.SearchView mas_makeConstraints:^(MASConstraintMaker *make) {
- make.top.mas_offset(5);
- make.left.right.mas_equalTo(self.HeadView);
- make.height.mas_offset(36);
- }];
- [self.view addSubview:self.tableView];
- [self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.right.mas_equalTo(self.view);
- make.top.mas_equalTo(self.NavBar.mas_bottom);
- if (@available(iOS 11.0, *)) {
- make.bottom.equalTo(self.view.mas_safeAreaLayoutGuideBottom);
- } else {
- make.bottom.equalTo(self.view.mas_bottom);
- }
- }];
- self.tableView.tableHeaderView = self.HeadView;
-
- [self setBarData];
- WS(weakSelf);
- [self.SearchView.button setAction:^{
- CommomSearchVC * vc = [[CommomSearchVC alloc] init];
- vc.hidesBottomBarWhenPushed = YES;
- [weakSelf.navigationController pushViewController:vc animated:YES];
- }];
- self.tableView.delegate = self;
- self.tableView.dataSource = self;
- self.tableView.backgroundColor = [UIColor clearColor];
- [[UtilsTools getWindow] addSubview:self.noteBookShareVC.view];
- [[UtilsTools getWindow] bringSubviewToFront:self.noteBookShareVC.view];
- }
- - (void)getDataList {
- WS(weakSelf);
- SHOWLOADING
- [[HttpManager sharedHttpManager] POSTUrl:Host(API_Collection_List) parameters:@{@"FolderId":@(0),@"Page":@(1),@"PerPage":@(99999999),@"VisitUserId":@(0)} responseStyle:JOSN success:^(id _Nonnull responseObject) {
- REMOVESHOW
- [weakSelf.dataArray removeAllObjects];
- NSLog(@"%@",responseObject);
- MyFavoriteModel *listModel = [[MyFavoriteModel alloc] initWithDictionary:responseObject error:nil];
- weakSelf.totalPage = listModel.Total;
- [weakSelf.dataArray addObjectsFromArray:listModel.Items];
- for (MyFavoriteSubModel *model in weakSelf.dataArray) {
- if (model.CollectionType == CollectModel_Text) {
- model.CollectionType = CollectModel_Aritle;
- }
- }
- [weakSelf changeMessageStatusWithNumber:weakSelf.dataArray.count];
- dispatch_async(dispatch_get_main_queue(), ^{
- [weakSelf.tableView reloadData];
- });
- } failure:^(NSError * _Nonnull error) {
- REMOVESHOW
- }];
- }
- - (BOOL)hidesBottomBarWhenPushed{
- return NO;
- }
- #pragma mark - UITableViewDelegate
- - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
- return 2;
- }
- - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
- switch (section) {
- case 0:{
- return 1;
- }break;
- default:{
- return self.dataArray.count;
- }break;
- }
- }
- - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
- switch (indexPath.section) {
- case 0:{
- return 74.f;
- }break;
- default:{
- return UITableViewAutomaticDimension;
- }break;
- }
- }
- - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
- {
- switch (section) {
- case 0:{
- return 0.f;
- }break;
- default:{
- return 36.f;
- }break;
- }
- }
- - (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
- {
- switch (section) {
- case 0:{
- UIView * view = [UIView new];
- return view;
- }break;
- default:{
- UIView * view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 36)];
- view.backgroundColor = UIColorHex(0xF5F5F5);
- UILabel * label = [UILabel new];
- label.font = [UIFont systemFontOfSize:14];
- label.textColor = UIColorHex(0x888888);
- label.text = @"最新收藏";
- [view addSubview:label];
- [label mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.mas_offset(15);
- make.centerY.mas_equalTo(view);
- }];
- return view;
- }break;
- }
- }
- - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
- switch (indexPath.section) {
- case 0:
- {
- ChatMsgListCell *cell = [ChatMsgListCell configCell1:tableView indexPath:indexPath];
- [cell.cell1ContentBgView addSubview:self.collectionView];
- self.collectionView.frame = CGRectMake(0, 0, SCREEN_WIDTH, cell.cell1ContentBgView.height);
- [self.collectionView reloadData];
- return cell;
- }
- break;
- default:
- {
- MyFavoriteSubModel * model = [self.dataArray objectAtIndex:indexPath.row];
- if (model.CollectionType == CollectModel_TopicBooK) {
- CommonListCell *cell = [CommonListCell configCell2:tableView indexPath:indexPath];
- [cell setCellTopicBookData:model];
- WS(weakSelf);
- [cell.desBtn setAction:^{
- MyFavoriteVC * vc = [MyFavoriteVC initMyFavoriteVC];
- vc.listType = model.FolderId == 0 ? MyFavoriteListLevelTypeA : MyFavoriteListLevelTypeB;
- vc.FolderId = model.FolderId;
- vc.myTitle = model.FolderName;
- [weakSelf.navigationController pushViewController:vc animated:YES];
- }];
- return cell;
- }else{
- switch (model.CollectionType) {
- case CollectModel_Teacher:
- {
- CommonListCell *cell = [CommonListCell configCell2:tableView indexPath:indexPath];
- [cell setCellNoAuthorData:model];
- WS(weakSelf);
- [cell.desBtn setAction:^{
- MyFavoriteVC * vc = [MyFavoriteVC initMyFavoriteVC];
- vc.listType = model.FolderId == 0 ? MyFavoriteListLevelTypeA : MyFavoriteListLevelTypeB;
- vc.FolderId = model.FolderId;
- vc.myTitle = model.FolderName;
- [weakSelf.navigationController pushViewController:vc animated:YES];
- }];
- return cell;
- }
- break;
- case CollectModel_Organization:
- {
- CommonListCell *cell = [CommonListCell configCell2:tableView indexPath:indexPath];
- [cell setCellNoAuthorData:model];
- WS(weakSelf);
- [cell.desBtn setAction:^{
- MyFavoriteVC * vc = [MyFavoriteVC initMyFavoriteVC];
- vc.listType = model.FolderId == 0 ? MyFavoriteListLevelTypeA : MyFavoriteListLevelTypeB;
- vc.FolderId = model.FolderId;
- vc.myTitle = model.FolderName;
- [weakSelf.navigationController pushViewController:vc animated:YES];
- }];
- return cell;
- }
- break;
- default:
- {
- if (model.CollectionType != CollectModel_Toipc && model.Data.Author.length == 0) {
- CommonListCell *cell = [CommonListCell configCell2:tableView indexPath:indexPath];
- [cell setCellNoAuthorData:model];
- WS(weakSelf);
- [cell.desBtn setAction:^{
- MyFavoriteVC * vc = [MyFavoriteVC initMyFavoriteVC];
- vc.listType = model.FolderId == 0 ? MyFavoriteListLevelTypeA : MyFavoriteListLevelTypeB;
- vc.FolderId = model.FolderId;
- vc.myTitle = model.FolderName;
- [weakSelf.navigationController pushViewController:vc animated:YES];
- }];
- return cell;
- }else{
- CommonListCell *cell = [CommonListCell configCell1:tableView indexPath:indexPath];
- [cell setCell1Data:model];
- WS(weakSelf);
- [cell.desBtn setAction:^{
- MyFavoriteVC * vc = [MyFavoriteVC initMyFavoriteVC];
- vc.listType = model.FolderId == 0 ? MyFavoriteListLevelTypeA : MyFavoriteListLevelTypeB;
- vc.FolderId = model.FolderId;
- vc.myTitle = model.FolderName;
- [weakSelf.navigationController pushViewController:vc animated:YES];
- }];
- if (model.CollectionType == CollectModel_Toipc) {
- [cell.comeBtn setAction:^{
- TDGroupInfoListVC * vc = [TDGroupInfoListVC initTDGroupInfoListVC];
- vc.GroupId = model.Data.GroupId;
- vc.titleStr = model.Data.GroupName;
- [weakSelf.navigationController pushViewController:vc animated:YES];
- }];
- }
- return cell;
- }
- }
- break;
- }
- }
- }
- break;
- }
- }
- - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
- [tableView deselectRowAtIndexPath:indexPath animated:YES];
- if (indexPath.section > 0) {
- MyFavoriteSubModel * model = [self.dataArray objectAtIndex:indexPath.row];
- switch (model.CollectionType) {
- case CollectModel_Aritle:{
- MyTDTopicDetailVC * vc = [MyTDTopicDetailVC initMyTDTopicDetailVC];
- vc.type = CollectModel_Aritle;
- vc.Id = model.CollectionDataId;
- [self.navigationController pushViewController:vc animated:YES];
- }break;
- case CollectModel_MediaAritle:{
- MyTDTopicDetailVC * vc = [MyTDTopicDetailVC initMyTDTopicDetailVC];
- vc.type = CollectModel_MediaAritle;
- vc.Id = model.CollectionDataId;
- [self.navigationController pushViewController:vc animated:YES];
- }break;
- case CollectModel_Toipc:
- {
- MyTDTopicDetailVC * vc = [MyTDTopicDetailVC initMyTDTopicDetailVC];
- vc.type = CollectModel_Toipc;
- vc.Id = model.CollectionDataId;
- [self.navigationController pushViewController:vc animated:YES];
- }break;
- case CollectModel_NewTopic:
- {
- MyTDTopicDetailVC * vc = [MyTDTopicDetailVC initMyTDTopicDetailVC];
- vc.type = CollectModel_NewTopic;
- vc.Id = model.CollectionDataId;
- [self.navigationController pushViewController:vc animated:YES];
- }break;
- case CollectModel_Collect:{
-
- }break;
- case CollectModel_NoteBook:{
- MyTDTopicDetailVC * vc = [MyTDTopicDetailVC initMyTDTopicDetailVC];
- vc.type = CollectModel_NoteBook;
- vc.Id = model.CollectionDataId;
- vc.isNoteBook = YES;
- [self.navigationController pushViewController:vc animated:YES];
- }break;
- case CollectModel_CollectFile:{
- if (model.SourceUserId == [AppUserModel sharedAppUserModel].Id || model.SourceUserId == 0) {
- MyFavoriteVC * vc = [MyFavoriteVC initMyFavoriteVC];
- vc.listType = model.CollectionDataId == 0 ? MyFavoriteListLevelTypeA : MyFavoriteListLevelTypeB;
- vc.FolderId = model.CollectionDataId;
- vc.myTitle = model.Title;
- [self.navigationController pushViewController:vc animated:YES];
- }else{
- OtherFavoriteVC * vc = [OtherFavoriteVC initOtherFavoriteVC];
- vc.listType = model.CollectionDataId == 0 ? MyFavoriteListLevelTypeA : MyFavoriteListLevelTypeB;
- vc.FolderId = model.CollectionDataId;
- vc.CollectionDataId = model.CollectionDataId;
- vc.CollectionType = model.CollectionType;
- vc.Author = model.Data.Author;
- vc.myTitle = model.Title;
- vc.VisitUserId = model.SourceUserId;
- [self.navigationController pushViewController:vc animated:YES];
- }
- }break;
- case CollectModel_NoteFile: {
- if (model.SourceUserId == [AppUserModel sharedAppUserModel].Id || model.SourceUserId == 0) {
- NoteBookVC * vc = [NoteBookVC initNoteBookVC];
- vc.listType = model.CollectionDataId == 0 ? MyFavoriteListLevelTypeA : MyFavoriteListLevelTypeB;
- vc.FolderId = model.CollectionDataId;
- vc.myTitle = model.Title;
- [self.navigationController pushViewController:vc animated:YES];
- }else{
- OtherNoteBookVC * vc = [OtherNoteBookVC initOtherNoteBookVC];
- vc.listType = model.CollectionDataId == 0 ? MyFavoriteListLevelTypeA : MyFavoriteListLevelTypeB;
- vc.FolderId = model.CollectionDataId;
- vc.CollectionDataId = model.CollectionDataId;
- vc.CollectionType = model.CollectionType;
- vc.Author = model.Data.Author;
- vc.myTitle = model.Title;
- vc.VisitUserId = model.SourceUserId;
- [self.navigationController pushViewController:vc animated:YES];
- }
- }break;
- case CollectModel_TopicBooK:{
- if (model.SourceUserId == [AppUserModel sharedAppUserModel].Id || model.SourceUserId == 0) {
- NoteBookVC * vc = [NoteBookVC initNoteBookVC];
- vc.listType = MyFavoriteListLevelTypeA;
- vc.FolderId = model.CollectionDataId;
- vc.TypeValue = 1;
- vc.myTitle = model.Title;
- [self.navigationController pushViewController:vc animated:YES];
- }else{
- OtherNoteBookVC * vc = [OtherNoteBookVC initOtherNoteBookVC];
- vc.listType = MyFavoriteListLevelTypeA ;
- vc.FolderId = model.CollectionDataId;
- vc.CollectionDataId = model.CollectionDataId;
- vc.CollectionType = model.CollectionType;
- vc.Author = model.Data.Author;
- vc.TypeValue = 1;
- vc.myTitle = model.Title;
- vc.VisitUserId = model.SourceUserId;
- [self.navigationController pushViewController:vc animated:YES];
- }
- }break;
- case CollectModel_TopicSubBooK:{
- if (model.SourceUserId == [AppUserModel sharedAppUserModel].Id || model.SourceUserId == 0) {
- NoteBookVC * vc = [NoteBookVC initNoteBookVC];
- vc.listType = MyFavoriteListLevelTypeB;
- vc.FolderId = model.CollectionDataId;
- vc.TypeValue = 1;
- vc.myTitle = model.Title;
- [self.navigationController pushViewController:vc animated:YES];
- }else{
- OtherNoteBookVC * vc = [OtherNoteBookVC initOtherNoteBookVC];
- vc.listType = MyFavoriteListLevelTypeB;
- vc.FolderId = model.CollectionDataId;
- vc.CollectionDataId = model.CollectionDataId;
- vc.CollectionType = model.CollectionType;
- vc.Author = model.Data.Author;
- vc.TypeValue = 1;
- vc.myTitle = model.Title;
- vc.VisitUserId = model.SourceUserId;
- [self.navigationController pushViewController:vc animated:YES];
- }
- }break;
- case CollectModel_Notice:{
- MyTDTopicDetailVC * vc = [MyTDTopicDetailVC initMyTDTopicDetailVC];
- vc.type = CollectModel_Notice;
- vc.Id = model.CollectionDataId;
- [self.navigationController pushViewController:vc animated:YES];
- }break;
- case CollectModel_InterMail:{
- MyTDTopicDetailVC * vc = [MyTDTopicDetailVC initMyTDTopicDetailVC];
- vc.type = CollectModel_InterMail;
- vc.Id = model.CollectionDataId;
- [self.navigationController pushViewController:vc animated:YES];
- }break;
- case CollectModel_file:{
- FlowAttachmentsModel *wMdoel = [[FlowAttachmentsModel alloc]init];
- wMdoel.Url = model.Data.File;
- wMdoel.MinUrl = model.Data.File;
- wMdoel.Title = model.Data.FileName;
- wMdoel.SoureId = model.Data.Id;
- wMdoel.SoureTypeId = CollectModel_file;
- wMdoel.Size = model.Data.FileSize;
- DownFileViewController *downFileViewController = [[DownFileViewController alloc]init];
- downFileViewController.model = wMdoel;
- [self.navigationController pushViewController:downFileViewController animated:YES];
- }break;
- case CollectModel_meetDetail:
- {
- WorkFlowDetailsController * vc = [[WorkFlowDetailsController alloc] initWithId:model.CollectionDataId];
- [self.navigationController pushViewController:vc animated:YES];
- }
- break;
- case CollectModel_work:
- {
- MyApprovalPageDetail * vc = [[MyApprovalPageDetail alloc]init];
- vc.pageType = Type_ONEC;
- vc.indexId = model.CollectionDataId;
- vc.title = model.Data.Title;
- vc.TodoId = model.CollectionDataId;
- [self.navigationController pushViewController:vc animated:YES];
- }
- break;
- case CollectModel_StoreSound:
- {
- BookListenVC * vc = [BookListenVC initBookListenVC];
- vc.Id = model.CollectionDataId;
- vc.MediaType = MediaMusicType;
- [self.navigationController pushViewController:vc animated:YES];
- }
- break;
- case CollectModel_StoreVideo:
- {
- BookWCDetailVC * vc = [BookWCDetailVC initBookWCDetailVC];
- vc.Id = model.CollectionDataId;
- [self.navigationController pushViewController:vc animated:YES];
- }
- break;
- case CollectModel_Teacher:
- {
- BookTeacherDetailVC * vc = [BookTeacherDetailVC initBookTeacherDetailVC];
- vc.Id = model.CollectionDataId;
- [self.navigationController pushViewController:vc animated:YES];
- }
- break;
- case CollectModel_Organization:
- {
- HomeSCDetailVC * vc = [[HomeSCDetailVC alloc] init];
- vc.Id = model.CollectionDataId;
- vc.hidesBottomBarWhenPushed = YES;
- [self.navigationController pushViewController:vc animated:YES];
- }
- break;
- case CollectModel_meetMian:{
- MyTDTopicDetailVC * vc = [MyTDTopicDetailVC initMyTDTopicDetailVC];
- vc.Id = model.CollectionDataId;
- vc.type = CollectModel_meetMian;
- [self.navigationController pushViewController:vc animated:YES];
- }break;
- case CollectModel_financeCount:{
- CountDataVC *vc = [CountDataVC initCountDataVC];
- vc.index = 0;
- vc.titleStr = @"财务统计";
- [self.navigationController pushViewController:vc animated:YES];
- }break;
- case CollectModel_affairsCount:{
- CountDataVC *vc = [CountDataVC initCountDataVC];
- vc.index = 1;
- vc.titleStr = @"人事统计";
- [self.navigationController pushViewController:vc animated:YES];
- }break;
- case CollectModel_publishCount:{
- CountDataVC *vc = [CountDataVC initCountDataVC];
- vc.index = 2;
- vc.titleStr = @"出版统计";
- [self.navigationController pushViewController:vc animated:YES];
- }break;
- case CollectModel_StoreBook:{
- BookListDetailVC * vc = [BookListDetailVC initBookListDetailVC];
- vc.Id = model.CollectionDataId;
- vc.hidesBottomBarWhenPushed = YES;
- [self.navigationController pushViewController:vc animated:YES];
- }break;
- case CollectModel_StoreMing:
- {
- BookMingDetailVC * vc = [BookMingDetailVC initBookMingDetailVC];
- vc.gzId = model.CollectionDataId;
- vc.type = model.CollectionType;
- vc.titleStr = model.Data.Title;
- vc.hidesBottomBarWhenPushed = YES;
- [self.navigationController pushViewController:vc animated:YES];
- }break;
- case CollectModel_StoreQiKan:
- {
- BookPeriodicaDetailVC * vc = [BookPeriodicaDetailVC initBookPeriodicaDetailVC];
- vc.Id = model.CollectionDataId;
- vc.titleStr = model.Title;
- vc.hidesBottomBarWhenPushed = YES;
- [self.navigationController pushViewController:vc animated:YES];
- }break;
- case CollectModel_StoreGongzh:
- {
- BookMingDetailVC * vc = [BookMingDetailVC initBookMingDetailVC];
- vc.gzId = model.CollectionDataId;
- vc.type = model.CollectionType;
- vc.titleStr = model.Data.Title;
- vc.hidesBottomBarWhenPushed = YES;
- [self.navigationController pushViewController:vc animated:YES];
- }break;
- default:
- {
- MyTDTopicDetailVC * vc = [MyTDTopicDetailVC initMyTDTopicDetailVC];
- vc.Id = model.CollectionDataId;
- vc.type = CollectModel_Toipc;
- [self.navigationController pushViewController:vc animated:YES];
- }
- break;
- }
- }
- }
- #pragma mark - load
- - (UITableView *)tableView
- {
- if (!_tableView) {
- _tableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStylePlain];
- _tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
- }
- return _tableView;
- }
- - (MyTDGroupView *)SearchView
- {
- if (!_SearchView) {
- _SearchView = [[MyTDGroupView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 36)];
- }
- return _SearchView;
- }
- -(NSMutableArray *)dataArray{
- if(!_dataArray){
- _dataArray = [[NSMutableArray alloc] init];
- }
- return _dataArray;
- }
- -(NSMutableArray *)collectionDataSource{
- if(!_collectionDataSource){
- _collectionDataSource = [[NSMutableArray alloc] init];
- }
- return _collectionDataSource;
- }
- - (GHRefreshCollectionView *)collectionView {
- if (!_collectionView) {
- UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init];
- layout.scrollDirection = UICollectionViewScrollDirectionHorizontal;
- layout.sectionInset = UIEdgeInsetsMake(0, 0, 0, 0);
- _collectionView = [[GHRefreshCollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:layout];
- _collectionView.delegate = self;
- _collectionView.dataSource = self;
- _collectionView.showsHorizontalScrollIndicator = NO;
- [_collectionView registerNib:[UINib nibWithNibName:@"ChatMsgCollectionCell" bundle:nil] forCellWithReuseIdentifier:@"ChatMsgCollectionCell"];
- _collectionView.backgroundColor = [UIColor whiteColor];
- }
- return _collectionView;
- }
- #pragma mark UICollectionView
- - (NSInteger)numberOfSectionsInCollectionView:(GHRefreshCollectionView *)collectionView{
- return 1;
- }
- /**********************************************************************/
- #pragma mark -UICollectionViewDataSource
- /**********************************************************************/
- - (NSInteger)collectionView:(GHRefreshCollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
- return self.collectionDataSource.count;
- }
- - (UICollectionViewCell *)collectionView:(GHRefreshCollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
- {
- MoreAppInfoModel *bean = [self.collectionDataSource objectAtIndex:indexPath.item];
- ChatMsgCollectionCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"ChatMsgCollectionCell" forIndexPath:indexPath];
- cell.cell0IconImg.image = [UIImage imageNamed:bean.imgName];
- cell.cell0TitleLabel.text = bean.title;
- cell.imagH.constant = 25.f;
- cell.imagW.constant = 25.f;
- cell.titleConstant.constant = 8.f;
- switch (indexPath.item) {
- case 0:
- {
- cell.cell0ReadNumLabel.hidden = YES;
- NSString * count = @"0";
- cell.cell0ReadNumLabel.text = count;
- UILabel * label = [UILabel new];
- label.font = [UIFont systemFontOfSize:12];
- label.text = count;
- CGFloat width = [label sizeThatFits:CGSizeMake(SCREEN_WIDTH, 16)].width;
- if ((width + 5) < 16) {
- cell.constant.constant = 16;
- }else{
- cell.constant.constant = width + 8;
- }
- }
- break;
- case 1:
- {
- cell.cell0ReadNumLabel.hidden = YES;
- NSString * count = @"0";
- cell.cell0ReadNumLabel.text = count;
- UILabel * label = [UILabel new];
- label.font = [UIFont systemFontOfSize:12];
- label.text = count;
- CGFloat width = [label sizeThatFits:CGSizeMake(SCREEN_WIDTH, 16)].width;
- if ((width + 5) < 16) {
- cell.constant.constant = 16;
- }else{
- cell.constant.constant = width + 8;
- }
- }
- break;
- case 2:
- {
- cell.cell0ReadNumLabel.hidden = YES;
- NSString * count = @"0";
- cell.cell0ReadNumLabel.text = count;
- UILabel * label = [UILabel new];
- label.font = [UIFont systemFontOfSize:12];
- label.text = count;
- CGFloat width = [label sizeThatFits:CGSizeMake(SCREEN_WIDTH, 16)].width;
- if ((width + 5) < 16) {
- cell.constant.constant = 16;
- }else{
- cell.constant.constant = width + 8;
- }
- }
- break;
- case 3:
- {
- cell.cell0ReadNumLabel.hidden = YES;
- NSString * count = @"0";
- cell.cell0ReadNumLabel.text = count;
- UILabel * label = [UILabel new];
- label.font = [UIFont systemFontOfSize:12];
- label.text = count;
- CGFloat width = [label sizeThatFits:CGSizeMake(SCREEN_WIDTH, 16)].width;
- if ((width + 5) < 16) {
- cell.constant.constant = 16;
- }else{
- cell.constant.constant = width + 8;
- }
- }
- break;
- default:
- {
- cell.cell0ReadNumLabel.hidden = YES ;
- }
- break;
- }
- cell.cell0MengCengView.hidden = YES;
- return cell;
- }
- /****************************************************/
- #pragma mark --UICollectionViewDelegateFlowLayout
- /****************************************************/
- - (CGSize)collectionView:(GHRefreshCollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath
- {
- CGFloat width = (SCREEN_WIDTH - 20) / self.collectionDataSource.count;
- CGFloat height = 80;
- return CGSizeMake(width, height);
- }
- -(UIEdgeInsets)collectionView:(GHRefreshCollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout insetForSectionAtIndex:(NSInteger)section
- {
- CGFloat W = 10;
- return UIEdgeInsetsMake(0,W,0,W);
- }
- - (CGFloat)collectionView:(GHRefreshCollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout minimumLineSpacingForSectionAtIndex:(NSInteger)section{
- return 0;
- }
- - (CGFloat)collectionView:(GHRefreshCollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout minimumInteritemSpacingForSectionAtIndex:(NSInteger)section{
- return 0;
- }
- - (void)collectionView:(GHRefreshCollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath{
- [collectionView deselectItemAtIndexPath:indexPath animated:YES];
- switch (indexPath.item) {
- case 0:
- {
- MyFavoriteVC *vc = [MyFavoriteVC initMyFavoriteVC];
- vc.listType = MyFavoriteListLevelTypeA;
- vc.FolderId = 0;
- vc.operationStateEnum = OperationStateEnum0;
- vc.myTitle = @"我的收藏";
- vc.hidesBottomBarWhenPushed = YES;
- [self.navigationController pushViewController:vc animated:YES];
- }
- break;
- case 1:
- {
- CommonNoteVC * vc = [CommonNoteVC initCommonNoteVC];
- vc.hidesBottomBarWhenPushed = YES;
- [self.navigationController pushViewController:vc animated:YES];
- }
- break;
- case 2:
- {
- CommonToolVC * vc = [CommonToolVC initCommonToolVC];
- vc.hidesBottomBarWhenPushed = YES;
- [self.navigationController pushViewController:vc animated:YES];
- }
- break;
- default:
- {
- CommonWorkVC * vc = [CommonWorkVC initCommonWorkVC];
- vc.hidesBottomBarWhenPushed = YES;
- [self.navigationController pushViewController:vc animated:YES];
- }
- break;
- }
- }
- - (void)setBarData
- {
- [self.collectionDataSource removeAllObjects];
- NSArray * titleArray = @[@"收藏夹",@"笔记本",@"工具箱",@"工作台"];
- NSArray * imageArray = @[@"Common_collect",@"Common_note",@"Common_gjxiang",@"Common_gztai"];
- for (NSInteger i = 0; i < titleArray.count; i ++) {
- MoreAppInfoModel * model = [[MoreAppInfoModel alloc] init];
- model.title = titleArray[i];
- model.imgName = imageArray[i];
- [self.collectionDataSource addObject:model];
- }
- }
- #pragma Mark 左滑按钮 iOS8以上
- - (nullable UISwipeActionsConfiguration *)tableView:(UITableView *)tableView trailingSwipeActionsConfigurationForRowAtIndexPath:(NSIndexPath *)indexPath API_AVAILABLE(ios(11.0)) API_UNAVAILABLE(tvos){
- if (indexPath.section == 0) {
- UISwipeActionsConfiguration *actions = [UISwipeActionsConfiguration configurationWithActions:@[]];
- actions.performsFirstActionWithFullSwipe = NO;
- return actions;
- }else{
- WEAKSELF
- MyFavoriteSubModel * model = [self.dataArray objectAtIndex:indexPath.row];
- UIContextualAction *action1 = [UIContextualAction contextualActionWithStyle:UIContextualActionStyleNormal title:@"转发" handler:^(UIContextualAction * _Nonnull action, __kindof UIView * _Nonnull sourceView, void (^ _Nonnull completionHandler)(BOOL)) {
- [tableView setEditing:NO animated:YES];
- weakSelf.sendModel = model;
- if (model.CollectionType == CollectModel_StoreSound || weakSelf.sendModel.CollectionType == CollectModel_StoreVideo) {
- weakSelf.sendModel.Data.MinFile = weakSelf.sendModel.Data.ArticleImgUrl.firstObject;
- weakSelf.sendModel.Data.File = weakSelf.sendModel.Data.ArticleImgUrl.firstObject;
- }
- [weakSelf shareHander];
- }];
- action1.backgroundColor = UIColorHex(#FF923A);
- UIContextualAction *action2 = [UIContextualAction contextualActionWithStyle:UIContextualActionStyleNormal title:model.IsTop ? @"取消置顶" :@"置顶" handler:^(UIContextualAction * _Nonnull action, __kindof UIView * _Nonnull sourceView, void (^ _Nonnull completionHandler)(BOOL)) {
- [weakSelf topFind:model];
-
- }];
- action2.backgroundColor = UIColorHex(#9BA9CB);
- UIContextualAction *action3 = [UIContextualAction contextualActionWithStyle:UIContextualActionStyleNormal title:@"移动" handler:^(UIContextualAction * _Nonnull action, __kindof UIView * _Nonnull sourceView, void (^ _Nonnull completionHandler)(BOOL)) {
- [weakSelf launchMoveVC:@[@(model.Id)].mutableCopy];
- completionHandler(YES);
- }];
- action3.backgroundColor = UIColorHex(#589AF1);
- UIContextualAction *action4 = [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) {
- [weakSelf.tableView reloadData];
- }];
- [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];
- }];
- action4.backgroundColor = UIColorHex(#F64A33);
- UISwipeActionsConfiguration *actions = [UISwipeActionsConfiguration configurationWithActions:@[action4,action3,action2,action1]];
- actions.performsFirstActionWithFullSwipe = NO;
- return actions;
- }
- }
- - (void)topFind:(MyFavoriteSubModel*)findModel{
- WEAKSELF
- [[HttpManager sharedHttpManager] PUTUrl:[NSString stringWithFormat:@"%@%@%ld",BaseUrl,API_Find_Top,(long)findModel.Id] parameters:@{} success:^(id _Nonnull responseObject) {
- [weakSelf getDataList];
- } failure:^(NSError * _Nonnull error) {
- SHOWERROR([ZYCTool handerResultData:error]);
- }];
- }
- - (void)deleteFind:(NSMutableArray<MyFavoriteSubModel *>*)findModelArray indexPath:(NSIndexPath *)indexPath{
- NSMutableArray *MiddleIds = [NSMutableArray array];
-
- for (MyFavoriteSubModel *model in findModelArray) {
- [MiddleIds addObject:@(model.Id)];
- }
- NSMutableDictionary *dic = [[NSMutableDictionary alloc]init];
- [dic setValue:MiddleIds forKey:@"MiddleIds"];
- [dic setValue:@(3) forKey:@"FolderType"];
-
- WS(weakSelf);
- [[HttpManager sharedHttpManager] POSTUrl:Host(API_Find_DeleteRecord) parameters:dic responseStyle:DATA success:^(id _Nonnull responseObject) {
- [weakSelf.dataArray removeObjectAtIndex:indexPath.row];
- dispatch_async(dispatch_get_main_queue(), ^{
- [weakSelf.tableView reloadData];
- });
- } failure:^(NSError * _Nonnull error) {
- SHOWERROR([ZYCTool handerResultData:error]);
- }];
- }
- - (void)launchMoveVC:(NSMutableArray<NSNumber*>*)selectIDArray{
- MoveViewController * vc = [MoveViewController initMoveViewController];
- vc.TypeId = CreateCollectionType;
- vc.collectType = CollectHanderType_Move;
- vc.CollectionType = CollectModel_Collect;
- vc.ParentId = 0;
- vc.FolderIds = selectIDArray;
- vc.titleStr = @"移动";
- [self.navigationController pushViewController:vc animated:YES];
- }
- #pragma mark - 转发
- - (void)shareHander{
- [self.noteBookShareVC initNoteBookShareData];
- 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
- {
- NSString * url = [self.sendModel.Data.File stringByRemovingPercentEncoding];
- UMSocialMessageObject *messageObject = [UMSocialMessageObject messageObject];
-
- messageObject.title = self.sendModel.Title;
- //创建文件内容对象
- UMShareFileObject * fileObject = [UMShareFileObject shareObjectWithTitle:self.sendModel.Title descr:@"" thumImage:[UIImage imageNamed:[ZYCTool getFileNameImage:self.sendModel.Title]]];
-
- fileObject.fileData = [NSData dataWithContentsOfURL:[NSURL URLWithString:url]];
-
- fileObject.fileExtension = [self.sendModel.Title pathExtension];
-
- //分享消息对象设置分享内容对象
- messageObject.shareObject = fileObject;
-
- //调用分享接口
- [[UMSocialManager defaultManager] shareToPlatform:platformType messageObject:messageObject currentViewController:self completion:^(id data, NSError *error) {
- if (error) {
- SHOWERROR([ZYCTool handerResultData:error]);
- NSLog(@"************Share fail with error %@*********",error);
- }else{
- NSLog(@"response data is %@",data);
- }
- }];
- }
- - (void)shareWebPageToPlatformType:(UMSocialPlatformType)platformType title:(NSString *)title desc:(NSString *)desc url:(NSString *)url image:(NSString *)image
- {
- //创建分享消息对象
- UMSocialMessageObject *messageObject = [UMSocialMessageObject messageObject];
-
- messageObject.title = title;
- //创建网页内容对象
- UMShareWebpageObject *shareObject = [UMShareWebpageObject shareObjectWithTitle:title descr:desc thumImage:IMG(image)];
- //设置网页地址
- 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
- {
- NSString * name = self.sendModel.Data.Author;
- if (self.sendModel.CollectionType == CollectModel_Toipc) {
- name = [NSString stringWithFormat:@"%@ 来自-%@",self.sendModel.Data.Author, self.sendModel.GroupName];
- }
- if (self.sendModel.CollectionType == CollectModel_file) {
- [self shareWebPageToPlatformType:UMSocialPlatformType_WechatSession];
- }else{
- [self shareWebPageToPlatformType:UMSocialPlatformType_WechatSession title:self.sendModel.Title desc:name url:[self returnUrl] image:[self returnImage]];
- }
- }
- - (void)returnToWechatTimeLine
- {
- NSString * name = self.sendModel.Data.Author;
- if (self.sendModel.CollectionType == CollectModel_Toipc) {
- name = [NSString stringWithFormat:@"%@ 来自-%@",self.sendModel.Data.Author, self.sendModel.GroupName];
- }
- if (self.sendModel.CollectionType == CollectModel_file) {
- [self shareWebPageToPlatformType:UMSocialPlatformType_WechatTimeLine];
- }else{
- [self shareWebPageToPlatformType:UMSocialPlatformType_WechatTimeLine title:self.sendModel.Title desc:name url:[self returnUrl] image:[self returnImage]];
- }
- }
- - (void)returnToSina
- {
- NSString * name = self.sendModel.Data.Author;
- if (self.sendModel.CollectionType == CollectModel_Toipc) {
- name = [NSString stringWithFormat:@"%@ 来自-%@",self.sendModel.Data.Author, self.sendModel.GroupName];
- }
- if (self.sendModel.CollectionType == CollectModel_file) {
- [self shareWebPageToPlatformType:UMSocialPlatformType_Sina];
- }else{
- [self shareWebPageToPlatformType:UMSocialPlatformType_Sina title:self.sendModel.Title desc:name url:[self returnUrl] image:[self returnImage]];
- }
- }
- - (void)returnToQQ
- {
- NSString * name = self.sendModel.Data.Author;
- if (self.sendModel.CollectionType == CollectModel_Toipc) {
- name = [NSString stringWithFormat:@"%@ 来自-%@",self.sendModel.Data.Author, self.sendModel.GroupName];
- }
- if (self.sendModel.CollectionType == CollectModel_file) {
- [self shareWebPageToPlatformType:UMSocialPlatformType_QQ];
- }else{
- [self shareWebPageToPlatformType:UMSocialPlatformType_QQ title:self.sendModel.Title desc:name url:[self returnUrl] image:[self returnImage]];
- }
- }
- - (NSString *)returnUrl
- {
- switch (self.sendModel.Data.Type) {
- case CollectModel_Group:
- {
- NSString * url = [NSString stringWithFormat:@"%@%ld",Host(@"/admin/mobile/topicDetailsWx?"),(long)self.sendModel.CollectionDataId];
- return url;
- }
- break;
- case CollectModel_Toipc:
- {
- NSString * url = [NSString stringWithFormat:@"%@%ld",Host(@"/admin/mobile/topicDetailsWx?"),(long)self.sendModel.CollectionDataId];
- return url;
- }
- break;
- case CollectModel_NewTopic:
- {
- NSString * url = [NSString stringWithFormat:@"%@%ld",Host(@"/admin/mobile/noteDetailsWx?"),(long)self.sendModel.CollectionDataId];
- return url;
- }
- break;
- case CollectModel_Notice:
- {
- // NSString * url = [NSString stringWithFormat:@"%@%ld",@"http://192.168.0.119:8080/admin/mobile/noticeDetailsWx?",(long)self.currentNoteModel.Id];
- NSString * url = [NSString stringWithFormat:@"%@%ld",Host(@"/admin/mobile/noticeDetailsWx?"),(long)self.sendModel.CollectionDataId];
- return url;
- }
- break;
- case CollectModel_NoteBook:
- {
- NSString * url = [NSString stringWithFormat:@"%@%ld",Host(@"/admin/mobile/noteDetailsWx?"),(long)self.sendModel.CollectionDataId];
- return url;
- }
- break;
- case CollectModel_InterMail:
- {
- NSString * url = [NSString stringWithFormat:@"%@%ld",Host(@"/admin/mobile/mailWx?"),(long)self.sendModel.CollectionDataId];
- return url;
- }
- break;
- case CollectModel_NoSignMail:
- {
- NSString * url = [NSString stringWithFormat:@"%@%ld",Host(@"/admin/mobile/mailWx?"),(long)self.sendModel.CollectionDataId];
- return url;
- }
- break;
- case CollectModel_meetMian:
- {
- NSString * url = [NSString stringWithFormat:@"%@%ld",ShareHost(@"mobile/minutesMeetingWx?"),(long)self.sendModel.CollectionDataId];
- return url;
- }
- break;
- case CollectModel_meetDetail:
- {
- NSString * url = [NSString stringWithFormat:@"%@%ld",ShareHost(@"mobile/meetingWx?"),(long)self.sendModel.CollectionDataId];
- return url;
- }
- break;
- case CollectModel_NoteFile:
- {
- NSString * url = [NSString stringWithFormat:@"%@id=%ld&type=13&userId=%ld&name=%@&describe=%@",ShareHost(@"mobile/folderWx?"),(long)self.sendModel.CollectionDataId,self.sendModel.SourceUserId,self.sendModel.Title,@"笔记文件夹"];
- return url;
- }
- break;
- case CollectModel_CollectFile:
- {
- NSString * url = [NSString stringWithFormat:@"%@id=%ld&type=12&userId=%ld&name=%@&describe=%@",ShareHost(@"mobile/folderWx?"),(long)self.sendModel.CollectionDataId,self.sendModel.SourceUserId,self.sendModel.Title,@"收藏文件夹"];
- return url;
- }
- break;
- case CollectModel_TopicBooK:
- {
- NSString * url = [NSString stringWithFormat:@"%@id=%ld&type=41&userId=%ld&name=%@&describe=%@",ShareHost(@"mobile/folderWx?"),(long)self.sendModel.CollectionDataId,self.sendModel.SourceUserId,self.sendModel.Title,@"话题本"];
- return url;
- }
- break;
- case CollectModel_TopicSubBooK:
- {
- NSString * url = [NSString stringWithFormat:@"%@id=%ld&type=42&userId=%ld&name=%@&describe=%@",ShareHost(@"mobile/folderWx?"),(long)self.sendModel.CollectionDataId,self.sendModel.SourceUserId,self.sendModel.Title,@"话题文件夹"];
- return url;
- }
- break;
- case CollectModel_work:
- {
- NSString * url = [NSString stringWithFormat:@"%@%ld",ShareHost(@"mobile/approvalWx?"),(long)self.sendModel.CollectionDataId];
- return url;
- }
- break;
- case CollectModel_Aritle:
- {
- NSString * url = [NSString stringWithFormat:@"%@%ld",Host(@"/admin/mobile/mainText?"),(long)self.sendModel.CollectionDataId];
- return url;
- }
- break;
- default:
- {
- NSString * url = [NSString stringWithFormat:@"%@%ld",Host(@"/admin/mobile/noticeDetailsWx?"),(long)self.sendModel.CollectionDataId];
- return url;
- }
- break;
- }
- return @"";
- }
- - (NSString *)returnImage
- {
- switch (self.sendModel.CollectionType) {
- case CollectModel_Group:
- {
- NSString * url = @"笔记小组";
- return url;
- }
- break;
- case CollectModel_Toipc:
- {
- NSString * url = @"话题";
- return url;
- }
- break;
- case CollectModel_NewTopic:
- {
- NSString * url = @"话题";
- return url;
- }
- break;
- case CollectModel_Notice:
- {
- NSString * url = @"通知图标";
- return url;
- }
- break;
- case CollectModel_NoteBook:
- {
- NSString * url = @"noteBook_icon";
- return url;
- }
- break;
- case CollectModel_NoteFile:
- {
- NSString * url = @"share_file";
- return url;
- }
- break;
- case CollectModel_CollectFile:
- {
- NSString * url = @"share_file";
- return url;
- }
- break;
- case CollectModel_InterMail:
- {
- NSString * url = @"站内信";
- return url;
- }
- break;
- case CollectModel_NoSignMail:
- {
- NSString * url = @"站内信";
- return url;
- }
- break;
- case CollectModel_meetMian:
- {
- NSString * url = @"会议纪要";
- return url;
- }
- break;
- case CollectModel_meetDetail:
- {
- NSString * url = @"会议";
- return url;
- }
- break;
- case CollectModel_Aritle:
- {
- NSString * url = @"文章";
- return url;
- }
- break;
- case CollectModel_TopicBooK:
- {
- NSString * url = @"topicBook";
- return url;
- }
- break;
- case CollectModel_TopicSubBooK:
- {
- NSString * url = @"share_file";
- return url;
- }
- break;
- default:
- {
- NSString * url = @"笔记文章";
- return url;
- }
- break;
- }
- return @"";
- }
- #pragma mark - 分享功能
- - (void)returnToMessage
- {
- ShareListVC * vc = [ShareListVC initShareListVC];
- FlowAttachmentsModel * model = [[FlowAttachmentsModel alloc] init];
- model.SoureId = self.sendModel.CollectionDataId;
- model.SoureTypeId = self.sendModel.CollectionType;
- model.Title = self.sendModel.Title;
- model.Author = self.sendModel.Data.Author;
- model.SourceUserId = self.sendModel.SourceUserId;
- model.GroupId = self.sendModel.Data.GroupId;
- model.GroupName = self.sendModel.Data.GroupName;
- model.MinUrl = self.sendModel.Data.MinFile;
- model.Url = self.sendModel.Data.File;
- vc.sendModel = model;
- vc.isReturn = YES;
- [self.navigationController pushViewController:vc animated:YES];
- }
- - (void)returnToGroup
- {
- MyTDGroupViewController * vc = [[MyTDGroupViewController alloc] init];
- vc.type = CollectModel_Toipc;
- FlowAttachmentsModel * model = [[FlowAttachmentsModel alloc] init];
- model.SoureId = self.sendModel.CollectionDataId;
- model.SoureTypeId = self.sendModel.CollectionType;
- model.Title = self.sendModel.Title;
- model.Author = self.sendModel.Data.Author;
- model.SourceUserId = self.sendModel.SourceUserId;
- model.GroupId = self.sendModel.Data.GroupId;
- model.GroupName = self.sendModel.Data.GroupName;
- model.MinUrl = self.sendModel.Data.MinFile;
- model.Url = self.sendModel.Data.File;
- vc.sendModel = model;
- vc.isReturn = YES;
- [self.navigationController pushViewController:vc animated:YES];
- }
- - (void)returnToNote
- {
- MoveViewController * vc = [MoveViewController initMoveViewController];
- vc.isFromCreateBookVc = YES;
- vc.TypeId = CreateNotesType;
- vc.CollectionType = CollectModel_NoteBook;
- vc.titleStr = @"我的笔记";
- vc.ParentId = 0;
- FlowAttachmentsModel * model = [[FlowAttachmentsModel alloc] init];
- model.SoureId = self.sendModel.CollectionDataId;
- model.SoureTypeId = self.sendModel.CollectionType;
- model.Title = self.sendModel.Title;
- model.Author = self.sendModel.Data.Author;
- model.SourceUserId = self.sendModel.SourceUserId;
- model.GroupId = self.sendModel.Data.GroupId;
- model.GroupName = self.sendModel.Data.GroupName;
- model.MinUrl = self.sendModel.Data.MinFile;
- model.Url = self.sendModel.Data.File;
- vc.type = CollectModel_NoteBook;
- vc.sendModel = model;
- vc.isReturn = YES;
- [self.navigationController pushViewController:vc animated:YES];
- }
- - (void)returnToTopic
- {
- MyTDTopicCreateVC * vc = [MyTDTopicCreateVC initMyTDTopicCreateVC];
- vc.type = CollectModel_NewTopic;
- FlowAttachmentsModel * model = [[FlowAttachmentsModel alloc] init];
- model.SoureId = self.sendModel.CollectionDataId;
- model.SoureTypeId = self.sendModel.CollectionType;
- model.Title = self.sendModel.Title;
- model.Author = self.sendModel.Data.Author;
- model.SourceUserId = self.sendModel.SourceUserId;
- model.GroupId = self.sendModel.Data.GroupId;
- model.GroupName = self.sendModel.Data.GroupName;
- model.MinUrl = self.sendModel.Data.MinFile;
- model.Url = self.sendModel.Data.File;
- vc.type = CollectModel_NewTopic;
- vc.sendModel = model;
- vc.isReturn = YES;
- [self.navigationController pushViewController:vc animated:YES];
- }
- //- (void)scrollViewWillEndDragging:(UIScrollView *)scrollView withVelocity:(CGPoint)velocity targetContentOffset:(inout CGPoint *)targetContentOffset
- //{
- // UIPanGestureRecognizer * pan = scrollView.panGestureRecognizer;
- // CGFloat v = [pan velocityInView:scrollView].y;
- // NSLog(@"%.2f",v);
- // if (v < 140) {
- // self.HeadView.hidden = YES;
- // self.collectionView.hidden = YES;
- // }else{
- // self.HeadView.hidden = NO;
- // self.collectionView.hidden = NO;
- // }
- //}
- @end
|