|
|
@@ -15,32 +15,35 @@
|
|
|
#import <BRPickerView.h>
|
|
|
#import "MySkillsController.h"
|
|
|
#import "ShareCardController.h"
|
|
|
+#import "HobbyViewController.h"
|
|
|
|
|
|
-@interface ModelCardController ()<UITableViewDelegate, UITableViewDataSource, UITextFieldDelegate> {
|
|
|
+@interface ModelCardController () <UITableViewDelegate, UITableViewDataSource, UITextFieldDelegate> {
|
|
|
ModelUser *tempUser;
|
|
|
}
|
|
|
|
|
|
-@property (nonatomic, strong) UITableView *tableView;
|
|
|
-@property (nonatomic, strong) NSArray *titlesArr;
|
|
|
-@property (nonatomic, strong) NSArray *conentArr;
|
|
|
-
|
|
|
-@property (nonatomic, strong) UITableViewCell *nameCell;
|
|
|
-@property (nonatomic, strong) UITableViewCell *ageCell;
|
|
|
-@property (nonatomic, strong) UITableViewCell *heiCell;
|
|
|
-@property (nonatomic, strong) UITableViewCell *weiCell;
|
|
|
-@property (nonatomic, strong) UITableViewCell *waiBustHipCell; // 三围
|
|
|
-@property (nonatomic, strong) UITableViewCell *photoCell;
|
|
|
-@property (nonatomic, strong) UITableViewCell *areaCell; //地区(int类型,可空)
|
|
|
-@property (nonatomic, strong) UITableViewCell *occupationCell; //职业
|
|
|
-@property (nonatomic, strong) UITableViewCell *spdjCell;//视频单价
|
|
|
-@property (nonatomic, strong) UITableViewCell *fgbqCell;//风格标签
|
|
|
-@property (nonatomic, strong) UITableViewCell *lnameCell; //个性签名
|
|
|
-@property (nonatomic, strong) UITableViewCell *wdryCell; // 我的荣誉
|
|
|
-@property (nonatomic, strong) UITableViewCell *constellationCell; // 星座
|
|
|
-@property (nonatomic, strong) UITableViewCell *collegeCell; // 学校
|
|
|
-@property (nonatomic, strong) UITableViewCell *hobbyCell; // 爱好
|
|
|
-
|
|
|
-@property (nonatomic, strong) NSMutableArray *areaArray;
|
|
|
+@property(nonatomic, strong) UITableView *tableView;
|
|
|
+@property(nonatomic, strong) NSArray *titlesArr;
|
|
|
+@property(nonatomic, strong) NSArray *conentArr;
|
|
|
+
|
|
|
+@property(nonatomic, strong) UITableViewCell *nameCell;
|
|
|
+@property(nonatomic, strong) UITableViewCell *ageCell;
|
|
|
+@property(nonatomic, strong) UITableViewCell *heiCell;
|
|
|
+@property(nonatomic, strong) UITableViewCell *weiCell;
|
|
|
+@property(nonatomic, strong) UITableViewCell *waiBustHipCell; // 三围
|
|
|
+@property(nonatomic, strong) UITableViewCell *photoCell;
|
|
|
+@property(nonatomic, strong) UITableViewCell *areaCell; //地区(int类型,可空)
|
|
|
+@property(nonatomic, strong) UITableViewCell *occupationCell; //职业
|
|
|
+@property(nonatomic, strong) UITableViewCell *spdjCell;//视频单价
|
|
|
+@property(nonatomic, strong) UITableViewCell *fgbqCell;//风格标签
|
|
|
+@property(nonatomic, strong) UITableViewCell *lnameCell; //个性签名
|
|
|
+@property(nonatomic, strong) UITableViewCell *wdryCell; // 我的荣誉
|
|
|
+@property(nonatomic, strong) UITableViewCell *constellationCell; // 星座
|
|
|
+@property(nonatomic, strong) UITableViewCell *collegeCell; // 学校
|
|
|
+@property(nonatomic, strong) UITableViewCell *hobbyCell; // 爱好
|
|
|
+
|
|
|
+@property(nonatomic, strong) NSMutableArray *areaArray;
|
|
|
+@property(nonatomic, strong) NSArray *jobArray;
|
|
|
+@property(nonatomic, strong) NSArray *constellationArray;
|
|
|
|
|
|
@end
|
|
|
|
|
|
@@ -48,35 +51,35 @@
|
|
|
|
|
|
- (void)viewDidLoad {
|
|
|
[super viewDidLoad];
|
|
|
-
|
|
|
+
|
|
|
self.title = @"模卡资料";
|
|
|
- UIButton * btn = [UIButton buttonWithType:UIButtonTypeCustom];
|
|
|
+ UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
|
|
|
btn.frame = CGRectMake(0, 0, 40, 40);
|
|
|
[btn setImage:[UIImage imageNamed:@"fanhui2"] forState:UIControlStateNormal];
|
|
|
- btn.imageEdgeInsets = UIEdgeInsetsMake(0, -20, 0, 0);
|
|
|
+ btn.imageEdgeInsets = UIEdgeInsetsMake(0, -20, 0, 0);
|
|
|
[btn addTarget:self action:@selector(backClick) forControlEvents:UIControlEventTouchUpInside];
|
|
|
UIBarButtonItem *leftItem = [[UIBarButtonItem alloc] initWithCustomView:btn];
|
|
|
- UIBarButtonItem *nagetiveSpacer = [[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace target:nil action:nil];
|
|
|
+ UIBarButtonItem *nagetiveSpacer = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace target:nil action:nil];
|
|
|
self.navigationItem.leftBarButtonItems = @[nagetiveSpacer, leftItem];
|
|
|
-
|
|
|
+
|
|
|
self.titlesArr = @[@[@"照片"],
|
|
|
- @[@"姓名"],
|
|
|
- @[@"个性签名"],
|
|
|
- @[@"视频单价"],
|
|
|
- @[@"身高",@"体重",@"三围",@"地区",@"年龄",@"职业",@"星座",@"毕业院校",@"兴趣爱好"],
|
|
|
- @[@"我的标签"],
|
|
|
- @[@"我的荣誉"]];
|
|
|
+ @[@"姓名"],
|
|
|
+ @[@"个性签名"],
|
|
|
+ @[@"视频单价"],
|
|
|
+ @[@"身高", @"体重", @"三围", @"地区", @"年龄", @"职业", @"星座", @"毕业院校", @"兴趣爱好"],
|
|
|
+ @[@"我的标签"],
|
|
|
+ @[@"我的荣誉"]];
|
|
|
self.conentArr = @[@[@""],
|
|
|
- @[@""],
|
|
|
- @[@""],
|
|
|
- @[@""],
|
|
|
- @[@"",@"",@"",@"",@"",@"",@"",@"",@""],
|
|
|
- @[@""],
|
|
|
- @[@""]];
|
|
|
-
|
|
|
+ @[@""],
|
|
|
+ @[@""],
|
|
|
+ @[@""],
|
|
|
+ @[@"", @"", @"", @"", @"", @"", @"", @"", @""],
|
|
|
+ @[@""],
|
|
|
+ @[@""]];
|
|
|
self.areaArray = [NSMutableArray array];
|
|
|
+ self.jobArray = @[@"空姐", @"职业模特", @"白领", @"演员", @"护士", @"学生", @"老师", @"品酒师", @"其他"];
|
|
|
+ self.constellationArray = @[@"水瓶座", @"双鱼座", @"白羊座", @"金牛座", @"双子座", @"巨蟹座", @"狮子座", @"处女座", @"天秤座", @"天蝎座", @"射手座", @"魔蝎座"];
|
|
|
|
|
|
-
|
|
|
UIView *headerView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, ScreenWidth, 10)];
|
|
|
headerView.backgroundColor = RGBValueColor(0xf7f7f7, 1.0);
|
|
|
//
|
|
|
@@ -84,11 +87,11 @@
|
|
|
footerView.backgroundColor = RGBValueColor(0xf7f7f7, 1.0);
|
|
|
UIButton *bindingBtn = [UIButton buttonWithType:UIButtonTypeCustom];
|
|
|
bindingBtn.frame = CGRectMake(20, 39, ScreenWidth - 40, 44);
|
|
|
-
|
|
|
- bindingBtn.layer.backgroundColor = [UIColor colorWithRed:255/255.0 green:64/255.0 blue:149/255.0 alpha:1].CGColor;
|
|
|
+
|
|
|
+ bindingBtn.layer.backgroundColor = [UIColor colorWithRed:255 / 255.0 green:64 / 255.0 blue:149 / 255.0 alpha:1].CGColor;
|
|
|
bindingBtn.layer.cornerRadius = 22;
|
|
|
- bindingBtn.layer.shadowColor = [UIColor colorWithRed:255/255.0 green:64/255.0 blue:149/255.0 alpha:0.36].CGColor;
|
|
|
- bindingBtn.layer.shadowOffset = CGSizeMake(0,8);
|
|
|
+ bindingBtn.layer.shadowColor = [UIColor colorWithRed:255 / 255.0 green:64 / 255.0 blue:149 / 255.0 alpha:0.36].CGColor;
|
|
|
+ bindingBtn.layer.shadowOffset = CGSizeMake(0, 8);
|
|
|
bindingBtn.layer.shadowOpacity = 1;
|
|
|
bindingBtn.layer.shadowRadius = 10;
|
|
|
if ([@"init" isEqualToString:self.type]) {
|
|
|
@@ -100,7 +103,7 @@
|
|
|
[bindingBtn setTitleColor:RGBValueColor(0xffffff, 1.0) forState:UIControlStateNormal];
|
|
|
[bindingBtn addTarget:self action:@selector(bindingBtnAction) forControlEvents:UIControlEventTouchUpInside];
|
|
|
[footerView addSubview:bindingBtn];
|
|
|
-
|
|
|
+
|
|
|
self.tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, ScreenWidth, ScreenHeight) style:UITableViewStylePlain];
|
|
|
// self.tableView.scrollEnabled = NO;
|
|
|
self.tableView.backgroundColor = RGBValueColor(0xf7f7f7, 1.0);
|
|
|
@@ -111,7 +114,7 @@
|
|
|
self.tableView.tableHeaderView = headerView;
|
|
|
self.tableView.tableFooterView = footerView;
|
|
|
[self.view addSubview:self.tableView];
|
|
|
- self.view.backgroundColor = [UIColor colorWithRed:242/255.0 green:244/255.0 blue:245/255.0 alpha:1];
|
|
|
+ self.view.backgroundColor = [UIColor colorWithRed:242 / 255.0 green:244 / 255.0 blue:245 / 255.0 alpha:1];
|
|
|
[self getAreaData];
|
|
|
}
|
|
|
|
|
|
@@ -137,18 +140,18 @@
|
|
|
[YanCNetWorkManager requestGETWithURLStr:Url_getArea(PublicUrl) parameters:@{} finish:^(id dataDic) {
|
|
|
[self.areaArray addObjectsFromArray:dataDic[@"data"]];
|
|
|
[self.tableView reloadData];
|
|
|
- } enError:^(NSError *error) {
|
|
|
-
|
|
|
+ } enError:^(NSError *error) {
|
|
|
+
|
|
|
}];
|
|
|
}
|
|
|
|
|
|
- (void)getModelData {
|
|
|
- [YanCNetWorkManager requestGETWithURLStr:Url_getModelData(PublicUrl) parameters:@{@"modelpk":[ModelUser user].modelpk} finish:^(id dataDic) {
|
|
|
+ [YanCNetWorkManager requestGETWithURLStr:Url_getModelData(PublicUrl) parameters:@{@"modelpk": [ModelUser user].modelpk} finish:^(id dataDic) {
|
|
|
[[ModelUser modelUser] setValuesForKeysWithDictionary:[dataDic[@"data"] firstObject]];
|
|
|
tempUser = [ModelUser mj_objectWithKeyValues:[dataDic[@"data"] firstObject]];
|
|
|
[self.tableView reloadData];
|
|
|
- } enError:^(NSError *error) {
|
|
|
-
|
|
|
+ } enError:^(NSError *error) {
|
|
|
+
|
|
|
}];
|
|
|
}
|
|
|
|
|
|
@@ -157,19 +160,20 @@
|
|
|
}
|
|
|
|
|
|
#pragma mark -- UITableViewDelegate, UITableViewDataSource
|
|
|
--(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
|
|
|
+
|
|
|
+- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
|
|
|
return self.titlesArr.count;
|
|
|
}
|
|
|
|
|
|
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
|
|
|
- return ((NSDictionary*)self.titlesArr[section]).count;
|
|
|
+ return ((NSDictionary *) self.titlesArr[section]).count;
|
|
|
}
|
|
|
|
|
|
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
|
|
|
- static NSString *reuseIdentifier=@"cellID";
|
|
|
+ static NSString *reuseIdentifier = @"cellID";
|
|
|
UITableViewCell *modelCell = [tableView dequeueReusableCellWithIdentifier:reuseIdentifier];
|
|
|
if (modelCell == nil) {
|
|
|
- modelCell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:reuseIdentifier];
|
|
|
+ modelCell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:reuseIdentifier];
|
|
|
}
|
|
|
modelCell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
|
|
|
modelCell.selectionStyle = UITableViewCellSelectionStyleNone;
|
|
|
@@ -178,11 +182,11 @@
|
|
|
modelCell.textLabel.font = [UIFont systemFontOfSize:14.0];
|
|
|
modelCell.detailTextLabel.font = [UIFont systemFontOfSize:14.0];
|
|
|
modelCell.textLabel.text = self.titlesArr[indexPath.section][indexPath.row];
|
|
|
-
|
|
|
+
|
|
|
NSString *rowTitle = self.titlesArr[indexPath.section][indexPath.row];
|
|
|
if ([@"照片" isEqualToString:rowTitle]) {
|
|
|
self.photoCell = modelCell;
|
|
|
- modelCell.detailTextLabel.text = [NSString stringWithFormat:@"%@张照片",tempUser.photocount];
|
|
|
+ modelCell.detailTextLabel.text = [NSString stringWithFormat:@"%@张照片", tempUser.photocount];
|
|
|
} else if ([@"姓名" isEqualToString:rowTitle]) {
|
|
|
self.nameCell = modelCell;
|
|
|
modelCell.detailTextLabel.text = tempUser.pet;
|
|
|
@@ -191,16 +195,16 @@
|
|
|
modelCell.detailTextLabel.text = tempUser.lname;
|
|
|
} else if ([@"视频单价" isEqualToString:rowTitle]) {
|
|
|
self.spdjCell = modelCell;
|
|
|
- modelCell.detailTextLabel.text = [NSString stringWithFormat:@"%@元/分钟",tempUser.vprice];
|
|
|
+ modelCell.detailTextLabel.text = [NSString stringWithFormat:@"%@元/分钟", tempUser.vprice];
|
|
|
} else if ([@"身高" isEqualToString:rowTitle]) {
|
|
|
self.heiCell = modelCell;
|
|
|
- modelCell.detailTextLabel.text = [NSString stringWithFormat:@"%@cm",tempUser.hei];
|
|
|
+ modelCell.detailTextLabel.text = [NSString stringWithFormat:@"%@cm", tempUser.hei];
|
|
|
} else if ([@"体重" isEqualToString:rowTitle]) {
|
|
|
self.weiCell = modelCell;
|
|
|
- modelCell.detailTextLabel.text = [NSString stringWithFormat:@"%@kg",tempUser.wei];
|
|
|
+ modelCell.detailTextLabel.text = [NSString stringWithFormat:@"%@kg", tempUser.wei];
|
|
|
} else if ([@"三围" isEqualToString:rowTitle]) {
|
|
|
self.waiBustHipCell = modelCell;
|
|
|
- modelCell.detailTextLabel.text = [NSString stringWithFormat:@"%@/%@/%@",tempUser.bust,tempUser.wai,tempUser.hip];
|
|
|
+ modelCell.detailTextLabel.text = [NSString stringWithFormat:@"%@/%@/%@", tempUser.bust, tempUser.wai, tempUser.hip];
|
|
|
} else if ([@"地区" isEqualToString:rowTitle]) {
|
|
|
self.areaCell = modelCell;
|
|
|
modelCell.detailTextLabel.text = @"";
|
|
|
@@ -276,7 +280,7 @@
|
|
|
for (NSDictionary *dic in self.areaArray) {
|
|
|
if ([dic[@"name"] isEqualToString:selectValue]) {
|
|
|
[YanCNetWorkManager requestPostWithURLStr:Url_updateModelCard(PublicUrl)
|
|
|
- parameters:@{@"area":dic[@"pk"],@"modelpk":[ModelUser user].modelpk}
|
|
|
+ parameters:@{@"area": dic[@"pk"], @"modelpk": [ModelUser user].modelpk}
|
|
|
finish:^(id dataDic) {
|
|
|
if ([dataDic[@"msg"] isEqualToString:@"success"]) {
|
|
|
[MBProgressHUD showSuccess:@"修改成功"];
|
|
|
@@ -284,10 +288,10 @@
|
|
|
} else {
|
|
|
[MBProgressHUD showError:@"修改失败"];
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
enError:^(NSError *error) {
|
|
|
-
|
|
|
+
|
|
|
}];
|
|
|
}
|
|
|
}
|
|
|
@@ -297,21 +301,51 @@
|
|
|
infoVc.editType = InfoEditTypeAge;
|
|
|
[self.navigationController pushViewController:infoVc animated:YES];
|
|
|
} else if ([@"职业" isEqualToString:rowTitle]) {
|
|
|
- InfoEditViewController *infoVc = [InfoEditViewController new];
|
|
|
- infoVc.editType = InfoEditTypeOccupation;
|
|
|
- [self.navigationController pushViewController:infoVc animated:YES];
|
|
|
+ // InfoEditViewController *infoVc = [InfoEditViewController new];
|
|
|
+ // infoVc.editType = InfoEditTypeOccupation;
|
|
|
+ // [self.navigationController pushViewController:infoVc animated:YES];
|
|
|
+ [BRStringPickerView showStringPickerWithTitle:@"请选择职业" dataSource:self.jobArray defaultSelValue:nil resultBlock:^(id selectValue) {
|
|
|
+ [YanCNetWorkManager requestPostWithURLStr:Url_updateModelCard(PublicUrl)
|
|
|
+ parameters:@{@"occupation": selectValue, @"modelpk": [ModelUser user].modelpk}
|
|
|
+ finish:^(id dataDic) {
|
|
|
+ if ([dataDic[@"msg"] isEqualToString:@"success"]) {
|
|
|
+ [MBProgressHUD showSuccess:@"修改成功"];
|
|
|
+ cell.detailTextLabel.text = selectValue;
|
|
|
+ } else {
|
|
|
+ [MBProgressHUD showError:@"修改失败"];
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ enError:^(NSError *error) {
|
|
|
+
|
|
|
+ }];
|
|
|
+ }];
|
|
|
} else if ([@"星座" isEqualToString:rowTitle]) {
|
|
|
- InfoEditViewController *infoVc = [InfoEditViewController new];
|
|
|
- infoVc.editType = InfoEditTypeConstellation;
|
|
|
- [self.navigationController pushViewController:infoVc animated:YES];
|
|
|
+ // InfoEditViewController *infoVc = [InfoEditViewController new];
|
|
|
+ // infoVc.editType = InfoEditTypeConstellation;
|
|
|
+ // [self.navigationController pushViewController:infoVc animated:YES];
|
|
|
+ [BRStringPickerView showStringPickerWithTitle:@"请选择星座" dataSource:self.constellationArray defaultSelValue:nil resultBlock:^(id selectValue) {
|
|
|
+ [YanCNetWorkManager requestPostWithURLStr:Url_updateModelCard(PublicUrl)
|
|
|
+ parameters:@{@"constellation": selectValue, @"modelpk": [ModelUser user].modelpk}
|
|
|
+ finish:^(id dataDic) {
|
|
|
+ if ([dataDic[@"msg"] isEqualToString:@"success"]) {
|
|
|
+ [MBProgressHUD showSuccess:@"修改成功"];
|
|
|
+ cell.detailTextLabel.text = selectValue;
|
|
|
+ } else {
|
|
|
+ [MBProgressHUD showError:@"修改失败"];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ enError:^(NSError *error) {
|
|
|
+
|
|
|
+ }];
|
|
|
+ }];
|
|
|
} else if ([@"毕业院校" isEqualToString:rowTitle]) {
|
|
|
InfoEditViewController *infoVc = [InfoEditViewController new];
|
|
|
infoVc.editType = InfoEditTypeCollege;
|
|
|
[self.navigationController pushViewController:infoVc animated:YES];
|
|
|
} else if ([@"兴趣爱好" isEqualToString:rowTitle]) {
|
|
|
- InfoEditViewController *infoVc = [InfoEditViewController new];
|
|
|
- infoVc.editType = InfoEditTypeHobby;
|
|
|
- [self.navigationController pushViewController:infoVc animated:YES];
|
|
|
+ HobbyViewController *hobbyVC = [[HobbyViewController alloc] init];
|
|
|
+ [self.navigationController pushViewController:hobbyVC animated:YES];
|
|
|
} else if ([@"我的标签" isEqualToString:rowTitle]) {
|
|
|
ModelTagViewController *tagVC = [ModelTagViewController new];
|
|
|
[self.navigationController pushViewController:tagVC animated:YES];
|
|
|
@@ -322,57 +356,59 @@
|
|
|
}
|
|
|
|
|
|
#pragma mark -- 保存按钮
|
|
|
+
|
|
|
- (void)bindingBtnAction {
|
|
|
- NSLog(@"name %@", self.nameCell.textLabel.text);
|
|
|
- if (self.nameCell.textLabel.text.length == 0) {
|
|
|
- [MBProgressHUD showOnlyText:@"请选择填写姓名" controller:self];
|
|
|
+ if ([tempUser.photocount intValue] < 5) {
|
|
|
+ [self.view makeToast:@"请至少上传5张照片" duration:2.0 position:CSToastPositionCenter];
|
|
|
return;
|
|
|
}
|
|
|
- NSLog(@"age %@", self.ageCell.textLabel.text);
|
|
|
- if (self.ageCell.textLabel.text.length == 0) {
|
|
|
- [MBProgressHUD showOnlyText:@"请选择填写年龄" controller:self];
|
|
|
+ if (tempUser.pet.length == 0) {
|
|
|
+ [self.view makeToast:@"请填写姓名" duration:2.0 position:CSToastPositionCenter];
|
|
|
return;
|
|
|
}
|
|
|
- NSLog(@"heiCell %@", self.heiCell.textLabel.text);
|
|
|
- if (self.heiCell.textLabel.text.length == 0) {
|
|
|
- [MBProgressHUD showOnlyText:@"请选择填写身高" controller:self];
|
|
|
+ if (tempUser.lname.length == 0) {
|
|
|
+ [self.view makeToast:@"请填写个性签名" duration:2.0 position:CSToastPositionCenter];
|
|
|
return;
|
|
|
}
|
|
|
- NSLog(@"体重 %@", self.weiCell.textLabel.text);
|
|
|
- if (self.weiCell.textLabel.text.length == 0) {
|
|
|
- [MBProgressHUD showOnlyText:@"请选择填写体重" controller:self];
|
|
|
+ if (tempUser.vprice.length == 0) {
|
|
|
+ [self.view makeToast:@"请填写视频单价" duration:2.0 position:CSToastPositionCenter];
|
|
|
return;
|
|
|
}
|
|
|
- NSLog(@"三围 %@", self.nameCell.textLabel.text);
|
|
|
- if (self.nameCell.textLabel.text.length == 0) {
|
|
|
- [MBProgressHUD showOnlyText:@"请选择填写三围" controller:self];
|
|
|
+ if (tempUser.hei.length == 0 || [@"0" isEqualToString:tempUser.hei]) {
|
|
|
+ [self.view makeToast:@"请填写身高" duration:2.0 position:CSToastPositionCenter];
|
|
|
return;
|
|
|
}
|
|
|
- NSLog(@"地区 %@", self.areaCell.textLabel.text);
|
|
|
- if (self.areaCell.textLabel.text.length == 0) {
|
|
|
- [MBProgressHUD showOnlyText:@"请选择填写地区" controller:self];
|
|
|
+ if (tempUser.wei.length == 0 || [@"0" isEqualToString:tempUser.wei]) {
|
|
|
+ [self.view makeToast:@"请填写体重" duration:2.0 position:CSToastPositionCenter];
|
|
|
return;
|
|
|
}
|
|
|
- if (![[ModelUser user].modelpk isEqualToString:@"51"]) {
|
|
|
- NSLog(@"视频单价 %@", self.spdjCell.textLabel.text);
|
|
|
- if (self.spdjCell.textLabel.text.length == 0) {
|
|
|
- [MBProgressHUD showOnlyText:@"请选择填写视频单价" controller:self];
|
|
|
- return;
|
|
|
- }
|
|
|
+ if (tempUser.bust.length == 0) {
|
|
|
+ [self.view makeToast:@"请填写三围" duration:2.0 position:CSToastPositionCenter];
|
|
|
+ return;
|
|
|
}
|
|
|
- NSLog(@"风格标签 %@", self.fgbqCell.textLabel.text);
|
|
|
- if (self.fgbqCell.textLabel.text.length == 0) {
|
|
|
- [MBProgressHUD showOnlyText:@"请选择填写标签" controller:self];
|
|
|
+ if (tempUser.area.length == 0) {
|
|
|
+ [self.view makeToast:@"请填写地区" duration:2.0 position:CSToastPositionCenter];
|
|
|
return;
|
|
|
}
|
|
|
- NSLog(@"个人签名 %@", self.lnameCell.textLabel.text);
|
|
|
- if (self.lnameCell.textLabel.text.length == 0) {
|
|
|
- [MBProgressHUD showOnlyText:@"请选择填写签名" controller:self];
|
|
|
+ if (tempUser.age.length == 0) {
|
|
|
+ [self.view makeToast:@"请填写年龄" duration:2.0 position:CSToastPositionCenter];
|
|
|
return;
|
|
|
}
|
|
|
-// [MBProgressHUD showSuccess:@"保存成功"];
|
|
|
-// [NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(backClick) userInfo:nil repeats:NO];
|
|
|
-
|
|
|
+ if (tempUser.occupation.length == 0) {
|
|
|
+ [self.view makeToast:@"请填写职业" duration:2.0 position:CSToastPositionCenter];
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (tempUser.constellation.length == 0) {
|
|
|
+ [self.view makeToast:@"请填写星座" duration:2.0 position:CSToastPositionCenter];
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (tempUser.college.length == 0) {
|
|
|
+ [self.view makeToast:@"请填写毕业院校" duration:2.0 position:CSToastPositionCenter];
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ // [MBProgressHUD showSuccess:@"保存成功"];
|
|
|
+ // [NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(backClick) userInfo:nil repeats:NO];
|
|
|
+
|
|
|
if ([@"init" isEqualToString:self.type]) {
|
|
|
MySkillsController *mySkillsVC = [[MySkillsController alloc] init];
|
|
|
[self.navigationController pushViewController:mySkillsVC animated:YES];
|
|
|
@@ -383,24 +419,26 @@
|
|
|
}
|
|
|
|
|
|
#pragma mark -- 网络请求
|
|
|
+
|
|
|
- (void)postDataFromNetworking {
|
|
|
[MBProgressHUD showHUDAddedTo:self.view animated:YES];
|
|
|
ModelUser *modelUser = [ModelUser user];
|
|
|
-
|
|
|
- NSDictionary *dic = [[NSDictionary alloc] initWithObjectsAndKeys:modelUser.modelpk,@"modelpk",self.lnameCell.textLabel.text,@"lname", nil];
|
|
|
-
|
|
|
- [YanCNetWorkManager requestPostWithURLStr:Url_updateModelCard(PublicUrl) parameters:dic finish:^(id dataDic) {
|
|
|
- [MBProgressHUD hideHUDForView:self.view animated:YES];
|
|
|
-
|
|
|
- NSString *issuccess = dataDic[@"msg"];
|
|
|
- if ([issuccess isEqualToString:@"success"]) {
|
|
|
- [MBProgressHUD showSuccess:@"保存成功"];
|
|
|
- } else {
|
|
|
-
|
|
|
- }
|
|
|
- } enError:^(NSError *error) {
|
|
|
- [MBProgressHUD hideHUDForView:self.view animated:YES];
|
|
|
- }];
|
|
|
+ NSDictionary *dic = @{@"modelpk": modelUser.modelpk, @"lname": self.lnameCell.textLabel.text};
|
|
|
+ [YanCNetWorkManager requestPostWithURLStr:Url_updateModelCard(PublicUrl)
|
|
|
+ parameters:dic
|
|
|
+ finish:^(id dataDic) {
|
|
|
+ [MBProgressHUD hideHUDForView:self.view animated:YES];
|
|
|
+
|
|
|
+ NSString *issuccess = dataDic[@"msg"];
|
|
|
+ if ([issuccess isEqualToString:@"success"]) {
|
|
|
+ [MBProgressHUD showSuccess:@"保存成功"];
|
|
|
+ } else {
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ enError:^(NSError *error) {
|
|
|
+ [MBProgressHUD hideHUDForView:self.view animated:YES];
|
|
|
+ }];
|
|
|
}
|
|
|
|
|
|
@end
|