MySetViewController.m 22 KB

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