MySetViewController.m 28 KB

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