MySetViewController.m 32 KB

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