MySetViewController.m 22 KB

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