MySetViewController.m 29 KB

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