MySetViewController.m 27 KB

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