123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143 |
- //
- // RDSResetDeviceVC.m
- // Temperature
- //
- // Created by RD on 2023/1/10.
- //
- #import "RDSResetDeviceVC.h"
- #import "RDSAddRoomVC.h"
- #import "YXSetWifiViewController.h"
- @interface RDSResetDeviceVC ()
- @property (weak, nonatomic) IBOutlet UILabel *lab1;
- @property (weak, nonatomic) IBOutlet UILabel *lab2;
- @property (weak, nonatomic) IBOutlet UIImageView *imgView1;
- @property (weak, nonatomic) IBOutlet UIImageView *imgView2;
- @end
- @implementation RDSResetDeviceVC
- - (void)viewDidLoad {
- [super viewDidLoad];
-
- self.view.backgroundColor = [UIColor whiteColor];
-
- if (self.itemModel.steps == nil || self.itemModel.steps.count == 0) {
- [self createAlert];
- } else {
- [self createUI];
- }
-
- }
- -(void)createAlert
- {
- UIAlertController *alert = [UIAlertController alertControllerWithTitle:nil message:@"该设备暂不能添加" preferredStyle:UIAlertControllerStyleAlert];
-
- UIAlertAction *cancleAction = [UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) {
- [self.navigationController popViewControllerAnimated:YES];
- }];
-
- [alert addAction:cancleAction];
-
- [self presentViewController:self animated:YES completion:nil];
-
- }
- -(void)createUI
- {
- _lab1.text = @"1、永续精灵通电状态下,长按5秒钟,语音提示:进入配网状态 ,蓝色灯为快闪状态";
- _lab2.text = @"2、将手机靠近设备开始配网";
- _imgView1.image = [UIImage imageNamed:@"img_reset_1"];
- _imgView2.image = [UIImage imageNamed:@"img_reset_2"];
- }
- //-(void)createUI2
- //{
- // if(TheDataManager.rooms.count == 0){
- // switch (self.itemModel.deviceType) {
- // case RDSDeviceType_MasterController: {
- // UIFont *font = [UIFont systemFontOfSize:14];
- //
- // NSMutableDictionary *attributes = [NSMutableDictionary dictionary];
- // [attributes setObject:font forKey:NSFontAttributeName];
- // [attributes setObject:[UIColor colorWithHexString:@"#1E1E1E"] forKey:NSForegroundColorAttributeName];
- //
- // NSMutableDictionary *attributes2 = [NSMutableDictionary dictionary];
- // [attributes2 setObject:font forKey:NSFontAttributeName];
- // [attributes2 setObject:[UIColor colorWithHexString:@"#267AFF"] forKey:NSForegroundColorAttributeName];
- //
- // NSString *text = @"1. 主线控器开机状态下,长按 3s进入设置界面";
- // NSAttributedString *att = [[NSAttributedString alloc] initWithString:text attributes:attributes];
- //
- // NSString *text2 = @"【菜单键】";
- // NSAttributedString *att2 = [[NSAttributedString alloc] initWithString:text2 attributes:attributes2];
- //
- // NSString *text3 = @"3s进入设置界面";
- // NSAttributedString *att3 = [[NSAttributedString alloc] initWithString:text3 attributes:attributes];
- //
- // NSString *text4 = @"2. 再次长按";
- // NSAttributedString *att4 = [[NSAttributedString alloc] initWithString:text4 attributes:attributes];
- //
- // NSString *text5 = @",直到显示配网二维码";
- // NSAttributedString *att5 = [[NSAttributedString alloc] initWithString:text5 attributes:attributes];
- //
- // // 添加主控
- // NSMutableAttributedString *firstStr = [[NSMutableAttributedString alloc]init];
- // [firstStr appendAttributedString:att];
- // [firstStr appendAttributedString:att2];
- // [firstStr appendAttributedString:att3];
- // _lab1.attributedText = firstStr;
- //
- // NSMutableAttributedString *secondStr = [[NSMutableAttributedString alloc]init];
- // [secondStr appendAttributedString:att4];
- // [secondStr appendAttributedString:att2];
- // [secondStr appendAttributedString:att5];
- // _lab2.attributedText = secondStr;
- // _imgView1.image = [UIImage imageNamed:@"device_img_1"];
- // _imgView2.image = [UIImage imageNamed:@"device_img_2"];
- // break;
- // }
- // case RDSDeviceType_SubController: {
- // // 添加分控
- // _lab1.text = @"1、分控制器开机状态下,长按『菜单键』3s直到界面出现配网二维码";
- // _lab2.text = @"2、使用APP扫码绑定";
- // _imgView1.image = [UIImage imageNamed:@"img_reset_3"];
- // _imgView2.image = [UIImage imageNamed:@"img_reset_4"];
- // break;
- // }
- // case RDSDeviceType_IntelligentWaterCollector: {
- // // 添加集分水器
- // _lab1.text = @"1、永续精灵通电状态下,长按5秒钟,语音提示:进入配网状态 ,蓝色灯为快闪状态";
- // _lab2.text = @"2、将手机靠近设备开始配网";
- // _imgView1.image = [UIImage imageNamed:@"img_reset_1"];
- // _imgView2.image = [UIImage imageNamed:@"img_reset_2"];
- // break;
- // }
- // case RDSDeviceType_YongXuSpirit: {
- // // 添加永续精灵
- // _lab1.text = @"1、永续精灵通电状态下,长按5秒钟,语音提示:开始蓝牙配网 ,蓝色灯为快闪状态";
- // _lab2.text = @"2、将手机靠近设备开始配网";
- // _imgView1.image = [UIImage imageNamed:@"image_reset_5"];
- // _imgView2.image = [UIImage imageNamed:@"image_reset_5"];
- // break;
- // }
- // default:
- // break;
- // }
- //}
- - (IBAction)onNextBtnClick {
-
- // RDSAddRoomVC *vc = [[RDSAddRoomVC alloc] init];
- // vc.deviceTypeModel = self.deviceTypeModel;
- // [self pushViewController:vc animated:YES];
-
- YXSetWifiViewController *wifiVc = [[YXSetWifiViewController alloc]init];
- [self pushViewController:wifiVc animated:YES];
- }
- @end
|