BGTopicTimeLineListController.m 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663
  1. //
  2. // BGTopicTimeLineListController.m
  3. // BuguLive
  4. //
  5. // Created by bugu on 2019/12/13.
  6. // Copyright © 2019 xfg. All rights reserved.
  7. //
  8. #import "BGTopicTimeLineListController.h"
  9. #import "BzoneLogic.h"
  10. #import "CellForWorkGroup.h"
  11. #import "CellForWorkGroupRepost.h"
  12. #import "YHRefreshTableView.h"
  13. #import "YHWorkGroup.h"
  14. #import "YHUserInfoManager.h"
  15. //#import "YHUtils.h"
  16. #import "YHSharePresentView.h"
  17. #import "UITableViewCell+HYBMasonryAutoCellHeight.h"
  18. #import "DetailsLineViewController.h"
  19. #import <CLPlayer/CLPlayerView.h>
  20. #import "YHPlayerViewController.h"
  21. #import "ReleaseDynamicVC.h"
  22. @interface BGTopicTimeLineListController ()<UITableViewDelegate,UITableViewDataSource,CellForWorkGroupDelegate,CellForWorkGroupRepostDelegate,BzoneLogicDelegate>{
  23. int _currentRequestPage; //当前请求页面
  24. BOOL _reCalculate;
  25. }
  26. @property (nonatomic,strong) UITableView *tableView;
  27. @property (nonatomic,strong) NSMutableArray *dataArray;
  28. @property (nonatomic,strong) NSMutableDictionary *heightDict;
  29. @property (nonatomic, strong) BzoneLogic *logic;
  30. @property (nonatomic, strong) CellForWorkGroup *c_cell;
  31. @property (nonatomic, strong) CLPlayerView *playerView;
  32. @property(nonatomic, strong) UIButton *releaseBtn;
  33. @end
  34. @implementation BGTopicTimeLineListController
  35. - (void)viewDidLoad {
  36. [super viewDidLoad];
  37. //话题
  38. self.title = self.topic.name;
  39. [self backBtnWithBlock];
  40. [self initUI];
  41. self.logic = [BzoneLogic new];
  42. self.logic.page = 1;
  43. _logic.delegagte = self;
  44. // _logic.to_uid = self.to_uid;
  45. _logic.isGZ = YES;
  46. [_logic loadListDataWiththeme:self.topic.t_id];
  47. [self requestDataLoadNew:YES];
  48. // Do any additional setup after loading the view.
  49. }
  50. - (void)backBtnWithBlock
  51. {
  52. // 返回按钮
  53. self.navigationItem.leftBarButtonItem = [UIBarButtonItem itemWithTarget:self action:@selector(onReturnBtnPress) image:@"com_arrow_vc_back" highImage:@"com_arrow_vc_back"];
  54. }
  55. - (void)onReturnBtnPress
  56. {
  57. [self.navigationController popViewControllerAnimated:YES];
  58. }
  59. - (void)initUI{
  60. self.tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, kScreenW, kScreenH - kTopHeight) style:UITableViewStylePlain];
  61. NSLog(@"%f",kTabBarHeight);
  62. NSLog(@"%f",kNavigationBarHeight);
  63. self.tableView.delegate = self;
  64. self.tableView.dataSource = self;
  65. self.tableView.tag = 1107;
  66. self.tableView.backgroundColor = RGBCOLOR(244, 244, 244);
  67. self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
  68. [self.view addSubview:self.tableView];
  69. // [self.tableView setEnableLoadNew:YES];
  70. // [self.tableView setEnableLoadMore:YES];
  71. self.view.backgroundColor = RGBCOLOR(244, 244, 244);
  72. [self.tableView registerClass:[CellForWorkGroup class] forCellReuseIdentifier:NSStringFromClass([CellForWorkGroup class])];
  73. [self.tableView registerClass:[CellForWorkGroupRepost class] forCellReuseIdentifier:NSStringFromClass([CellForWorkGroupRepost class])];
  74. [BGMJRefreshManager refresh:self.tableView target:self headerRereshAction:@selector(refreshHeader) footerRereshAction:@selector(refreshFooter)];
  75. [self.view addSubview:self.releaseBtn];
  76. [self.releaseBtn mas_makeConstraints:^(MASConstraintMaker *make) {
  77. make.bottom.mas_equalTo(-92-(isIPhoneX()?34:0));
  78. make.right.mas_equalTo(-8);
  79. make.size.mas_equalTo(kRealValue(64));
  80. }];
  81. [self.view bringSubviewToFront:self.releaseBtn];
  82. }
  83. //发布话题动态
  84. - (void)releaseeButtonClick{
  85. ReleaseDynamicVC *pushVC = [ReleaseDynamicVC new];
  86. pushVC.topic = self.topic;
  87. //指定话题
  88. FWWeakify(self)
  89. pushVC.postFinishBlock = ^(BOOL isFinish) {
  90. if (isFinish) {
  91. FWStrongify(self)
  92. //刷新 话题动态的数据
  93. [self.logic loadListDataWiththeme:self.topic.t_id];
  94. }
  95. };
  96. [[AppDelegate sharedAppDelegate]presentViewController:pushVC animated:YES completion:nil];
  97. }
  98. #pragma mark - 网络请求
  99. - (void)requestDataLoadNew:(BOOL)loadNew{
  100. YHRefreshType refreshType;
  101. if (loadNew) {
  102. _currentRequestPage = 1;
  103. refreshType = YHRefreshType_LoadNew;
  104. // [self.tableView setNoMoreData:NO];
  105. }
  106. else{
  107. _currentRequestPage ++;
  108. refreshType = YHRefreshType_LoadMore;
  109. }
  110. if (loadNew) {
  111. [self.dataArray removeAllObjects];
  112. [self.heightDict removeAllObjects];
  113. }
  114. _logic.page = _currentRequestPage;
  115. [_logic loadListDataWiththeme:self.topic.t_id];
  116. }
  117. -(void)requestZoneListDataCompleted
  118. {
  119. [self.tableView reloadData];
  120. [self.tableView.mj_footer endRefreshing];
  121. [self.tableView.mj_header endRefreshing];
  122. self.dataArray = _logic.dataArray;
  123. if(_logic.noHasMore == YES)
  124. {
  125. [self.tableView.mj_footer endRefreshingWithNoMoreData];
  126. }
  127. if (self.dataArray.count > 0) {
  128. [self hideNoContentView];
  129. }else{
  130. [self showNoContentView];
  131. }
  132. [BGMJRefreshManager endRefresh:self.tableView];
  133. }
  134. -(void)refreshHeader{
  135. [self requestDataLoadNew:YES];
  136. }
  137. -(void)refreshFooter{
  138. [self requestDataLoadNew:NO];
  139. }
  140. - (void)viewWillAppear:(BOOL)animated {
  141. [super viewWillAppear:animated];
  142. self.navigationController.navigationBar.hidden = NO;
  143. }
  144. - (void)viewWillDisappear:(BOOL)animated {
  145. [super viewWillDisappear:animated];
  146. [_playerView destroyPlayer];
  147. _c_cell =nil;
  148. }
  149. #pragma mark - UITableViewDataSource
  150. - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
  151. return self.dataArray.count;
  152. }
  153. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
  154. MGGroupUserInfo *model = self.dataArray[indexPath.row];
  155. //原创cell
  156. CellForWorkGroup *cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([CellForWorkGroup class])];
  157. if (!cell) {
  158. cell = [[CellForWorkGroup alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([CellForWorkGroup class])];
  159. }
  160. cell.indexPath = indexPath;
  161. cell.model = model;
  162. cell.delegate = self;
  163. return cell;
  164. }
  165. #pragma mark - UITableViewDelegate
  166. - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
  167. if (indexPath.row < self.dataArray.count) {
  168. CGFloat height = 0.0;
  169. //原创cell
  170. Class currentClass = [CellForWorkGroup class];
  171. MGGroupUserInfo *model = self.dataArray[indexPath.row];
  172. //取缓存高度
  173. NSDictionary *dict = self.heightDict[model.id];
  174. if (dict) {
  175. if (model.isOpening) {
  176. height = [dict[@"open"] floatValue];
  177. }else{
  178. height = [dict[@"normal"] floatValue];
  179. }
  180. if (height) {
  181. return height;
  182. }
  183. }
  184. // //转发cell
  185. // if (model.type == DynType_Forward) {
  186. // currentClass = [CellForWorkGroupRepost class];//第一版没有转发,因此这样稍该一下
  187. //
  188. // height = [CellForWorkGroupRepost hyb_heightForTableView:tableView config:^(UITableViewCell *sourceCell) {
  189. // CellForWorkGroupRepost *cell = (CellForWorkGroupRepost *)sourceCell;
  190. //
  191. // cell.model = model;
  192. //
  193. // }];
  194. //
  195. // }
  196. // else{
  197. height = [CellForWorkGroup hyb_heightForTableView:tableView config:^(UITableViewCell *sourceCell) {
  198. CellForWorkGroup *cell = (CellForWorkGroup *)sourceCell;
  199. cell.model = model;
  200. }];
  201. if (model.cover_url && ![model.cover_url isEqualToString:@""])
  202. {
  203. // height += 94;
  204. }
  205. // }
  206. //缓存高度
  207. if (model.id) {
  208. NSMutableDictionary *aDict = [NSMutableDictionary new];
  209. if (model.isOpening) {
  210. [aDict setObject:@(height) forKey:@"open"];
  211. }else{
  212. [aDict setObject:@(height) forKey:@"normal"];
  213. }
  214. [self.heightDict setObject:aDict forKey:model.id];
  215. }
  216. return height;
  217. }
  218. else{
  219. return 44.0f;
  220. }
  221. }
  222. - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
  223. // self.hidesBottomBarWhenPushed = YES;
  224. MGGroupUserInfo *model = self.dataArray[indexPath.row];
  225. DetailsLineViewController *datails = [DetailsLineViewController new];
  226. datails.topic = 1;
  227. datails.title = ASLocalizedString(@"动态详情");
  228. datails.model = model;
  229. datails.refreshData = ^{
  230. _currentRequestPage = 1;
  231. self.logic.page = _currentRequestPage;
  232. [self.logic loadListDataWiththeme:self.topic.t_id];
  233. };
  234. [[AppDelegate sharedAppDelegate] pushViewController:datails animated:YES];
  235. [tableView deselectRowAtIndexPath:indexPath animated:YES];
  236. // [AppDelegate sharedAppDelegate].topViewController.hidesBottomBarWhenPushed = YES;
  237. // self.hidesBottomBarWhenPushed = YES;
  238. }
  239. -(void)tableView:(UITableView *)tableView willDisplayCell:(CellForWorkGroup *)cell forRowAtIndexPath:(NSIndexPath *)indexPath{
  240. MGGroupUserInfo *model = self.dataArray[indexPath.row];
  241. if (model.cover_url && ![model.cover_url isEqualToString:@""]){
  242. //原创cell
  243. [self onTouchActionVideo:cell withFullScreen:NO];
  244. }
  245. }
  246. - (void)tableView:(UITableView *)tableView didEndDisplayingCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath
  247. {
  248. // if ([_c_cell isEqual:cell])
  249. // {
  250. // //区分是否是播放器所在的cell,销毁时将指针置空
  251. // [_playerView destroyPlayer];
  252. // _c_cell =nil;
  253. // }
  254. }
  255. //-(void)scrollViewDidScroll:(UIScrollView *)scrollView{
  256. //
  257. // if(self.timeLineDelegate && [self.timeLineDelegate respondsToSelector:@selector(protocolTimeLineDidScrollView:offset:)])
  258. // {
  259. // [self.timeLineDelegate protocolTimeLineDidScrollView:scrollView offset:scrollView.contentOffset.y];
  260. // }
  261. //}
  262. - (void)creatOriModel:(MGGroupUserInfo *)model totalCount:(int)totalCount{
  263. }
  264. #pragma mark - YHRefreshTableViewDelegate
  265. - (void)refreshTableViewLoadNew:(YHRefreshTableView*)view{
  266. // [self requestDataLoadNew:YES];
  267. }
  268. - (void)refreshTableViewLoadmore:(YHRefreshTableView*)view{
  269. // [self requestDataLoadNew:NO];
  270. }
  271. #pragma mark - CellForWorkGroupDelegate
  272. - (void)onAvatarInCell:(CellForWorkGroup *)cell{
  273. }
  274. - (void)onMoreInCell:(CellForWorkGroup *)cell{
  275. if (cell.indexPath.row < [self.dataArray count]) {
  276. YHWorkGroup *model = self.dataArray[cell.indexPath.row];
  277. model.isOpening = !model.isOpening;
  278. [self.tableView reloadRowsAtIndexPaths:@[cell.indexPath] withRowAnimation:UITableViewRowAnimationFade];
  279. }
  280. }
  281. - (void)onCommentInCell:(CellForWorkGroup *)cell{
  282. MGGroupUserInfo *model = self.dataArray[cell.indexPath.row];
  283. // self.hidesBottomBarWhenPushed = YES;
  284. DetailsLineViewController *datails = [DetailsLineViewController new];
  285. datails.hidesBottomBarWhenPushed = YES;
  286. datails.title = ASLocalizedString(@"评论");
  287. datails.topic = 1;
  288. datails.model = model;
  289. datails.refreshData = ^{
  290. _currentRequestPage = 1;
  291. self.logic.page = _currentRequestPage;
  292. [self.logic loadListDataWiththeme:self.topic.t_id];
  293. };
  294. [self.navigationController pushViewController:datails animated:YES];
  295. // self.hidesBottomBarWhenPushed = NO;
  296. }
  297. - (void)onLikeInCell:(CellForWorkGroup *)cell{
  298. __weak __typeof(self)weakSelf = self;
  299. MGGroupUserInfo *model = self.dataArray[cell.indexPath.row];
  300. BOOL isLike = ![model.is_like isEqualToString:@"1"];
  301. [self.logic addDolikeID:cell.model.id isLike:isLike Success:^(id _Nonnull selfPtr, BOOL isFinished) {
  302. if (cell.indexPath.row < [self.dataArray count]) {
  303. MGGroupUserInfo *model = weakSelf.dataArray[cell.indexPath.row];
  304. // BOOL isLike = [model.is_like isEqualToString:@"1"];
  305. NSInteger praise = [model.praise integerValue];
  306. if (isFinished) {//此处取反
  307. praise += 1;
  308. model.is_like = @"1";
  309. }else{
  310. praise -= 1;
  311. model.is_like = @"0";
  312. }
  313. //
  314. model.praise = [NSString stringWithFormat:@"%ld",praise];
  315. cell.model = model;
  316. [weakSelf.dataArray replaceObjectAtIndex:cell.indexPath.row withObject:model];
  317. // [weakSelf.tableView reloadRowsAtIndexPaths:@[cell.indexPath] withRowAnimation:UITableViewRowAnimationNone];
  318. }
  319. }];
  320. }
  321. - (void)onShareInCell:(CellForWorkGroup *)cell{
  322. if (cell.indexPath.row < [self.dataArray count]){
  323. [self _shareWithCell:cell];
  324. }
  325. }
  326. - (void)onDeleteInCell:(CellForWorkGroup *)cell{
  327. if (cell.indexPath.row < [self.dataArray count]) {
  328. [self _deleteDynAtIndexPath:cell.indexPath dynamicId:cell.model.id cell:cell];
  329. }
  330. }
  331. - (void)onTopicInCell:(CellForWorkGroup *)cell{
  332. }
  333. - (void)onTouchActionVideo:(CellForWorkGroup *)cell withFullScreen:(BOOL)fullScreen
  334. {
  335. if (fullScreen) {
  336. YHPlayerViewController *vc = [[YHPlayerViewController alloc]initWithPlayerURL:cell.model.video];
  337. [[AppDelegate sharedAppDelegate] pushViewController:vc animated:YES];
  338. return;
  339. }
  340. _c_cell =cell;
  341. [_playerView destroyPlayer];
  342. _playerView =nil;
  343. _playerView = [[CLPlayerView alloc] initWithFrame:CGRectMake(0, 0, cell.ClVideoview.width, cell.ClVideoview.height)];
  344. _playerView.backgroundColor = kClearColor;
  345. _playerView.layer.cornerRadius = 4;
  346. _playerView.layer.masksToBounds = YES;
  347. // CLPlayerViewConfigure *config = [CLPlayerViewConfigure defaultConfigure];
  348. // config.mute = YES;
  349. _playerView.configure.mute = YES;
  350. _playerView.isFullScreen = fullScreen;
  351. _playerView.configure.mute = !fullScreen;
  352. _playerView.configure.isLandscape = YES;
  353. _playerView.configure.videoFillMode = VideoFillModeResizeAspectFill;
  354. [_playerView updateWithConfigure:^(CLPlayerViewConfigure *configure) {
  355. if (fullScreen) {
  356. _playerView.frame = CGRectMake(0, 0, kScreenW, kScreenH);
  357. [self.tabBarController.view addSubview:_playerView];
  358. UITapGestureRecognizer *tapPlayerView = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(tapPlayerView:)];
  359. [_playerView.maskView addGestureRecognizer:tapPlayerView];
  360. }else{
  361. [cell.ClVideoview addSubview:_playerView];
  362. UITapGestureRecognizer *tapPlayerView = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(tapBigScreen:)];
  363. [_playerView.maskView addGestureRecognizer:tapPlayerView];
  364. }
  365. _playerView.url = [NSURL URLWithString:cell.model.video];
  366. //播放
  367. [_playerView playVideo];
  368. }];
  369. // [cell.ClVideoview addSubview:_playerView];
  370. // _playerView.url =[NSURL URLWithString:cell.model.video];
  371. // //播放
  372. // [_playerView playVideo];
  373. //返回按钮点击事件回调
  374. [_playerView backButton:^(UIButton *button) {
  375. NSLog(ASLocalizedString(@"返回按钮被点击"));
  376. }];
  377. //播放完成回调
  378. [_playerView endPlay:^{
  379. //销毁播放器
  380. [_playerView destroyPlayer];
  381. _playerView = nil;
  382. NSLog(ASLocalizedString(@"播放完成"));
  383. }];
  384. }
  385. -(void)tapPlayerView:(UITapGestureRecognizer *)sender{
  386. [self onTouchActionVideo:_c_cell withFullScreen:NO];
  387. }
  388. -(void)tapBigScreen:(UITapGestureRecognizer *)sender{
  389. [self onTouchActionVideo:_c_cell withFullScreen:YES];
  390. }
  391. #pragma mark - CellForWorkGroupRepostDelegate
  392. - (void)onAvatarInRepostCell:(CellForWorkGroupRepost *)cell{
  393. }
  394. - (void)onTapRepostViewInCell:(CellForWorkGroupRepost *)cell{
  395. }
  396. - (void)onCommentInRepostCell:(CellForWorkGroupRepost *)cell{
  397. }
  398. - (void)onLikeInRepostCell:(CellForWorkGroupRepost *)cell{
  399. if (cell.indexPath.row < [self.dataArray count]) {
  400. YHWorkGroup *model = self.dataArray[cell.indexPath.row];
  401. BOOL isLike = !model.isLike;
  402. //更新本地数据源
  403. model.isLike = isLike;
  404. if (isLike) {
  405. model.likeCount += 1;
  406. }else{
  407. model.likeCount -= 1;
  408. }
  409. [self.tableView reloadRowsAtIndexPaths:@[cell.indexPath] withRowAnimation:UITableViewRowAnimationNone];
  410. }
  411. }
  412. - (void)onShareInRepostCell:(CellForWorkGroupRepost *)cell{
  413. // if (cell.indexPath.row < [self.dataArray count]){
  414. // [self _shareWithCell:cell];
  415. // }
  416. }
  417. - (void)onDeleteInRepostCell:(CellForWorkGroup *)cell{
  418. if (cell.indexPath.row < [self.dataArray count]) {
  419. [self _deleteDynAtIndexPath:cell.indexPath dynamicId:cell.model.id cell:cell];
  420. }
  421. }
  422. - (void)onMoreInRespostCell:(CellForWorkGroupRepost *)cell{
  423. if (cell.indexPath.row < [self.dataArray count]) {
  424. YHWorkGroup *model = self.dataArray[cell.indexPath.row];
  425. model.isOpening = !model.isOpening;
  426. [self.tableView reloadRowsAtIndexPaths:@[cell.indexPath] withRowAnimation:UITableViewRowAnimationFade];
  427. }
  428. }
  429. - (void)onFollowInCell:(CellForWorkGroup *)cell{
  430. if (cell.indexPath.row < [self.dataArray count]) {
  431. FWWeakify(self)
  432. [self.logic addFollowUID:cell.model.uid Success:^(NSDictionary * _Nonnull dic) {
  433. NSInteger _has_focus = [dic toInt:@"has_focus"];
  434. if (_has_focus == 1) {
  435. [FanweMessage alert:ASLocalizedString(@"关注成功")];
  436. }
  437. //刷新数据
  438. FWStrongify(self)
  439. _currentRequestPage = 1;
  440. self.logic.page = _currentRequestPage;
  441. [self.logic loadListDataWiththeme:self.topic.t_id];
  442. }];
  443. }
  444. }
  445. #pragma mark - private
  446. - (void)_deleteDynAtIndexPath:(NSIndexPath *)indexPath dynamicId:(NSString *)dynamicId cell:(CellForWorkGroup *)cell{
  447. FWWeakify(self)
  448. __weak __typeof(self)weakSelf = self;
  449. [self.logic delZone:dynamicId Success:^{
  450. [FanweMessage alertHUD:ASLocalizedString(@"删除动态成功")];
  451. // [FanweMessage alert:ASLocalizedString(@"删除动态成功")];
  452. // [weakSelf.navigationController popViewControllerAnimated:YES];
  453. [self requestDataLoadNew:YES];
  454. }];
  455. // [FanweMessage alert:ASLocalizedString(@"提示")message:ASLocalizedString(@"确定删除该动态?")destructiveAction:^{
  456. // FWStrongify(self)
  457. // [self.logic loadListDataWiththeme:self.topic.t_id];
  458. // [FanweMessage alert:ASLocalizedString(@"删除动态成功")];
  459. // } cancelAction:^{
  460. //
  461. // }];
  462. }
  463. - (void)_shareWithCell:(CellForWorkGroup *)cell{
  464. FWWeakify(self)
  465. [_logic dynamicForwardWithDynamic_id:cell.model.id Success:^{
  466. FWStrongify(self)
  467. cell.model.bottomViewSelect = YES;
  468. cell.bottomView.hidden = YES;
  469. [[BGHUDHelper sharedInstance]tipMessage:ASLocalizedString(@"转发成功")];
  470. [self.logic loadListDataWiththeme:self.topic.t_id];
  471. }];
  472. }
  473. /*
  474. #pragma mark - Navigation
  475. // In a storyboard-based application, you will often want to do a little preparation before navigation
  476. - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
  477. // Get the new view controller using [segue destinationViewController].
  478. // Pass the selected object to the new view controller.
  479. }
  480. */
  481. #pragma mark - setter
  482. -(UIButton *)releaseBtn{
  483. if (!_releaseBtn) {
  484. _releaseBtn = ({
  485. UIButton * btn = [UIButton buttonWithType:UIButtonTypeCustom];
  486. [btn setTitleColor:kWhiteColor forState:UIControlStateNormal];
  487. btn.titleLabel.font = [UIFont systemFontOfSize:16];
  488. [btn setTitle:ASLocalizedString(@"立即\n参与")forState:UIControlStateNormal];
  489. btn.titleLabel.lineBreakMode = NSLineBreakByWordWrapping;
  490. [btn addTarget:self action:@selector(releaseeButtonClick) forControlEvents:UIControlEventTouchUpInside];
  491. [btn setBackgroundImage:[UIImage imageNamed:@"立即参与按钮"] forState:UIControlStateNormal];
  492. btn;
  493. });
  494. }
  495. return _releaseBtn;
  496. }
  497. - (NSMutableArray *)dataArray{
  498. if (!_dataArray) {
  499. _dataArray = [NSMutableArray array];
  500. }
  501. return _dataArray;
  502. }
  503. - (NSMutableDictionary *)heightDict{
  504. if (!_heightDict) {
  505. _heightDict = [NSMutableDictionary new];
  506. }
  507. return _heightDict;
  508. }
  509. @end