MySetViewController.m 26 KB

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