|
|
@ -54,13 +54,26 @@ |
|
|
|
/// 设备信息View |
|
|
|
/// 设备信息View |
|
|
|
- (void)DeviceMsgView |
|
|
|
- (void)DeviceMsgView |
|
|
|
{ |
|
|
|
{ |
|
|
|
NSArray *titleArr = @[GJText(@"头像"), |
|
|
|
NSArray *titleArr; |
|
|
|
GJText(@"名称"), |
|
|
|
|
|
|
|
GJText(@"性别"), |
|
|
|
if (self.model.virtualFlag) |
|
|
|
GJText(@"学校"), |
|
|
|
{ |
|
|
|
GJText(@"年级"), |
|
|
|
titleArr = @[GJText(@"头像"), |
|
|
|
GJText(@"班级"), |
|
|
|
GJText(@"名称"), |
|
|
|
GJText(@"设备电话号码")]; |
|
|
|
GJText(@"性别"), |
|
|
|
|
|
|
|
GJText(@"设备电话号码")]; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
titleArr = @[GJText(@"头像"), |
|
|
|
|
|
|
|
GJText(@"名称"), |
|
|
|
|
|
|
|
GJText(@"性别"), |
|
|
|
|
|
|
|
GJText(@"学校"), |
|
|
|
|
|
|
|
GJText(@"年级"), |
|
|
|
|
|
|
|
GJText(@"班级"), |
|
|
|
|
|
|
|
GJText(@"设备电话号码")]; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
UIView *bgView = [UICommon ui_view:CGRectZero backgroundColor:KKWhiteColorColor cornerRadius:0 borderWidth:0 borderColor:KKClearColor]; |
|
|
|
UIView *bgView = [UICommon ui_view:CGRectZero backgroundColor:KKWhiteColorColor cornerRadius:0 borderWidth:0 borderColor:KKClearColor]; |
|
|
|
[self.view addSubview:bgView]; |
|
|
|
[self.view addSubview:bgView]; |
|
|
|
[bgView mas_makeConstraints:^(MASConstraintMaker *make) { |
|
|
|
[bgView mas_makeConstraints:^(MASConstraintMaker *make) { |
|
|
@ -111,7 +124,7 @@ |
|
|
|
else if (i != 0 && i != 2) |
|
|
|
else if (i != 0 && i != 2) |
|
|
|
{ |
|
|
|
{ |
|
|
|
/// 姓名和电话号码 |
|
|
|
/// 姓名和电话号码 |
|
|
|
UITextField *textfield = [UICommon ui_textField:CGRectZero textColor:KKTextBlackColor backColor:KKClearColor font:FontADA_(13) maxTextNum:i == titleArr.count-1 ? 11 : 20 placeholderColor:KKGrey143 placeholder:GJText(@"请输入设备电话号码") toMaxNum:^(UITextField *textField) { |
|
|
|
UITextField *textfield = [UICommon ui_textField:CGRectZero textColor:KKTextBlackColor backColor:KKClearColor font:FontADA_(13) maxTextNum:i == titleArr.count-1 ? 11 : 20 placeholderColor:KKGrey143 placeholder:i == 1 ? GJText(@"请输入名称") : GJText(@"请输入设备电话号码") toMaxNum:^(UITextField *textField) { |
|
|
|
|
|
|
|
|
|
|
|
} change:^(UITextField *textField) { |
|
|
|
} change:^(UITextField *textField) { |
|
|
|
|
|
|
|
|
|
|
@ -121,20 +134,28 @@ |
|
|
|
textfield.textColor = KKGrey143; |
|
|
|
textfield.textColor = KKGrey143; |
|
|
|
if (i == 1) |
|
|
|
if (i == 1) |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
if (self.model.virtualFlag) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
textfield.enabled = YES; |
|
|
|
|
|
|
|
textfield.textColor = KKTextBlackColor; |
|
|
|
|
|
|
|
} |
|
|
|
textfield.text = self.model.name; |
|
|
|
textfield.text = self.model.name; |
|
|
|
self.nameField = textfield; |
|
|
|
self.nameField = textfield; |
|
|
|
} |
|
|
|
} |
|
|
|
if (i == 3) |
|
|
|
if (!self.model.virtualFlag) |
|
|
|
{ |
|
|
|
|
|
|
|
textfield.text = self.model.schName; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (i == 4) |
|
|
|
|
|
|
|
{ |
|
|
|
{ |
|
|
|
textfield.text = self.model.gradeName; |
|
|
|
if (i == 3) |
|
|
|
} |
|
|
|
{ |
|
|
|
if (i == 5) |
|
|
|
textfield.text = self.model.schName; |
|
|
|
{ |
|
|
|
} |
|
|
|
textfield.text = self.model.className; |
|
|
|
if (i == 4) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
textfield.text = self.model.gradeName; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (i == 5) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
textfield.text = self.model.className; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if (i == titleArr.count-1) |
|
|
|
if (i == titleArr.count-1) |
|
|
|
{ |
|
|
|
{ |
|
|
@ -153,7 +174,7 @@ |
|
|
|
make.height.mas_equalTo(Adapted(44)); |
|
|
|
make.height.mas_equalTo(Adapted(44)); |
|
|
|
}]; |
|
|
|
}]; |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
else if (i == 2) |
|
|
|
{ |
|
|
|
{ |
|
|
|
/// 性别 |
|
|
|
/// 性别 |
|
|
|
NSArray *sexArr = @[GJText(@"男"), |
|
|
|
NSArray *sexArr = @[GJText(@"男"), |
|
|
@ -333,6 +354,13 @@ |
|
|
|
[parameters setValue:@(self.relationshipId) forKey:@"relationshipId"]; |
|
|
|
[parameters setValue:@(self.relationshipId) forKey:@"relationshipId"]; |
|
|
|
[parameters setValue:@(self.sex) forKey:@"sex"]; |
|
|
|
[parameters setValue:@(self.sex) forKey:@"sex"]; |
|
|
|
[parameters setValue:self.weightBtn.currentTitle forKey:@"weight"]; |
|
|
|
[parameters setValue:self.weightBtn.currentTitle forKey:@"weight"]; |
|
|
|
|
|
|
|
[parameters setValue:@(self.model.virtualFlag) forKey:@"virtualFlag"]; |
|
|
|
|
|
|
|
if (self.model.virtualFlag) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
[parameters setValue:self.model.schId forKey:@"schId"]; |
|
|
|
|
|
|
|
[parameters setValue:self.model.gradeId forKey:@"gradeId"]; |
|
|
|
|
|
|
|
[parameters setValue:self.model.classId forKey:@"classId"]; |
|
|
|
|
|
|
|
} |
|
|
|
[[[APIManager sharedManager] uploadImageWithURL:AddDevice_URL parameters:parameters images:@[self.iconBtn.currentImage]] subscribeNext:^(id _Nullable x) { |
|
|
|
[[[APIManager sharedManager] uploadImageWithURL:AddDevice_URL parameters:parameters images:@[self.iconBtn.currentImage]] subscribeNext:^(id _Nullable x) { |
|
|
|
[UICommon HidenLoading]; |
|
|
|
[UICommon HidenLoading]; |
|
|
|
[UICommon MessageSuccessText:@"添加成功"]; |
|
|
|
[UICommon MessageSuccessText:@"添加成功"]; |
|
|
|