|
|
|
@ -54,13 +54,26 @@
@@ -54,13 +54,26 @@
|
|
|
|
|
/// 设备信息View |
|
|
|
|
- (void)DeviceMsgView |
|
|
|
|
{ |
|
|
|
|
NSArray *titleArr = @[GJText(@"头像"), |
|
|
|
|
NSArray *titleArr; |
|
|
|
|
|
|
|
|
|
if (self.model.virtualFlag) |
|
|
|
|
{ |
|
|
|
|
titleArr = @[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]; |
|
|
|
|
[self.view addSubview:bgView]; |
|
|
|
|
[bgView mas_makeConstraints:^(MASConstraintMaker *make) { |
|
|
|
@ -111,7 +124,7 @@
@@ -111,7 +124,7 @@
|
|
|
|
|
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) { |
|
|
|
|
|
|
|
|
@ -121,9 +134,16 @@
@@ -121,9 +134,16 @@
|
|
|
|
|
textfield.textColor = KKGrey143; |
|
|
|
|
if (i == 1) |
|
|
|
|
{ |
|
|
|
|
if (self.model.virtualFlag) |
|
|
|
|
{ |
|
|
|
|
textfield.enabled = YES; |
|
|
|
|
textfield.textColor = KKTextBlackColor; |
|
|
|
|
} |
|
|
|
|
textfield.text = self.model.name; |
|
|
|
|
self.nameField = textfield; |
|
|
|
|
} |
|
|
|
|
if (!self.model.virtualFlag) |
|
|
|
|
{ |
|
|
|
|
if (i == 3) |
|
|
|
|
{ |
|
|
|
|
textfield.text = self.model.schName; |
|
|
|
@ -136,6 +156,7 @@
@@ -136,6 +156,7 @@
|
|
|
|
|
{ |
|
|
|
|
textfield.text = self.model.className; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (i == titleArr.count-1) |
|
|
|
|
{ |
|
|
|
|
textfield.enabled = YES; |
|
|
|
@ -153,7 +174,7 @@
@@ -153,7 +174,7 @@
|
|
|
|
|
make.height.mas_equalTo(Adapted(44)); |
|
|
|
|
}]; |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
else if (i == 2) |
|
|
|
|
{ |
|
|
|
|
/// 性别 |
|
|
|
|
NSArray *sexArr = @[GJText(@"男"), |
|
|
|
@ -333,6 +354,13 @@
@@ -333,6 +354,13 @@
|
|
|
|
|
[parameters setValue:@(self.relationshipId) forKey:@"relationshipId"]; |
|
|
|
|
[parameters setValue:@(self.sex) forKey:@"sex"]; |
|
|
|
|
[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) { |
|
|
|
|
[UICommon HidenLoading]; |
|
|
|
|
[UICommon MessageSuccessText:@"添加成功"]; |
|
|
|
|