HomeViewController.m 40 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073
  1. //
  2. // HomeViewController.m
  3. // TheoryNetwork
  4. //
  5. // Created by tederen on 2019/9/20.
  6. // Copyright © 2019 tederen. All rights reserved.
  7. //
  8. //#import "DrawerView.h"
  9. #import "HomeViewController.h"
  10. #import "SurfaceSearchView.h"
  11. #import "HorizonScroll.h"
  12. #import "ChannelModel.h"
  13. #import "HomeSearchController.h"
  14. #import "AddChannelController.h"
  15. #import "HttpManager.h"
  16. #import "HomeDetailController.h"
  17. #import "APIPOPOPO.h"
  18. #import "MyApprovalPageDetail.h"
  19. #import "MailListDetailVC.h"
  20. #import "NavigationController.h"
  21. #import "UIAlertController+TapGesAlertController.h"
  22. #import "HomeArticleModel.h"
  23. #import "HomeListWorkCell.h"
  24. #import "HomeTableViewCell.h"
  25. #import "SLBannerView.h"
  26. #import "MyFavoriteVC.h"
  27. #import "OtherFavoriteVC.h"
  28. #import "NoteBookVC.h"
  29. #import "OtherNoteBookVC.h"
  30. #import "BookStoreHome.h"
  31. #import "HomeMusicCell.h"
  32. #import "HomeSchoolCell.h"
  33. #import "HomeUserPrivilegeCell.h"
  34. #import "HomeWeiCousreCell.h"
  35. #import "BookWCDetailVC.h"
  36. #import "HomeProblemTopCell.h"
  37. #import "HomeGoodBookCell.h"
  38. #import "BookDetailVC.h"
  39. #import "BookSubArticeCell.h"
  40. #import "HomeTeacherCell.h"
  41. #import "BookTeacherListVC.h"
  42. #import "HKFloatManager.h"
  43. #import "HomeBigshotCell.h"
  44. @interface HomeViewController () <UITableViewDataSource, UITableViewDelegate,SLBannerViewDelegate,AddChannelControllerDelegate>
  45. @property (nonatomic, strong) UILabel *titleLabel;
  46. @property (nonatomic, strong) UIView *bannerBgV;
  47. @property (nonatomic, strong) SLBannerView *bannerView;
  48. @property (nonatomic, strong) SurfaceSearchView *searchView;
  49. @property (nonatomic, strong) HorizonScroll *channelScroll;
  50. @property (nonatomic, strong) NSMutableArray *bannerImgArr;
  51. @property (nonatomic, strong) NSMutableArray * tabConfigArray;
  52. @property (nonatomic, strong) NSMutableArray * bannerModelArray;
  53. @property (nonatomic, strong) HomeArticleModel *model;
  54. @property (nonatomic, strong) TDWaitWorkModel *waitModel;
  55. @property (nonatomic, assign) NSInteger currentPage;
  56. @property (nonatomic, assign) NSInteger totalPage;
  57. @property (nonatomic, assign) NSInteger currentChannel;
  58. @property (nonatomic, strong) NSMutableDictionary *articleDic;
  59. @property (nonatomic, copy) NSMutableArray *dataSource;
  60. @property (nonatomic, strong) UITableView *tableView;
  61. @property (strong, nonatomic) UIAlertController *alertVC;
  62. /// 我的频道
  63. @property (copy, nonatomic) NSMutableArray *myChannel;
  64. @property (strong, nonatomic) UIView *noDataView;
  65. @property (nonatomic, strong) UILabel *noDataLabel;
  66. @end
  67. @implementation HomeViewController
  68. - (void)viewWillAppear:(BOOL)animated
  69. {
  70. [super viewWillAppear:animated];
  71. [self getRedBadge];
  72. }
  73. #pragma mark - LifeCycle
  74. - (void)viewDidLoad {
  75. [super viewDidLoad];
  76. [self getdata];
  77. self.fd_prefersNavigationBarHidden = YES;
  78. [self loadStatusBarColor:[UIColor whiteColor]];
  79. self.view.backgroundColor = UIColorHex(F2F2F2);
  80. [self.view addSubview:self.titleLabel];
  81. [self.view addSubview:self.searchView];
  82. [self.view addSubview:self.tableView];
  83. self.bannerView = [[SLBannerView alloc] initWithFrame:CGRectMake(15, 0, kGXScreenWidth - 30, 125)];
  84. self.bannerView.delegate = self;
  85. self.bannerView.durTimeInterval = 0.2;
  86. self.bannerView.imgStayTimeInterval = 2.5;
  87. self.bannerBgV = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kGXScreenWidth, 132)];
  88. self.bannerBgV.backgroundColor = [UIColor clearColor];
  89. [self.searchView setFrame:CGRectMake(0, 0, SCREEN_WIDTH, 52)];
  90. [self.bannerBgV addSubview:self.bannerView];
  91. [self.tableView setTableHeaderView:self.bannerBgV];
  92. [self layoutSubviews];
  93. WEAKSELF
  94. self.searchView.buttonBlock = ^(){
  95. HomeSearchController *homeSearch = [[HomeSearchController alloc] init];
  96. [weakSelf.navigationController pushViewController:homeSearch animated:YES];
  97. };
  98. self.searchView.bookBlock = ^(){
  99. BookStoreHome *vc = [BookStoreHome initBookStoreHome];
  100. vc.hidesBottomBarWhenPushed = YES;
  101. [weakSelf.navigationController pushViewController:vc animated:YES];
  102. };
  103. [UserManager getUserInfoDetail];
  104. self.tableView.delegate = self;
  105. self.tableView.dataSource = self;
  106. self.tableView.estimatedRowHeight = 100.f;
  107. self.tableView.rowHeight = UITableViewAutomaticDimension;
  108. [self.tableView registerNib:[UINib nibWithNibName:@"HomeListWorkCell" bundle:nil] forCellReuseIdentifier:@"HomeListWorkCell"];
  109. [self.tableView registerNib:[UINib nibWithNibName:@"HomeMusicCell" bundle:nil] forCellReuseIdentifier:@"HomeMusicCell"];
  110. [self.tableView registerNib:[UINib nibWithNibName:@"HomeSchoolCell" bundle:nil] forCellReuseIdentifier:@"HomeSchoolCell"];
  111. [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(tableViewScrollTop) name:HOMESCROLLVIEWTOTOP object:nil];
  112. [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(shareReturnAction:) name:SHARERETURNSUCCESS object:nil];
  113. [self setTableViewRefresh];
  114. }
  115. - (void)setTableViewRefresh{
  116. WS(weakSelf);
  117. self.tableView.mj_header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{
  118. [weakSelf headRefresh];
  119. }];
  120. self.tableView.mj_footer = [MJRefreshBackStateFooter footerWithRefreshingBlock:^{
  121. [weakSelf footerRefresh];
  122. }];
  123. }
  124. - (void)headRefresh{
  125. [self.tableView.mj_header endRefreshing];
  126. [self.tableView.mj_footer endRefreshing];
  127. self.currentPage = 1;
  128. if (self.currentChannel >= 2 && self.currentChannel <= 10) {
  129. [self.tableView reloadData];
  130. }else{
  131. [self.dataSource removeAllObjects];
  132. [self ReGetHomeListData:self.currentChannel];
  133. }
  134. }
  135. - (void)footerRefresh{
  136. self.currentPage += 1;
  137. if (self.dataSource.count == self.totalPage) {
  138. self.tableView.mj_footer.hidden = YES;
  139. [self.tableView.mj_footer resetNoMoreData];
  140. return;
  141. }
  142. if (self.currentChannel >= 2 && self.currentChannel <= 10) {
  143. [self.tableView.mj_footer resetNoMoreData];
  144. }else{
  145. [self ReGetHomeListData:self.currentChannel];
  146. }}
  147. - (void)getRedBadge
  148. {
  149. WS(weakSelf);
  150. //获取我审批和我发起以及抄送我的未读数
  151. [[HttpManager sharedHttpManager] GETUrl:[NSString stringWithFormat:@"%@%@",BaseUrl,@"/api/app/user/user-uread-count"] parameters:@{} responseStyle:JOSN success:^(id _Nonnull responseObject) {
  152. NSDictionary *dic = responseObject;
  153. WorkNumberModel *numberModel = [[WorkNumberModel alloc] initWithDictionary:dic error:nil];
  154. weakSelf.tabBarController.tabBar.items[1].badgeValue = numberModel.allNumber;
  155. weakSelf.tabBarController.tabBar.items[2].badgeValue = numberModel.allNotifacationNumber;
  156. } failure:^(NSError * _Nonnull error) {
  157. }];
  158. }
  159. - (void)tableViewScrollTop
  160. {
  161. if (self.dataSource.count > 0) {
  162. [self.tableView scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0] atScrollPosition:UITableViewScrollPositionTop animated:NO];
  163. [self.tableView scrollRectToVisible:CGRectMake(0, 0, 1, 1) animated:YES];
  164. }
  165. }
  166. - (void)dealloc
  167. {
  168. [[NSNotificationCenter defaultCenter] removeObserver:self];
  169. }
  170. #pragma mark - NetRequest
  171. - (void)getdata{
  172. #pragma mark - 轮播
  173. WS(weakSelf);
  174. dispatch_semaphore_t sem = dispatch_semaphore_create(0);
  175. __block NSInteger httpFinishCount = 0;
  176. dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
  177. [[HttpManager sharedHttpManager] GETUrl:[NSString stringWithFormat:@"%@%@",BaseUrl,HomeSlideImages_GET] parameters: @{} responseStyle:JOSN success:^(id _Nonnull responseObject) {
  178. NSArray *arr = responseObject[@"Items"];
  179. NSLog(@"首页轮播数据%@",arr.firstObject);
  180. [weakSelf.bannerModelArray removeAllObjects];
  181. [weakSelf.bannerImgArr removeAllObjects];
  182. NSMutableArray *array = [NSMutableArray array];
  183. NSMutableArray *array2 = [NSMutableArray array];
  184. for (int i = 0; i < arr.count; i++) {
  185. NSDictionary *dic = arr[i];
  186. HomeTopImageModel *imageModel = [[HomeTopImageModel alloc] initWithDictionary:dic error:nil];
  187. [array2 addObject:imageModel];
  188. [array addObject:dic[@"ImageUrl"]];
  189. }
  190. weakSelf.bannerImgArr = array;
  191. weakSelf.bannerModelArray = array2;
  192. weakSelf.bannerView.slImages = array;
  193. if (++httpFinishCount == 3) {
  194. dispatch_semaphore_signal(sem);
  195. }
  196. } failure:^(NSError * _Nonnull error) {
  197. REMOVESHOW
  198. }];
  199. #pragma mark - 频道
  200. [weakSelf loadChannelModel];
  201. [[HttpManager sharedHttpManager] POSTUrl:[NSString stringWithFormat:@"%@%@",BaseUrl,Article_Pindao_User_Post] parameters:@{} responseStyle:JOSN success:^(id _Nonnull responseObject) {
  202. NSLog(@"%@",responseObject);
  203. NSArray *array = responseObject;
  204. for (NSInteger i = 0 ; i < array.count; i ++) {
  205. NSDictionary *dic = array[i];
  206. ChannelModel *model = [ChannelModel modelWithDictionary:dic];
  207. if (model.ArticleGroupId == 0) {
  208. model.IsSelect = YES;
  209. }
  210. [weakSelf.myChannel addObject:model];
  211. }
  212. [weakSelf.channelScroll setChannelArray:weakSelf.myChannel];
  213. //先注释观察
  214. if (++httpFinishCount == 3) {
  215. dispatch_semaphore_signal(sem);
  216. }
  217. } failure:^(NSError * _Nonnull error) {
  218. REMOVESHOW
  219. }];
  220. #pragma mark - 列表
  221. [[HttpManager sharedHttpManager] POSTUrl:[NSString stringWithFormat:@"%@%@",BaseUrl,Article_Notice_list_Post] parameters: @{@"page":@(1),@"perPage":@10,@"GroupId":@(0)} responseStyle:JOSN success:^(id _Nonnull responseObject) {
  222. NSDictionary *dic = (NSDictionary *)responseObject;
  223. HomeArticleModel *model = [HomeArticleModel modelWithDictionary:dic];
  224. [weakSelf.dataSource addObjectsFromArray:model.Items];
  225. if (++httpFinishCount == 3) {
  226. dispatch_semaphore_signal(sem);
  227. }
  228. } failure:^(NSError * _Nonnull error) {
  229. }];
  230. dispatch_semaphore_wait(sem, DISPATCH_TIME_FOREVER);
  231. dispatch_async(dispatch_get_main_queue(), ^{
  232. REMOVESHOW
  233. [weakSelf.tableView.mj_header endRefreshing];
  234. [weakSelf.tableView.mj_footer endRefreshing];
  235. [weakSelf.tableView reloadData];
  236. });
  237. });
  238. }
  239. - (void)ReGetHomeListData:(NSInteger)channelId
  240. {
  241. WS(weakSelf);
  242. SHOWLOADING
  243. if (self.currentChannel == 1) {
  244. NSDictionary * paraDict = @{@"Type":@"MyChecking",@"page":@(self.currentPage),@"perPage":@10};
  245. [[HttpManager sharedHttpManager] GETUrl:Host(WorkFlowAddApproval_Post) parameters:paraDict responseStyle:JOSN success:^(id _Nonnull responseObject) {
  246. REMOVESHOW
  247. NSDictionary *dic = (NSDictionary *)responseObject;
  248. HomeArticleModel *model = [HomeArticleModel modelWithDictionary:dic];
  249. [weakSelf.tableView.mj_header endRefreshing];
  250. [weakSelf.tableView.mj_footer endRefreshing];
  251. weakSelf.totalPage = model.Count;
  252. [weakSelf.dataSource addObjectsFromArray:model.Items];
  253. [weakSelf.tableView reloadData];
  254. dispatch_async(dispatch_get_main_queue(), ^{
  255. if (weakSelf.dataSource.count > 0) {
  256. weakSelf.noDataView.hidden = YES;
  257. }else{
  258. weakSelf.noDataView.hidden = NO;
  259. if (weakSelf.currentChannel == 1) {
  260. weakSelf.noDataLabel.text = @"暂无待办工作";
  261. }else{
  262. weakSelf.noDataLabel.text = @"暂无数据";
  263. }
  264. }
  265. });
  266. } failure:^(NSError * _Nonnull error) {
  267. REMOVESHOW
  268. [weakSelf.tableView.mj_header endRefreshing];
  269. [weakSelf.tableView.mj_footer endRefreshing];
  270. SHOWERROR([ZYCTool handerResultData:error])
  271. }];
  272. }else{
  273. [[HttpManager sharedHttpManager] POSTUrl:[NSString stringWithFormat:@"%@%@",BaseUrl,Article_Notice_list_Post] parameters: @{@"page":@(self.currentPage),@"perPage":@10,@"GroupId":@(channelId)} responseStyle:JOSN success:^(id _Nonnull responseObject) {
  274. REMOVESHOW
  275. NSDictionary *dic = (NSDictionary *)responseObject;
  276. HomeArticleModel *model = [HomeArticleModel modelWithDictionary:dic];
  277. [weakSelf.tableView.mj_header endRefreshing];
  278. [weakSelf.tableView.mj_footer endRefreshing];
  279. weakSelf.totalPage = model.Count;
  280. [weakSelf.dataSource addObjectsFromArray:model.Items];
  281. [weakSelf.tableView reloadData];
  282. dispatch_async(dispatch_get_main_queue(), ^{
  283. if (weakSelf.dataSource.count > 0) {
  284. weakSelf.noDataView.hidden = YES;
  285. }else{
  286. weakSelf.noDataView.hidden = NO;
  287. if (weakSelf.currentChannel == 1) {
  288. weakSelf.noDataLabel.text = @"暂无待办工作";
  289. }else{
  290. weakSelf.noDataLabel.text = @"暂无数据";
  291. }
  292. }
  293. });
  294. } failure:^(NSError * _Nonnull error) {
  295. REMOVESHOW
  296. [weakSelf.tableView.mj_header endRefreshing];
  297. [weakSelf.tableView.mj_footer endRefreshing];
  298. }];
  299. }
  300. }
  301. -(void)layoutSubviews{
  302. [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
  303. make.top.equalTo(self.statusBar.mas_bottom);
  304. make.left.right.equalTo(self.view);
  305. make.height.equalTo(@44);
  306. }];
  307. [self.searchView mas_makeConstraints:^(MASConstraintMaker *make) {
  308. make.top.mas_equalTo(self.titleLabel.mas_bottom);
  309. make.left.right.equalTo(self.view);
  310. make.height.mas_offset(52);
  311. }];
  312. [self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
  313. make.top.mas_equalTo(self.searchView.mas_bottom);
  314. make.left.right.equalTo(self.view);
  315. if (@available(iOS 11.0, *)) {
  316. make.bottom.equalTo(self.view.mas_safeAreaLayoutGuideBottom);
  317. } else {
  318. make.bottom.equalTo(self.view.mas_bottom);
  319. }
  320. }];
  321. [self.view addSubview:self.noDataView];
  322. [self.noDataView mas_makeConstraints:^(MASConstraintMaker *make) {
  323. make.top.mas_equalTo(self.searchView.mas_bottom).offset(170);
  324. make.left.right.mas_equalTo(self.tableView);
  325. make.bottom.mas_offset(-self.tabBarController.tabBar.height);
  326. }];
  327. [self.noDataView addSubview:self.noDataLabel];
  328. [self.noDataLabel mas_makeConstraints:^(MASConstraintMaker *make) {
  329. make.center.mas_equalTo(self.noDataView);
  330. }];
  331. }
  332. - (BOOL)hidesBottomBarWhenPushed{
  333. return NO;
  334. }
  335. #pragma mark - UITableViewDataSource && UITableViewDelegate
  336. - (void)closeBtn_Click {
  337. [self.alertVC dismissViewControllerAnimated:YES completion:nil];
  338. }
  339. - (void)cellDidSelcet:(NSInteger )articleId{
  340. WEAKSELF
  341. UIButton *closeBtn = [UIButton buttonWithType:UIButtonTypeCustom];
  342. [closeBtn addTarget:self action:@selector(closeBtn_Click) forControlEvents:UIControlEventTouchUpInside];
  343. [closeBtn setImage:IMG(@"guanbi") forState:UIControlStateNormal];
  344. UIAlertController *alertVC = [UIAlertController alertControllerWithTitle:@"对此内容进行操作" message:@"" preferredStyle:UIAlertControllerStyleAlert];
  345. self.alertVC = alertVC;
  346. [alertVC.view addSubview:closeBtn];
  347. [closeBtn mas_makeConstraints:^(MASConstraintMaker *make) {
  348. make.right.equalTo(alertVC.view).offset(-10);
  349. make.top.equalTo(@10);
  350. make.size.mas_equalTo(CGSizeMake(22, 22));
  351. }];
  352. UIAlertAction *actionOK = [UIAlertAction actionWithTitle:@"屏蔽TA" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
  353. STRONGSELF
  354. [strongSelf homeNewsHander:articleId withTypeId:1];
  355. }];
  356. [actionOK setValue:k9 forKey:@"_titleTextColor"];
  357. UIAlertAction *actionNO = [UIAlertAction actionWithTitle:@"不感兴趣" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
  358. STRONGSELF
  359. [strongSelf homeNewsHander:articleId withTypeId:2];
  360. }];
  361. [alertVC addAction:actionOK];
  362. [alertVC addAction:actionNO];
  363. [self presentViewController:alertVC animated:YES completion:^{
  364. [alertVC tapGesAlert];
  365. }];
  366. }
  367. - (void)homeNewsHander:(NSInteger )articleId withTypeId:(NSInteger)blacklistType{
  368. WS(weakSelf);
  369. [[HttpManager sharedHttpManager] POSTUrl:[NSString stringWithFormat:@"%@/%@",BaseUrl,Article_Hander_Post] parameters:@{@"ArticleId":@(articleId),@"BlacklistType":@(blacklistType)} responseStyle:DATA success:^(id _Nonnull responseObject) {
  370. [weakSelf headRefresh];
  371. } failure:^(NSError * _Nonnull error) {
  372. }];
  373. }
  374. - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
  375. if (self.currentChannel == 10) {
  376. return 2;
  377. }
  378. return self.dataSource.count;
  379. }
  380. - (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
  381. {
  382. WS(weakSelf);
  383. self.channelScroll.ClickAddChannelBlock = ^{
  384. [weakSelf didClickAddButtonChannel];
  385. };
  386. self.channelScroll.ClickMusicBlock = ^{
  387. dispatch_async(dispatch_get_main_queue(), ^{
  388. [[HKFloatManager shared] showVideo];
  389. });
  390. };
  391. self.channelScroll.ClickSelectChannelBlock = ^(NSInteger channelId) {
  392. weakSelf.currentChannel = channelId;
  393. for (ChannelModel * model in weakSelf.myChannel) {
  394. model.IsSelect = NO;
  395. }
  396. for (ChannelModel * model in weakSelf.myChannel) {
  397. if (model.ArticleGroupId == channelId) {
  398. model.IsSelect = YES;
  399. }
  400. }
  401. [weakSelf.channelScroll.collectionView reloadData];
  402. [[HttpManager sharedHttpManager] cancelRequest];
  403. dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
  404. [weakSelf headRefresh];
  405. });
  406. };
  407. return self.channelScroll;
  408. }
  409. - (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section
  410. {
  411. return [UIView new];
  412. }
  413. - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
  414. {
  415. return 45.f;
  416. }
  417. - (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section
  418. {
  419. return 0.01f;
  420. }
  421. - (HorizonScroll *)channelScroll {
  422. if (!_channelScroll) {
  423. _channelScroll = [[HorizonScroll alloc] initWithFrame:CGRectMake(0, 0, kGXScreenWidth, 45)];
  424. _channelScroll.backgroundColor = [UIColor whiteColor];
  425. }
  426. return _channelScroll;
  427. }
  428. - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
  429. Item *model = self.dataSource[indexPath.row];
  430. switch (self.currentChannel) {
  431. case 1:
  432. {
  433. return 159.f + 15.f;
  434. }
  435. break;
  436. case 2:
  437. {
  438. return UITableViewAutomaticDimension;
  439. }
  440. break;
  441. case 3:
  442. {
  443. return UITableViewAutomaticDimension;
  444. }
  445. break;
  446. case 4:
  447. {
  448. return UITableViewAutomaticDimension;
  449. }
  450. break;
  451. case 5:
  452. {
  453. return UITableViewAutomaticDimension;
  454. }
  455. break;
  456. case 6:
  457. {
  458. return UITableViewAutomaticDimension;
  459. }
  460. break;
  461. case 7:
  462. {
  463. return UITableViewAutomaticDimension;
  464. }
  465. break;
  466. case 8:
  467. {
  468. return UITableViewAutomaticDimension;
  469. }
  470. break;
  471. case 9:
  472. {
  473. return UITableViewAutomaticDimension;
  474. }
  475. break;
  476. case 10:
  477. {
  478. return UITableViewAutomaticDimension;
  479. }
  480. break;
  481. default:
  482. {
  483. if (model.ImageUrls.count == 0) {
  484. model.cellID = 1;
  485. }else if(model.ImageUrls.count == 1 || model.ImageUrls.count == 2){
  486. model.cellID = 2;
  487. }else{
  488. model.cellID = 3;
  489. }
  490. switch (model.cellID) {
  491. case 1:
  492. {
  493. // UILabel * label = [UILabel new];
  494. // label.text = model.Title;
  495. // label.font = [UIFont systemFontOfSize:18];
  496. // label.numberOfLines = 2;
  497. // CGSize maxSize = CGSizeMake(SCREEN_WIDTH - 30, CGFLOAT_MAX);
  498. // CGSize newSize = [label sizeThatFits:maxSize];
  499. // int height = 49 + newSize.height;
  500. // return height;
  501. return UITableViewAutomaticDimension;
  502. }
  503. break;
  504. case 2:
  505. return 112;
  506. break;
  507. case 3:
  508. {
  509. UILabel * label = [UILabel new];
  510. label.text = model.Title;
  511. label.font = [UIFont fontWithName:@"PingFang SC" size:18];
  512. label.numberOfLines = 2;
  513. CGSize maxSize = CGSizeMake(SCREEN_WIDTH - 30.f, CGFLOAT_MAX);
  514. CGSize newSize = [label sizeThatFits:maxSize];
  515. NSInteger height = 86.f / 336.f * (SCREEN_WIDTH - 30.f) + 52.5f + newSize.height;
  516. return height;
  517. }
  518. break;
  519. default:
  520. return 70;
  521. break;
  522. }
  523. }
  524. break;
  525. }
  526. }
  527. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
  528. WS(weakSelf);
  529. Item * model = self.dataSource[indexPath.row];
  530. // 待办工作
  531. switch (self.currentChannel) {
  532. case 1:
  533. {
  534. HomeListWorkCell *cell = (HomeListWorkCell *)[tableView dequeueReusableCellWithIdentifier:@"HomeListWorkCell"];
  535. if (cell != nil && self.dataSource.count > 0) {
  536. if (indexPath.row == 0) {
  537. cell.top.constant = 11.f;
  538. }
  539. [cell loadSearchData:model];
  540. }
  541. return cell;
  542. }
  543. break;
  544. case 2:
  545. {
  546. HomeMusicCell * cell = [HomeMusicCell configCell:tableView indexPath:indexPath];
  547. if (indexPath.row == 0) {
  548. cell.height.constant = -2.f;
  549. }
  550. return cell;
  551. }
  552. break;
  553. case 3:
  554. {
  555. HomeSchoolCell * cell = [HomeSchoolCell configCell:tableView indexPath:indexPath];
  556. if (indexPath.row == 0) {
  557. cell.height.constant = -4.f;
  558. cell.topView.backgroundColor = [UIColor whiteColor];
  559. }
  560. [cell setData];
  561. return cell;
  562. }
  563. break;
  564. case 4:
  565. {
  566. HomeUserPrivilegeCell * cell = [HomeUserPrivilegeCell configCell:tableView indexPath:indexPath];
  567. if (indexPath.row == 0) {
  568. cell.height.constant = 11.f;
  569. }
  570. BOOL isEnd = self.dataSource.count - 1 == indexPath.row;
  571. [cell setDataWithItem:indexPath.row isUnUser:isEnd];
  572. return cell;
  573. }
  574. break;
  575. case 5:
  576. {
  577. HomeWeiCousreCell * cell = [HomeWeiCousreCell configCell0:tableView indexPath:indexPath];
  578. if (indexPath.row == 0) {
  579. cell.height.constant = 11.f;
  580. }
  581. return cell;
  582. }
  583. break;
  584. case 6:
  585. {
  586. if (indexPath.row == 0) {
  587. HomeProblemTopCell * cell = [HomeProblemTopCell configCell0:tableView indexPath:indexPath];
  588. cell.height.constant = -2.f;
  589. [cell setData];
  590. return cell;
  591. }else{
  592. HomeProblemTopCell * cell = [HomeProblemTopCell configCell1:tableView indexPath:indexPath];
  593. return cell;
  594. }
  595. }
  596. break;
  597. case 7:
  598. {
  599. HomeGoodBookCell * cell = [HomeGoodBookCell configCell:tableView indexPath:indexPath];
  600. if (indexPath.row == 0) {
  601. cell.height.constant = 11.f;
  602. }
  603. BOOL isEnd = self.dataSource.count - 1 == indexPath.row;
  604. [cell setDataWithItem:indexPath.row isUnUser:isEnd];
  605. cell.ClickIndexBlock = ^{
  606. BookDetailVC * vc = [BookDetailVC initBookDetailVC];
  607. vc.hidesBottomBarWhenPushed = YES;
  608. [weakSelf.navigationController pushViewController:vc animated:YES];
  609. };
  610. return cell;
  611. }
  612. break;
  613. case 8:
  614. {
  615. BookSubArticeCell * cell = [BookSubArticeCell configCell:tableView indexPath:indexPath];
  616. [cell setData];
  617. return cell;
  618. }
  619. break;
  620. case 9:
  621. {
  622. HomeTeacherCell * cell = [HomeTeacherCell configCell:tableView indexPath:indexPath];
  623. return cell;
  624. }
  625. break;
  626. case 10:
  627. {
  628. if (indexPath.row == 0) {
  629. HomeBigshotCell * cell = [HomeBigshotCell configCell0:tableView indexPath:indexPath];
  630. [cell setDatatype:0];
  631. return cell;
  632. }else{
  633. HomeBigshotCell * cell = [HomeBigshotCell configCell1:tableView indexPath:indexPath];
  634. [cell setDatatype:1];
  635. return cell;
  636. }
  637. }
  638. break;
  639. default:
  640. {
  641. if (model.ImageUrls.count == 0) {
  642. model.cellID = 1;
  643. }else if(model.ImageUrls.count == 1 || model.ImageUrls.count == 2){
  644. model.cellID = 2;
  645. }else{
  646. model.cellID = 3;
  647. }
  648. HomeTableViewCell *cell = [HomeTableViewCell cellWithTableView:tableView AndIndex:model.cellID];
  649. if (cell != nil && self.dataSource.count > 0) {
  650. [cell.deleteButton setCurrentButtonHotSize:CGSizeZero];
  651. [cell loadCurrentItemModel:model];
  652. cell.deleteButton.hidden = YES;
  653. cell.buttonBlock = ^{
  654. [weakSelf cellDidSelcet:model.Id];
  655. };
  656. }
  657. return cell;
  658. }
  659. break;
  660. }
  661. // if (self.currentChannel == 1) {
  662. // HomeListWorkCell *cell = (HomeListWorkCell *)[tableView dequeueReusableCellWithIdentifier:@"HomeListWorkCell"];
  663. // if (cell != nil && self.dataSource.count > 0) {
  664. // [cell loadSearchData:model];
  665. // }
  666. // return cell;
  667. // }else{
  668. // // 推荐
  669. // if (model.ImageUrls.count == 0) {
  670. // model.cellID = 1;
  671. // }else if(model.ImageUrls.count == 1 || model.ImageUrls.count == 2){
  672. // model.cellID = 2;
  673. // }else{
  674. // model.cellID = 3;
  675. // }
  676. // HomeTableViewCell *cell = [HomeTableViewCell cellWithTableView:tableView AndIndex:model.cellID];
  677. // if (cell != nil && self.dataSource.count > 0) {
  678. // [cell.deleteButton setCurrentButtonHotSize:CGSizeZero];
  679. // [cell loadCurrentItemModel:model];
  680. // cell.deleteButton.hidden = YES;
  681. // cell.buttonBlock = ^{
  682. // [weakSelf cellDidSelcet:model.Id];
  683. // };
  684. // }
  685. // return cell;
  686. // }
  687. }
  688. - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
  689. {
  690. [tableView deselectRowAtIndexPath:indexPath animated:YES];
  691. WS(weakSelf);
  692. Item * model = self.dataSource[indexPath.row];
  693. // 待办工作
  694. switch (self.currentChannel) {
  695. case 1:
  696. {
  697. MyApprovalPageDetail *myApprovalPageDetail = [[MyApprovalPageDetail alloc] init];
  698. [myApprovalPageDetail setActionSussBlock:^{
  699. [weakSelf headRefresh];
  700. }];
  701. if ([model.State isEqualToString:@"Meeting"]) {
  702. model.approvalText = @"上会";
  703. }else if ([model.State isEqualToString:@"Checked"]) {
  704. model.approvalText = @"审批通过";
  705. }else if ([model.State isEqualToString:@"Denied"]) {
  706. model.approvalText = @"已拒绝";
  707. }else if ([model.State isEqualToString:@"Wait"]) {
  708. model.approvalText = @"待定";
  709. }else{
  710. model.approvalText = @"待审核";
  711. }
  712. myApprovalPageDetail.pageType = Type_ONEA;
  713. myApprovalPageDetail.userId = model.UserId;
  714. myApprovalPageDetail.indexId = model.Id;
  715. myApprovalPageDetail.TodoId = model.TodoId;
  716. myApprovalPageDetail.title = model.Title;
  717. [self.navigationController pushViewController:myApprovalPageDetail animated:YES];
  718. }
  719. break;
  720. case 2:
  721. {
  722. }
  723. break;
  724. case 3:
  725. {
  726. }
  727. break;
  728. case 4:
  729. {
  730. }
  731. break;
  732. case 5:
  733. {
  734. BookWCDetailVC * vc = [BookWCDetailVC initBookWCDetailVC];
  735. vc.hidesBottomBarWhenPushed = YES;
  736. [self.navigationController pushViewController:vc animated:YES];
  737. }
  738. break;
  739. case 6:
  740. {
  741. if (indexPath.row > 0) {
  742. BookWCDetailVC * vc = [BookWCDetailVC initBookWCDetailVC];
  743. vc.hidesBottomBarWhenPushed = YES;
  744. [self.navigationController pushViewController:vc animated:YES];
  745. }
  746. }
  747. break;
  748. case 7:
  749. {
  750. }
  751. break;
  752. case 8:
  753. {
  754. }
  755. break;
  756. case 9:
  757. {
  758. BookTeacherListVC * vc = [BookTeacherListVC initBookTeacherListVC];
  759. vc.titleStr = @"李婉茹的书籍";
  760. vc.hidesBottomBarWhenPushed = YES;
  761. [self.navigationController pushViewController:vc animated:YES];
  762. }
  763. break;
  764. case 10:
  765. {
  766. }
  767. break;
  768. default:
  769. {
  770. MyTDTopicDetailVC * vc = [MyTDTopicDetailVC initMyTDTopicDetailVC];
  771. vc.type = CollectModel_Aritle;
  772. vc.Id = model.Id;
  773. vc.hidesBottomBarWhenPushed = YES;
  774. [self.navigationController pushViewController:vc animated:YES];
  775. }
  776. break;
  777. }
  778. }
  779. #pragma mark - channelScroll Block
  780. - (void)didClickAddButtonChannel{
  781. AddChannelController *addChannel = [[AddChannelController alloc] init];
  782. addChannel.modalPresentationStyle = UIModalPresentationFullScreen;
  783. addChannel.delegate = self;
  784. [self presentViewController:addChannel animated:YES completion:nil];
  785. }
  786. #pragma mark - AddChannelControllerDelegate
  787. - (void)upadateChannel{
  788. WS(weakSelf);
  789. [self loadChannelModel];
  790. [[HttpManager sharedHttpManager] POSTUrl:[NSString stringWithFormat:@"%@%@",BaseUrl,Article_Pindao_User_Post] parameters:@{} responseStyle:JOSN success:^(id _Nonnull responseObject) {
  791. NSLog(@"%@",responseObject);
  792. NSArray *array = responseObject;
  793. for (NSInteger i = 0 ; i < array.count; i ++) {
  794. NSDictionary *dic = array[i];
  795. ChannelModel *model = [ChannelModel modelWithDictionary:dic];
  796. [weakSelf.myChannel addObject:model];
  797. }
  798. dispatch_async(dispatch_get_main_queue(), ^{
  799. [weakSelf.channelScroll setChannelArray:weakSelf.myChannel];
  800. if (weakSelf.channelScroll.ClickSelectChannelBlock) {
  801. weakSelf.channelScroll.ClickSelectChannelBlock(weakSelf.currentChannel);
  802. }
  803. [weakSelf.tableView reloadData];
  804. });
  805. } failure:^(NSError * _Nonnull error) {
  806. REMOVESHOW
  807. }];
  808. }
  809. #pragma mark - SLBannerViewDelegate
  810. - (void)bannerView:(SLBannerView *)banner didClickImagesAtIndex:(NSInteger)index
  811. {
  812. [self getArticleDetail:index];
  813. }
  814. - (void)getArticleDetail:(NSInteger)index{
  815. HomeTopImageModel *model = self.bannerModelArray[index];
  816. NSLog(@"点击轮播图%ld",(long)model.ArticleId);
  817. SHOWLOADING
  818. WEAKSELF
  819. [[HttpManager sharedHttpManager] GETWithUrl:[NSString stringWithFormat:@"%@%ld",Article_Detail_Get,(long)model.ArticleId] parameters:@{} success:^(id _Nonnull responseObject) {
  820. REMOVESHOW;
  821. Item *model = [[Item alloc]initWithDictionary:responseObject error:nil];
  822. // HomeDetailController *homeDetail = [[HomeDetailController alloc] init];
  823. // [homeDetail loadCurrentModel:itemModel];
  824. MyTDTopicDetailVC * vc = [MyTDTopicDetailVC initMyTDTopicDetailVC];
  825. vc.type = CollectModel_Aritle;
  826. vc.Id = model.Id;
  827. [weakSelf.navigationController pushViewController:vc animated:YES];
  828. } failure:^(NSError * _Nonnull error) {
  829. SHOWERROR([ZYCTool handerResultData:error]);
  830. }];
  831. }
  832. #pragma mark - Setter
  833. - (UILabel *)titleLabel {
  834. if (!_titleLabel) {
  835. _titleLabel = [UILabel new];
  836. _titleLabel.backgroundColor = [UIColor whiteColor];
  837. _titleLabel.text = @"首页";
  838. _titleLabel.font = [UIFont systemFontOfSize:16.f];
  839. _titleLabel.textColor = UIColorHex(1A1A1A);
  840. _titleLabel.textAlignment = NSTextAlignmentCenter;
  841. }
  842. return _titleLabel;
  843. }
  844. - (SurfaceSearchView *)searchView {
  845. if (!_searchView) {
  846. _searchView = [[SurfaceSearchView alloc] init];
  847. [_searchView setBgViewColor:[UIColor clearColor]];
  848. // [_searchView setPlaceHolderText:@"输入关键字搜索"];
  849. [_searchView setMainType];
  850. }
  851. return _searchView;
  852. }
  853. - (UITableView * )tableView
  854. {
  855. if (!_tableView) {
  856. _tableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStylePlain];
  857. _tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
  858. _tableView.backgroundColor = [UIColor clearColor];
  859. }
  860. return _tableView;
  861. }
  862. - (NSMutableArray *)dataSource
  863. {
  864. if (!_dataSource) {
  865. _dataSource = [NSMutableArray array];
  866. }
  867. return _dataSource;
  868. }
  869. - (NSMutableArray *)tabConfigArray{
  870. if (!_tabConfigArray) {
  871. _tabConfigArray = [NSMutableArray array];
  872. }
  873. return _tabConfigArray;
  874. }
  875. - (NSMutableDictionary *)articleDic{
  876. if (!_articleDic) {
  877. _articleDic = [NSMutableDictionary dictionary];
  878. }
  879. return _articleDic;
  880. }
  881. - (NSMutableArray *)myChannel {
  882. if (!_myChannel) {
  883. _myChannel = [NSMutableArray array];
  884. }
  885. return _myChannel;
  886. }
  887. - (void)loadChannelModel
  888. {
  889. [self.myChannel removeAllObjects];
  890. ChannelModel * model = [[ChannelModel alloc] init];
  891. model.ArticleGroupId = 0;
  892. model.ArticleGroupName = @"推荐";
  893. model.IsSelect = YES;
  894. [self.myChannel addObject:model];
  895. // ChannelModel * workModel = [[ChannelModel alloc] init];
  896. // workModel.ArticleGroupId = 1;
  897. // workModel.ArticleGroupName = @"待办工作";
  898. // workModel.IsSelect = NO;
  899. // [self.myChannel addObject:workModel];
  900. ChannelModel * sModel = [[ChannelModel alloc] init];
  901. sModel.ArticleGroupId = 2;
  902. sModel.ArticleGroupName = @"信源听说";
  903. sModel.IsSelect = NO;
  904. [self.myChannel addObject:sModel];
  905. ChannelModel * mModel = [[ChannelModel alloc] init];
  906. mModel.ArticleGroupId = 3;
  907. mModel.ArticleGroupName = @"名校";
  908. mModel.IsSelect = NO;
  909. [self.myChannel addObject:mModel];
  910. ChannelModel * aModel = [[ChannelModel alloc] init];
  911. aModel.ArticleGroupId = 4;
  912. aModel.ArticleGroupName = @"会员特供";
  913. aModel.IsSelect = NO;
  914. [self.myChannel addObject:aModel];
  915. ChannelModel * bModel = [[ChannelModel alloc] init];
  916. bModel.ArticleGroupId = 5;
  917. bModel.ArticleGroupName = @"每日微课";
  918. bModel.IsSelect = NO;
  919. [self.myChannel addObject:bModel];
  920. ChannelModel * cModel = [[ChannelModel alloc] init];
  921. cModel.ArticleGroupId = 6;
  922. cModel.ArticleGroupName = @"每日一题";
  923. cModel.IsSelect = NO;
  924. [self.myChannel addObject:cModel];
  925. ChannelModel * dModel = [[ChannelModel alloc] init];
  926. dModel.ArticleGroupId = 7;
  927. dModel.ArticleGroupName = @"每日好书";
  928. dModel.IsSelect = NO;
  929. [self.myChannel addObject:dModel];
  930. ChannelModel * eModel = [[ChannelModel alloc] init];
  931. eModel.ArticleGroupId = 8;
  932. eModel.ArticleGroupName = @"每日好文";
  933. eModel.IsSelect = NO;
  934. [self.myChannel addObject:eModel];
  935. ChannelModel * fModel = [[ChannelModel alloc] init];
  936. fModel.ArticleGroupId = 9;
  937. fModel.ArticleGroupName = @"名师";
  938. fModel.IsSelect = NO;
  939. [self.myChannel addObject:fModel];
  940. ChannelModel * gModel = [[ChannelModel alloc] init];
  941. gModel.ArticleGroupId = 10;
  942. gModel.ArticleGroupName = @"大咖讲座";
  943. gModel.IsSelect = NO;
  944. [self.myChannel addObject:gModel];
  945. // ChannelModel * eModel = [[ChannelModel alloc] init];
  946. // eModel.ArticleGroupId = 8;
  947. // eModel.ArticleGroupName = @"每日好文";
  948. // eModel.IsSelect = NO;
  949. // [self.myChannel addObject:eModel];
  950. }
  951. - (UIView *)noDataView
  952. {
  953. if (!_noDataView) {
  954. _noDataView = [UIView new];
  955. _noDataView.hidden = YES;
  956. _noDataView.backgroundColor = UIColorHex(0xEEEEEE);
  957. }
  958. return _noDataView;
  959. }
  960. - (UILabel *)noDataLabel
  961. {
  962. if (!_noDataLabel) {
  963. _noDataLabel = [UILabel new];
  964. _noDataLabel.textColor = UIColorHex(0xBBBBBB);
  965. _noDataLabel.font = [UIFont systemFontOfSize:14];
  966. }
  967. return _noDataLabel;
  968. }
  969. #pragma mark - 分享成功跳转
  970. - (void)shareReturnAction:(NSNotification *)noti
  971. {
  972. NSDictionary * dic = noti.userInfo;
  973. CollectModelType type = [[dic objectForKey:@"type"] intValue];
  974. NSInteger Id = [[dic objectForKey:@"Id"] integerValue];
  975. NSInteger userId = [[dic objectForKey:@"userId"] integerValue];
  976. NSString* name = [[dic objectForKey:@"name"] stringByRemovingPercentEncoding];
  977. NSString* describe = [[dic objectForKey:@"describe"] stringByRemovingPercentEncoding];
  978. switch (type) {
  979. case CollectModel_CollectFile:
  980. {
  981. if (userId == [AppUserModel sharedAppUserModel].Id) {
  982. MyFavoriteVC *vc = [MyFavoriteVC initMyFavoriteVC];
  983. vc.listType = Id == 0 ? MyFavoriteListLevelTypeA : MyFavoriteListLevelTypeB;
  984. vc.ParentId = 0;
  985. vc.FolderId = Id;
  986. vc.myTitle = Id == 0 ? @"我的收藏" :name;
  987. [self.navigationController pushViewController:vc animated:YES];
  988. }else{
  989. OtherFavoriteVC * vc = [OtherFavoriteVC initOtherFavoriteVC];
  990. vc.listType = Id == 0 ? MyFavoriteListLevelTypeA : MyFavoriteListLevelTypeB;
  991. vc.FolderId = Id;
  992. vc.Author = describe;
  993. vc.myTitle = name;
  994. vc.VisitUserId = userId;
  995. [self.navigationController pushViewController:vc animated:YES];
  996. }
  997. }
  998. break;
  999. case CollectModel_NoteFile:
  1000. {
  1001. if (userId == [AppUserModel sharedAppUserModel].Id) {
  1002. NoteBookVC * vc = [NoteBookVC initNoteBookVC];
  1003. if (Id == 0) {
  1004. vc.listType = MyFavoriteListLevelTypeB;
  1005. vc.myTitle = @"我的笔记";
  1006. }else{
  1007. vc.listType = MyFavoriteListLevelTypeC;
  1008. vc.myTitle = name;
  1009. }
  1010. vc.ParentId = 0;
  1011. vc.FolderId = Id;
  1012. vc.isSubVC = YES;
  1013. [self.navigationController pushViewController:vc animated:YES];
  1014. }else{
  1015. OtherNoteBookVC * vc = [OtherNoteBookVC initOtherNoteBookVC];
  1016. vc.listType = Id == 0 ? MyFavoriteListLevelTypeA : MyFavoriteListLevelTypeB;
  1017. vc.FolderId = Id;
  1018. vc.Author = describe;
  1019. vc.myTitle = name;
  1020. vc.VisitUserId = userId;
  1021. [self.navigationController pushViewController:vc animated:YES];
  1022. }
  1023. }
  1024. break;
  1025. default:
  1026. {
  1027. MyTDTopicDetailVC * vc = [MyTDTopicDetailVC initMyTDTopicDetailVC];
  1028. vc.type = type;
  1029. vc.Id = Id;
  1030. [self.navigationController pushViewController:vc animated:YES];
  1031. }
  1032. break;
  1033. }
  1034. }
  1035. @end