MySetViewController.m 33 KB

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