完成设备修改页面
This commit is contained in:
parent
df311d475c
commit
68d441eb0d
|
|
@ -2458,6 +2458,7 @@
|
|||
E51D7D51208CDB5B001FF053 /* RuiMeiSetViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E51D7D50208CDB5B001FF053 /* RuiMeiSetViewController.m */; };
|
||||
E51D7D55208CE08D001FF053 /* CustomModeSetCell.m in Sources */ = {isa = PBXBuildFile; fileRef = E51D7D53208CE08D001FF053 /* CustomModeSetCell.m */; };
|
||||
E51D7D58208CE121001FF053 /* CustomModeSetCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = E51D7D57208CE120001FF053 /* CustomModeSetCell.xib */; };
|
||||
E51D7D5B208CF4E7001FF053 /* RuiMeiInputViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E51D7D5A208CF4E7001FF053 /* RuiMeiInputViewController.m */; };
|
||||
E547870B20728F390060C2C2 /* back_btn@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = E547870A20728F380060C2C2 /* back_btn@2x.png */; };
|
||||
E547870F2073192E0060C2C2 /* introlImage_iphonex_1.jpg in Resources */ = {isa = PBXBuildFile; fileRef = E547870C2073192D0060C2C2 /* introlImage_iphonex_1.jpg */; };
|
||||
E54787102073192E0060C2C2 /* introlImage_iphonex_2.jpg in Resources */ = {isa = PBXBuildFile; fileRef = E547870D2073192D0060C2C2 /* introlImage_iphonex_2.jpg */; };
|
||||
|
|
@ -6234,6 +6235,8 @@
|
|||
E51D7D52208CE08D001FF053 /* CustomModeSetCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CustomModeSetCell.h; sourceTree = "<group>"; };
|
||||
E51D7D53208CE08D001FF053 /* CustomModeSetCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CustomModeSetCell.m; sourceTree = "<group>"; };
|
||||
E51D7D57208CE120001FF053 /* CustomModeSetCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = CustomModeSetCell.xib; sourceTree = "<group>"; };
|
||||
E51D7D59208CF4E7001FF053 /* RuiMeiInputViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RuiMeiInputViewController.h; sourceTree = "<group>"; };
|
||||
E51D7D5A208CF4E7001FF053 /* RuiMeiInputViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RuiMeiInputViewController.m; sourceTree = "<group>"; };
|
||||
E547870A20728F380060C2C2 /* back_btn@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "back_btn@2x.png"; sourceTree = "<group>"; };
|
||||
E547870C2073192D0060C2C2 /* introlImage_iphonex_1.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = introlImage_iphonex_1.jpg; sourceTree = "<group>"; };
|
||||
E547870D2073192D0060C2C2 /* introlImage_iphonex_2.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = introlImage_iphonex_2.jpg; sourceTree = "<group>"; };
|
||||
|
|
@ -13775,6 +13778,8 @@
|
|||
E51D7D4D208CD5C8001FF053 /* RuiMeiCHControl.m */,
|
||||
E51D7D4F208CDB5B001FF053 /* RuiMeiSetViewController.h */,
|
||||
E51D7D50208CDB5B001FF053 /* RuiMeiSetViewController.m */,
|
||||
E51D7D59208CF4E7001FF053 /* RuiMeiInputViewController.h */,
|
||||
E51D7D5A208CF4E7001FF053 /* RuiMeiInputViewController.m */,
|
||||
);
|
||||
path = RuiMei;
|
||||
sourceTree = "<group>";
|
||||
|
|
@ -16282,6 +16287,7 @@
|
|||
88602FB11E124AF900F3DB5D /* NTESSessionCustomContentConfig.m in Sources */,
|
||||
881F0F4F1D73DF4E0091507E /* BaoGaoViewFirstCell.m in Sources */,
|
||||
88F5EFBC1D48D08100CC7CAF /* AsyncSocket.m in Sources */,
|
||||
E51D7D5B208CF4E7001FF053 /* RuiMeiInputViewController.m in Sources */,
|
||||
881672241EA5DE2B00BEBF23 /* UMComSelectTopicCell.m in Sources */,
|
||||
883E78BC1D48A5E50030E075 /* FListManager.m in Sources */,
|
||||
88602A1B1E10BC3400F3DB5D /* NIMContactDataCell.m in Sources */,
|
||||
|
|
|
|||
|
|
@ -0,0 +1,13 @@
|
|||
//
|
||||
// RuiMeiInputViewController.h
|
||||
// Ifish
|
||||
//
|
||||
// Created by Minghao Xue on 2018/4/23.
|
||||
// Copyright © 2018年 lianlian. All rights reserved.
|
||||
//
|
||||
|
||||
#import "IfishDeviceControlNameBaseController.h"
|
||||
|
||||
@interface RuiMeiInputViewController : IfishDeviceControlNameBaseController
|
||||
|
||||
@end
|
||||
|
|
@ -0,0 +1,157 @@
|
|||
//
|
||||
// RuiMeiInputViewController.m
|
||||
// Ifish
|
||||
//
|
||||
// Created by Minghao Xue on 2018/4/23.
|
||||
// Copyright © 2018年 lianlian. All rights reserved.
|
||||
//
|
||||
|
||||
#import "RuiMeiInputViewController.h"
|
||||
#import "RuSunChangeNameTextViewCell.h"
|
||||
#define RUSUNCHCELL_CH1 20000
|
||||
#define RUSUNCHCELL_CH2 20001
|
||||
#define RUSUNCHCELL_CH3 20002
|
||||
#define RUSUNCHCELL_CH4 20003
|
||||
#define RUSUNCHCELL_JIARE 20004
|
||||
#import "RuiMeiCHNameCustom.h"
|
||||
#import "RuiMeiCHControl.h"
|
||||
#import "UserExtendataArchaver.h"
|
||||
|
||||
@interface RuiMeiInputViewController ()
|
||||
|
||||
@end
|
||||
|
||||
@implementation RuiMeiInputViewController
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
self.tableView.dataSource =self;
|
||||
}
|
||||
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
|
||||
|
||||
if (section==0) {
|
||||
|
||||
return 1;
|
||||
|
||||
}else{
|
||||
|
||||
return 5;
|
||||
}
|
||||
}
|
||||
|
||||
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
|
||||
|
||||
return 2;
|
||||
}
|
||||
|
||||
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
|
||||
|
||||
if (indexPath.section==0) {
|
||||
|
||||
return [super baseViewLoadDeviceNameCell:indexPath intable:tableView];
|
||||
}
|
||||
|
||||
RuSunChangeNameTextViewCell*cell=[tableView dequeueReusableCellWithIdentifier:@"RuSunChangeNameTextViewCell"];
|
||||
if (cell==nil) {
|
||||
cell= [[[NSBundle mainBundle]loadNibNamed:@"RuSunChangeNameTextViewCell" owner:self options:nil]lastObject];
|
||||
|
||||
}
|
||||
|
||||
//控制原名
|
||||
if (indexPath.row==4&&indexPath.section==1) {
|
||||
cell.lineImgView.image = [UIImage imageNamed:@"redact_line_last"];
|
||||
|
||||
}
|
||||
NSArray *titles= @[@"S1",@"S2",@"UV/杀菌",@"冲浪/氧泵",@"加热棒"];
|
||||
if (indexPath.section==1) {
|
||||
cell.chTitle.text = titles[indexPath.row];
|
||||
}
|
||||
|
||||
//自定义名字
|
||||
RuiMeiCHControl * ruSunch = [RuiMeiCHNameCustom currentdevice:self.device.macAddress];
|
||||
if (indexPath.section==1&&indexPath.row==0) {
|
||||
cell.chName.text = ruSunch.ch1name;
|
||||
|
||||
}else if (indexPath.section==1&&indexPath.row==1){
|
||||
cell.chName.text = ruSunch.ch2name;
|
||||
}else if (indexPath.section==1&&indexPath.row==2){
|
||||
cell.chName.text = ruSunch.ch3name;
|
||||
}else if (indexPath.section==1&&indexPath.row==3){
|
||||
cell.chName.text = ruSunch.ch4name;
|
||||
}else if (indexPath.section==1&&indexPath.row==4){
|
||||
cell.chName.text = ruSunch.jiaRe;
|
||||
}
|
||||
|
||||
cell.chName.delegate = self;
|
||||
cell.tag = 20000 + indexPath.row;
|
||||
return cell;
|
||||
}
|
||||
|
||||
-(void)sureAction
|
||||
{
|
||||
//RuiMeiCHNameCustom 本地处理 保存按钮名称 不与服务器交互
|
||||
RuiMeiCHControl *ruSunch = [[RuiMeiCHControl alloc] init];
|
||||
RuSunChangeNameTextViewCell*cell1 = [self.view viewWithTag:RUSUNCHCELL_CH1];
|
||||
if (cell1.chName.text.length>3) {
|
||||
[self.view makeToast:@"S1不能超过3个字"];
|
||||
return;
|
||||
}
|
||||
if (cell1.chName.text.length==0) {
|
||||
[self.view makeToast:@"S1不能为空"];
|
||||
return;
|
||||
}
|
||||
|
||||
ruSunch.ch1name = cell1.chName.text;
|
||||
RuSunChangeNameTextViewCell*cell2 = [self.view viewWithTag:RUSUNCHCELL_CH2];
|
||||
if (cell2.chName.text.length>3) {
|
||||
[self.view makeToast:@"S2不能超过3个字"];
|
||||
return;
|
||||
}
|
||||
if (cell2.chName.text.length==0) {
|
||||
[self.view makeToast:@"S2不能为空"];
|
||||
return;
|
||||
}
|
||||
|
||||
ruSunch.ch2name = cell2.chName.text;
|
||||
RuSunChangeNameTextViewCell*cell3 = [self.view viewWithTag:RUSUNCHCELL_CH3];
|
||||
if (cell3.chName.text.length>3) {
|
||||
[self.view makeToast:@"UV/杀菌不能超过3个字"];
|
||||
return;
|
||||
}
|
||||
if (cell3.chName.text.length==0) {
|
||||
[self.view makeToast:@"UV/杀菌不能为空"];
|
||||
return;
|
||||
}
|
||||
|
||||
ruSunch.ch3name = cell3.chName.text;
|
||||
RuSunChangeNameTextViewCell*cell4 = [self.view viewWithTag:RUSUNCHCELL_CH4];
|
||||
if (cell4.chName.text.length>3) {
|
||||
[self.view makeToast:@"冲浪/氧泵不能超过3个字"];
|
||||
return;
|
||||
}
|
||||
if (cell4.chName.text.length==0) {
|
||||
[self.view makeToast:@"冲浪/氧泵不能为空"];
|
||||
return;
|
||||
}
|
||||
ruSunch.ch4name = cell4.chName.text;
|
||||
|
||||
RuSunChangeNameTextViewCell*cell5 = [self.view viewWithTag:RUSUNCHCELL_JIARE];
|
||||
if (cell5.chName.text.length>3) {
|
||||
[self.view makeToast:@"加热棒名不能超过3个字"];
|
||||
return;
|
||||
}
|
||||
if (cell5.chName.text.length==0) {
|
||||
[self.view makeToast:@"加热棒名不能为空"];
|
||||
return;
|
||||
}
|
||||
ruSunch.jiaRe = cell5.chName.text;
|
||||
|
||||
ruSunch.macAd = self.device.macAddress;
|
||||
|
||||
[RuiMeiCHNameCustom saveCHname:ruSunch];
|
||||
|
||||
[self upLoadDeviceName];
|
||||
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
@ -21,11 +21,10 @@
|
|||
#import "XuToWenDuPicview.h"
|
||||
#import "RuSunLightOrder.h"
|
||||
#import "RuSunGuiDeng.h"
|
||||
#import "RunSun84CHSetViewController.h"
|
||||
#import "RuiMeiSetViewController.h"
|
||||
#import "RuiMeiCHControl.h"
|
||||
#import "RuiMeiCHNameCustom.h"
|
||||
#import "RuSunInpdViewController.h"
|
||||
#import "RuiMeiInputViewController.h"
|
||||
#import "HaveHotCoolWenDuPicview.h"
|
||||
|
||||
@interface RuiMeiViewController ()<IfishCommuniteDelegate>
|
||||
|
|
@ -36,7 +35,7 @@
|
|||
@property(nonatomic,strong) HaveHotCoolWenDuPicview *wenduPicview;
|
||||
@property(nonatomic,strong) RuiMeiSetViewController *setVC;
|
||||
//@property(nonatomic,strong) RunSunChangeNameViewController *changenameVC;
|
||||
@property(nonatomic,strong) RuSunInpdViewController *changenameVC;
|
||||
@property(nonatomic,strong) RuiMeiInputViewController *changenameVC;
|
||||
|
||||
@end
|
||||
|
||||
|
|
@ -559,9 +558,7 @@
|
|||
-(void)shezhiMingCheng
|
||||
{
|
||||
|
||||
//_changenameVC = [[RunSunChangeNameViewController alloc] init];
|
||||
|
||||
_changenameVC = [[RuSunInpdViewController alloc] init];
|
||||
_changenameVC = [[RuiMeiInputViewController alloc] init];
|
||||
_changenameVC.name = self.name.text;
|
||||
_changenameVC.device = self.currentDevice;
|
||||
__weak typeof (self)wself = self;
|
||||
|
|
|
|||
Loading…
Reference in New Issue