|
@@ -0,0 +1,946 @@
|
|
|
+//
|
|
|
+// SourceGroupVC.m
|
|
|
+// smartRhino
|
|
|
+//
|
|
|
+// Created by niuzhen on 2020/5/7.
|
|
|
+// Copyright © 2020 tederen. All rights reserved.
|
|
|
+//
|
|
|
+
|
|
|
+#import "SourceGroupVC.h"
|
|
|
+#import "MyTDGroupView.h"
|
|
|
+#import "TDGroupInfoListCell.h"
|
|
|
+#import "ChatMsgListCell.h"
|
|
|
+#import "TDGroupInfoListModel.h"
|
|
|
+#import "NoteBookVC.h"
|
|
|
+#import "OtherNoteBookVC.h"
|
|
|
+#import "MailListDetailVC.h"
|
|
|
+#import "MyFavoriteVC.h"
|
|
|
+#import "MyTDGroupViewController.h"
|
|
|
+#import "MoveViewController.h"
|
|
|
+#import "OtherFavoriteVC.h"
|
|
|
+#import "TDGroupInfoListVC.h"
|
|
|
+#import "WorkFlowDetailsController.h"
|
|
|
+#import "MyApprovalPageDetail.h"
|
|
|
+#import "DownFileViewController.h"
|
|
|
+#import "ShareListVC.h"
|
|
|
+#import "TDInterLeterHomeViewController.h"
|
|
|
+#import "MailListVC.h"
|
|
|
+#import "WaitWorkVC.h"
|
|
|
+#import "MyTDTopicSearchVC.h"
|
|
|
+#import "NoteBookShareVC.h"
|
|
|
+#import "GroupSquareVC.h"
|
|
|
+
|
|
|
+@interface SourceGroupVC ()<UITableViewDelegate,UITableViewDataSource,NoteBookShareVCDelegate>
|
|
|
+@property (weak, nonatomic) IBOutlet UIButton *editBtn;
|
|
|
+@property (weak, nonatomic) IBOutlet UIButton *squareBtn;
|
|
|
+@property (weak, nonatomic) IBOutlet UIView *HeadView;
|
|
|
+@property (weak, nonatomic) IBOutlet UITableView *tableView;
|
|
|
+@property (strong, nonatomic) MyTDGroupView *SearchView;
|
|
|
+@property (copy, nonatomic) NSMutableArray *dataArray;
|
|
|
+@property (strong, nonatomic) UIView *groupView;
|
|
|
+@property (strong, nonatomic) NoteBookShareVC *noteBookShareVC;
|
|
|
+@property (copy, nonatomic) FlowAttachmentsModel *sendModel;
|
|
|
+@property (assign, nonatomic) BOOL isReturn;
|
|
|
+@end
|
|
|
+
|
|
|
+@implementation SourceGroupVC
|
|
|
++(SourceGroupVC *)initSourceGroupVC{
|
|
|
+ SourceGroupVC *controller = [StoryboardManager.shared.Source instantiateViewControllerWithIdentifier:@"SourceGroupVC"];
|
|
|
+ return controller;
|
|
|
+}
|
|
|
+- (void)viewDidLoad {
|
|
|
+ [super viewDidLoad];
|
|
|
+ self.fd_prefersNavigationBarHidden = YES;
|
|
|
+ [self addHeaderSubView];
|
|
|
+ self.tableView.delegate = self;
|
|
|
+ self.tableView.dataSource = self;
|
|
|
+ WS(weakSelf);
|
|
|
+ [self.squareBtn setAction:^{
|
|
|
+ GroupSquareVC * vc = [GroupSquareVC initGroupSquareVC];
|
|
|
+ [weakSelf.navigationController pushViewController:vc animated:YES];
|
|
|
+ }];
|
|
|
+ [self.editBtn setAction:^{
|
|
|
+ MyTDTopicCreateVC * vc = [MyTDTopicCreateVC initMyTDTopicCreateVC];
|
|
|
+ vc.type = CollectModel_NewTopic;
|
|
|
+ vc.upDateBlock = ^{
|
|
|
+ [weakSelf getData];
|
|
|
+ };
|
|
|
+ [weakSelf.navigationController pushViewController:vc animated:YES];
|
|
|
+ }];
|
|
|
+ [self getData];
|
|
|
+}
|
|
|
+
|
|
|
+- (void)addHeaderSubView
|
|
|
+{
|
|
|
+ [self.HeadView addSubview:self.SearchView];
|
|
|
+ [self.SearchView mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+ make.left.top.right.mas_equalTo(self.HeadView);
|
|
|
+ make.height.mas_offset(36);
|
|
|
+ }];
|
|
|
+ [self.HeadView addSubview:self.groupView];
|
|
|
+ [self.groupView mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+ make.top.mas_equalTo(self.SearchView.mas_bottom);
|
|
|
+ make.left.bottom.right.mas_equalTo(self.HeadView);
|
|
|
+ }];
|
|
|
+ UIImageView * imgV = [UIImageView new];
|
|
|
+ imgV.image = IMG(@"Source_Group_Icon");
|
|
|
+ [self.groupView addSubview:imgV];
|
|
|
+ [imgV mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+ make.left.mas_offset(15);
|
|
|
+ make.centerY.mas_equalTo(self.groupView);
|
|
|
+ }];
|
|
|
+
|
|
|
+ UILabel * lineL = [UILabel new];
|
|
|
+ lineL.backgroundColor = LINEBGCOLOR;
|
|
|
+ [self.groupView addSubview:lineL];
|
|
|
+ [lineL mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+ make.left.bottom.right.mas_equalTo(self.groupView);
|
|
|
+ make.height.mas_offset(0.5);
|
|
|
+ }];
|
|
|
+
|
|
|
+ UILabel * titleL = [UILabel new];
|
|
|
+ titleL.textColor = UIColorHex(0x0A0A0A);
|
|
|
+ titleL.font = [UIFont systemFontOfSize:15];
|
|
|
+ titleL.text = @"小组";
|
|
|
+ [self.groupView addSubview:titleL];
|
|
|
+ [titleL mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+ make.centerY.mas_equalTo(self.groupView);
|
|
|
+ make.left.mas_equalTo(imgV.mas_right).offset(15);
|
|
|
+ }];
|
|
|
+ UIImageView * rightImgV = [UIImageView new];
|
|
|
+ rightImgV.image = IMG(@"chatmsg_rightArrow_icon");
|
|
|
+ [self.groupView addSubview:rightImgV];
|
|
|
+ [rightImgV mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+ make.centerY.mas_equalTo(self.groupView);
|
|
|
+ make.right.offset(-15);
|
|
|
+ }];
|
|
|
+ WS(weakSelf);
|
|
|
+ UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithActionBlock:^(id _Nonnull sender) {
|
|
|
+ [weakSelf pushGroupVC];
|
|
|
+ }];
|
|
|
+ self.groupView.userInteractionEnabled = YES;
|
|
|
+ [self.groupView addGestureRecognizer:tap];
|
|
|
+}
|
|
|
+- (void)pushGroupVC
|
|
|
+{
|
|
|
+ MyTDGroupViewController * vc = [[MyTDGroupViewController alloc] init];
|
|
|
+ [self.navigationController pushViewController:vc animated:YES];
|
|
|
+}
|
|
|
+- (void)getData
|
|
|
+{
|
|
|
+ WS(weakSelf);
|
|
|
+ NSDictionary * paraDict = @{@"ParentId":@(0),
|
|
|
+ @"UserId":@([AppUserModel sharedAppUserModel].Id),
|
|
|
+ @"Keyword": @"",
|
|
|
+ @"Page":@(1),
|
|
|
+ @"TopicGroupIds": @[],
|
|
|
+ @"PerPage": @(99999999),
|
|
|
+ @"Sort":@""
|
|
|
+ };
|
|
|
+ [[HttpManager sharedHttpManager] POSTUrl:Host(APP_Topic_Topic_List_Page) parameters:paraDict responseStyle:JOSN success:^(id _Nonnull responseObject) {
|
|
|
+ NSLog(@"%@",responseObject);
|
|
|
+ [weakSelf.tableView.mj_header endRefreshing];
|
|
|
+ [weakSelf.tableView.mj_footer endRefreshing];
|
|
|
+ TopicListModel * model = [TopicListModel modelWithDictionary:responseObject];
|
|
|
+ [weakSelf.dataArray addObjectsFromArray:model.Items];
|
|
|
+ dispatch_async(dispatch_get_main_queue(), ^{
|
|
|
+ [weakSelf.tableView reloadData];
|
|
|
+ });
|
|
|
+ } failure:^(NSError * _Nonnull error) {
|
|
|
+ [weakSelf.tableView.mj_header endRefreshing];
|
|
|
+ [weakSelf.tableView.mj_footer endRefreshing];
|
|
|
+ }];
|
|
|
+}
|
|
|
+#pragma mark - UITableViewDelegate
|
|
|
+- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
|
|
|
+ return 1;
|
|
|
+}
|
|
|
+
|
|
|
+- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
|
|
|
+ return self.dataArray.count;
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
|
|
|
+ return UITableViewAutomaticDimension;
|
|
|
+}
|
|
|
+
|
|
|
+- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
|
|
|
+ WS(weakSelf);
|
|
|
+ TopicListItemModel * model = [self.dataArray objectAtIndex:indexPath.row];
|
|
|
+ switch (model.DataType) {
|
|
|
+ case TopiclistCellImage:
|
|
|
+ {
|
|
|
+ TDGroupInfoListCell * cell;
|
|
|
+ switch (model.Data.count) {
|
|
|
+ case 1:
|
|
|
+ {
|
|
|
+ cell = [TDGroupInfoListCell configCell1:tableView indexPath:indexPath];
|
|
|
+ cell.cellImagV1.hidden = NO;
|
|
|
+ cell.cellImagV2.hidden = YES;
|
|
|
+ cell.cellImagV3.hidden = YES;
|
|
|
+ cell.cellImagV4.hidden = YES;
|
|
|
+ cell.cellImagV5.hidden = YES;
|
|
|
+ cell.cellImagV6.hidden = YES;
|
|
|
+ cell.cellImagV7.hidden = YES;
|
|
|
+ cell.cellImagV8.hidden = YES;
|
|
|
+ cell.cellImagV9.hidden = YES;
|
|
|
+ TopicListSubModel * subModel0 = model.Data[0];
|
|
|
+ [cell.cellImagV1 sd_setImageWithURL:[NSURL URLWithString:subModel0.File] placeholderImage:IMG(@"img_placeHolderVertical")];
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case 2:
|
|
|
+ {
|
|
|
+ cell = [TDGroupInfoListCell configCell1:tableView indexPath:indexPath];
|
|
|
+ cell.cellImagV1.hidden = NO;
|
|
|
+ cell.cellImagV2.hidden = NO;
|
|
|
+ cell.cellImagV3.hidden = YES;
|
|
|
+ cell.cellImagV4.hidden = YES;
|
|
|
+ cell.cellImagV5.hidden = YES;
|
|
|
+ cell.cellImagV6.hidden = YES;
|
|
|
+ cell.cellImagV7.hidden = YES;
|
|
|
+ cell.cellImagV8.hidden = YES;
|
|
|
+ cell.cellImagV9.hidden = YES;
|
|
|
+ TopicListSubModel * subModel0 = model.Data[0];
|
|
|
+ [cell.cellImagV1 sd_setImageWithURL:[NSURL URLWithString:subModel0.File] placeholderImage:IMG(@"img_placeHolderVertical")];
|
|
|
+ TopicListSubModel * subModel1 = model.Data[1];
|
|
|
+ [cell.cellImagV2 sd_setImageWithURL:[NSURL URLWithString:subModel1.File] placeholderImage:IMG(@"img_placeHolderVertical")];
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case 3:
|
|
|
+ {
|
|
|
+ cell = [TDGroupInfoListCell configCell2:tableView indexPath:indexPath];
|
|
|
+ cell.cellImagV1.hidden = NO;
|
|
|
+ cell.cellImagV2.hidden = NO;
|
|
|
+ cell.cellImagV3.hidden = NO;
|
|
|
+ cell.cellImagV4.hidden = YES;
|
|
|
+ cell.cellImagV5.hidden = YES;
|
|
|
+ cell.cellImagV6.hidden = YES;
|
|
|
+ cell.cellImagV7.hidden = YES;
|
|
|
+ cell.cellImagV8.hidden = YES;
|
|
|
+ cell.cellImagV9.hidden = YES;
|
|
|
+ TopicListSubModel * subModel0 = model.Data[0];
|
|
|
+ [cell.cellImagV1 sd_setImageWithURL:[NSURL URLWithString:subModel0.File] placeholderImage:IMG(@"img_placeHolderVertical")];
|
|
|
+ TopicListSubModel * subModel1 = model.Data[1];
|
|
|
+ [cell.cellImagV2 sd_setImageWithURL:[NSURL URLWithString:subModel1.File] placeholderImage:IMG(@"img_placeHolderVertical")];
|
|
|
+ TopicListSubModel * subModel2 = model.Data[2];
|
|
|
+ [cell.cellImagV3 sd_setImageWithURL:[NSURL URLWithString:subModel2.File] placeholderImage:IMG(@"img_placeHolderVertical")];
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case 4:
|
|
|
+ {
|
|
|
+ cell = [TDGroupInfoListCell configCell3:tableView indexPath:indexPath];
|
|
|
+ cell.cellImagV1.hidden = NO;
|
|
|
+ cell.cellImagV2.hidden = NO;
|
|
|
+ cell.cellImagV3.hidden = NO;
|
|
|
+ cell.cellImagV4.hidden = NO;
|
|
|
+ cell.cellImagV5.hidden = YES;
|
|
|
+ cell.cellImagV6.hidden = YES;
|
|
|
+ cell.cellImagV7.hidden = YES;
|
|
|
+ cell.cellImagV8.hidden = YES;
|
|
|
+ cell.cellImagV9.hidden = YES;
|
|
|
+ TopicListSubModel * subModel0 = model.Data[0];
|
|
|
+ [cell.cellImagV1 sd_setImageWithURL:[NSURL URLWithString:subModel0.File] placeholderImage:IMG(@"img_placeHolderVertical")];
|
|
|
+ TopicListSubModel * subModel1 = model.Data[1];
|
|
|
+ [cell.cellImagV2 sd_setImageWithURL:[NSURL URLWithString:subModel1.File] placeholderImage:IMG(@"img_placeHolderVertical")];
|
|
|
+ TopicListSubModel * subModel2 = model.Data[2];
|
|
|
+ [cell.cellImagV3 sd_setImageWithURL:[NSURL URLWithString:subModel2.File] placeholderImage:IMG(@"img_placeHolderVertical")];
|
|
|
+ TopicListSubModel * subModel3 = model.Data[3];
|
|
|
+ [cell.cellImagV4 sd_setImageWithURL:[NSURL URLWithString:subModel3.File] placeholderImage:IMG(@"img_placeHolderVertical")];
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case 5:
|
|
|
+ {
|
|
|
+ cell = [TDGroupInfoListCell configCell4:tableView indexPath:indexPath];
|
|
|
+ cell.cellImagV1.hidden = NO;
|
|
|
+ cell.cellImagV2.hidden = NO;
|
|
|
+ cell.cellImagV3.hidden = NO;
|
|
|
+ cell.cellImagV4.hidden = NO;
|
|
|
+ cell.cellImagV5.hidden = NO;
|
|
|
+ cell.cellImagV6.hidden = YES;
|
|
|
+ cell.cellImagV7.hidden = YES;
|
|
|
+ cell.cellImagV8.hidden = YES;
|
|
|
+ cell.cellImagV9.hidden = YES;
|
|
|
+ TopicListSubModel * subModel0 = model.Data[0];
|
|
|
+ [cell.cellImagV1 sd_setImageWithURL:[NSURL URLWithString:subModel0.File] placeholderImage:IMG(@"img_placeHolderVertical")];
|
|
|
+ TopicListSubModel * subModel1 = model.Data[1];
|
|
|
+ [cell.cellImagV2 sd_setImageWithURL:[NSURL URLWithString:subModel1.File] placeholderImage:IMG(@"img_placeHolderVertical")];
|
|
|
+ TopicListSubModel * subModel2 = model.Data[2];
|
|
|
+ [cell.cellImagV3 sd_setImageWithURL:[NSURL URLWithString:subModel2.File] placeholderImage:IMG(@"img_placeHolderVertical")];
|
|
|
+ TopicListSubModel * subModel3 = model.Data[3];
|
|
|
+ [cell.cellImagV4 sd_setImageWithURL:[NSURL URLWithString:subModel3.File] placeholderImage:IMG(@"img_placeHolderVertical")];
|
|
|
+ TopicListSubModel * subModel4 = model.Data[4];
|
|
|
+ [cell.cellImagV5 sd_setImageWithURL:[NSURL URLWithString:subModel4.File] placeholderImage:IMG(@"img_placeHolderVertical")];
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case 6:
|
|
|
+ {
|
|
|
+ cell = [TDGroupInfoListCell configCell4:tableView indexPath:indexPath];
|
|
|
+ cell.cellImagV1.hidden = NO;
|
|
|
+ cell.cellImagV2.hidden = NO;
|
|
|
+ cell.cellImagV3.hidden = NO;
|
|
|
+ cell.cellImagV4.hidden = NO;
|
|
|
+ cell.cellImagV5.hidden = NO;
|
|
|
+ cell.cellImagV6.hidden = NO;
|
|
|
+ cell.cellImagV7.hidden = YES;
|
|
|
+ cell.cellImagV8.hidden = YES;
|
|
|
+ cell.cellImagV9.hidden = YES;
|
|
|
+ TopicListSubModel * subModel0 = model.Data[0];
|
|
|
+ [cell.cellImagV1 sd_setImageWithURL:[NSURL URLWithString:subModel0.File] placeholderImage:IMG(@"img_placeHolderVertical")];
|
|
|
+ TopicListSubModel * subModel1 = model.Data[1];
|
|
|
+ [cell.cellImagV2 sd_setImageWithURL:[NSURL URLWithString:subModel1.File] placeholderImage:IMG(@"img_placeHolderVertical")];
|
|
|
+ TopicListSubModel * subModel2 = model.Data[2];
|
|
|
+ [cell.cellImagV3 sd_setImageWithURL:[NSURL URLWithString:subModel2.File] placeholderImage:IMG(@"img_placeHolderVertical")];
|
|
|
+ TopicListSubModel * subModel3 = model.Data[3];
|
|
|
+ [cell.cellImagV4 sd_setImageWithURL:[NSURL URLWithString:subModel3.File] placeholderImage:IMG(@"img_placeHolderVertical")];
|
|
|
+ TopicListSubModel * subModel4 = model.Data[4];
|
|
|
+ [cell.cellImagV5 sd_setImageWithURL:[NSURL URLWithString:subModel4.File] placeholderImage:IMG(@"img_placeHolderVertical")];
|
|
|
+ TopicListSubModel * subModel5 = model.Data[5];
|
|
|
+ [cell.cellImagV6 sd_setImageWithURL:[NSURL URLWithString:subModel5.File] placeholderImage:IMG(@"img_placeHolderVertical")];
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case 7:
|
|
|
+ {
|
|
|
+ cell = [TDGroupInfoListCell configCell5:tableView indexPath:indexPath];
|
|
|
+ cell.cellImagV1.hidden = NO;
|
|
|
+ cell.cellImagV2.hidden = NO;
|
|
|
+ cell.cellImagV3.hidden = NO;
|
|
|
+ cell.cellImagV4.hidden = NO;
|
|
|
+ cell.cellImagV5.hidden = NO;
|
|
|
+ cell.cellImagV6.hidden = NO;
|
|
|
+ cell.cellImagV7.hidden = NO;
|
|
|
+ cell.cellImagV8.hidden = YES;
|
|
|
+ cell.cellImagV9.hidden = YES;
|
|
|
+ TopicListSubModel * subModel0 = model.Data[0];
|
|
|
+ [cell.cellImagV1 sd_setImageWithURL:[NSURL URLWithString:subModel0.File] placeholderImage:IMG(@"img_placeHolderVertical")];
|
|
|
+ TopicListSubModel * subModel1 = model.Data[1];
|
|
|
+ [cell.cellImagV2 sd_setImageWithURL:[NSURL URLWithString:subModel1.File] placeholderImage:IMG(@"img_placeHolderVertical")];
|
|
|
+ TopicListSubModel * subModel2 = model.Data[2];
|
|
|
+ [cell.cellImagV3 sd_setImageWithURL:[NSURL URLWithString:subModel2.File] placeholderImage:IMG(@"img_placeHolderVertical")];
|
|
|
+ TopicListSubModel * subModel3 = model.Data[3];
|
|
|
+ [cell.cellImagV4 sd_setImageWithURL:[NSURL URLWithString:subModel3.File] placeholderImage:IMG(@"img_placeHolderVertical")];
|
|
|
+ TopicListSubModel * subModel4 = model.Data[4];
|
|
|
+ [cell.cellImagV5 sd_setImageWithURL:[NSURL URLWithString:subModel4.File] placeholderImage:IMG(@"img_placeHolderVertical")];
|
|
|
+ TopicListSubModel * subModel5 = model.Data[5];
|
|
|
+ [cell.cellImagV6 sd_setImageWithURL:[NSURL URLWithString:subModel5.File] placeholderImage:IMG(@"img_placeHolderVertical")];
|
|
|
+ TopicListSubModel * subModel6 = model.Data[6];
|
|
|
+ [cell.cellImagV7 sd_setImageWithURL:[NSURL URLWithString:subModel6.File] placeholderImage:IMG(@"img_placeHolderVertical")];
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case 8:
|
|
|
+ {
|
|
|
+ cell = [TDGroupInfoListCell configCell5:tableView indexPath:indexPath];
|
|
|
+ cell.cellImagV1.hidden = NO;
|
|
|
+ cell.cellImagV2.hidden = NO;
|
|
|
+ cell.cellImagV3.hidden = NO;
|
|
|
+ cell.cellImagV4.hidden = NO;
|
|
|
+ cell.cellImagV5.hidden = NO;
|
|
|
+ cell.cellImagV6.hidden = NO;
|
|
|
+ cell.cellImagV7.hidden = NO;
|
|
|
+ cell.cellImagV8.hidden = NO;
|
|
|
+ cell.cellImagV9.hidden = YES;
|
|
|
+ TopicListSubModel * subModel0 = model.Data[0];
|
|
|
+ [cell.cellImagV1 sd_setImageWithURL:[NSURL URLWithString:subModel0.File] placeholderImage:IMG(@"img_placeHolderVertical")];
|
|
|
+ TopicListSubModel * subModel1 = model.Data[1];
|
|
|
+ [cell.cellImagV2 sd_setImageWithURL:[NSURL URLWithString:subModel1.File] placeholderImage:IMG(@"img_placeHolderVertical")];
|
|
|
+ TopicListSubModel * subModel2 = model.Data[2];
|
|
|
+ [cell.cellImagV3 sd_setImageWithURL:[NSURL URLWithString:subModel2.File] placeholderImage:IMG(@"img_placeHolderVertical")];
|
|
|
+ TopicListSubModel * subModel3 = model.Data[3];
|
|
|
+ [cell.cellImagV4 sd_setImageWithURL:[NSURL URLWithString:subModel3.File] placeholderImage:IMG(@"img_placeHolderVertical")];
|
|
|
+ TopicListSubModel * subModel4 = model.Data[4];
|
|
|
+ [cell.cellImagV5 sd_setImageWithURL:[NSURL URLWithString:subModel4.File] placeholderImage:IMG(@"img_placeHolderVertical")];
|
|
|
+ TopicListSubModel * subModel5 = model.Data[5];
|
|
|
+ [cell.cellImagV6 sd_setImageWithURL:[NSURL URLWithString:subModel5.File] placeholderImage:IMG(@"img_placeHolderVertical")];
|
|
|
+ TopicListSubModel * subModel6 = model.Data[6];
|
|
|
+ [cell.cellImagV7 sd_setImageWithURL:[NSURL URLWithString:subModel6.File] placeholderImage:IMG(@"img_placeHolderVertical")];
|
|
|
+ TopicListSubModel * subModel7 = model.Data[7];
|
|
|
+ [cell.cellImagV8 sd_setImageWithURL:[NSURL URLWithString:subModel7.File] placeholderImage:IMG(@"img_placeHolderVertical")];
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ {
|
|
|
+ cell = [TDGroupInfoListCell configCell5:tableView indexPath:indexPath];
|
|
|
+ cell.cellImagV1.hidden = NO;
|
|
|
+ cell.cellImagV2.hidden = NO;
|
|
|
+ cell.cellImagV3.hidden = NO;
|
|
|
+ cell.cellImagV4.hidden = NO;
|
|
|
+ cell.cellImagV5.hidden = NO;
|
|
|
+ cell.cellImagV6.hidden = NO;
|
|
|
+ cell.cellImagV7.hidden = NO;
|
|
|
+ cell.cellImagV8.hidden = NO;
|
|
|
+ cell.cellImagV9.hidden = NO;
|
|
|
+ TopicListSubModel * subModel0 = model.Data[0];
|
|
|
+ [cell.cellImagV1 sd_setImageWithURL:[NSURL URLWithString:subModel0.File] placeholderImage:IMG(@"img_placeHolderVertical")];
|
|
|
+ TopicListSubModel * subModel1 = model.Data[1];
|
|
|
+ [cell.cellImagV2 sd_setImageWithURL:[NSURL URLWithString:subModel1.File] placeholderImage:IMG(@"img_placeHolderVertical")];
|
|
|
+ TopicListSubModel * subModel2 = model.Data[2];
|
|
|
+ [cell.cellImagV3 sd_setImageWithURL:[NSURL URLWithString:subModel2.File] placeholderImage:IMG(@"img_placeHolderVertical")];
|
|
|
+ TopicListSubModel * subModel3 = model.Data[3];
|
|
|
+ [cell.cellImagV4 sd_setImageWithURL:[NSURL URLWithString:subModel3.File] placeholderImage:IMG(@"img_placeHolderVertical")];
|
|
|
+ TopicListSubModel * subModel4 = model.Data[4];
|
|
|
+ [cell.cellImagV5 sd_setImageWithURL:[NSURL URLWithString:subModel4.File] placeholderImage:IMG(@"img_placeHolderVertical")];
|
|
|
+ TopicListSubModel * subModel5 = model.Data[5];
|
|
|
+ [cell.cellImagV6 sd_setImageWithURL:[NSURL URLWithString:subModel5.File] placeholderImage:IMG(@"img_placeHolderVertical")];
|
|
|
+ TopicListSubModel * subModel6 = model.Data[6];
|
|
|
+ [cell.cellImagV7 sd_setImageWithURL:[NSURL URLWithString:subModel6.File] placeholderImage:IMG(@"img_placeHolderVertical")];
|
|
|
+ TopicListSubModel * subModel7 = model.Data[7];
|
|
|
+ [cell.cellImagV8 sd_setImageWithURL:[NSURL URLWithString:subModel7.File] placeholderImage:IMG(@"img_placeHolderVertical")];
|
|
|
+ TopicListSubModel * subModel8 = model.Data[8];
|
|
|
+ [cell.cellImagV9 sd_setImageWithURL:[NSURL URLWithString:subModel8.File] placeholderImage:IMG(@"img_placeHolderVertical")];
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+
|
|
|
+ [cell.cellIconV sd_setImageWithURL:[NSURL URLWithString:model.AvatarUrl] placeholderImage:kUserDefaultHeadImage];
|
|
|
+ [cell.fileBtn setTitle:model.FolderResult.FolderName forState:UIControlStateNormal];
|
|
|
+ [cell.fileBtn setAction:^{
|
|
|
+ [weakSelf enterFileWithModel:model];
|
|
|
+ }];
|
|
|
+ cell.ClickUserBlock = ^{
|
|
|
+ [weakSelf showUserInfo:model.UserId];
|
|
|
+ };
|
|
|
+ cell.cellTimeL.text = [model.CreatedDate substringWithRange:NSMakeRange(5, 11)];
|
|
|
+ cell.celltitleL.attributedText = [self setTitleWithStr:model.Title];
|
|
|
+ cell.cellContentL.attributedText = [self setTextWithStr:model.Content];
|
|
|
+ cell.cellNameL.text = model.UserName;
|
|
|
+ cell.cellReadNumL.text = [NSString stringWithFormat:@"阅读:%ld",(long)model.ReadCount];
|
|
|
+ [cell.cellLikeBtn setAction:^{
|
|
|
+ [weakSelf likeAction:model withBtn:cell.cellLikeBtn index:indexPath];
|
|
|
+ }];
|
|
|
+ if (model.CommentCount > 0) {
|
|
|
+ [cell.cellPingBtn setTitle:[NSString stringWithFormat:@"%ld",(long)model.CommentCount] forState:UIControlStateNormal];
|
|
|
+ }else{
|
|
|
+ [cell.cellPingBtn setTitle:@"评论" forState:UIControlStateNormal];
|
|
|
+ }
|
|
|
+ if (model.PraiseCount > 0) {
|
|
|
+ [cell.cellLikeBtn setTitle:[NSString stringWithFormat:@"%ld",(long)model.PraiseCount] forState:UIControlStateNormal];
|
|
|
+ }else{
|
|
|
+ [cell.cellLikeBtn setTitle:@"赞" forState:UIControlStateNormal];
|
|
|
+ }
|
|
|
+ if (model.IsPraise) {
|
|
|
+ [cell.cellLikeBtn setTitleColor:UIColorHex(#009AFF) forState:UIControlStateNormal];
|
|
|
+ [cell.cellLikeBtn setImage:[UIImage imageNamed:@"收藏_赞_select"] forState:UIControlStateNormal];
|
|
|
+ }else{
|
|
|
+ [cell.cellLikeBtn setTitleColor:UIColorHex(#999999) forState:UIControlStateNormal];
|
|
|
+ [cell.cellLikeBtn setImage:[UIImage imageNamed:@"收藏_赞"] forState:UIControlStateNormal];
|
|
|
+ }
|
|
|
+ [cell.cellPingBtn setAction:^{
|
|
|
+ [weakSelf CommentPush:model];
|
|
|
+ }];
|
|
|
+ [cell.cellSendBtn setAction:^{
|
|
|
+ [weakSelf reSend:model];
|
|
|
+ }];
|
|
|
+ if (model.Title.length == 0) {
|
|
|
+ cell.TitleConstant.constant = 0;
|
|
|
+ }else{
|
|
|
+ cell.TitleConstant.constant = 10.f;
|
|
|
+ }
|
|
|
+ if (model.Content.length == 0) {
|
|
|
+ cell.subTitleContant.constant = 0.f;
|
|
|
+ }else{
|
|
|
+ cell.subTitleContant.constant = 7.5f;
|
|
|
+ }
|
|
|
+ cell.fileContant.constant = 0.f;
|
|
|
+ return cell;
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case TopiclistCellFile:
|
|
|
+ {
|
|
|
+ TDGroupInfoListCell * cell = [TDGroupInfoListCell configCell6:tableView indexPath:indexPath];
|
|
|
+ [cell.cellIconV sd_setImageWithURL:[NSURL URLWithString:model.AvatarUrl] placeholderImage:kUserDefaultHeadImage];
|
|
|
+ [cell.fileBtn setTitle:model.FolderResult.FolderName forState:UIControlStateNormal];
|
|
|
+ [cell.fileBtn setAction:^{
|
|
|
+ [weakSelf enterFileWithModel:model];
|
|
|
+ }];
|
|
|
+ [cell.ClickFileAction setAction:^{
|
|
|
+ [weakSelf pushFileWithModel:model.Data.firstObject];
|
|
|
+ }];
|
|
|
+ cell.cellNameL.text = model.UserName;
|
|
|
+ cell.cellTimeL.text = [model.CreatedDate substringWithRange:NSMakeRange(5, 11)];
|
|
|
+ cell.celltitleL.attributedText = [self setTitleWithStr:model.Title];
|
|
|
+ cell.cellContentL.attributedText = [self setTextWithStr:model.Content];
|
|
|
+ [cell setDataWithCell6:model.Data.firstObject];
|
|
|
+ cell.cellReadNumL.text = [NSString stringWithFormat:@"阅读:%ld",(long)model.ReadCount];
|
|
|
+ [cell.cellLikeBtn setAction:^{
|
|
|
+ [weakSelf likeAction:model withBtn:cell.cellLikeBtn index:indexPath];
|
|
|
+ }];
|
|
|
+ if (model.CommentCount > 0) {
|
|
|
+ [cell.cellPingBtn setTitle:[NSString stringWithFormat:@"%ld",(long)model.CommentCount] forState:UIControlStateNormal];
|
|
|
+ }else{
|
|
|
+ [cell.cellPingBtn setTitle:@"评论" forState:UIControlStateNormal];
|
|
|
+ }
|
|
|
+ if (model.PraiseCount > 0) {
|
|
|
+ [cell.cellLikeBtn setTitle:[NSString stringWithFormat:@"%ld",(long)model.PraiseCount] forState:UIControlStateNormal];
|
|
|
+ }else{
|
|
|
+ [cell.cellLikeBtn setTitle:@"赞" forState:UIControlStateNormal];
|
|
|
+ }
|
|
|
+ if (model.IsPraise) {
|
|
|
+ [cell.cellLikeBtn setTitleColor:UIColorHex(#009AFF) forState:UIControlStateNormal];
|
|
|
+ [cell.cellLikeBtn setImage:[UIImage imageNamed:@"收藏_赞_select"] forState:UIControlStateNormal];
|
|
|
+ }else{
|
|
|
+ [cell.cellLikeBtn setTitleColor:UIColorHex(#999999) forState:UIControlStateNormal];
|
|
|
+ [cell.cellLikeBtn setImage:[UIImage imageNamed:@"收藏_赞"] forState:UIControlStateNormal];
|
|
|
+ }
|
|
|
+ [cell.cellPingBtn setAction:^{
|
|
|
+ [weakSelf CommentPush:model];
|
|
|
+ }];
|
|
|
+ [cell.cellSendBtn setAction:^{
|
|
|
+ [weakSelf reSend:model];
|
|
|
+ }];
|
|
|
+ if (model.Title.length == 0) {
|
|
|
+ cell.TitleConstant.constant = 0;
|
|
|
+ }else{
|
|
|
+ cell.TitleConstant.constant = 10.f;
|
|
|
+ }
|
|
|
+ if (model.Content.length == 0) {
|
|
|
+ cell.subTitleContant.constant = 0.f;
|
|
|
+ }else{
|
|
|
+ cell.subTitleContant.constant = 7.5f;
|
|
|
+ }
|
|
|
+ cell.ClickUserBlock = ^{
|
|
|
+ [weakSelf showUserInfo:model.UserId];
|
|
|
+ };
|
|
|
+ return cell;
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ default:///TopiclistCellNone
|
|
|
+ {
|
|
|
+ TDGroupInfoListCell * cell = [TDGroupInfoListCell configCell0:tableView indexPath:indexPath];
|
|
|
+ [cell.cellIconV sd_setImageWithURL:[NSURL URLWithString:model.AvatarUrl] placeholderImage:kUserDefaultHeadImage];
|
|
|
+ [cell.fileBtn setTitle:model.FolderResult.FolderName forState:UIControlStateNormal];
|
|
|
+ [cell.fileBtn setAction:^{
|
|
|
+ [weakSelf enterFileWithModel:model];
|
|
|
+ }];
|
|
|
+ cell.cellNameL.text = model.UserName;
|
|
|
+ cell.cellTimeL.text = [model.CreatedDate substringWithRange:NSMakeRange(5, 11)];
|
|
|
+ cell.celltitleL.attributedText = [self setTitleWithStr:model.Title];
|
|
|
+ cell.cellContentL.attributedText = [self setTextWithStr:model.Content];
|
|
|
+ cell.cellReadNumL.text = [NSString stringWithFormat:@"阅读:%ld",(long)model.ReadCount];
|
|
|
+ [cell.cellLikeBtn setAction:^{
|
|
|
+ [weakSelf likeAction:model withBtn:cell.cellLikeBtn index:indexPath];
|
|
|
+ }];
|
|
|
+ if (model.CommentCount > 0) {
|
|
|
+ [cell.cellPingBtn setTitle:[NSString stringWithFormat:@"%ld",(long)model.CommentCount] forState:UIControlStateNormal];
|
|
|
+ }else{
|
|
|
+ [cell.cellPingBtn setTitle:@"评论" forState:UIControlStateNormal];
|
|
|
+ }
|
|
|
+ if (model.PraiseCount > 0) {
|
|
|
+ [cell.cellLikeBtn setTitle:[NSString stringWithFormat:@"%ld",(long)model.PraiseCount] forState:UIControlStateNormal];
|
|
|
+ }else{
|
|
|
+ [cell.cellLikeBtn setTitle:@"赞" forState:UIControlStateNormal];
|
|
|
+ }
|
|
|
+ if (model.IsPraise) {
|
|
|
+ [cell.cellLikeBtn setTitleColor:UIColorHex(#009AFF) forState:UIControlStateNormal];
|
|
|
+ [cell.cellLikeBtn setImage:[UIImage imageNamed:@"收藏_赞_select"] forState:UIControlStateNormal];
|
|
|
+ }else{
|
|
|
+ [cell.cellLikeBtn setTitleColor:UIColorHex(#999999) forState:UIControlStateNormal];
|
|
|
+ [cell.cellLikeBtn setImage:[UIImage imageNamed:@"收藏_赞"] forState:UIControlStateNormal];
|
|
|
+ }
|
|
|
+ [cell.cellPingBtn setAction:^{
|
|
|
+ [weakSelf CommentPush:model];
|
|
|
+ }];
|
|
|
+ [cell.cellSendBtn setAction:^{
|
|
|
+ [weakSelf reSend:model];
|
|
|
+ }];
|
|
|
+ if (model.Title.length == 0) {
|
|
|
+ cell.TitleConstant.constant = 0;
|
|
|
+ }else{
|
|
|
+ cell.TitleConstant.constant = 10.f;
|
|
|
+ }
|
|
|
+ if (model.Content.length == 0) {
|
|
|
+ cell.subTitleContant.constant = 0.f;
|
|
|
+ }else{
|
|
|
+ cell.subTitleContant.constant = 7.5f;
|
|
|
+ }
|
|
|
+ cell.ClickUserBlock = ^{
|
|
|
+ [weakSelf showUserInfo:model.UserId];
|
|
|
+ };
|
|
|
+ return cell;
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+}
|
|
|
+- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
|
|
|
+ [tableView deselectRowAtIndexPath:indexPath animated:YES];
|
|
|
+}
|
|
|
+
|
|
|
+- (void)enterFileWithModel:(TopicListItemModel *)model
|
|
|
+{
|
|
|
+ if (model.UserId == [AppUserModel sharedAppUserModel].Id) {
|
|
|
+ NoteBookVC *vc = [NoteBookVC initNoteBookVC];
|
|
|
+ vc.listType = MyFavoriteListLevelTypeB;
|
|
|
+ vc.FolderId = model.FolderResult.Id;
|
|
|
+ vc.ParentId = model.FolderResult.Id;
|
|
|
+ vc.myTitle = model.FolderResult.FolderName;
|
|
|
+ vc.VisitUserId = model.UserId;
|
|
|
+ [self.navigationController pushViewController:vc animated:YES];
|
|
|
+ }else{
|
|
|
+ OtherNoteBookVC *vc = [OtherNoteBookVC initOtherNoteBookVC];
|
|
|
+ vc.listType = MyFavoriteListLevelTypeB;
|
|
|
+ vc.FolderId = model.FolderResult.Id;
|
|
|
+ vc.Author = model.UserName;
|
|
|
+ vc.myTitle = model.FolderResult.FolderName;
|
|
|
+ vc.VisitUserId = model.UserId;
|
|
|
+
|
|
|
+ [self.navigationController pushViewController:vc animated:YES];
|
|
|
+ }
|
|
|
+}
|
|
|
+- (void)showUserInfo:(NSInteger)userId
|
|
|
+{
|
|
|
+ MailListDetailVC * vc = [MailListDetailVC initMailListDetailVC];
|
|
|
+ vc.indexId = userId;
|
|
|
+ [self.navigationController pushViewController:vc animated:YES];
|
|
|
+}
|
|
|
+#pragma mark - 点击评论
|
|
|
+- (void)likeAction:(TopicListItemModel *)model withBtn:(UIButton *)btn index:(NSIndexPath *)indexPath
|
|
|
+{
|
|
|
+ WS(weakSelf);
|
|
|
+ NSDictionary * paraDict = @{@"SourceId":@(model.Id),
|
|
|
+ @"TypeValue":@(3),///3 笔记
|
|
|
+ @"AnalyzeType":@(1)
|
|
|
+ };
|
|
|
+ btn.enabled = NO;
|
|
|
+ [[HttpManager sharedHttpManager] POSTUrl:Host(API_APP_Analyze_Set) parameters:paraDict responseStyle:DATA success:^(id _Nonnull responseObject) {
|
|
|
+ btn.enabled = YES;
|
|
|
+ model.IsPraise = !model.IsPraise;
|
|
|
+ model.PraiseCount = model.IsPraise ? (model.PraiseCount + 1) : (model.PraiseCount - 1);
|
|
|
+ dispatch_async(dispatch_get_main_queue(), ^{
|
|
|
+ [weakSelf.tableView reloadRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationNone];
|
|
|
+ });
|
|
|
+ } failure:^(NSError * _Nonnull error) {
|
|
|
+ btn.enabled = YES;
|
|
|
+ }];
|
|
|
+}
|
|
|
+- (void)CommentPush:(TopicListItemModel *)model
|
|
|
+{
|
|
|
+ MyTDTopicDetailVC * vc = [MyTDTopicDetailVC initMyTDTopicDetailVC];
|
|
|
+ vc.type = CollectModel_NewTopic;
|
|
|
+ vc.deleteTopicBlock = ^{
|
|
|
+
|
|
|
+ };
|
|
|
+ vc.Id = model.Id;
|
|
|
+ vc.isComment = YES;
|
|
|
+ [self.navigationController pushViewController:vc animated:YES];
|
|
|
+}
|
|
|
+- (void)reSend:(TopicListItemModel *)model
|
|
|
+{
|
|
|
+ FlowAttachmentsModel * topicModel = [[FlowAttachmentsModel alloc] init];
|
|
|
+ topicModel.SoureTypeId = CollectModel_NewTopic;
|
|
|
+ topicModel.Title = model.Title;
|
|
|
+ topicModel.SoureId = model.Id;
|
|
|
+ topicModel.Title = model.Title;
|
|
|
+ topicModel.Author = model.UserName;
|
|
|
+ self.sendModel = topicModel;
|
|
|
+ [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 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.sendModel.Title desc:[NSString stringWithFormat:@"来自-%@",self.sendModel.Author] url:[self returnUrl]];
|
|
|
+}
|
|
|
+- (void)returnToWechatTimeLine
|
|
|
+{
|
|
|
+ [self shareWebPageToPlatformType:UMSocialPlatformType_WechatTimeLine title:self.sendModel.Title desc:[NSString stringWithFormat:@"来自-%@",self.sendModel.Author] url:[self returnUrl]];
|
|
|
+}
|
|
|
+- (void)returnToSina
|
|
|
+{
|
|
|
+ [self shareWebPageToPlatformType:UMSocialPlatformType_Sina title:self.sendModel.Title desc:[NSString stringWithFormat:@"来自-%@",self.sendModel.Author] url:[self returnUrl]];
|
|
|
+}
|
|
|
+- (void)returnToQQ
|
|
|
+{
|
|
|
+ [self shareWebPageToPlatformType:UMSocialPlatformType_QQ title:self.sendModel.Title desc:[NSString stringWithFormat:@"来自-%@",self.sendModel.Author] url:[self returnUrl]];
|
|
|
+}
|
|
|
+- (NSString *)returnUrl
|
|
|
+{
|
|
|
+ NSString * url = [NSString stringWithFormat:@"%@%ld",Host(@"/admin/mobile/noteDetailsWx?"),(long)self.sendModel.Id];
|
|
|
+ return url;
|
|
|
+}
|
|
|
+#pragma mark - 分享功能
|
|
|
+- (void)returnToMessage
|
|
|
+{
|
|
|
+ ShareListVC * vc = [ShareListVC initShareListVC];
|
|
|
+ vc.sendModel = self.sendModel;
|
|
|
+ vc.isReturn = YES;
|
|
|
+ [self.navigationController pushViewController:vc animated:YES];
|
|
|
+}
|
|
|
+- (void)returnToGroup
|
|
|
+{
|
|
|
+ MyTDGroupViewController * vc = [[MyTDGroupViewController alloc] init];
|
|
|
+ vc.type = CollectModel_Group;
|
|
|
+ vc.sendModel = self.sendModel;
|
|
|
+ vc.isReturn = YES;
|
|
|
+
|
|
|
+ [self.navigationController pushViewController:vc animated:YES];
|
|
|
+}
|
|
|
+- (void)returnToNote
|
|
|
+{
|
|
|
+ MyTDTopicCreateVC * vc = [MyTDTopicCreateVC initMyTDTopicCreateVC];
|
|
|
+ vc.type = CollectModel_NoteBook;
|
|
|
+ vc.sendModel = self.sendModel;
|
|
|
+ vc.isReturn = YES;
|
|
|
+ [self.navigationController pushViewController:vc animated:YES];
|
|
|
+}
|
|
|
+- (void)returnToTopic
|
|
|
+{
|
|
|
+ MyTDTopicCreateVC * vc = [MyTDTopicCreateVC initMyTDTopicCreateVC];
|
|
|
+ vc.type = CollectModel_NewTopic;
|
|
|
+ vc.sendModel = self.sendModel;
|
|
|
+ vc.isReturn = YES;
|
|
|
+ [self.navigationController pushViewController:vc animated:YES];
|
|
|
+}
|
|
|
+
|
|
|
+#pragma mark - 点击文件跳转
|
|
|
+- (void)pushFileWithModel:(TopicListSubModel *)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];
|
|
|
+ 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_NoteBook:
|
|
|
+ {
|
|
|
+ MyTDTopicDetailVC * vc = [MyTDTopicDetailVC initMyTDTopicDetailVC];
|
|
|
+ vc.type = CollectModel_NoteBook;
|
|
|
+ vc.Id = model.Id;
|
|
|
+ [self.navigationController pushViewController:vc animated:YES];
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case CollectModel_CollectFile:{
|
|
|
+ if (model.SourceUserId == [AppUserModel sharedAppUserModel].Id) {
|
|
|
+ MyFavoriteVC *vc = [MyFavoriteVC initMyFavoriteVC];
|
|
|
+ vc.listType = model.Id == 0 ? MyFavoriteListLevelTypeA : MyFavoriteListLevelTypeB;
|
|
|
+ vc.ParentId = 0;
|
|
|
+ vc.FolderId = model.Id;
|
|
|
+ vc.myTitle = model.Title;
|
|
|
+ [self.navigationController pushViewController:vc animated:YES];
|
|
|
+ }else{
|
|
|
+ OtherFavoriteVC *vc = [OtherFavoriteVC initOtherFavoriteVC];
|
|
|
+ vc.listType = model.Id == 0 ? MyFavoriteListLevelTypeA : MyFavoriteListLevelTypeB;
|
|
|
+ vc.ParentId = 0;
|
|
|
+ vc.FolderId = model.Id;
|
|
|
+ vc.myTitle = model.Title;
|
|
|
+ vc.VisitUserId = model.SourceUserId;
|
|
|
+ [self.navigationController pushViewController:vc animated:YES];
|
|
|
+ }
|
|
|
+ }break;
|
|
|
+ case CollectModel_NoteFile:{
|
|
|
+ if (model.SourceUserId == [AppUserModel sharedAppUserModel].Id) {
|
|
|
+ NoteBookVC *vc = [NoteBookVC initNoteBookVC];
|
|
|
+ vc.listType = model.Id == 0 ? MyFavoriteListLevelTypeA : MyFavoriteListLevelTypeB;
|
|
|
+ vc.ParentId = 0;
|
|
|
+ vc.FolderId = model.Id;
|
|
|
+ vc.myTitle = model.Title;
|
|
|
+ vc.VisitUserId = 0;
|
|
|
+ [self.navigationController pushViewController:vc animated:YES];
|
|
|
+ }else{
|
|
|
+ OtherNoteBookVC *vc = [OtherNoteBookVC initOtherNoteBookVC];
|
|
|
+ vc.listType = model.Id == 0 ? MyFavoriteListLevelTypeA : MyFavoriteListLevelTypeB;
|
|
|
+ vc.ParentId = 0;
|
|
|
+ vc.FolderId = model.Id;
|
|
|
+ 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.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;
|
|
|
+ }
|
|
|
+}
|
|
|
+- (void)pushSearchVC
|
|
|
+{
|
|
|
+ MyTDTopicSearchVC * vc = [[MyTDTopicSearchVC alloc] init];
|
|
|
+ vc.searchType = TDTopicSearch;
|
|
|
+ [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;
|
|
|
+}
|
|
|
+#pragma mark - Load On Demand
|
|
|
+- (NSMutableArray *)dataArray
|
|
|
+{
|
|
|
+ if (!_dataArray) {
|
|
|
+ _dataArray = [NSMutableArray array];
|
|
|
+ }
|
|
|
+ return _dataArray;
|
|
|
+}
|
|
|
+- (MyTDGroupView *)SearchView
|
|
|
+{
|
|
|
+ if (!_SearchView) {
|
|
|
+ _SearchView = [[MyTDGroupView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 36)];
|
|
|
+ }
|
|
|
+ return _SearchView;
|
|
|
+}
|
|
|
+- (UIView *)groupView
|
|
|
+{
|
|
|
+ if (!_groupView) {
|
|
|
+ _groupView = [UIView new];
|
|
|
+ }
|
|
|
+ return _groupView;
|
|
|
+}
|
|
|
+@end
|