MPersonCenterVC.m 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626
  1. //
  2. // MPersonCenterVC.m
  3. // BuguLive
  4. //
  5. // Created by 丁凯 on 2017/7/19.
  6. // Copyright © 2017年 xfg. All rights reserved.
  7. //
  8. #import "MPersonCenterVC.h"
  9. #import "userPageModel.h"
  10. #import "SSearchVC.h"
  11. #import "PersonCenterModel.h"
  12. #import "MPersonCenterCell.h"
  13. #import "MPCHeadView.h"
  14. #import "UserCenterTopView.h"
  15. #import "OnLiveViewController.h"
  16. #import "MGInvateCodeViewController.h"//邀请码
  17. @interface MPersonCenterVC ()<UITableViewDataSource,UITableViewDelegate>
  18. @property ( nonatomic,strong) NSMutableArray *titleArray; //setion名字
  19. @property ( nonatomic,strong) NSMutableArray *imageArray; //setion图片
  20. @property ( nonatomic,strong) NSMutableArray *detailArray; //setion详情
  21. @property ( nonatomic,strong) UITableView *tableView; //tableView
  22. @property ( nonatomic,strong) userPageModel *userModel; //userModel
  23. @property ( nonatomic,assign) BOOL isUserNav; //是否使用导航栏
  24. @property ( nonatomic,strong) UIButton *topBtn; //tableView
  25. //@property ( nonatomic,strong) MPCHeadView *tableHeadView; //tableHeadView
  26. @property ( nonatomic,strong) UserCenterTopView *tableHeadView; //tableHeadView
  27. @property ( nonatomic,strong) UIView *myLFFView; //直播关注粉丝底部的view
  28. @property ( nonatomic,strong) PersonCenterModel *personCModel; //处理UI的model
  29. @property ( nonatomic,assign) BOOL isFirstLoad; //是否第一次加载
  30. @property ( nonatomic,assign) float scrollH; //滚动的高度
  31. @end
  32. @implementation MPersonCenterVC
  33. - (void)viewDidLoad
  34. {
  35. [super viewDidLoad];
  36. self.automaticallyAdjustsScrollViewInsets = NO;
  37. [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(loadNetData) name:@"updateCoin" object:nil];
  38. [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(IMChatHaveNewMsgNotification:) name:g_notif_chatmsg object:nil];
  39. }
  40. - (void)initFWUI
  41. {
  42. [super initFWUI];
  43. self.view.backgroundColor = [UIColor colorWithHexString:@"#F3F4F8"];
  44. // kBackGroundColor;
  45. self.personCModel = [[PersonCenterModel alloc]init];
  46. // self.tableHeadView = [[MPCHeadView alloc]initWithFrame:CGRectMake(0, 0, kScreenW, 315) andHeadType:1];
  47. NSArray *objs = [[NSBundle mainBundle]loadNibNamed:@"UserCenterTopView" owner:nil options:nil];
  48. UIImageView *bgImgView = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, kScreenW, kRealValue(390))];
  49. bgImgView.userInteractionEnabled = YES;
  50. bgImgView.image = [UIImage imageNamed:@"bogo_me_top_bgImgView"];
  51. [self.view addSubview:bgImgView];
  52. self.tableView.backgroundColor = kClearColor;
  53. UserCenterTopView *view = objs.firstObject;
  54. self.tableHeadView = view;
  55. if ([[GlobalVariables sharedInstance].appModel.ios_checkVersionStr isEqualToString:VersionNum]) {
  56. }else{
  57. self.tableView.tableHeaderView = self.tableHeadView;
  58. }
  59. FWWeakify(self)
  60. [self.tableHeadView setClickBtnBlock:^(UserCenterTopViewBtnType type) {
  61. FWStrongify(self)
  62. int section = 0;
  63. switch (type) {
  64. case UserCenterTopViewBtnTypeShop:
  65. section = MPBGSHOP;
  66. break;
  67. case UserCenterTopViewBtnTypeVIP://贵族中心
  68. section = MPGuiZu;
  69. break;
  70. case UserCenterTopViewBtnTypeLevel:
  71. section = MPCGradeSection;
  72. break;
  73. case UserCenterTopViewBtnTypeFamily:
  74. {
  75. if ([_userModel.family_id intValue] == 0)
  76. {
  77. [self.personCModel createFamilyViewWithVC:self andModel:_userModel];
  78. }
  79. else
  80. {
  81. [self.personCModel goToFamilyDesVCWithModel:_userModel];
  82. }
  83. return;
  84. }
  85. break;
  86. case UserCenterTopViewBtnTypeSet:
  87. section = MPCSetSection;
  88. break;
  89. case UserCenterTopViewBtnTypeAccount:
  90. section = MPCAcountSection;
  91. break;
  92. case UserCenterTopViewBtnTypeIncome:
  93. section = MPCIncomeSection;
  94. break;
  95. case UserCenterTopViewBtnTypeEdit:
  96. section = MPCMyEditSection;
  97. break;
  98. case UserCenterTopViewBtnTypeRecord:
  99. {
  100. OnLiveViewController *onliveVC = [[OnLiveViewController alloc]init];
  101. onliveVC.user_id = self.userModel.user_id;
  102. [[AppDelegate sharedAppDelegate] pushViewController:onliveVC animated:YES];
  103. return;
  104. }
  105. break;
  106. case UserCenterTopViewBtnTypeVideo:
  107. section = MPCMyVideoSection;
  108. break;
  109. case UserCenterTopViewBtnTypeFocus:
  110. section = 52;
  111. break;
  112. case UserCenterTopViewBtnTypeFan:
  113. section = 53;
  114. break;
  115. case UserCenterTopViewBtnTypeIcon:
  116. section = MPCMyInfoSection;
  117. break;
  118. case UserCenterTopViewBtnTypeSign:
  119. section = 999;
  120. break;
  121. default:
  122. break;
  123. }
  124. [self.personCModel didSelectWithModel:self.userModel andSection:section];
  125. }];
  126. // [self.tableHeadView setHeadViewBlock:^(int btnIndex){
  127. // FWStrongify(self)
  128. // int section = btnIndex-100;
  129. // if (section == 0) section = 24; //搜索
  130. // else if (section == 1) section = 25; //IM消息
  131. // else if (section == 2) section = 26; //头像
  132. // else if (section == 3) section = 27; //编辑
  133. // else if (section == 4) section = 21; //直播
  134. // else if (section == 5) section = 28; //关注
  135. // else if (section == 6) section = 22; //粉丝
  136. // else if (section == 7) section = 23; //小视频
  137. // [self.personCModel didSelectWithModel:self.userModel andSection:section];
  138. // }];
  139. [self.view addSubview:self.tableView];
  140. }
  141. - (void)initFWData
  142. {
  143. [super initFWData];
  144. [self loadNetData];
  145. }
  146. - (void)viewWillAppear:(BOOL)animated
  147. {
  148. [super viewWillAppear:animated];
  149. [self requestDataToady];
  150. [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleDefault animated:animated];
  151. if (!self.isFirstLoad)
  152. {
  153. [self loadNetData];
  154. }
  155. self.isFirstLoad = NO;
  156. [self userNavigation];
  157. // [self.personCModel loadBadageDataWithView:self.tableHeadView];
  158. [self.personCModel createExchangeCoinViewWithVC:self];
  159. [[UIBarButtonItem appearance]setTitleTextAttributes:@{NSForegroundColorAttributeName:kBlackColor,
  160. NSFontAttributeName:[UIFont systemFontOfSize:15]
  161. } forState:UIControlStateNormal];
  162. }
  163. -(void)viewWillDisappear:(BOOL)animated
  164. {
  165. [super viewWillDisappear:animated];
  166. if (self.isUserNav ==NO)
  167. {
  168. [self.navigationController setNavigationBarHidden:NO animated:NO];
  169. }
  170. else
  171. {
  172. [self.navigationController setNavigationBarHidden:YES animated:NO];
  173. }
  174. [UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleDefault;
  175. }
  176. - (void)viewDidDisappear:(BOOL)animated
  177. {
  178. [super viewDidDisappear:animated];
  179. [UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleDefault;
  180. }
  181. #pragma mark 导航栏相关操作的处理
  182. - (void)userNavigation
  183. {
  184. if (self.isUserNav ==NO)
  185. {
  186. [self.navigationController setNavigationBarHidden:YES animated:NO];
  187. [self setStateBackColor];
  188. }
  189. else
  190. {
  191. [self.navigationController setNavigationBarHidden:NO animated:NO];
  192. }
  193. }
  194. - (void)clickButtonTag:(UIButton *)button
  195. {
  196. [self.personCModel didSelectWithModel:_userModel andSection:(int)button.tag+20];
  197. }
  198. - (void)loadNetData
  199. {
  200. if (![IMAPlatform isAutoLogin])// 如果没有登录,就不需要后续操作
  201. {
  202. return;
  203. }
  204. NSMutableDictionary *parmDict = [NSMutableDictionary dictionary];
  205. [parmDict setObject:@"user" forKey:@"ctl"];
  206. [parmDict setObject:@"userinfo" forKey:@"act"];
  207. FWWeakify(self)
  208. [self.httpsManager POSTWithParameters:parmDict SuccessBlock:^(NSDictionary *responseJson)
  209. {
  210. FWStrongify(self)
  211. if ([responseJson toInt:@"status"] == 1)
  212. {
  213. _userModel = [userPageModel mj_objectWithKeyValues:[responseJson objectForKey:@"user"]];
  214. UserModel *model = [UserModel modelWithDictionary:[responseJson objectForKey:@"user"]];
  215. // self.BuguLive.appModel.h5_url = [AppUrlModel mj_objectWithKeyValues:[responseJson objectForKey:@"h5_url"]];
  216. [GlobalVariables sharedInstance].is_noble_mysterious = _userModel.is_noble_mysterious;
  217. [GlobalVariables sharedInstance].userModel = model;
  218. [self.tableHeadView setViewWithModel:_userModel];
  219. if ([[GlobalVariables sharedInstance].appModel.ios_checkVersionStr isEqualToString:VersionNum]) {
  220. }else{
  221. self.tableView.tableHeaderView = self.tableHeadView;
  222. }
  223. [self.personCModel creatUIWithModel:_userModel andMArr:self.detailArray andMyView:self.myLFFView];
  224. [self.tableView reloadData];
  225. }else
  226. {
  227. [FanweMessage alertHUD:[responseJson toString:@"error"]];
  228. }
  229. [BGMJRefreshManager endRefresh:self.tableView];
  230. } FailureBlock:^(NSError *error)
  231. {
  232. FWStrongify(self)
  233. [BGMJRefreshManager endRefresh:self.tableView];
  234. }];
  235. }
  236. - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
  237. {
  238. return self.titleArray.count;
  239. }
  240. - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
  241. {
  242. return [self.personCModel getMyHeightWithModel:_userModel andBuguLive:self.BuguLive andSection:(int)section andType:1];
  243. }
  244. - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
  245. {
  246. // if ([VersionNum isEqualToString: [GlobalVariables sharedInstance].appModel.ios_check_version])
  247. // {
  248. // if (indexPath.section == MPCInviteUser ||indexPath.section == MPGuiZu ||indexPath.section == MPCGradeSection || indexPath.section == MPBGSHOP || indexPath.section == MPCarBuy || indexPath.section == MPCContributeSection || indexPath.section == MPCFamilySection || indexPath.section == MPCRenZhenSection || indexPath.section == MPCMySmallShop || indexPath.section == MPCLiveHostCenter )
  249. // {
  250. // return 0;
  251. // }
  252. // return 45*kAppRowHScale;
  253. // }
  254. // int section = (int)indexPath.section;
  255. //
  256. // if ([self.BuguLive.appModel.open_noble isEqualToString:@"0"] && section == MPBGSHOP) {
  257. // return kRealValue(45) + 8;
  258. // }
  259. //
  260. // if (section == MPCSetInvateCode || section == MPGuiZu || section == MPCSZJLSection) {
  261. // return kRealValue(45) + 8;
  262. // }
  263. return kRealValue(45);
  264. }
  265. -(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{
  266. UIView *view = [[UIView alloc]initWithFrame:CGRectMake(kRealValue(12), 0, kScreenW - kRealValue(12 * 2), 8)];
  267. view = [self setCornerViewWithView:view isTop:YES cornerNum:4];
  268. view.backgroundColor = kWhiteColor;
  269. UIView *bgView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, kScreenW, 8)];
  270. [bgView addSubview:view];
  271. return bgView;
  272. }
  273. - (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section{
  274. UIView *view = [[UIView alloc]initWithFrame:CGRectMake(kRealValue(12), 0, kScreenW - kRealValue(12 * 2), 8)];
  275. view = [self setCornerViewWithView:view isTop:NO cornerNum:8];
  276. view.backgroundColor = kWhiteColor;
  277. UIView *bgView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, kScreenW,8)];
  278. [bgView addSubview:view];
  279. if (kIsCheckingVersion())
  280. {
  281. view.height = bgView.height = 0;
  282. }
  283. return bgView;
  284. }
  285. -(UIView *)setCornerViewWithView:(UIView *)view isTop:(BOOL)isTop cornerNum:(CGFloat)cornerNum{
  286. UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:view.bounds byRoundingCorners:isTop ? (UIRectCornerTopLeft | UIRectCornerTopRight) : (UIRectCornerBottomLeft | UIRectCornerBottomRight) cornerRadii:CGSizeMake(cornerNum,cornerNum)];//圆角大小
  287. CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
  288. maskLayer.frame = view.bounds;
  289. maskLayer.path = maskPath.CGPath;
  290. view.layer.mask = maskLayer;
  291. return view;
  292. }
  293. - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
  294. {
  295. if (kIsCheckingVersion())
  296. {
  297. return 0;;
  298. }
  299. return section == 0 ? 5 : 0;
  300. // [self.personCModel getMyHeightWithModel:_userModel andBuguLive:self.BuguLive andSection:(int)section andType:2];
  301. }
  302. - (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section
  303. {
  304. if (kIsCheckingVersion())
  305. {
  306. return 0;;
  307. }
  308. if (section == MPCSetSection)
  309. {
  310. return 5;
  311. // 10*kAppRowHScale;
  312. }else
  313. {
  314. return 0.01;
  315. }
  316. }
  317. #pragma mark HomePageDelegate 0搜索 3IM消息 4更换头像 5编辑
  318. - (void)sentTagCount:(int)tagIndex
  319. {
  320. if (tagIndex == 0)
  321. {
  322. tagIndex = 2;
  323. }
  324. [self.personCModel didSelectWithModel:_userModel andSection:22+tagIndex];
  325. }
  326. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
  327. {
  328. int section = (int)indexPath.section;
  329. MPersonCenterCell *cell = [tableView dequeueReusableCellWithIdentifier:@"MPersonCenterCell"];
  330. cell.selectionStyle = UITableViewCellSelectionStyleNone;
  331. [cell creatCellWithImgStr:self.imageArray[section] andLeftStr:self.titleArray[section] andRightStr:self.detailArray[section] andSection:section];
  332. if (section == MPCRenZhenSection && [_userModel.is_authentication integerValue] == 2)
  333. {
  334. cell.rightLabel.textColor = kAppGrayColor1;
  335. }else
  336. {
  337. cell.rightLabel.textColor = kAppGrayColor3;
  338. }
  339. if (self.BuguLive.appModel.game_distribution !=1)// 游戏分享收益不存在 分享收益横线处理
  340. {
  341. if (self.BuguLive.appModel.distribution==1)
  342. {
  343. if (section == MPCShareISection)
  344. {
  345. cell.lineView.hidden = NO;
  346. }
  347. }
  348. }
  349. if ([self.BuguLive.appModel.shop_shopping_cart integerValue] != 1)//我的购物车不存在 订单管理 我的订单 商品管理横线处理
  350. {
  351. if (![_userModel.show_podcast_order isEqualToString:@""] &&[_userModel.show_podcast_order intValue] !=0)
  352. {
  353. if (section == MPCOrderMSection)
  354. {
  355. cell.lineView.hidden = YES;
  356. }
  357. }else
  358. {
  359. if (![_userModel.show_user_order isEqualToString:@""] &&[_userModel.show_user_order intValue] !=0)
  360. {
  361. if (section == MPCMyOrderSection)
  362. {
  363. cell.lineView.hidden = YES;
  364. }
  365. }else
  366. {
  367. if (![_userModel.show_podcast_goods isEqualToString:@""] &&[_userModel.show_podcast_goods intValue] !=0)
  368. {
  369. if (section == MPCGoodsMSection)
  370. {
  371. cell.lineView.hidden = YES;
  372. }
  373. }
  374. }
  375. }
  376. }
  377. if (section == MPCSetInvateCode || section == MPGuiZu || section == MPCSZJLSection || ([self.BuguLive.appModel.open_noble isEqualToString:@"0"] && section == MPBGSHOP)) {
  378. cell.lineView.frame = CGRectMake(0, kRealValue(44), kScreenW, 8);
  379. cell.imgCenterConstraint.constant = -4;
  380. }else{
  381. cell.lineView.frame = CGRectMake(10, kRealValue(44), kScreenW-10, 1);
  382. cell.imgCenterConstraint.constant = 0;
  383. }
  384. if ([self.BuguLive.appModel.open_society_module integerValue] !=1)//我的公会不存在 我的公会横线处理
  385. {
  386. if ([self.BuguLive.appModel.open_family_module integerValue]==1)
  387. {
  388. if (section == MPCFamilySection)
  389. {
  390. cell.lineView.hidden = YES;
  391. }
  392. }
  393. }
  394. if (kIsCheckingVersion())
  395. {
  396. if (section == MPCInviteUser ||section == MPGuiZu ||section == MPCGradeSection || section == MPBGSHOP || section == MPCarBuy || section == MPCContributeSection || section == MPCFamilySection || section == MPCRenZhenSection || indexPath.section == MPCMySmallShop || indexPath.section == MPCLiveHostCenter)
  397. {
  398. cell.hidden = YES;
  399. }
  400. }
  401. if (section == MPCLiveHostCenter || section == MPCSZJLSection) {
  402. cell.rightLabel.hidden = YES;
  403. }
  404. // cell.lineView.hidden = YES;
  405. return cell;
  406. }
  407. - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
  408. {
  409. if (indexPath.section == MPCexchangeCoinsSection)//兑换游戏币
  410. {
  411. [self.personCModel exchangeGaomeCoinsWithModel:_userModel];
  412. }else if (indexPath.section == MPCFamilySection)//我的公会
  413. {
  414. if ([_userModel.family_id intValue] == 0)
  415. {
  416. [self.personCModel createFamilyViewWithVC:self andModel:_userModel];
  417. }
  418. else
  419. {
  420. [self.personCModel goToFamilyDesVCWithModel:_userModel];
  421. }
  422. }else if (indexPath.section == MPCTradeSection)//我的公会
  423. {
  424. if ([_userModel.society_id intValue] == 0)
  425. {
  426. [self.personCModel createSocietyViewWithVC:self andModel:_userModel];
  427. }
  428. else
  429. {
  430. [self.personCModel goToSocietyDesVCWithModel:_userModel];
  431. }
  432. }else
  433. {
  434. [self.personCModel didSelectWithModel:_userModel andSection:(int)indexPath.section];
  435. }
  436. }
  437. #pragma mark 通知
  438. - (void)IMChatHaveNewMsgNotification:(NSNotification*)notification
  439. {
  440. // [self.personCModel loadBadageDataWithView:self.tableHeadView];
  441. }
  442. #pragma mark 解决Segmented的滑块快速滑动时的延迟,同时把点击滑块的情况排除在外
  443. - (void)scrollViewDidScroll:(UIScrollView *)scrollView
  444. {
  445. if (!self.isUserNav)
  446. {
  447. self.scrollH = scrollView.contentOffset.y;
  448. [self setStateBackColor];
  449. }
  450. }
  451. #pragma mark 状态栏颜色的控制
  452. - (void)setStateBackColor
  453. {
  454. }
  455. #pragma mark - 判断当日是否签到
  456. - (void)requestDataToady{
  457. if (![IMAPlatform isAutoLogin])
  458. {
  459. return;
  460. }
  461. NSMutableDictionary *parmDict = [NSMutableDictionary dictionary];
  462. [parmDict setObject:@"index" forKey:@"ctl"];
  463. [parmDict setObject:@"is_signin" forKey:@"act"];
  464. FWWeakify(self)
  465. [[NetHttpsManager manager] POSTWithParameters:parmDict SuccessBlock:^(NSDictionary *responseJson) {
  466. FWStrongify(self)
  467. if ([responseJson toInt:@"today_signin"] == 0) {
  468. [self.tableHeadView.signButton setTitle:ASLocalizedString(@"签到") forState:UIControlStateNormal];
  469. }else{
  470. [self.tableHeadView.signButton setTitle:ASLocalizedString(@"已签到") forState:UIControlStateNormal];
  471. }
  472. } FailureBlock:^(NSError *error) {
  473. }];
  474. }
  475. #pragma mark ===============================================get方法==========================================================
  476. -(NSMutableArray *)titleArray{
  477. if (!_titleArray) {
  478. _titleArray = [[NSMutableArray alloc]initWithObjects:ASLocalizedString(@"我的小店"),ASLocalizedString(@"邀请赚钱"),ASLocalizedString(@"主播认证"),ASLocalizedString(@"分享收益"),ASLocalizedString(@"77票贡献榜"),ASLocalizedString(@"直播间收支记录"),ASLocalizedString(@"设置"),nil];
  479. }
  480. return _titleArray;
  481. }
  482. - (NSMutableArray *)imageArray
  483. {
  484. if (!_imageArray)
  485. {
  486. _imageArray = [[NSMutableArray alloc]initWithObjects:
  487. @"bogo_me_list_shop",@"bogo_me_list_invite",@"bogo_me_list_cert",@"bogo_me_list_shareIncome",@"bogo_me_list_Contribute",@"bogo_me_list_IncomeRecord",@"bogo_me_list_set", nil];
  488. }
  489. return _imageArray;
  490. }
  491. - (NSMutableArray *)detailArray
  492. {
  493. if (!_detailArray)
  494. {
  495. _detailArray = [[NSMutableArray alloc]initWithObjects:@"no",@"no",@"no",@"no",@"no",@"no",@"no",
  496. nil];
  497. }
  498. return _detailArray;
  499. }
  500. - (UITableView *)tableView
  501. {
  502. if (!_tableView)
  503. {
  504. if (self.isUserNav ==NO)
  505. {
  506. _tableView =[[UITableView alloc] initWithFrame:CGRectMake(0, kStatusBarHeight, kScreenW, kScreenH-kTabBarHeight - kStatusBarHeight - 10 ) style:UITableViewStylePlain];
  507. }
  508. else
  509. {
  510. _tableView =[[UITableView alloc] initWithFrame:CGRectMake(0, kStatusBarHeight, kScreenW, kScreenH-kStatusBarHeight-kNavigationBarHeight- kStatusBarHeight + 10) style:UITableViewStylePlain];
  511. }
  512. if (isIPhoneX()) {
  513. _tableView.top = MG_TOP_MARGIN;
  514. }
  515. _tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
  516. _tableView.dataSource = self;
  517. _tableView.delegate = self;
  518. _tableView.backgroundColor = kBackGroundColor;
  519. [_tableView registerNib:[UINib nibWithNibName:@"MPersonCenterCell" bundle:nil] forCellReuseIdentifier:@"MPersonCenterCell"];
  520. // _tableView.tableHeaderView = self.tableHeadView;
  521. _tableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero];
  522. // [BGMJRefreshManager refresh:_tableView target:self headerRereshAction:@selector(loadNetData) shouldHeaderBeginRefresh:YES footerRereshAction:nil];
  523. }
  524. return _tableView;
  525. }
  526. - (UIStatusBarStyle)preferredStatusBarStyle{
  527. if (@available(iOS 13, *)) {
  528. return UIStatusBarStyleDarkContent;
  529. }
  530. return UIStatusBarStyleDefault;
  531. }
  532. @end