DetailsLineViewController.m 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633
  1. //
  2. // DetailsLineViewController.m
  3. // MarryU
  4. //
  5. // Created by 志刚杨 on 2017/6/26.
  6. // Copyright © 2017年 voidcat. All rights reserved.
  7. //
  8. #import "DetailsLineViewController.h"
  9. #import "CellForWorkGroup.h"
  10. #import "CellForWorkGroupRepost.h"
  11. //#import "YHUtils.h"
  12. #import "UITableViewCell+HYBMasonryAutoCellHeight.h"
  13. #import "YZInputView.h"
  14. #import "CellForReplyTableViewCell.h"
  15. #import "MGGroupUserInfo.h"
  16. //#import "UserHomeController.h"
  17. //#import "MGNewUserinfoViewController.h"
  18. #import "BzoneLogic.h"
  19. #import <YYKit.h>
  20. #import <CLPlayer/CLPlayerView.h>
  21. #import "BGTopicTimeLineListController.h"//话题页
  22. #import "YHPlayerViewController.h"//视频播放页
  23. @interface DetailsLineViewController ()<CellForWorkGroupDelegate,UITableViewDelegate,CellForWorkGroupDelegate,CellForWorkGroupRepostDelegate,BzoneLogicDelegate,UITableViewDataSource,UITableViewDelegate>
  24. //@property(nonatomic, strong) UITableView *tableView;
  25. @property(nonatomic, strong) UITextField *inputView;
  26. @property(nonatomic, strong) UIView *bottomView;
  27. @property(nonatomic, strong) NSArray *dataarray;
  28. @property(nonatomic, strong) UILabel *posttip;
  29. @property(nonatomic, strong) NSString *type;
  30. @property(nonatomic, strong) BzoneLogic *zoneLogic;
  31. @property(nonatomic, strong) UITableView *tableView;
  32. @property (nonatomic, strong) CellForWorkGroup *c_cell;
  33. @property (nonatomic, strong) CLPlayerView *playerView;
  34. @property (nonatomic,strong) NSMutableDictionary *heightDict;
  35. @end
  36. static CGFloat const kBottomHeight = 44;
  37. @implementation DetailsLineViewController
  38. {
  39. YYTextKeyboardManager *YYmanager;
  40. }
  41. - (NSMutableDictionary *)heightDict{
  42. if (!_heightDict) {
  43. _heightDict = [NSMutableDictionary new];
  44. }
  45. return _heightDict;
  46. }
  47. - (void)viewDidLoad {
  48. [super viewDidLoad];
  49. UIImageView *topImgView = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, kScreenW, kScreenW)];
  50. topImgView.image = [UIImage imageNamed:@"bg_top"];
  51. [self.view addSubview:topImgView];
  52. UIView * navView = [[UIView alloc] initWithFrame:CGRectMake(0, StatusBarHeight, SCREEN_WIDTH, NavigationHeight)];
  53. navView.backgroundColor = UIColor.clearColor;
  54. [self.view addSubview:navView];
  55. UIButton * backBtn = [UIButton buttonWithType:UIButtonTypeCustom];
  56. [backBtn setImage:[UIImage imageNamed:@"com_arrow_vc_back"] forState:UIControlStateNormal];
  57. backBtn.frame = CGRectMake(10, 0, 44, 44);
  58. [backBtn addTarget:self action:@selector(onReturnBtnPress) forControlEvents:UIControlEventTouchUpInside];
  59. [navView addSubview:backBtn];
  60. UILabel * titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 200, 30)];
  61. titleLabel.centerX = SCREEN_WIDTH/2;
  62. titleLabel.centerY = backBtn.centerY;
  63. titleLabel.text = self.title;
  64. titleLabel.textColor = UIColor.blackColor;
  65. titleLabel.font = [UIFont boldSystemFontOfSize:18];
  66. titleLabel.textAlignment = NSTextAlignmentCenter;
  67. [navView addSubview:titleLabel];
  68. self.tableView = [[UITableView alloc]initWithFrame:CGRectMake(0, navView.bottom, kScreenW, kScreenH - navView.bottom - kBottomHeight) style:UITableViewStylePlain];
  69. self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
  70. self.tableView.dataSource = self;
  71. self.tableView.delegate = self;
  72. self.tableView.backgroundColor = [UIColor clearColor];
  73. self.tableView.mj_footer.hidden = YES;
  74. self.tableView.mj_header.hidden = YES;
  75. [self.tableView registerClass:[CellForWorkGroup class] forCellReuseIdentifier:@"CellForWorkGroup"];
  76. [self.tableView registerClass:[CellForReplyTableViewCell class] forCellReuseIdentifier:@"CellForReplyTableViewCell"];
  77. [self.view addSubview:self.tableView];
  78. self.view.backgroundColor = [UIColor clearColor];
  79. [self setnav];
  80. self.tableView.backgroundColor = [UIColor clearColor];
  81. _bottomView = [[UIView alloc] init];
  82. [self.view addSubview:_bottomView];
  83. _bottomView.frame = CGRectMake(0, kScreenH - kBottomHeight - SafeAreaBottomHeight, kScreenW, kBottomHeight);
  84. _inputView = [[UITextField alloc] init];
  85. [_bottomView addSubview:_inputView];
  86. _inputView.frame = CGRectMake(0, 0, _bottomView.width - kRealValue(60 + 5), kBottomHeight);
  87. _inputView.leftView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, kRealValue(10), 0)];
  88. _inputView.centerY = _bottomView.height / 2;
  89. _inputView.leftViewMode = UITextFieldViewModeAlways;
  90. _inputView.backgroundColor = [UIColor whiteColor];
  91. _inputView.layer.borderWidth = 1;
  92. _inputView.layer.borderColor = RGB(250, 250, 250).CGColor;
  93. _inputView.font = [UIFont systemFontOfSize:14];
  94. // DEFAULT_FONT(16);
  95. UIButton *btnpost = [[UIButton alloc] init];
  96. [btnpost setTitle:ASLocalizedString(@"发送")forState:UIControlStateNormal];
  97. // btnpost.layer.cornerRadius = 12.5;
  98. // btnpost.layer.masksToBounds = YES;
  99. btnpost.titleLabel.font = [UIFont systemFontOfSize:15];
  100. [btnpost setBackgroundImage:[UIImage imageNamed:@"dynamic_sendcomentBg"] forState:UIControlStateNormal];
  101. [btnpost setTitleColor:kWhiteColor forState:UIControlStateNormal];
  102. btnpost.frame = CGRectMake(kScreenW - kRealValue(60), 0, kRealValue(58), kRealValue(35));
  103. [btnpost addTarget:self action:@selector(save) forControlEvents:UIControlEventTouchUpInside];
  104. btnpost.centerY = _bottomView.height / 2;
  105. //添加私密评论
  106. _bottomView.backgroundColor = [UIColor whiteColor];
  107. [_bottomView addSubview:_posttip];
  108. [_bottomView addSubview:btnpost];
  109. // 设置文本框占位文字
  110. _inputView.placeholder =ASLocalizedString(@"说点什么吧...");
  111. //键盘监听
  112. YYmanager = [YYTextKeyboardManager defaultManager];
  113. [YYmanager addObserver:self];
  114. _type = @"1";
  115. _dataarray = [NSArray array];
  116. _zoneLogic = [[BzoneLogic alloc] init];
  117. _zoneLogic.delegagte = self;
  118. // [_zoneLogic loadReplyListWhidZoneID:SafeStr(self.model.dynamic_id)];
  119. [self UpdateData];
  120. [self setupBackBtnWithBlock:nil];
  121. }
  122. - (void)setupBackBtnWithBlock:(BackBlock)backBlock
  123. {
  124. self.navigationItem.leftBarButtonItem = [UIBarButtonItem itemWithTarget:self action:@selector(onReturnBtnPress) image:@"com_arrow_vc_back" highImage:@"com_arrow_vc_back"];
  125. }
  126. #pragma mark - 返回上一级
  127. - (void)onReturnBtnPress
  128. {
  129. [self.navigationController popViewControllerAnimated:YES];
  130. }
  131. - (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch
  132. {
  133. // 过滤掉UIButton,也可以是其他类型
  134. if ( [touch.view isKindOfClass:[UIButton class]])
  135. {
  136. return NO;
  137. }
  138. return YES;
  139. }
  140. -(void)save
  141. {
  142. if(_inputView.text.length == 0)
  143. {
  144. // [[HUDHelper sharedInstance] tipMessage:ASLocalizedString(@"请输入评论内容")];
  145. [SVProgressHUD showInfoWithStatus:ASLocalizedString(@"请输入评论内容")];
  146. return;
  147. }
  148. __weak __typeof(self)weakSelf = self;
  149. [self.zoneLogic addDynamicReplyID:self.model.id WihtiContent:_inputView.text adnAudio:@"" Success:^{
  150. [weakSelf.inputView resignFirstResponder];
  151. weakSelf.inputView.text = @"";
  152. // [BGHUDHelper alert:ASLocalizedString(@"评论成功")];
  153. if (weakSelf.refreshData) {
  154. weakSelf.refreshData();
  155. }
  156. [weakSelf UpdateData];
  157. }];
  158. }
  159. //get_dynamic_info
  160. - (void)setDynamic_id:(NSString *)dynamic_id{
  161. NSMutableDictionary *mDict = [NSMutableDictionary dictionary];
  162. [mDict setObject:@"dynamic" forKey:@"ctl"];
  163. [mDict setObject:@"get_dynamic_info" forKey:@"act"];
  164. [mDict setObject:dynamic_id forKey:@"dynamic_id"];
  165. [[NetHttpsManager manager] POSTWithParameters:mDict SuccessBlock:^(NSDictionary *responseJson) {
  166. if ([responseJson toInt:@"status"] == 1)
  167. {
  168. MGGroupUserInfo *model = [MGGroupUserInfo mj_objectWithKeyValues:responseJson[@"data"]];
  169. self.model = model;
  170. [self.tableView reloadData];
  171. [BGMJRefreshManager endRefresh:_tableView];
  172. }
  173. } FailureBlock:^(NSError *error) {
  174. [BGMJRefreshManager endRefresh:_tableView];
  175. }];
  176. }
  177. -(void)UpdateData
  178. {
  179. [_zoneLogic loadReplyListWhidZoneID:self.model.id];
  180. // [ODTDynamic getreplyWithdid:_model.dynamicId :^(NSMutableArray *data) {
  181. // _dataarray = [NSMutableArray array];
  182. // for (NSDictionary *dic in data) {
  183. // MGGroupUserInfo *model = [MGGroupUserInfo modelWithDictionary:dic];
  184. // [_dataarray addObject:model];
  185. // [_tableView reloadData];
  186. // }
  187. // } :^(NSString *error) {
  188. //// [MBProgressHUD showError:error];
  189. // }];
  190. }
  191. -(void)requestZoneReplyListDataCompletedWhih:(NSArray<MGGroupUserInfo *> *)list
  192. {
  193. _dataarray = list;
  194. _model.comments = [NSString stringWithFormat:@"%ld",list.count];
  195. NSLog(@"当前动态评论数量:%ld",_dataarray.count);
  196. [self.tableView reloadData];
  197. }
  198. -(void)keyboardHide:(UITapGestureRecognizer*)tap{
  199. [_inputView resignFirstResponder];
  200. }
  201. - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
  202. return 2;
  203. }
  204. - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
  205. if(section == 0)
  206. {
  207. return 1;
  208. }
  209. else
  210. {
  211. return _dataarray.count;
  212. }
  213. }
  214. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
  215. if(indexPath.section == 0)
  216. {
  217. CellForWorkGroup *cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([CellForWorkGroup class])];
  218. if (!cell) {
  219. cell = [[CellForWorkGroup alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([CellForWorkGroup class])];
  220. }
  221. cell.indexPath = indexPath;
  222. cell.model = _model;
  223. cell.delegate = self;
  224. return cell;
  225. }
  226. else
  227. {
  228. CellForReplyTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([CellForReplyTableViewCell class])];
  229. if (!cell) {
  230. cell = [[CellForReplyTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([CellForReplyTableViewCell class])];
  231. }
  232. __weak __typeof(self)weakSelf = self;
  233. cell.clickDeleteBlock = ^(BOOL isDelete) {
  234. [weakSelf deleteCommentCell:indexPath.row];
  235. };
  236. MGGroupUserInfo *model = _dataarray[indexPath.row];
  237. [cell setModel:model];
  238. return cell;
  239. }
  240. }
  241. -(void)deleteCommentCell:(NSInteger)indexPathRow{
  242. [FanweMessage alert:ASLocalizedString(@"提示")message:ASLocalizedString(@"是否删除评论")destructiveAction:^{
  243. MGGroupUserInfo *model = _dataarray[indexPathRow];
  244. NSMutableDictionary *parmDict = [NSMutableDictionary dictionary];
  245. [parmDict setObject:@"dynamic" forKey:@"ctl"];
  246. [parmDict setObject:@"del_comments" forKey:@"act"];
  247. [parmDict setObject:model.id forKey:@"comment_id"];
  248. __weak __typeof(self)weakSelf = self;
  249. [[NetHttpsManager manager] POSTWithParameters:parmDict SuccessBlock:^(NSDictionary *responseJson) {
  250. if ([responseJson toInt:@"status"] == 1) {
  251. // [BGHUDHelper alert:[responseJson valueForKey:@"error"]];
  252. [FanweMessage alertHUD:[responseJson valueForKey:@"error"]];
  253. // [FanweMessage alert:[responseJson valueForKey:@"error"]];
  254. [_zoneLogic loadReplyListWhidZoneID:self.model.id];
  255. }
  256. } FailureBlock:^(NSError *error) {
  257. }];
  258. } cancelAction:^{
  259. }];
  260. }
  261. -(void)setnav
  262. {
  263. }
  264. - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
  265. [tableView deselectRowAtIndexPath:indexPath animated:YES];
  266. if(indexPath.section == 1)
  267. {
  268. // MGGroupUserInfo *model = _dataarray[indexPath.row];
  269. // MGNewUserinfoViewController *userhome = [MGNewUserinfoViewController new];
  270. // userhome.uid = model.uid;
  271. // [self.navigationController pushViewController:userhome animated:NO];
  272. }
  273. }
  274. - (void)tableView:(UITableView *)tableView didEndDisplayingCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath
  275. {
  276. if ([_c_cell isEqual:cell])
  277. {
  278. //区分是否是播放器所在的cell,销毁时将指针置空
  279. [_playerView destroyPlayer];
  280. _c_cell =nil;
  281. }
  282. }
  283. #pragma mark - UITableViewDelegate
  284. - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
  285. if (indexPath.section == 0) {
  286. CGFloat height = 0.0;
  287. //原创cell
  288. MGGroupUserInfo *model = _model;
  289. height = [CellForWorkGroup hyb_heightForTableView:tableView config:^(UITableViewCell *sourceCell) {
  290. CellForWorkGroup *cell = (CellForWorkGroup *)sourceCell;
  291. cell.model = model;
  292. }];
  293. return height;
  294. }
  295. else{
  296. kRealValue(100);
  297. CGFloat height = 0.0;
  298. // //原创cell
  299. MGGroupUserInfo *model = _dataarray[indexPath.row];
  300. //
  301. // //取缓存高度
  302. // NSDictionary *dict = self.heightDict[model.id];
  303. // if (dict) {
  304. // if (model.isOpening) {
  305. // height = [dict[@"open"] floatValue];
  306. // }else{
  307. // height = [dict[@"normal"] floatValue];
  308. // }
  309. // if (height) {
  310. // return height;
  311. // }
  312. // }
  313. //
  314. height = [CellForReplyTableViewCell hyb_heightForTableView:tableView config:^(UITableViewCell *sourceCell) {
  315. CellForReplyTableViewCell *cell = (CellForReplyTableViewCell *)sourceCell;
  316. cell.model = model;
  317. }];
  318. return height;
  319. //
  320. // //缓存高度
  321. // if (model.id) {
  322. // NSMutableDictionary *aDict = [NSMutableDictionary new];
  323. // if (model.isOpening) {
  324. // [aDict setObject:@(height) forKey:@"open"];
  325. // }else{
  326. // [aDict setObject:@(height) forKey:@"normal"];
  327. // }
  328. // [self.heightDict setObject:aDict forKey:model.id];
  329. // }
  330. // return height;
  331. }
  332. return kRealValue(44);
  333. }
  334. #pragma mark - CellForWorkGroupDelegate
  335. - (void)onAvatarInCell:(CellForWorkGroup *)cell{
  336. // MGNewUserinfoViewController *user = [[MGNewUserinfoViewController alloc] init];
  337. // user.uid = cell.model.userInfo.id;
  338. // [self.navigationController pushViewController:user animated:NO];
  339. }
  340. - (void)onMoreInCell:(CellForWorkGroup *)cell{
  341. }
  342. - (void)onCommentInCell:(CellForWorkGroup *)cell{
  343. }
  344. - (void)onLikeInCell:(CellForWorkGroup *)cell{
  345. __weak __typeof(self)weakSelf = self;
  346. NSLog(@"%@",cell.model.is_like);
  347. BOOL isLike = ![cell.model.is_like isEqualToString:@"1"];
  348. [_zoneLogic addDolikeID:cell.model.id isLike:isLike Success:^(id _Nonnull selfPtr, BOOL isFinished) {
  349. MGGroupUserInfo *model = weakSelf.model;
  350. BOOL isLike = !model.is_like;
  351. NSInteger praise = [selfPtr integerValue];
  352. if ([cell.model.is_like isEqualToString:@"1"]) {//此处取反
  353. // praise += 1;
  354. weakSelf.model.is_like = @"0";
  355. }else{
  356. // praise -= 1;
  357. weakSelf.model.is_like = @"1";
  358. }
  359. model.praise = [NSString stringWithFormat:@"%ld",praise];
  360. // [NSString stringWithFormat:@"%ld",(long)selfPtr];
  361. cell.model = weakSelf.model;
  362. [cell.liksBtn setImage:[UIImage imageNamed:[_model.is_like isEqualToString:@"1"] ? @"mg_dy_likes_select" : @"mg_dy_likes"] forState:UIControlStateNormal];
  363. [cell.liksBtn setTitleColor:[UIColor colorWithHexString:[_model.is_like isEqualToString:@"1"] ? @"#FF268E" : @"#999999"] forState:UIControlStateNormal];
  364. [weakSelf.tableView reloadData];
  365. }];
  366. }
  367. - (void)onShareInCell:(CellForWorkGroup *)cell{
  368. }
  369. - (void)onDeleteInCell:(CellForWorkGroup *)cell{
  370. __weak __typeof(self)weakSelf = self;
  371. [self.zoneLogic delZone:self.model.id Success:^{
  372. [FanweMessage alert:ASLocalizedString(@"删除动态成功")];
  373. [weakSelf.navigationController popViewControllerAnimated:YES];
  374. if (weakSelf.refreshData) {
  375. weakSelf.refreshData();
  376. }
  377. }];
  378. // loadListDataWithAct:@"2"];
  379. // self _deleteDynAtIndexPath:<#(NSIndexPath *)#> dynamicId:<#(NSString *)#> cell:<#(CellForWorkGroup *)#>
  380. }
  381. #pragma mark - CellForWorkGroupRepostDelegate
  382. - (void)onAvatarInRepostCell:(CellForWorkGroupRepost *)cell{
  383. }
  384. - (void)onTapRepostViewInCell:(CellForWorkGroupRepost *)cell{
  385. }
  386. - (void)onCommentInRepostCell:(CellForWorkGroupRepost *)cell{
  387. }
  388. - (void)onLikeInRepostCell:(CellForWorkGroupRepost *)cell{
  389. }
  390. - (void)onShareInRepostCell:(CellForWorkGroupRepost *)cell{
  391. }
  392. - (void)onDeleteInRepostCell:(CellForWorkGroupRepost *)cell{
  393. }
  394. - (void)onMoreInRespostCell:(CellForWorkGroupRepost *)cell{
  395. }
  396. - (void)onTouchActionVideo:(CellForWorkGroup *)cell withFullScreen:(BOOL)fullScreen
  397. {
  398. if (fullScreen) {
  399. YHPlayerViewController *vc = [[YHPlayerViewController alloc]initWithPlayerURL:cell.model.video];
  400. [[AppDelegate sharedAppDelegate] pushViewController:vc animated:YES];
  401. return;
  402. }
  403. _c_cell =cell;
  404. [_playerView destroyPlayer];
  405. _playerView =nil;
  406. _playerView = [[CLPlayerView alloc] initWithFrame:CGRectMake(0, 0, cell.ClVideoview.width, cell.ClVideoview.height)];
  407. [cell.ClVideoview addSubview:_playerView];
  408. _playerView.url =[NSURL URLWithString:cell.model.video];
  409. //播放
  410. [_playerView playVideo];
  411. //返回按钮点击事件回调
  412. [_playerView backButton:^(UIButton *button) {
  413. NSLog(ASLocalizedString(@"返回按钮被点击"));
  414. }];
  415. //播放完成回调
  416. [_playerView endPlay:^{
  417. //销毁播放器
  418. [_playerView destroyPlayer];
  419. _playerView = nil;
  420. NSLog(ASLocalizedString(@"播放完成"));
  421. }];
  422. }
  423. - (void)onTopicInCell:(CellForWorkGroup *)cell{
  424. // if (self.topic) {
  425. // [self.navigationController popViewControllerAnimated:YES];
  426. // } else {
  427. BGTopicTimeLineListController *pushVC = [BGTopicTimeLineListController new];
  428. MGDynamicTopicModel *topic = [MGDynamicTopicModel new];
  429. topic.t_id = self.model.theme_id;
  430. topic.name = self.model.theme;
  431. pushVC.topic = topic;
  432. [self.navigationController pushViewController:pushVC animated:YES];
  433. // [[AppDelegate sharedAppDelegate]pushViewController:pushVC];
  434. }
  435. - (void)onFollowInCell:(CellForWorkGroup *)cell{
  436. FWWeakify(self)
  437. [self.zoneLogic addFollowUID:cell.model.uid Success:^(NSDictionary * _Nonnull dic) {
  438. //刷新数据
  439. FWStrongify(self)
  440. NSInteger _has_focus = [dic toInt:@"has_focus"];
  441. if (_has_focus == 1) {
  442. [[BGHUDHelper sharedInstance] tipMessage:ASLocalizedString(@"关注成功")];
  443. //[FanweMessage alert:ASLocalizedString(@"关注成功")];
  444. self.model.is_focus = @(1);
  445. [self.tableView reloadSection:0 withRowAnimation:UITableViewRowAnimationNone];
  446. if (self.refreshData) {
  447. self.refreshData();
  448. }
  449. }
  450. }];
  451. }
  452. #pragma mark - private
  453. - (void)_deleteDynAtIndexPath:(NSIndexPath *)indexPath dynamicId:(NSString *)dynamicId cell:(CellForWorkGroup *)cell{
  454. __weak __typeof(self)weakSelf = self;
  455. [FanweMessage alert:ASLocalizedString(@"提示")message:ASLocalizedString(@"确定删除该动态?")destructiveAction:^{
  456. [weakSelf.zoneLogic loadListDataWithAct:@"2"];
  457. [FanweMessage alert:ASLocalizedString(@"删除动态成功")];
  458. if (weakSelf.refreshData) {
  459. weakSelf.refreshData();
  460. }
  461. } cancelAction:^{
  462. }];
  463. }
  464. -(void)viewWillAppear:(BOOL)animated
  465. {
  466. [super viewWillAppear:animated];
  467. self.navigationController.navigationBar.hidden = YES;
  468. [self.navigationController setNavigationBarHidden:YES];
  469. }
  470. - (void)keyboardChangedWithTransition:(YYTextKeyboardTransition)transition {
  471. CGRect toFrame = [YYmanager convertRect:transition.toFrame toView:self.view];
  472. BOOL toVisible = transition.toVisible;
  473. if(toVisible == YES)
  474. {
  475. _bottomView.frame = CGRectMake(0, toFrame.origin.y - kBottomHeight , kScreenW, kBottomHeight);
  476. }
  477. else
  478. {
  479. _bottomView.frame = CGRectMake(0, kScreenH - kBottomHeight - SafeAreaBottomHeight, kScreenW, kBottomHeight);
  480. // _bottomView.frame = CGRectMake(0, kScreenHeight - 60 - 10 - kTopHeight, kScreenW, kTabBarHeight);
  481. }
  482. }
  483. @end