MySetViewController.m 26 KB

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