RDSResetDeviceVC.m 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. //
  2. // RDSResetDeviceVC.m
  3. // Temperature
  4. //
  5. // Created by RD on 2023/1/10.
  6. //
  7. #import "RDSResetDeviceVC.h"
  8. #import "RDSAddRoomVC.h"
  9. #import "YXSetWifiViewController.h"
  10. @interface RDSResetDeviceVC ()
  11. @property (weak, nonatomic) IBOutlet UILabel *lab1;
  12. @property (weak, nonatomic) IBOutlet UILabel *lab2;
  13. @property (weak, nonatomic) IBOutlet UIImageView *imgView1;
  14. @property (weak, nonatomic) IBOutlet UIImageView *imgView2;
  15. @end
  16. @implementation RDSResetDeviceVC
  17. - (void)viewDidLoad {
  18. [super viewDidLoad];
  19. self.view.backgroundColor = [UIColor whiteColor];
  20. if (self.itemModel.steps == nil || self.itemModel.steps.count == 0) {
  21. [self createAlert];
  22. } else {
  23. [self createUI];
  24. }
  25. }
  26. -(void)createAlert
  27. {
  28. UIAlertController *alert = [UIAlertController alertControllerWithTitle:nil message:@"该设备暂不能添加" preferredStyle:UIAlertControllerStyleAlert];
  29. UIAlertAction *cancleAction = [UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) {
  30. [self.navigationController popViewControllerAnimated:YES];
  31. }];
  32. [alert addAction:cancleAction];
  33. [self presentViewController:self animated:YES completion:nil];
  34. }
  35. -(void)createUI
  36. {
  37. _lab1.text = @"1、永续精灵通电状态下,长按5秒钟,语音提示:进入配网状态 ,蓝色灯为快闪状态";
  38. _lab2.text = @"2、将手机靠近设备开始配网";
  39. _imgView1.image = [UIImage imageNamed:@"img_reset_1"];
  40. _imgView2.image = [UIImage imageNamed:@"img_reset_2"];
  41. }
  42. //-(void)createUI2
  43. //{
  44. // if(TheDataManager.rooms.count == 0){
  45. // switch (self.itemModel.deviceType) {
  46. // case RDSDeviceType_MasterController: {
  47. // UIFont *font = [UIFont systemFontOfSize:14];
  48. //
  49. // NSMutableDictionary *attributes = [NSMutableDictionary dictionary];
  50. // [attributes setObject:font forKey:NSFontAttributeName];
  51. // [attributes setObject:[UIColor colorWithHexString:@"#1E1E1E"] forKey:NSForegroundColorAttributeName];
  52. //
  53. // NSMutableDictionary *attributes2 = [NSMutableDictionary dictionary];
  54. // [attributes2 setObject:font forKey:NSFontAttributeName];
  55. // [attributes2 setObject:[UIColor colorWithHexString:@"#267AFF"] forKey:NSForegroundColorAttributeName];
  56. //
  57. // NSString *text = @"1. 主线控器开机状态下,长按 3s进入设置界面";
  58. // NSAttributedString *att = [[NSAttributedString alloc] initWithString:text attributes:attributes];
  59. //
  60. // NSString *text2 = @"【菜单键】";
  61. // NSAttributedString *att2 = [[NSAttributedString alloc] initWithString:text2 attributes:attributes2];
  62. //
  63. // NSString *text3 = @"3s进入设置界面";
  64. // NSAttributedString *att3 = [[NSAttributedString alloc] initWithString:text3 attributes:attributes];
  65. //
  66. // NSString *text4 = @"2. 再次长按";
  67. // NSAttributedString *att4 = [[NSAttributedString alloc] initWithString:text4 attributes:attributes];
  68. //
  69. // NSString *text5 = @",直到显示配网二维码";
  70. // NSAttributedString *att5 = [[NSAttributedString alloc] initWithString:text5 attributes:attributes];
  71. //
  72. // // 添加主控
  73. // NSMutableAttributedString *firstStr = [[NSMutableAttributedString alloc]init];
  74. // [firstStr appendAttributedString:att];
  75. // [firstStr appendAttributedString:att2];
  76. // [firstStr appendAttributedString:att3];
  77. // _lab1.attributedText = firstStr;
  78. //
  79. // NSMutableAttributedString *secondStr = [[NSMutableAttributedString alloc]init];
  80. // [secondStr appendAttributedString:att4];
  81. // [secondStr appendAttributedString:att2];
  82. // [secondStr appendAttributedString:att5];
  83. // _lab2.attributedText = secondStr;
  84. // _imgView1.image = [UIImage imageNamed:@"device_img_1"];
  85. // _imgView2.image = [UIImage imageNamed:@"device_img_2"];
  86. // break;
  87. // }
  88. // case RDSDeviceType_SubController: {
  89. // // 添加分控
  90. // _lab1.text = @"1、分控制器开机状态下,长按『菜单键』3s直到界面出现配网二维码";
  91. // _lab2.text = @"2、使用APP扫码绑定";
  92. // _imgView1.image = [UIImage imageNamed:@"img_reset_3"];
  93. // _imgView2.image = [UIImage imageNamed:@"img_reset_4"];
  94. // break;
  95. // }
  96. // case RDSDeviceType_IntelligentWaterCollector: {
  97. // // 添加集分水器
  98. // _lab1.text = @"1、永续精灵通电状态下,长按5秒钟,语音提示:进入配网状态 ,蓝色灯为快闪状态";
  99. // _lab2.text = @"2、将手机靠近设备开始配网";
  100. // _imgView1.image = [UIImage imageNamed:@"img_reset_1"];
  101. // _imgView2.image = [UIImage imageNamed:@"img_reset_2"];
  102. // break;
  103. // }
  104. // case RDSDeviceType_YongXuSpirit: {
  105. // // 添加永续精灵
  106. // _lab1.text = @"1、永续精灵通电状态下,长按5秒钟,语音提示:开始蓝牙配网 ,蓝色灯为快闪状态";
  107. // _lab2.text = @"2、将手机靠近设备开始配网";
  108. // _imgView1.image = [UIImage imageNamed:@"image_reset_5"];
  109. // _imgView2.image = [UIImage imageNamed:@"image_reset_5"];
  110. // break;
  111. // }
  112. // default:
  113. // break;
  114. // }
  115. //}
  116. - (IBAction)onNextBtnClick {
  117. // RDSAddRoomVC *vc = [[RDSAddRoomVC alloc] init];
  118. // vc.deviceTypeModel = self.deviceTypeModel;
  119. // [self pushViewController:vc animated:YES];
  120. YXSetWifiViewController *wifiVc = [[YXSetWifiViewController alloc]init];
  121. [self pushViewController:wifiVc animated:YES];
  122. }
  123. @end