ModelCardController.m 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448
  1. //
  2. // ModelDataController.m
  3. // model
  4. //
  5. // Created by JuYi on 2018/7/16.
  6. // Copyright © 2018年 Mine. All rights reserved.
  7. // 模卡资料
  8. #import "ModelCardController.h"
  9. #import "MeasurementsViewController.h"
  10. #import "ModelPhotoViewController.h"
  11. #import "ModelTagViewController.h"
  12. #import "ModelHonorViewController.h"
  13. #import "InfoEditViewController.h"
  14. #import <BRPickerView.h>
  15. #import "MySkillsController.h"
  16. #import "ShareCardController.h"
  17. #import "HobbyViewController.h"
  18. @interface ModelCardController () <UITableViewDelegate, UITableViewDataSource, UITextFieldDelegate> {
  19. ModelUser *tempUser;
  20. }
  21. @property(nonatomic, strong) UITableView *tableView;
  22. @property(nonatomic, strong) NSArray *titlesArr;
  23. @property(nonatomic, strong) NSArray *conentArr;
  24. @property(nonatomic, strong) UITableViewCell *nameCell;
  25. @property(nonatomic, strong) UITableViewCell *ageCell;
  26. @property(nonatomic, strong) UITableViewCell *heiCell;
  27. @property(nonatomic, strong) UITableViewCell *weiCell;
  28. @property(nonatomic, strong) UITableViewCell *waiBustHipCell; // 三围
  29. @property(nonatomic, strong) UITableViewCell *photoCell;
  30. @property(nonatomic, strong) UITableViewCell *areaCell; //地区(int类型,可空)
  31. @property(nonatomic, strong) UITableViewCell *occupationCell; //职业
  32. @property(nonatomic, strong) UITableViewCell *spdjCell;//视频单价
  33. @property(nonatomic, strong) UITableViewCell *fgbqCell;//风格标签
  34. @property(nonatomic, strong) UITableViewCell *lnameCell; //个性签名
  35. @property(nonatomic, strong) UITableViewCell *wdryCell; // 我的荣誉
  36. @property(nonatomic, strong) UITableViewCell *constellationCell; // 星座
  37. @property(nonatomic, strong) UITableViewCell *collegeCell; // 学校
  38. @property(nonatomic, strong) UITableViewCell *hobbyCell; // 爱好
  39. @property(nonatomic, strong) NSMutableArray *areaArray;
  40. @property(nonatomic, strong) NSArray *jobArray;
  41. @property(nonatomic, strong) NSArray *constellationArray;
  42. @end
  43. @implementation ModelCardController
  44. - (void)viewDidLoad {
  45. [super viewDidLoad];
  46. self.title = @"模卡资料";
  47. UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
  48. btn.frame = CGRectMake(0, 0, 40, 40);
  49. [btn setImage:[UIImage imageNamed:@"fanhui2"] forState:UIControlStateNormal];
  50. btn.imageEdgeInsets = UIEdgeInsetsMake(0, -20, 0, 0);
  51. [btn addTarget:self action:@selector(backClick) forControlEvents:UIControlEventTouchUpInside];
  52. UIBarButtonItem *leftItem = [[UIBarButtonItem alloc] initWithCustomView:btn];
  53. UIBarButtonItem *nagetiveSpacer = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace target:nil action:nil];
  54. self.navigationItem.leftBarButtonItems = @[nagetiveSpacer, leftItem];
  55. self.titlesArr = @[@[@"照片"],
  56. @[@"姓名"],
  57. @[@"个性签名"],
  58. @[@"视频单价"],
  59. @[@"身高", @"体重", @"三围", @"地区", @"年龄", @"职业", @"星座", @"毕业院校", @"兴趣爱好"],
  60. @[@"我的标签"],
  61. @[@"我的荣誉"]];
  62. self.conentArr = @[@[@""],
  63. @[@""],
  64. @[@""],
  65. @[@""],
  66. @[@"", @"", @"", @"", @"", @"", @"", @"", @""],
  67. @[@""],
  68. @[@""]];
  69. self.areaArray = [NSMutableArray array];
  70. self.jobArray = @[@"空姐", @"职业模特", @"白领", @"演员", @"护士", @"学生", @"老师", @"品酒师", @"其他"];
  71. self.constellationArray = @[@"水瓶座", @"双鱼座", @"白羊座", @"金牛座", @"双子座", @"巨蟹座", @"狮子座", @"处女座", @"天秤座", @"天蝎座", @"射手座", @"魔蝎座"];
  72. UIView *headerView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, ScreenWidth, 10)];
  73. headerView.backgroundColor = RGBValueColor(0xf7f7f7, 1.0);
  74. //
  75. UIView *footerView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, ScreenWidth, ScreenHeight - 460)];
  76. footerView.backgroundColor = RGBValueColor(0xf7f7f7, 1.0);
  77. UIButton *bindingBtn = [UIButton buttonWithType:UIButtonTypeCustom];
  78. bindingBtn.frame = CGRectMake(20, 39, ScreenWidth - 40, 44);
  79. bindingBtn.layer.backgroundColor = [UIColor colorWithRed:255 / 255.0 green:64 / 255.0 blue:149 / 255.0 alpha:1].CGColor;
  80. bindingBtn.layer.cornerRadius = 22;
  81. bindingBtn.layer.shadowColor = [UIColor colorWithRed:255 / 255.0 green:64 / 255.0 blue:149 / 255.0 alpha:0.36].CGColor;
  82. bindingBtn.layer.shadowOffset = CGSizeMake(0, 8);
  83. bindingBtn.layer.shadowOpacity = 1;
  84. bindingBtn.layer.shadowRadius = 10;
  85. if ([@"init" isEqualToString:self.type]) {
  86. [bindingBtn setTitle:@"下一步" forState:UIControlStateNormal];
  87. } else {
  88. [bindingBtn setTitle:@"查看我的模卡" forState:UIControlStateNormal];
  89. }
  90. bindingBtn.titleLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightMedium];
  91. [bindingBtn setTitleColor:RGBValueColor(0xffffff, 1.0) forState:UIControlStateNormal];
  92. [bindingBtn addTarget:self action:@selector(bindingBtnAction) forControlEvents:UIControlEventTouchUpInside];
  93. [footerView addSubview:bindingBtn];
  94. self.tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, ScreenWidth, ScreenHeight) style:UITableViewStylePlain];
  95. // self.tableView.scrollEnabled = NO;
  96. self.tableView.backgroundColor = RGBValueColor(0xf7f7f7, 1.0);
  97. self.tableView.delegate = self;
  98. self.tableView.dataSource = self;
  99. self.tableView.showsVerticalScrollIndicator = NO;
  100. // self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
  101. self.tableView.tableHeaderView = headerView;
  102. self.tableView.tableFooterView = footerView;
  103. [self.view addSubview:self.tableView];
  104. self.view.backgroundColor = [UIColor colorWithRed:242 / 255.0 green:244 / 255.0 blue:245 / 255.0 alpha:1];
  105. [self getAreaData];
  106. }
  107. - (void)viewWillAppear:(BOOL)animated {
  108. [super viewWillAppear:animated];
  109. [self.navigationController setNavigationBarHidden:NO animated:YES];
  110. [self getModelData];
  111. }
  112. - (void)didReceiveMemoryWarning {
  113. [super didReceiveMemoryWarning];
  114. // Dispose of any resources that can be recreated.
  115. }
  116. - (void)getAreaData {
  117. [YanCNetWorkManager requestGETWithURLStr:Url_getArea(PublicUrl) parameters:@{} finish:^(id dataDic) {
  118. [self.areaArray addObjectsFromArray:dataDic[@"data"]];
  119. [self.tableView reloadData];
  120. } enError:^(NSError *error) {
  121. }];
  122. }
  123. - (void)getModelData {
  124. [YanCNetWorkManager requestGETWithURLStr:Url_getModelData(PublicUrl) parameters:@{@"modelpk": [ModelUser user].modelpk} finish:^(id dataDic) {
  125. [[ModelUser modelUser] setValuesForKeysWithDictionary:[dataDic[@"data"] firstObject]];
  126. tempUser = [ModelUser mj_objectWithKeyValues:[dataDic[@"data"] firstObject]];
  127. [self.tableView reloadData];
  128. } enError:^(NSError *error) {
  129. }];
  130. }
  131. - (void)backClick {
  132. if ([@"init" isEqualToString:self.type]) {
  133. if ([self checkInfo]) {
  134. [self.navigationController popViewControllerAnimated:YES];
  135. }
  136. } else {
  137. [self.navigationController popViewControllerAnimated:YES];
  138. }
  139. }
  140. #pragma mark -- UITableViewDelegate, UITableViewDataSource
  141. - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
  142. return self.titlesArr.count;
  143. }
  144. - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
  145. return ((NSDictionary *) self.titlesArr[section]).count;
  146. }
  147. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
  148. static NSString *reuseIdentifier = @"cellID";
  149. UITableViewCell *modelCell = [tableView dequeueReusableCellWithIdentifier:reuseIdentifier];
  150. if (modelCell == nil) {
  151. modelCell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:reuseIdentifier];
  152. }
  153. modelCell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
  154. modelCell.selectionStyle = UITableViewCellSelectionStyleNone;
  155. modelCell.detailTextLabel.textColor = RGBValueColor(0x999999, 1.0);
  156. modelCell.textLabel.textColor = RGBValueColor(0x333333, 1.0);
  157. modelCell.textLabel.font = [UIFont systemFontOfSize:14.0];
  158. modelCell.detailTextLabel.font = [UIFont systemFontOfSize:14.0];
  159. modelCell.textLabel.text = self.titlesArr[indexPath.section][indexPath.row];
  160. NSString *rowTitle = self.titlesArr[indexPath.section][indexPath.row];
  161. if ([@"照片" isEqualToString:rowTitle]) {
  162. self.photoCell = modelCell;
  163. modelCell.detailTextLabel.text = [NSString stringWithFormat:@"%@张照片", tempUser.photocount];
  164. } else if ([@"姓名" isEqualToString:rowTitle]) {
  165. self.nameCell = modelCell;
  166. modelCell.detailTextLabel.text = tempUser.pet;
  167. } else if ([@"个性签名" isEqualToString:rowTitle]) {
  168. self.lnameCell = modelCell;
  169. modelCell.detailTextLabel.text = tempUser.lname;
  170. } else if ([@"视频单价" isEqualToString:rowTitle]) {
  171. self.spdjCell = modelCell;
  172. modelCell.detailTextLabel.text = [NSString stringWithFormat:@"%@元/分钟", tempUser.vprice];
  173. } else if ([@"身高" isEqualToString:rowTitle]) {
  174. self.heiCell = modelCell;
  175. modelCell.detailTextLabel.text = [NSString stringWithFormat:@"%@cm", tempUser.hei];
  176. } else if ([@"体重" isEqualToString:rowTitle]) {
  177. self.weiCell = modelCell;
  178. modelCell.detailTextLabel.text = [NSString stringWithFormat:@"%@kg", tempUser.wei];
  179. } else if ([@"三围" isEqualToString:rowTitle]) {
  180. self.waiBustHipCell = modelCell;
  181. modelCell.detailTextLabel.text = [NSString stringWithFormat:@"%@/%@/%@", tempUser.bust, tempUser.wai, tempUser.hip];
  182. } else if ([@"地区" isEqualToString:rowTitle]) {
  183. self.areaCell = modelCell;
  184. modelCell.detailTextLabel.text = @"";
  185. for (NSDictionary *dic in self.areaArray) {
  186. if ([dic[@"pk"] isEqual:tempUser.area]) {
  187. modelCell.detailTextLabel.text = dic[@"name"];
  188. }
  189. }
  190. } else if ([@"年龄" isEqualToString:rowTitle]) {
  191. self.ageCell = modelCell;
  192. modelCell.detailTextLabel.text = tempUser.age;
  193. } else if ([@"职业" isEqualToString:rowTitle]) {
  194. self.occupationCell = modelCell;
  195. modelCell.detailTextLabel.text = tempUser.occupation;
  196. } else if ([@"星座" isEqualToString:rowTitle]) {
  197. self.constellationCell = modelCell;
  198. modelCell.detailTextLabel.text = tempUser.constellation;
  199. } else if ([@"毕业院校" isEqualToString:rowTitle]) {
  200. self.collegeCell = modelCell;
  201. modelCell.detailTextLabel.text = tempUser.college;
  202. } else if ([@"兴趣爱好" isEqualToString:rowTitle]) {
  203. self.hobbyCell = modelCell;
  204. modelCell.detailTextLabel.text = tempUser.hobby;
  205. } else if ([@"我的标签" isEqualToString:rowTitle]) {
  206. self.fgbqCell = modelCell;
  207. modelCell.detailTextLabel.text = [NSString stringWithFormat:@"%@个标签", tempUser.stylecount];
  208. } else if ([@"我的荣誉" isEqualToString:rowTitle]) {
  209. self.wdryCell = modelCell;
  210. modelCell.detailTextLabel.text = [NSString stringWithFormat:@"%@个荣誉", tempUser.honorcount];
  211. }
  212. return modelCell;
  213. }
  214. - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
  215. return 50;
  216. }
  217. - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
  218. UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];
  219. NSString *rowTitle = self.titlesArr[indexPath.section][indexPath.row];
  220. if ([@"照片" isEqualToString:rowTitle]) {
  221. ModelPhotoViewController *photovc = [ModelPhotoViewController new];
  222. [self.navigationController pushViewController:photovc animated:YES];
  223. } else if ([@"姓名" isEqualToString:rowTitle]) {
  224. InfoEditViewController *infoVc = [InfoEditViewController new];
  225. infoVc.editType = InfoEditTypeName;
  226. [self.navigationController pushViewController:infoVc animated:YES];
  227. } else if ([@"个性签名" isEqualToString:rowTitle]) {
  228. InfoEditViewController *infoVc = [InfoEditViewController new];
  229. infoVc.editType = InfoEditTypeSigature;
  230. [self.navigationController pushViewController:infoVc animated:YES];
  231. } else if ([@"视频单价" isEqualToString:rowTitle]) {
  232. InfoEditViewController *infoVc = [InfoEditViewController new];
  233. infoVc.editType = InfoEditTypeVprice;
  234. [self.navigationController pushViewController:infoVc animated:YES];
  235. } else if ([@"身高" isEqualToString:rowTitle]) {
  236. InfoEditViewController *infoVc = [InfoEditViewController new];
  237. infoVc.editType = InfoEditTypeHeight;
  238. [self.navigationController pushViewController:infoVc animated:YES];
  239. } else if ([@"体重" isEqualToString:rowTitle]) {
  240. InfoEditViewController *infoVc = [InfoEditViewController new];
  241. infoVc.editType = InfoEditTypeWeight;
  242. [self.navigationController pushViewController:infoVc animated:YES];
  243. } else if ([@"三围" isEqualToString:rowTitle]) {
  244. MeasurementsViewController *bmhVc = [MeasurementsViewController new];
  245. [self.navigationController pushViewController:bmhVc animated:YES];
  246. } else if ([@"地区" isEqualToString:rowTitle]) {
  247. NSMutableArray *tempArray = [NSMutableArray array];
  248. for (NSDictionary *dic in self.areaArray) {
  249. [tempArray addObject:dic[@"name"]];
  250. }
  251. [BRStringPickerView showStringPickerWithTitle:@"请选择地区" dataSource:tempArray defaultSelValue:nil resultBlock:^(id selectValue) {
  252. for (NSDictionary *dic in self.areaArray) {
  253. if ([dic[@"name"] isEqualToString:selectValue]) {
  254. [YanCNetWorkManager requestPostWithURLStr:Url_updateModelCard(PublicUrl)
  255. parameters:@{@"area": dic[@"pk"], @"modelpk": [ModelUser user].modelpk}
  256. finish:^(id dataDic) {
  257. if ([dataDic[@"msg"] isEqualToString:@"success"]) {
  258. [MBProgressHUD showSuccess:@"修改成功"];
  259. cell.detailTextLabel.text = selectValue;
  260. } else {
  261. [MBProgressHUD showError:@"修改失败"];
  262. }
  263. }
  264. enError:^(NSError *error) {
  265. }];
  266. }
  267. }
  268. }];
  269. } else if ([@"年龄" isEqualToString:rowTitle]) {
  270. InfoEditViewController *infoVc = [InfoEditViewController new];
  271. infoVc.editType = InfoEditTypeAge;
  272. [self.navigationController pushViewController:infoVc animated:YES];
  273. } else if ([@"职业" isEqualToString:rowTitle]) {
  274. // InfoEditViewController *infoVc = [InfoEditViewController new];
  275. // infoVc.editType = InfoEditTypeOccupation;
  276. // [self.navigationController pushViewController:infoVc animated:YES];
  277. [BRStringPickerView showStringPickerWithTitle:@"请选择职业" dataSource:self.jobArray defaultSelValue:nil resultBlock:^(id selectValue) {
  278. [YanCNetWorkManager requestPostWithURLStr:Url_updateModelCard(PublicUrl)
  279. parameters:@{@"occupation": selectValue, @"modelpk": [ModelUser user].modelpk}
  280. finish:^(id dataDic) {
  281. if ([dataDic[@"msg"] isEqualToString:@"success"]) {
  282. [MBProgressHUD showSuccess:@"修改成功"];
  283. cell.detailTextLabel.text = selectValue;
  284. } else {
  285. [MBProgressHUD showError:@"修改失败"];
  286. }
  287. }
  288. enError:^(NSError *error) {
  289. }];
  290. }];
  291. } else if ([@"星座" isEqualToString:rowTitle]) {
  292. // InfoEditViewController *infoVc = [InfoEditViewController new];
  293. // infoVc.editType = InfoEditTypeConstellation;
  294. // [self.navigationController pushViewController:infoVc animated:YES];
  295. [BRStringPickerView showStringPickerWithTitle:@"请选择星座" dataSource:self.constellationArray defaultSelValue:nil resultBlock:^(id selectValue) {
  296. [YanCNetWorkManager requestPostWithURLStr:Url_updateModelCard(PublicUrl)
  297. parameters:@{@"constellation": selectValue, @"modelpk": [ModelUser user].modelpk}
  298. finish:^(id dataDic) {
  299. if ([dataDic[@"msg"] isEqualToString:@"success"]) {
  300. [MBProgressHUD showSuccess:@"修改成功"];
  301. cell.detailTextLabel.text = selectValue;
  302. } else {
  303. [MBProgressHUD showError:@"修改失败"];
  304. }
  305. }
  306. enError:^(NSError *error) {
  307. }];
  308. }];
  309. } else if ([@"毕业院校" isEqualToString:rowTitle]) {
  310. InfoEditViewController *infoVc = [InfoEditViewController new];
  311. infoVc.editType = InfoEditTypeCollege;
  312. [self.navigationController pushViewController:infoVc animated:YES];
  313. } else if ([@"兴趣爱好" isEqualToString:rowTitle]) {
  314. HobbyViewController *hobbyVC = [[HobbyViewController alloc] init];
  315. [self.navigationController pushViewController:hobbyVC animated:YES];
  316. } else if ([@"我的标签" isEqualToString:rowTitle]) {
  317. ModelTagViewController *tagVC = [ModelTagViewController new];
  318. [self.navigationController pushViewController:tagVC animated:YES];
  319. } else if ([@"我的荣誉" isEqualToString:rowTitle]) {
  320. ModelHonorViewController *honorVc = [ModelHonorViewController new];
  321. [self.navigationController pushViewController:honorVc animated:YES];
  322. }
  323. }
  324. #pragma mark -- 保存按钮
  325. - (BOOL)checkInfo {
  326. if ([tempUser.photocount intValue] < 5) {
  327. [self.view makeToast:@"请至少上传5张照片" duration:2.0 position:CSToastPositionCenter];
  328. return NO;
  329. }
  330. if (tempUser.pet.length == 0) {
  331. [self.view makeToast:@"请填写姓名" duration:2.0 position:CSToastPositionCenter];
  332. return NO;
  333. }
  334. if (tempUser.lname.length == 0) {
  335. [self.view makeToast:@"请填写个性签名" duration:2.0 position:CSToastPositionCenter];
  336. return NO;
  337. }
  338. if (tempUser.vprice.length == 0) {
  339. [self.view makeToast:@"请填写视频单价" duration:2.0 position:CSToastPositionCenter];
  340. return NO;
  341. }
  342. if (tempUser.hei.length == 0 || [@"0" isEqualToString:tempUser.hei]) {
  343. [self.view makeToast:@"请填写身高" duration:2.0 position:CSToastPositionCenter];
  344. return NO;
  345. }
  346. if (tempUser.wei.length == 0 || [@"0" isEqualToString:tempUser.wei]) {
  347. [self.view makeToast:@"请填写体重" duration:2.0 position:CSToastPositionCenter];
  348. return NO;
  349. }
  350. if (tempUser.bust.length == 0) {
  351. [self.view makeToast:@"请填写三围" duration:2.0 position:CSToastPositionCenter];
  352. return NO;
  353. }
  354. if (tempUser.area.length == 0) {
  355. [self.view makeToast:@"请填写地区" duration:2.0 position:CSToastPositionCenter];
  356. return NO;
  357. }
  358. if (tempUser.age.length == 0) {
  359. [self.view makeToast:@"请填写年龄" duration:2.0 position:CSToastPositionCenter];
  360. return NO;
  361. }
  362. if (tempUser.occupation.length == 0) {
  363. [self.view makeToast:@"请填写职业" duration:2.0 position:CSToastPositionCenter];
  364. return NO;
  365. }
  366. if (tempUser.constellation.length == 0) {
  367. [self.view makeToast:@"请填写星座" duration:2.0 position:CSToastPositionCenter];
  368. return NO;
  369. }
  370. if (tempUser.college.length == 0) {
  371. [self.view makeToast:@"请填写毕业院校" duration:2.0 position:CSToastPositionCenter];
  372. return NO;
  373. }
  374. return YES;
  375. }
  376. - (void)bindingBtnAction {
  377. if ([self checkInfo]) {
  378. if ([@"init" isEqualToString:self.type]) {
  379. MySkillsController *mySkillsVC = [[MySkillsController alloc] init];
  380. [self.navigationController pushViewController:mySkillsVC animated:YES];
  381. } else {
  382. ShareCardController *shareCardVC = [[ShareCardController alloc] init];
  383. [self.navigationController pushViewController:shareCardVC animated:YES];
  384. }
  385. }
  386. // [MBProgressHUD showSuccess:@"保存成功"];
  387. // [NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(backClick) userInfo:nil repeats:NO];
  388. }
  389. #pragma mark -- 网络请求
  390. - (void)postDataFromNetworking {
  391. [MBProgressHUD showHUDAddedTo:self.view animated:YES];
  392. ModelUser *modelUser = [ModelUser user];
  393. NSDictionary *dic = @{@"modelpk": modelUser.modelpk, @"lname": self.lnameCell.textLabel.text};
  394. [YanCNetWorkManager requestPostWithURLStr:Url_updateModelCard(PublicUrl)
  395. parameters:dic
  396. finish:^(id dataDic) {
  397. [MBProgressHUD hideHUDForView:self.view animated:YES];
  398. NSString *issuccess = dataDic[@"msg"];
  399. if ([issuccess isEqualToString:@"success"]) {
  400. [MBProgressHUD showSuccess:@"保存成功"];
  401. } else {
  402. }
  403. }
  404. enError:^(NSError *error) {
  405. [MBProgressHUD hideHUDForView:self.view animated:YES];
  406. }];
  407. }
  408. @end