MySetViewController.m 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557
  1. //
  2. // MySetViewController.m
  3. // 双子星云手机
  4. //
  5. // Created by APPLE on 2023/8/17.
  6. //
  7. #import "MySetViewController.h"
  8. #import <SDWebImage.h>
  9. #import <Masonry.h>
  10. #import "HelpDownScrollView.h"
  11. #import "MineViewCell.h"
  12. #import "ChangeLogoViewController.h"
  13. #import "HidenMaskSetViewController.h"
  14. #import "CustomerWebViewController.h"
  15. #import "AboutViewController.h"
  16. #import "iPhone.h"
  17. #import "CloudPhoneAPI.h"
  18. #import "ComontAlretViewController.h"
  19. #import "ModifyPWDFirstViewController.h"
  20. #import "TipsQRCodeForChangeDeviceViewController.h"
  21. #import "connectDeviceManager.h"
  22. #import "mySetHeadView.h"
  23. #import "uploadImageOrVideoViewController.h"
  24. #import "TZImagePickerController.h"
  25. #import "uploadFileRecordViewController.h"
  26. #import "privacyModeViewController.h"
  27. #import "TvStatusModel.h"
  28. @interface MySetViewController ()<HelpDownScrollViewDelegate,UITableViewDelegate,UITableViewDataSource,ComontAlretViewControllerDelegate>
  29. {
  30. UILabel *phoneLabel;
  31. UILabel *vipTypeTipsLabel;
  32. UIButton *tvP2PBtn;
  33. }
  34. @property (nonatomic, strong, nullable) UITableView *tableView;
  35. @end
  36. @implementation MySetViewController
  37. - (void)viewDidLoad {
  38. [super viewDidLoad];
  39. // Do any additional setup after loading the view.
  40. [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(getCouldPhoneTvStatusFun:) name:getCouldPhoneTvStatusNotification object:nil];
  41. [self drawAnyView];
  42. }
  43. - (void)viewWillAppear:(BOOL)animated
  44. {
  45. [super viewWillAppear:animated];
  46. if(_getTvStatus){
  47. _getTvStatus();
  48. }
  49. }
  50. - (void)drawAnyView{
  51. [self.view setBackgroundColor:HWF5F7FAColor];
  52. [self.toolBar setHidden:YES];
  53. [self.navigationBar setHidden:YES];
  54. [self.navBarBGView setHidden:NO];
  55. [self.titleLabel setText:NSLocalizedString(@"more_set",nil)];
  56. [self.view addSubview:self.tableView];
  57. [self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
  58. make.left.mas_equalTo(0);
  59. make.right.mas_equalTo(0);
  60. make.bottom.mas_equalTo(0);
  61. make.top.equalTo(self.navBarBGView.mas_bottom).offset(5.f);
  62. }];
  63. }
  64. - (UIView *)tableHeadView{
  65. UIView *bgView = [[UIView alloc] initWithFrame:(CGRectMake(0, 0, SCREEN_W, 108.f + 15))];
  66. [bgView setBackgroundColor:[UIColor clearColor]];
  67. mySetHeadView *headView = [[mySetHeadView alloc] init];
  68. [bgView addSubview:headView];
  69. headView.layer.cornerRadius = 8;
  70. headView.layer.masksToBounds = YES;
  71. [headView mas_makeConstraints:^(MASConstraintMaker *make) {
  72. make.left.mas_equalTo(15);
  73. make.right.mas_equalTo(-15);
  74. make.top.mas_equalTo(0);
  75. make.bottom.mas_equalTo(-15);
  76. }];
  77. KWeakSelf
  78. #pragma mark 上传文件相关处理
  79. headView.didClickBut = ^(NSInteger tag) {
  80. [weakSelf didClickUploadFileByTag:tag];
  81. };
  82. return bgView;
  83. }
  84. #pragma mark 点击文件上传相关
  85. - (void)didClickUploadFileByTag:(NSInteger)tag
  86. {
  87. if(tag ==2 || tag ==3){
  88. if(self->_getBaseInfo){
  89. self->_getBaseInfo();
  90. }
  91. uploadImageOrVideoViewController *vc = [uploadImageOrVideoViewController new];
  92. if(tag ==2){
  93. vc.isPhotoType = YES;
  94. }
  95. else{
  96. vc.isPhotoType = NO;
  97. }
  98. [self.navigationController pushViewController:vc animated:YES];
  99. }
  100. else if(tag == 1){
  101. uploadFileRecordViewController *vc = [uploadFileRecordViewController new];
  102. vc.isNotUploadingType = YES;
  103. [self.navigationController pushViewController:vc animated:YES];
  104. }
  105. }
  106. - (UIView *)tableFoorView{
  107. UIView *bgView = [[UIView alloc] initWithFrame:(CGRectMake(0, 0, SCREEN_W, 68.f))];
  108. [bgView setBackgroundColor:[UIColor clearColor]];
  109. tvP2PBtn = [[UIButton alloc] initWithFrame:(CGRectMake(15, 20, SCREEN_W - 2*15.f, 48.f))];
  110. [tvP2PBtn setBackgroundColor:HWFFFFFFColor];
  111. [tvP2PBtn setTitle:NSLocalizedString(@"my_set_no_TV_p2p",nil) forState:(UIControlStateNormal)];
  112. [tvP2PBtn setTitle:NSLocalizedString(@"my_set_no_close_TV_p2p",nil) forState:(UIControlStateSelected)];
  113. [tvP2PBtn setTitleColor:HW0A132BColor forState:(UIControlStateNormal)];
  114. [tvP2PBtn.titleLabel setFont:[UIFont boldSystemFontOfSize:14.f]];
  115. [tvP2PBtn addTarget:self
  116. action:@selector(tvP2PBtnPressed)
  117. forControlEvents:(UIControlEventTouchUpInside)];
  118. [tvP2PBtn.layer setCornerRadius:8.f];
  119. [bgView addSubview:tvP2PBtn];
  120. return bgView;
  121. }
  122. #pragma mark 点击投屏
  123. - (void)tvP2PBtnPressed{
  124. if(tvP2PBtn.selected)
  125. {
  126. [self showCloseTVP2PFun];
  127. }
  128. else{
  129. [self showTVP2PFun];
  130. }
  131. }
  132. #pragma mark 显示投屏提示语
  133. - (void)showTVP2PFun{
  134. /*弹窗提示TV投屏*/
  135. ComontAlretViewController *nextVC = [[ComontAlretViewController alloc] initWithTiTle:NSLocalizedString(@"my_set_TVP2P_Open_title",nil)
  136. msg:NSLocalizedString(@"my_set_TVP2P_Open_Subtitle",nil)
  137. imageStr:nil
  138. cancelTitle:NSLocalizedString(@"my_set_TVP2P_Open_sure",nil)
  139. okTitle:nil isOkBtnHighlight:NO
  140. didClickOk:^{
  141. HLog(@"111");
  142. } didClickCancel:^{
  143. //HLog(@"2222");
  144. [self gotoSetTVP2PFun];
  145. }];
  146. nextVC.modalPresentationStyle = UIModalPresentationCustom;
  147. [self presentViewController:nextVC animated:YES completion:^{
  148. nextVC.view.superview.backgroundColor = [UIColor clearColor];
  149. }];
  150. }
  151. #pragma mark 确认开始TV投屏
  152. -(void)gotoSetTVP2PFun
  153. {
  154. if(_needToTVP2P){
  155. _needToTVP2P();
  156. }
  157. [self.navigationController popViewControllerAnimated:YES];
  158. }
  159. #pragma mark 显示关闭投屏提示语
  160. - (void)showCloseTVP2PFun{
  161. /*弹窗提示TV投屏*/
  162. ComontAlretViewController *nextVC = [[ComontAlretViewController alloc] initWithTiTle:NSLocalizedString(@"my_set_no_close_TV_p2p_tip",nil)
  163. msg:nil
  164. imageStr:nil
  165. cancelTitle:NSLocalizedString(@"other_cancel",nil)
  166. okTitle:NSLocalizedString(@"my_set_TVP2P_Open_sure",nil) isOkBtnHighlight:YES
  167. didClickOk:^{
  168. [self gotoCloseTVP2PFun];
  169. } didClickCancel:^{
  170. //HLog(@"2222");
  171. }];
  172. nextVC.modalPresentationStyle = UIModalPresentationCustom;
  173. [self presentViewController:nextVC animated:YES completion:^{
  174. nextVC.view.superview.backgroundColor = [UIColor clearColor];
  175. }];
  176. }
  177. #pragma mark 确认开始TV投屏
  178. -(void)gotoCloseTVP2PFun
  179. {
  180. if(_closeTVP2P){
  181. _closeTVP2P();
  182. tvP2PBtn.selected = NO;
  183. }
  184. tvP2PBtn.userInteractionEnabled = NO;
  185. dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
  186. self->tvP2PBtn.userInteractionEnabled = YES;
  187. });
  188. }
  189. - (void)helpDownScrollViewBePressed:(nonnull id)sender withIndex:(NSInteger)index {
  190. HLog(@"\n----点击了第个%ld按钮----",index);
  191. if (index == 0){
  192. ChangeLogoViewController *nextVC = [[ChangeLogoViewController alloc] init];
  193. [self.navigationController pushViewController:nextVC animated:YES];
  194. }else if (index == 1){/**/
  195. HidenMaskSetViewController *nextVC = [[HidenMaskSetViewController alloc] init];
  196. [self.navigationController pushViewController:nextVC animated:YES];
  197. }
  198. }
  199. #pragma mark - 懒加载
  200. - (UITableView *)tableView{
  201. if (!_tableView) {
  202. _tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_W, SCREEN_H - TABBARHEIGHT) style:UITableViewStylePlain];
  203. _tableView.delegate = self;
  204. _tableView.dataSource = self;
  205. _tableView.showsVerticalScrollIndicator = NO;
  206. _tableView.showsHorizontalScrollIndicator = NO;
  207. // _tableView.contentInset = UIEdgeInsetsMake(-H_STATE_BAR, 0, 0, 0);
  208. [_tableView setSeparatorStyle:(UITableViewCellSeparatorStyleNone)];
  209. [_tableView setSeparatorColor:[UIColor clearColor]];
  210. [_tableView setBackgroundColor:[UIColor clearColor]];
  211. [_tableView setTableFooterView:[UIView new]];
  212. [_tableView setBounces:YES];
  213. if (@available(iOS 15.0, *)) {
  214. _tableView.sectionHeaderTopPadding = 0;
  215. }
  216. [_tableView setTableFooterView:[self tableFoorView]];
  217. [_tableView setTableHeaderView:[self tableHeadView]];
  218. }
  219. return _tableView;
  220. }
  221. #pragma mark - 列表委托
  222. - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
  223. return 1;
  224. }
  225. - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
  226. return 6;
  227. //return 5;//去掉更换icon
  228. }
  229. - (MineViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
  230. NSInteger row = indexPath.row;
  231. static NSString *identifier = @"MineViewCell";
  232. MineViewCell * cell = [tableView dequeueReusableCellWithIdentifier:identifier];
  233. cell.selectionStyle = UITableViewCellSelectionStyleNone;
  234. if (!cell){
  235. cell = [[MineViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:identifier];
  236. [cell setSelectionStyle:UITableViewCellSelectionStyleNone];
  237. [cell setBackgroundColor:[UIColor clearColor]];
  238. [cell setAccessoryType:(UITableViewCellAccessoryNone)];
  239. }
  240. [cell.bgViewLayer removeFromSuperlayer];
  241. [cell.titleLabel2 setHidden:YES];
  242. [cell.rightImage setHidden:NO];
  243. [cell.lineView setHidden:NO];
  244. [cell.maskSwitch setHidden:YES];
  245. if (row == 0){
  246. [cell.titleLabel setText:NSLocalizedString(@"my_set_Privacy_Model",nil)];
  247. [cell.mImageView setImage:[UIImage imageNamed:@"icon_Privacy_model"]];
  248. // [cell.titleLabel setText:NSLocalizedString(@"my_set_no_modify_pwd",nil)];
  249. // [cell.mImageView setImage:[UIImage imageNamed:@"mdoify_pwd"]];
  250. /*上圆角*/
  251. //设置部分圆角 贝塞尔曲线
  252. UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, SCREEN_W-30 , 60)
  253. byRoundingCorners:UIRectCornerTopLeft | UIRectCornerTopRight
  254. cornerRadii:CGSizeMake(8, 8)];
  255. CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
  256. maskLayer.frame = cell.cellBgView.bounds;
  257. maskLayer.path = maskPath.CGPath;
  258. cell.bgViewLayer = maskLayer;
  259. cell.cellBgView.layer.mask = cell.bgViewLayer;
  260. // }else if (row == 1){
  261. // [cell.titleLabel setText:NSLocalizedString(@"my_set_no_change_logo",nil)];
  262. // [cell.mImageView setImage:[UIImage imageNamed:@"icon_change_logo"]];
  263. // // }else if (row == 2){
  264. // // [cell.titleLabel setText:NSLocalizedString(@"mask_view_hiden_set_hiden",nil)];
  265. // // [cell.mImageView setImage:[UIImage imageNamed:@"icon-jincheng"]];
  266. // // }else if (row == 3){
  267. // }else if (row == 1){
  268. // [cell.titleLabel setText:NSLocalizedString(@"my_set_no_fanzhuan_exit",nil)];
  269. // [cell.mImageView setImage:[UIImage imageNamed:@"fanzhuan"]];
  270. // [cell.rightImage setHidden:YES];
  271. // [cell.maskSwitch setHidden:NO];
  272. //}else if (row == 4){/*版本信息*/
  273. }else if (row == 1){/*版本信息*/
  274. [cell.titleLabel setText:NSLocalizedString(@"my_set_no_check_update",nil)];
  275. [cell.mImageView setImage:[UIImage imageNamed:@"app_update"]];
  276. [cell.titleLabel2 setText:[iPhone appVersion]];
  277. [cell.titleLabel2 setHidden:NO];
  278. //}else if (row == 5){/*更换设备*/
  279. }else if (row == 2){/*更换设备*/
  280. [cell.titleLabel setText:NSLocalizedString(@"my_set_no_change_phone",nil)];
  281. [cell.mImageView setImage:[UIImage imageNamed:@"icon_change_ohone"]];
  282. //}else if (row == 6){
  283. }else if (row == 3){/*常见问题*/
  284. [cell.titleLabel setText:NSLocalizedString(@"my_set_no_common_problem",nil)];
  285. [cell.mImageView setImage:[UIImage imageNamed:@"icon_common_problem"]];
  286. }else if (row == 4){/*回复出厂*/
  287. [cell.titleLabel setText:NSLocalizedString(@"my_set_no_Restore_Factory",nil)];
  288. [cell.mImageView setImage:[UIImage imageNamed:@"icon_Restore_Factory"]];
  289. }else if (row == 5){/*重启空间*/
  290. [cell.titleLabel setText:NSLocalizedString(@"my_set_no_restart_phone",nil)];
  291. [cell.mImageView setImage:[UIImage imageNamed:@"icon-gengxin"]];
  292. /*下圆角*/
  293. UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, SCREEN_W-30 , 60)
  294. byRoundingCorners:UIRectCornerBottomLeft | UIRectCornerBottomRight
  295. cornerRadii:CGSizeMake(8, 8)];
  296. CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
  297. maskLayer.frame = cell.cellBgView.bounds;
  298. maskLayer.path = maskPath.CGPath;
  299. cell.bgViewLayer = maskLayer;
  300. cell.cellBgView.layer.mask = cell.bgViewLayer;
  301. [cell.lineView setHidden:YES];
  302. }
  303. return cell;
  304. }
  305. - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
  306. return 60;
  307. }
  308. - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
  309. [tableView deselectRowAtIndexPath:indexPath animated:YES];
  310. NSInteger row = indexPath.row;
  311. if (0 == row){
  312. privacyModeViewController *nextVC = [[privacyModeViewController alloc] init];
  313. [self.navigationController pushViewController:nextVC animated:YES];
  314. /*修改密码*/
  315. // ModifyPWDFirstViewController *nextVC = [[ModifyPWDFirstViewController alloc] init];
  316. // [self.navigationController pushViewController:nextVC animated:YES];
  317. // }else if (1 == row){
  318. // /*更换图标*/
  319. // ChangeLogoViewController *nextVC = [[ChangeLogoViewController alloc] init];
  320. // [self.navigationController pushViewController:nextVC animated:YES];
  321. // }else if (1 == row){/*进城隐藏*/
  322. // HidenMaskSetViewController *nextVC = [[HidenMaskSetViewController alloc] init];
  323. // [self.navigationController pushViewController:nextVC animated:YES];
  324. // }else if (3 == row){/*设备翻转*/
  325. // ;
  326. }
  327. //else if (4 == row){/*版本信息*/
  328. else if (1 == row){/*版本信息*/
  329. AboutViewController *vc = [[AboutViewController alloc] init];
  330. vc.getSysInfo = ^{
  331. if(self->_getSysInfo){
  332. self->_getSysInfo();
  333. }
  334. };
  335. [self.navigationController pushViewController:vc animated:YES];
  336. //}else if (5 == row){/*更换设备*/
  337. }else if (2 == row){/*更换设备*/
  338. TipsQRCodeForChangeDeviceViewController *vc = [[TipsQRCodeForChangeDeviceViewController alloc] init];
  339. [self.navigationController pushViewController:vc animated:YES];
  340. }else if (3 == row){/*常见问题*/
  341. CustomerWebViewController *vc = [[CustomerWebViewController alloc] init];
  342. vc.titleStr = NSLocalizedString(@"my_set_no_common_problem",nil);
  343. NSString *url = @"https://cliys.armclouding.com/h5/microserviceUserH5/commonProblem/questionIndex.html";
  344. vc.webUrl = url;
  345. [self.navigationController pushViewController:vc animated:YES];
  346. }else if (4 == row){/*恢复出厂*/
  347. [self RestoreFactoryAleartFun];
  348. }else if (5 == row){/*重启空间*/
  349. /*弹窗提示重启*/
  350. ComontAlretViewController *nextVC = [[ComontAlretViewController alloc] initWithTiTle:NSLocalizedString(@"my_set_no_restart_phone_tips",nil)
  351. msg:nil
  352. imageStr:nil
  353. cancelTitle:NSLocalizedString(@"other_cancel",nil)
  354. okTitle:NSLocalizedString(@"my_set_no_restart_phone_btn_ok",nil) isOkBtnHighlight:NO
  355. didClickOk:^{
  356. } didClickCancel:^{
  357. }];
  358. nextVC.modalPresentationStyle = UIModalPresentationCustom;
  359. nextVC.delegate = self;
  360. [self presentViewController:nextVC animated:YES completion:^{
  361. nextVC.view.superview.backgroundColor = [UIColor clearColor];
  362. }];
  363. }
  364. }
  365. - (void)CommonAlertokBtnClickPressed{
  366. // /*重启云手机*/
  367. // 通过指令通道发送 {"type":"reboot"}
  368. if(_needToReboot){
  369. _needToReboot();
  370. }
  371. //提示语
  372. [[iToast makeText:NSLocalizedString(@"player_link_rebooting_Tips",nil)] show];
  373. }
  374. #pragma mark 点击恢复出厂
  375. - (void)RestoreFactoryAleartFun
  376. {
  377. KWeakSelf
  378. /*弹窗提示恢复出厂*/
  379. ComontAlretViewController *nextVC = [[ComontAlretViewController alloc] initWithTiTle:NSLocalizedString(@"my_set_no_Restore_Factory_tips",nil)
  380. msg:NSLocalizedString(@"my_set_no_Restore_Factory_msg",nil)
  381. imageStr:@"icon_Restore_Factory_big"
  382. cancelTitle:NSLocalizedString(@"my_set_TVP2P_Open_sure",nil)
  383. okTitle:NSLocalizedString(@"other_cancel",nil) isOkBtnHighlight:YES
  384. didClickOk:^{
  385. } didClickCancel:^{
  386. //点击确定
  387. [weakSelf gotoResetFun];
  388. }];
  389. nextVC.modalPresentationStyle = UIModalPresentationCustom;
  390. [self presentViewController:nextVC animated:YES completion:^{
  391. nextVC.view.superview.backgroundColor = [UIColor clearColor];
  392. }];
  393. }
  394. #pragma mark 点击了恢复出厂
  395. - (void)gotoResetFun
  396. {
  397. if(_needToReset){
  398. _needToReset();
  399. }
  400. [self RestoreFactoryingFun];
  401. }
  402. #pragma mark 恢复出厂中
  403. - (void)RestoreFactoryingFun
  404. {
  405. KWeakSelf
  406. /*弹窗提示恢复出厂*/
  407. ComontAlretViewController *nextVC = [[ComontAlretViewController alloc] initWithTiTle:NSLocalizedString(@"my_set_no_Restore_Factorying_tips",nil)
  408. msg:NSLocalizedString(@"my_set_no_Restore_Factorying_msg",nil)
  409. imageStr:nil
  410. cancelTitle:NSLocalizedString(@"my_set_no_Restore_Factorying",nil)
  411. okTitle:nil
  412. isOkBtnHighlight:NO
  413. didClickOk:^{
  414. [weakSelf RestoreFactoryCompleteFun];
  415. } didClickCancel:^{
  416. }];
  417. [nextVC setButtonCountdownFun:180];//90
  418. nextVC.modalPresentationStyle = UIModalPresentationCustom;
  419. [self presentViewController:nextVC animated:YES completion:^{
  420. nextVC.view.superview.backgroundColor = [UIColor clearColor];
  421. }];
  422. }
  423. #pragma mark 恢复出厂倒计时结束
  424. - (void)RestoreFactoryCompleteFun
  425. {
  426. KWeakSelf
  427. //瑞云发起重连
  428. NSString *snStr = [connectDeviceManager shareInstance].DeviceThirdIdMod.data.sn;
  429. if(snStr){
  430. [[connectDeviceManager shareInstance] getThridMsgBySN:snStr needReconnect:YES didNetEnd:^(bool didSuc) {
  431. if(didSuc){
  432. if(self->_needToResetAndOk){
  433. self->_needToResetAndOk();
  434. }
  435. }
  436. else{
  437. [weakSelf RestoreFactoryCompleteFun];
  438. return;
  439. }
  440. }];
  441. }
  442. /*弹窗提示恢复出厂*/
  443. ComontAlretViewController *nextVC = [[ComontAlretViewController alloc] initWithTiTle:NSLocalizedString(@"my_set_no_Restore_Factory_ok_tips",nil)
  444. msg:NSLocalizedString(@"my_set_no_Restore_Factory_ok_msg",nil)
  445. imageStr:nil
  446. cancelTitle:NSLocalizedString(@"my_set_no_Restore_FactoryOK",nil)
  447. okTitle:nil
  448. isOkBtnHighlight:NO
  449. didClickOk:^{
  450. } didClickCancel:^{
  451. [weakSelf.navigationController popViewControllerAnimated:YES];
  452. }];
  453. nextVC.modalPresentationStyle = UIModalPresentationCustom;
  454. [self presentViewController:nextVC animated:YES completion:^{
  455. nextVC.view.superview.backgroundColor = [UIColor clearColor];
  456. }];
  457. }
  458. - (void)getCouldPhoneTvStatusFun:(NSNotification*)not
  459. {
  460. TvStatusModel *model = [not object];
  461. //HLog(@"%@",baseInfoModel);
  462. if(!model || ![model isKindOfClass:[TvStatusModel class]]){
  463. return;
  464. }
  465. if([model.msg containsString:@"PushStreamBActivity"]){
  466. tvP2PBtn.selected = YES;
  467. }
  468. else{
  469. tvP2PBtn.selected = NO;
  470. }
  471. }
  472. @end