MySetViewController.m 29 KB

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