NewListVC.m 45 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117
  1. //
  2. // RenGouViewController.m
  3. // upAPP
  4. //
  5. // Created by 樊亮 on 2020/4/3.
  6. // Copyright © 2020 youke. All rights reserved.
  7. //
  8. #import "NewListVC.h"
  9. #import "ACMediaFrame.h"
  10. #import "UIView+ACMediaExt.h"
  11. #import "YDFlexoView.h"
  12. #import "RadioButton.h"
  13. #import "DatePickerView.h"
  14. #import "OSSImageUploader.h"
  15. #import "ProjectControlsVC.h"
  16. #import "UIExPickerView.h"
  17. #import "yetaiModel.h"
  18. @interface NewListVC ()<UIScrollViewDelegate,UITextViewDelegate,UITextFieldDelegate,pickerDelegate>
  19. {
  20. CGFloat _mediaH;
  21. ACSelectMediaView *_mediaView;
  22. }
  23. @property(nonatomic,strong)UILabel *titleLab;
  24. @property(nonatomic,strong)UITableView *tab;
  25. @property(nonatomic,strong)NSMutableArray *imageArr;
  26. @property(nonatomic,strong)UIButton *sendBtn;
  27. @property(nonatomic,strong)UITextView *describeText;
  28. @property(nonatomic,strong)UILabel *lbl;
  29. @property(nonatomic,strong)NSArray *sectionArr;
  30. @property(nonatomic,strong)NSArray *kehuInfoArr;
  31. @property(nonatomic,strong)NSArray *projectInfoArr;
  32. @property(nonatomic,strong)NSArray *contractInfoArr;
  33. @property(nonatomic,strong)UITextField *nameField;
  34. @property(nonatomic,strong)UITextField *phoneField;
  35. @property(nonatomic,strong)UITextField *numberField;
  36. @property(nonatomic,strong)UITextField *positionField;
  37. @property(nonatomic,strong)UITextField *mianjiField;
  38. @property(nonatomic,strong)UILabel *ProjectLab;
  39. @property(nonatomic,strong)UITextField *SerialField;
  40. @property(nonatomic,strong)UILabel *dateLab;
  41. @property(nonatomic,strong)UITextField *typeField;
  42. @property(nonatomic,strong)UITextField *priceField;
  43. @property(nonatomic,strong)UITextField *dateField;
  44. @property(nonatomic,strong)UITextField *areaField;
  45. @property(nonatomic,strong)UIButton *dateBtn;
  46. @property(nonatomic,strong)UIScrollView *scrollView;
  47. @property(nonatomic,strong)UIView *contentView;
  48. @property(nonatomic,strong)UIView *view1;
  49. @property(nonatomic,strong)UILabel *titleLab1;
  50. @property(nonatomic,strong)UILabel *yetaiLLL;//业态
  51. @property(nonatomic,strong)UIButton *yetaiBtn;//业态
  52. @property (nonatomic,strong) DatePickerView *datePicker;
  53. @property (nonatomic,strong) UIExPickerView *yetaiPicker;
  54. @property (strong, nonatomic) HttpRequestManger *sessionManager;
  55. @property(nonatomic,strong)NSMutableArray *uploadImages;
  56. @property(nonatomic,strong)NSMutableArray *dataArr;
  57. @property(nonatomic,strong)NSMutableArray *dataA;
  58. @property(nonatomic,strong)NSMutableArray *dataB;
  59. @property(nonatomic,strong)NSString *yetaiStr;//业态字段
  60. @property(nonatomic,strong)NSString *yetaiNum;//业态对应value
  61. @end
  62. @implementation NewListVC
  63. - (HttpRequestManger*) sessionManager{
  64. if (!_sessionManager) {
  65. _sessionManager = [[HttpRequestManger alloc]init];
  66. }
  67. return _sessionManager;
  68. }
  69. - (void)viewDidLoad {
  70. [super viewDidLoad];
  71. [self.navigationView removeAllLeftButton];
  72. self.view.backgroundColor = [UIColor colorWithHexValue:0xF7F8FA];
  73. _titleLab = [[UILabel alloc]init];
  74. _titleLab.frame = CGRectMake(0,0, kGScreenWidth-60, 30);
  75. if([_typeString isEqualToString:@"待认购"]){
  76. _titleLab.text = @"录认购";
  77. }else{
  78. _titleLab.text = @"录意向";
  79. }
  80. [self.navigationView addTitleView:_titleLab];
  81. kWeakSelf(self);
  82. [self.navigationView addLeftButtonWithImage:[UIImage imageNamed:@"btn_back"] clickCallBack:^(UIView *view) {
  83. [weakself.navigationController popViewControllerAnimated:YES];
  84. }];
  85. [self loadDate];
  86. [self setUI];
  87. }
  88. -(void)setUI{
  89. _scrollView = [[UIScrollView alloc]initWithFrame:CGRectMake(0, NaviHeight, kGScreenWidth, kGScreenHeight -NaviHeight -70)];
  90. _scrollView.backgroundColor = [UIColor colorWithHexValue:0xf7f8fa];
  91. _scrollView.contentSize = CGSizeMake(kGScreenWidth, kGScreenHeight +150);
  92. _scrollView.scrollEnabled = YES;//控制控件是否能滚动
  93. _scrollView.showsHorizontalScrollIndicator = NO;//水平方向的滚动指示
  94. _scrollView.bounces = YES;
  95. [self.view addSubview:_scrollView];
  96. UIView *bottomView = [[UIView alloc]initWithFrame:CGRectMake(15, kGScreenHeight -70, kGScreenWidth-30, 50)];
  97. bottomView.backgroundColor = [UIColor colorWithHexValue:0x64ABFF];
  98. [self.view addSubview:bottomView];
  99. _sendBtn = [UIButton buttonWithType:UIButtonTypeCustom];
  100. _sendBtn.frame = CGRectMake(0, 0, kGScreenWidth-30, 50);
  101. [_sendBtn setTitle:@"提交" forState:UIControlStateNormal];
  102. _sendBtn.backgroundColor = [UIColor colorWithHexValue:0x64ABFF];
  103. [_sendBtn setTintColor:[UIColor whiteColor]];
  104. [_sendBtn addTarget:self action:@selector(buttonEvent:) forControlEvents:UIControlEventTouchUpInside];
  105. [bottomView addSubview:_sendBtn];
  106. if([_typeString isEqualToString:@"待认购"]){
  107. _sectionArr = @[@"认购客户信息",@"认购信息"];
  108. }else{
  109. _sectionArr = @[@"认购客户信息",@"意向信息"];
  110. }
  111. _kehuInfoArr = @[@"品牌名称:",@"客户姓名:",@"联系方式:",@"公司职位:"];
  112. //商铺号 业态 面积
  113. _projectInfoArr =@[@"项目名称:",@"商铺号:",@"意向业态:",@"意向面积:",@"意向价格:",@"认购日期:",@"意向总价:"];
  114. UILabel *titleLa1 = [[UILabel alloc]init];
  115. titleLa1.textColor = [UIColor blackColor];
  116. titleLa1.font = TextFont(16.5);
  117. titleLa1.text = _sectionArr[0];
  118. [_scrollView addSubview:titleLa1];
  119. [titleLa1 mas_makeConstraints:^(MASConstraintMaker *make) {
  120. make.size.mas_equalTo(CGSizeMake(120, 15));
  121. make.left.equalTo(_scrollView.mas_left).offset(15);
  122. make.top.equalTo(_scrollView.mas_top).offset(15);
  123. }];
  124. UIView *view1 =[[UIView alloc]initWithFrame:CGRectMake(0, 45, kGScreenWidth, 180)];
  125. view1.backgroundColor = [UIColor whiteColor];
  126. [_scrollView addSubview:view1];
  127. UIImageView *xingImage = [[UIImageView alloc]init];
  128. xingImage.image = [UIImage imageNamed:@"redxing"];
  129. [view1 addSubview:xingImage];
  130. [xingImage mas_makeConstraints:^(MASConstraintMaker *make) {
  131. make.left.equalTo(view1.mas_left).offset(15);
  132. make.top.equalTo(view1.mas_top).offset(18);
  133. make.size.mas_equalTo(CGSizeMake(8, 8));
  134. }];
  135. UILabel *titleLa2 = [[UILabel alloc]init];
  136. titleLa2.textColor = [UIColor blackColor];
  137. titleLa2.font = TextFont(15);
  138. titleLa2.textAlignment = NSTextAlignmentRight;
  139. [view1 addSubview:titleLa2];
  140. titleLa2.text = _kehuInfoArr[0];
  141. [titleLa2 mas_makeConstraints:^(MASConstraintMaker *make) {
  142. make.left.equalTo(xingImage.mas_right).offset(3);
  143. make.top.equalTo(view1.mas_top).offset(15);
  144. make.size.mas_equalTo(CGSizeMake(70, 15));
  145. }];
  146. _nameField = [[UITextField alloc]init];
  147. _nameField.placeholder =@"请输入品牌名称";
  148. _nameField.text = self.brandStr;
  149. _nameField.textAlignment = NSTextAlignmentLeft;
  150. _nameField.textColor = [UIColor blackColor];
  151. _nameField.font = TextFont(15);
  152. [view1 addSubview:_nameField];
  153. [_nameField mas_makeConstraints:^(MASConstraintMaker *make) {
  154. make.size.mas_equalTo(CGSizeMake(kGScreenWidth - 150, 20));
  155. make.left.equalTo(titleLa2.mas_right).offset(18);
  156. make.top.equalTo(view1.mas_top).offset(13);
  157. }];
  158. UIView *line1 = [[UIView alloc]init];
  159. line1.backgroundColor = [UIColor colorWithHexValue:0xf7f8fa];
  160. [view1 addSubview:line1];
  161. [line1 mas_makeConstraints:^(MASConstraintMaker *make) {
  162. make.left.equalTo(view1.mas_left);
  163. make.top.equalTo(titleLa2.mas_bottom).offset(15);
  164. make.size.mas_equalTo(CGSizeMake(kGScreenWidth, 0.8));
  165. }];
  166. UIImageView *xingImage1 = [[UIImageView alloc]init];
  167. xingImage1.image = [UIImage imageNamed:@"redxing"];
  168. [view1 addSubview:xingImage1];
  169. [xingImage1 mas_makeConstraints:^(MASConstraintMaker *make) {
  170. make.left.equalTo(view1.mas_left).offset(15);
  171. make.top.equalTo(line1.mas_top).offset(18);
  172. make.size.mas_equalTo(CGSizeMake(8, 8));
  173. }];
  174. UILabel *titleLa3 = [[UILabel alloc]init];
  175. titleLa3.textColor = [UIColor blackColor];
  176. titleLa3.font = TextFont(15);
  177. titleLa3.textAlignment = NSTextAlignmentRight;
  178. [view1 addSubview:titleLa3];
  179. titleLa3.text = _kehuInfoArr[1];
  180. [titleLa3 mas_makeConstraints:^(MASConstraintMaker *make) {
  181. make.left.equalTo(xingImage1.mas_right).offset(3);
  182. make.top.equalTo(line1.mas_top).offset(15);
  183. make.size.mas_equalTo(CGSizeMake(70, 15));
  184. }];
  185. _phoneField = [[UITextField alloc]init];
  186. _phoneField.placeholder =@"请输入客户姓名";
  187. _phoneField.text = _name;
  188. _phoneField.textAlignment = NSTextAlignmentLeft;
  189. _phoneField.textColor = [UIColor blackColor];
  190. _phoneField.keyboardType = UIKeyboardTypeNumberPad;
  191. _phoneField.delegate =self;
  192. _phoneField.font = TextFont(15);
  193. [view1 addSubview:_phoneField];
  194. [_phoneField mas_makeConstraints:^(MASConstraintMaker *make) {
  195. make.size.mas_equalTo(CGSizeMake(kGScreenWidth - 150, 30));
  196. make.left.equalTo(titleLa3.mas_right).offset(18);
  197. make.top.equalTo(line1.mas_top).offset(8);
  198. }];
  199. [self setUpPhoneTextfield];
  200. UIView *line2 = [[UIView alloc]init];
  201. line2.backgroundColor = [UIColor colorWithHexValue:0xf7f8fa];
  202. [view1 addSubview:line2];
  203. [line2 mas_makeConstraints:^(MASConstraintMaker *make) {
  204. make.left.equalTo(view1.mas_left);
  205. make.top.equalTo(titleLa3.mas_bottom).offset(15);
  206. make.size.mas_equalTo(CGSizeMake(kGScreenWidth, 1));
  207. }];
  208. UIImageView *xingImage2 = [[UIImageView alloc]init];
  209. xingImage2.image = [UIImage imageNamed:@"redxing"];
  210. [view1 addSubview:xingImage2];
  211. [xingImage2 mas_makeConstraints:^(MASConstraintMaker *make) {
  212. make.left.equalTo(view1.mas_left).offset(15);
  213. make.top.equalTo(line2.mas_top).offset(18);
  214. make.size.mas_equalTo(CGSizeMake(8, 8));
  215. }];
  216. UILabel *titleLa4 = [[UILabel alloc]init];
  217. titleLa4.textColor = [UIColor blackColor];
  218. titleLa4.font = TextFont(15);
  219. titleLa4.textAlignment = NSTextAlignmentRight;
  220. [view1 addSubview:titleLa4];
  221. titleLa4.text = _kehuInfoArr[2];
  222. [titleLa4 mas_makeConstraints:^(MASConstraintMaker *make) {
  223. make.left.equalTo(xingImage2.mas_right).offset(3);
  224. make.top.equalTo(line2.mas_top).offset(15);
  225. make.size.mas_equalTo(CGSizeMake(70, 15));
  226. }];
  227. _numberField = [[UITextField alloc]init];
  228. _numberField.placeholder =@"请输入联系方式";
  229. _numberField.textAlignment = NSTextAlignmentLeft;
  230. _numberField.textColor = [UIColor blackColor];
  231. _numberField.font = TextFont(15);
  232. [view1 addSubview:_numberField];
  233. [_numberField mas_makeConstraints:^(MASConstraintMaker *make) {
  234. make.size.mas_equalTo(CGSizeMake(kGScreenWidth - 150, 30));
  235. make.left.equalTo(titleLa3.mas_right).offset(18);
  236. make.top.equalTo(line2.mas_top).offset(8);
  237. }];
  238. //-----------------------
  239. UIView *lineL = [[UIView alloc]init];
  240. lineL.backgroundColor = [UIColor colorWithHexValue:0xf7f8fa];
  241. [view1 addSubview:lineL];
  242. [lineL mas_makeConstraints:^(MASConstraintMaker *make) {
  243. make.left.equalTo(view1.mas_left);
  244. make.top.equalTo(titleLa4.mas_bottom).offset(15);
  245. make.size.mas_equalTo(CGSizeMake(kGScreenWidth, 1));
  246. }];
  247. UIImageView *signImg = [[UIImageView alloc]init];
  248. signImg.image = [UIImage imageNamed:@"redxing"];
  249. [view1 addSubview:signImg];
  250. [signImg mas_makeConstraints:^(MASConstraintMaker *make) {
  251. make.left.equalTo(view1.mas_left).offset(15);
  252. make.top.equalTo(lineL.mas_top).offset(18);
  253. make.size.mas_equalTo(CGSizeMake(8, 8));
  254. }];
  255. UILabel *titleL = [[UILabel alloc]init];
  256. titleL.textColor = [UIColor blackColor];
  257. titleL.font = TextFont(15);
  258. titleL.textAlignment = NSTextAlignmentRight;
  259. [view1 addSubview:titleL];
  260. titleL.text = _kehuInfoArr[3];
  261. [titleL mas_makeConstraints:^(MASConstraintMaker *make) {
  262. make.left.equalTo(signImg.mas_right).offset(3);
  263. make.top.equalTo(lineL.mas_top).offset(15);
  264. make.size.mas_equalTo(CGSizeMake(70, 15));
  265. }];
  266. _positionField = [[UITextField alloc]init];
  267. _positionField.placeholder =@"请输入公司职位";
  268. _positionField.textAlignment = NSTextAlignmentLeft;
  269. _positionField.textColor = [UIColor blackColor];
  270. _positionField.font = TextFont(15);
  271. [view1 addSubview:_positionField];
  272. [_positionField mas_makeConstraints:^(MASConstraintMaker *make) {
  273. make.size.mas_equalTo(CGSizeMake(kGScreenWidth - 150, 30));
  274. make.left.equalTo(titleL.mas_right).offset(18);
  275. make.top.equalTo(lineL.mas_top).offset(8);
  276. }];
  277. //++++++++++++++++++++++++
  278. UILabel *titleLa5 = [[UILabel alloc]init];
  279. titleLa5.textColor = [UIColor blackColor];
  280. titleLa5.font = TextFont(16.5);
  281. titleLa5.text = _sectionArr[1];
  282. [_scrollView addSubview:titleLa5];
  283. [titleLa5 mas_makeConstraints:^(MASConstraintMaker *make) {
  284. make.size.mas_equalTo(CGSizeMake(120, 15));
  285. make.left.equalTo(_scrollView.mas_left).offset(15);
  286. make.top.equalTo(view1.mas_bottom).offset(15);
  287. }];
  288. UIView *view2 =[[UIView alloc]init];
  289. view2.backgroundColor = [UIColor whiteColor];
  290. [_scrollView addSubview:view2];
  291. [view2 mas_makeConstraints:^(MASConstraintMaker *make) {
  292. make.size.mas_equalTo(CGSizeMake(kGScreenWidth, 320));
  293. make.left.equalTo(_scrollView.mas_left);
  294. make.top.equalTo(titleLa5.mas_bottom).offset(15);
  295. }];
  296. //项目名称
  297. UIImageView *xingImage3 = [[UIImageView alloc]init];
  298. xingImage3.image = [UIImage imageNamed:@"redxing"];
  299. [view2 addSubview:xingImage3];
  300. [xingImage3 mas_makeConstraints:^(MASConstraintMaker *make) {
  301. make.left.equalTo(view2.mas_left).offset(15);
  302. make.top.equalTo(view2.mas_top).offset(18);
  303. make.size.mas_equalTo(CGSizeMake(8, 8));
  304. }];
  305. UILabel *titleLa6 = [[UILabel alloc]init];
  306. titleLa6.textColor = [UIColor blackColor];
  307. titleLa6.font = TextFont(15);
  308. titleLa6.textAlignment = NSTextAlignmentRight;
  309. [view2 addSubview:titleLa6];
  310. titleLa6.text = _projectInfoArr[0];
  311. [titleLa6 mas_makeConstraints:^(MASConstraintMaker *make) {
  312. make.left.equalTo(xingImage3.mas_right).offset(3);
  313. make.top.equalTo(view2.mas_top).offset(15);
  314. make.size.mas_equalTo(CGSizeMake(70, 15));
  315. }];
  316. _ProjectLab = [[UILabel alloc]init];
  317. _ProjectLab.textColor = [UIColor blackColor];
  318. _ProjectLab.font = TextFont(15);
  319. _ProjectLab.textAlignment = NSTextAlignmentLeft;
  320. [view2 addSubview:_ProjectLab];
  321. _ProjectLab.text = _projectName;
  322. [_ProjectLab mas_makeConstraints:^(MASConstraintMaker *make) {
  323. make.size.mas_equalTo(CGSizeMake(kGScreenWidth - 150, 20));
  324. make.left.equalTo(titleLa6.mas_right).offset(18);
  325. make.top.equalTo(view2.mas_top).offset(13);
  326. }];
  327. UIView *line3 = [[UIView alloc]init];
  328. line3.backgroundColor = [UIColor colorWithHexValue:0xf7f8fa];
  329. [view2 addSubview:line3];
  330. [line3 mas_makeConstraints:^(MASConstraintMaker *make) {
  331. make.left.equalTo(view2.mas_left);
  332. make.top.equalTo(titleLa6.mas_bottom).offset(15);
  333. make.size.mas_equalTo(CGSizeMake(kGScreenWidth,1));
  334. }];
  335. //商铺号
  336. UIImageView *xingImage4 = [[UIImageView alloc]init];
  337. xingImage4.image = [UIImage imageNamed:@"redxing"];
  338. [view2 addSubview:xingImage4];
  339. [xingImage4 mas_makeConstraints:^(MASConstraintMaker *make) {
  340. make.left.equalTo(view2.mas_left).offset(15);
  341. make.top.equalTo(line3.mas_top).offset(18);
  342. make.size.mas_equalTo(CGSizeMake(8, 8));
  343. }];
  344. UILabel *titleLa7 = [[UILabel alloc]init];
  345. titleLa7.textColor = [UIColor blackColor];
  346. titleLa7.font = TextFont(15);
  347. titleLa7.textAlignment = NSTextAlignmentRight;
  348. [view2 addSubview:titleLa7];
  349. titleLa7.text = _projectInfoArr[1];
  350. [titleLa7 mas_makeConstraints:^(MASConstraintMaker *make) {
  351. make.left.equalTo(xingImage4.mas_right).offset(3);
  352. make.top.equalTo(line3.mas_top).offset(15);
  353. make.size.mas_equalTo(CGSizeMake(70, 15));
  354. }];
  355. _SerialField = [[UITextField alloc]init];
  356. _SerialField.placeholder =@"请输入商铺号";
  357. _SerialField.textAlignment = NSTextAlignmentLeft;
  358. _SerialField.textColor = [UIColor blackColor];
  359. _SerialField.font = TextFont(15);
  360. [view2 addSubview:_SerialField];
  361. [_SerialField mas_makeConstraints:^(MASConstraintMaker *make) {
  362. make.size.mas_equalTo(CGSizeMake(kGScreenWidth - 150, 30));
  363. make.left.equalTo(titleLa7.mas_right).offset(18);
  364. make.top.equalTo(line3.mas_top).offset(8);
  365. }];
  366. UIView *line33 = [[UIView alloc]init];
  367. line33.backgroundColor = [UIColor colorWithHexValue:0xf7f8fa];
  368. [view2 addSubview:line33];
  369. [line33 mas_makeConstraints:^(MASConstraintMaker *make) {
  370. make.left.equalTo(view2.mas_left);
  371. make.top.equalTo(titleLa7.mas_bottom).offset(15);
  372. make.size.mas_equalTo(CGSizeMake(kGScreenWidth,1));
  373. }];
  374. //新增 业态
  375. //++++++++++++[@"项目名称:",@"商铺号:",@"业态:",@"面积:",@"价格:",@"认购日期:",@"总价:"];
  376. UIImageView *yetaiImage = [[UIImageView alloc]init];
  377. yetaiImage.image = [UIImage imageNamed:@"redxing"];
  378. [view2 addSubview:yetaiImage];
  379. [yetaiImage mas_makeConstraints:^(MASConstraintMaker *make) {
  380. make.left.equalTo(view2.mas_left).offset(15);
  381. make.top.equalTo(line33.mas_top).offset(18);
  382. make.size.mas_equalTo(CGSizeMake(8, 8));
  383. }];
  384. UILabel *yetaiLbl = [[UILabel alloc]init];
  385. yetaiLbl.textColor = [UIColor blackColor];
  386. yetaiLbl.font = TextFont(15);
  387. yetaiLbl.textAlignment = NSTextAlignmentRight;
  388. [view2 addSubview:yetaiLbl];
  389. yetaiLbl.text = _projectInfoArr[2];
  390. [yetaiLbl mas_makeConstraints:^(MASConstraintMaker *make) {
  391. make.left.equalTo(yetaiImage.mas_right).offset(3);
  392. make.top.equalTo(line33.mas_top).offset(15);
  393. make.size.mas_equalTo(CGSizeMake(70, 15));
  394. }];
  395. _yetaiLLL = [[UILabel alloc]init];
  396. _yetaiLLL.textColor = [UIColor colorWithHexValue:0x898989];
  397. _yetaiLLL.font = TextFont(15);
  398. _yetaiLLL.textAlignment = NSTextAlignmentLeft;
  399. [view2 addSubview:_yetaiLLL];
  400. _yetaiLLL.text = @"请选择业态";
  401. [_yetaiLLL mas_makeConstraints:^(MASConstraintMaker *make) {
  402. make.size.mas_equalTo(CGSizeMake(100, 30));
  403. make.left.equalTo(yetaiLbl.mas_right).offset(18);
  404. make.top.equalTo(line33.mas_top).offset(8);
  405. }];
  406. UIView *yetailine = [[UIView alloc]init];
  407. yetailine.backgroundColor = [UIColor colorWithHexValue:0xf7f8fa];
  408. [view2 addSubview:yetailine];
  409. [yetailine mas_makeConstraints:^(MASConstraintMaker *make) {
  410. make.left.equalTo(view2.mas_left);
  411. make.top.equalTo(yetaiLbl.mas_bottom).offset(15);
  412. make.size.mas_equalTo(CGSizeMake(kGScreenWidth,1));
  413. }];
  414. _yetaiBtn = [UIButton buttonWithType:UIButtonTypeCustom];
  415. [_yetaiBtn setBackgroundImage:[UIImage imageNamed:@"zhankai1-copy"] forState:UIControlStateNormal];
  416. [_yetaiBtn addTarget:self action:@selector(yetaiClick:) forControlEvents:UIControlEventTouchUpInside];
  417. [view2 addSubview:_yetaiBtn];
  418. [_yetaiBtn mas_makeConstraints:^(MASConstraintMaker *make) {
  419. make.size.mas_equalTo(CGSizeMake(22, 22));
  420. make.left.equalTo(_yetaiLLL.mas_right).offset(8);
  421. make.top.equalTo(line33.mas_top).offset(10);
  422. }];
  423. //----------------------
  424. //新增面积
  425. //++++++++++++++++++++++
  426. UIImageView *mianjiImg = [[UIImageView alloc]init];
  427. mianjiImg.image = [UIImage imageNamed:@"redxing"];
  428. [view2 addSubview:mianjiImg];
  429. [mianjiImg mas_makeConstraints:^(MASConstraintMaker *make) {
  430. make.left.equalTo(view2.mas_left).offset(15);
  431. make.top.equalTo(yetailine.mas_top).offset(18);
  432. make.size.mas_equalTo(CGSizeMake(8, 8));
  433. }];
  434. UILabel *mianjiLbl = [[UILabel alloc]init];
  435. mianjiLbl.textColor = [UIColor blackColor];
  436. mianjiLbl.font = TextFont(15);
  437. mianjiLbl.textAlignment = NSTextAlignmentRight;
  438. [view2 addSubview:mianjiLbl];
  439. mianjiLbl.text = _projectInfoArr[3];
  440. [mianjiLbl mas_makeConstraints:^(MASConstraintMaker *make) {
  441. make.left.equalTo(mianjiImg.mas_right).offset(3);
  442. make.top.equalTo(yetailine.mas_top).offset(15);
  443. make.size.mas_equalTo(CGSizeMake(70, 15));
  444. }];
  445. _mianjiField = [[UITextField alloc]init];
  446. _mianjiField.placeholder =@"请输入面积";
  447. _mianjiField.textAlignment = NSTextAlignmentLeft;
  448. _mianjiField.textColor = [UIColor blackColor];
  449. _mianjiField.font = TextFont(15);
  450. [view2 addSubview:_mianjiField];
  451. [_mianjiField mas_makeConstraints:^(MASConstraintMaker *make) {
  452. make.size.mas_equalTo(CGSizeMake(kGScreenWidth - 150, 30));
  453. make.left.equalTo(mianjiLbl.mas_right).offset(18);
  454. make.top.equalTo(yetailine.mas_top).offset(8);
  455. }];
  456. UIView *mianjiLine = [[UIView alloc]init];
  457. mianjiLine.backgroundColor = [UIColor colorWithHexValue:0xf7f8fa];
  458. [view2 addSubview:mianjiLine];
  459. [mianjiLine mas_makeConstraints:^(MASConstraintMaker *make) {
  460. make.left.equalTo(view2.mas_left);
  461. make.top.equalTo(mianjiLbl.mas_bottom).offset(15);
  462. make.size.mas_equalTo(CGSizeMake(kGScreenWidth,1));
  463. }];
  464. //----------------------
  465. //价格
  466. UIImageView *xingImage5 = [[UIImageView alloc]init];
  467. xingImage5.image = [UIImage imageNamed:@"redxing"];
  468. [view2 addSubview:xingImage5];
  469. [xingImage5 mas_makeConstraints:^(MASConstraintMaker *make) {
  470. make.left.equalTo(view2.mas_left).offset(15);
  471. make.top.equalTo(mianjiLine.mas_top).offset(18);
  472. make.size.mas_equalTo(CGSizeMake(8, 8));
  473. }];
  474. UILabel *titleLa8 = [[UILabel alloc]init];
  475. titleLa8.textColor = [UIColor blackColor];
  476. titleLa8.font = TextFont(15);
  477. titleLa8.textAlignment = NSTextAlignmentRight;
  478. [view2 addSubview:titleLa8];
  479. titleLa8.text = _projectInfoArr[4];
  480. [titleLa8 mas_makeConstraints:^(MASConstraintMaker *make) {
  481. make.left.equalTo(xingImage5.mas_right).offset(3);
  482. make.top.equalTo(mianjiLine.mas_top).offset(15);
  483. make.size.mas_equalTo(CGSizeMake(70, 15));
  484. }];
  485. _priceField = [[UITextField alloc]init];
  486. _priceField.placeholder =@"请输入价格";
  487. _priceField.textAlignment = NSTextAlignmentLeft;
  488. _priceField.textColor = [UIColor blackColor];
  489. _priceField.font = TextFont(15);
  490. [view2 addSubview:_priceField];
  491. [_priceField mas_makeConstraints:^(MASConstraintMaker *make) {
  492. make.size.mas_equalTo(CGSizeMake(kGScreenWidth - 150, 30));
  493. make.left.equalTo(titleLa8.mas_right).offset(18);
  494. make.top.equalTo(mianjiLine.mas_top).offset(8);
  495. }];
  496. UIView *line4 = [[UIView alloc]init];
  497. line4.backgroundColor = [UIColor colorWithHexValue:0xf7f8fa];
  498. [view2 addSubview:line4];
  499. [line4 mas_makeConstraints:^(MASConstraintMaker *make) {
  500. make.left.equalTo(view2.mas_left);
  501. make.top.equalTo(titleLa8.mas_bottom).offset(15);
  502. make.size.mas_equalTo(CGSizeMake(kGScreenWidth,1));
  503. }];
  504. //认购日期
  505. UIImageView *xingImage6 = [[UIImageView alloc]init];
  506. xingImage6.image = [UIImage imageNamed:@"redxing"];
  507. [view2 addSubview:xingImage6];
  508. [xingImage6 mas_makeConstraints:^(MASConstraintMaker *make) {
  509. make.left.equalTo(view2.mas_left).offset(15);
  510. make.top.equalTo(line4.mas_top).offset(18);
  511. make.size.mas_equalTo(CGSizeMake(8, 8));
  512. }];
  513. UILabel *titleLa9 = [[UILabel alloc]init];
  514. titleLa9.textColor = [UIColor blackColor];
  515. titleLa9.font = TextFont(15);
  516. titleLa9.textAlignment = NSTextAlignmentRight;
  517. [view2 addSubview:titleLa9];
  518. titleLa9.text = _projectInfoArr[5];
  519. [titleLa9 mas_makeConstraints:^(MASConstraintMaker *make) {
  520. make.left.equalTo(xingImage6.mas_right).offset(3);
  521. make.top.equalTo(line4.mas_top).offset(15);
  522. make.size.mas_equalTo(CGSizeMake(70, 15));
  523. }];
  524. _dateLab = [[UILabel alloc]init];
  525. _dateLab.textColor = [UIColor colorWithHexValue:0x898989];
  526. _dateLab.font = TextFont(15);
  527. _dateLab.text = @"请选择";
  528. _dateLab.textAlignment = NSTextAlignmentLeft;
  529. [view2 addSubview:_dateLab];
  530. [_dateLab mas_makeConstraints:^(MASConstraintMaker *make) {
  531. make.size.mas_equalTo(CGSizeMake(100, 30));
  532. make.left.equalTo(titleLa9.mas_right).offset(18);
  533. make.top.equalTo(line4.mas_top).offset(8);
  534. }];
  535. _dateBtn = [UIButton buttonWithType:UIButtonTypeCustom];
  536. [_dateBtn setBackgroundImage:[UIImage imageNamed:@"icon_date"] forState:UIControlStateNormal];
  537. [_dateBtn addTarget:self action:@selector(dateClick:) forControlEvents:UIControlEventTouchUpInside];
  538. [view2 addSubview:_dateBtn];
  539. [_dateBtn mas_makeConstraints:^(MASConstraintMaker *make) {
  540. make.size.mas_equalTo(CGSizeMake(22, 22));
  541. make.left.equalTo(_dateLab.mas_right).offset(8);
  542. make.top.equalTo(line4.mas_top).offset(10);
  543. }];
  544. UIView *line5 = [[UIView alloc]init];
  545. line5.backgroundColor = [UIColor colorWithHexValue:0xf7f8fa];
  546. [view2 addSubview:line5];
  547. [line5 mas_makeConstraints:^(MASConstraintMaker *make) {
  548. make.left.equalTo(view2.mas_left);
  549. make.top.equalTo(titleLa9.mas_bottom).offset(15);
  550. make.size.mas_equalTo(CGSizeMake(kGScreenWidth,1));
  551. }];
  552. UIImageView *xingImage7 = [[UIImageView alloc]init];
  553. xingImage7.image = [UIImage imageNamed:@"redxing"];
  554. [view2 addSubview:xingImage7];
  555. [xingImage7 mas_makeConstraints:^(MASConstraintMaker *make) {
  556. make.left.equalTo(view2.mas_left).offset(15);
  557. make.top.equalTo(line5.mas_top).offset(18);
  558. make.size.mas_equalTo(CGSizeMake(8, 8));
  559. }];
  560. UILabel *titleLa10 = [[UILabel alloc]init];
  561. titleLa10.textColor = [UIColor blackColor];
  562. titleLa10.font = TextFont(15);
  563. titleLa10.textAlignment = NSTextAlignmentRight;
  564. [view2 addSubview:titleLa10];
  565. titleLa10.text = _projectInfoArr[6];
  566. [titleLa10 mas_makeConstraints:^(MASConstraintMaker *make) {
  567. make.left.equalTo(xingImage7.mas_right).offset(3);
  568. make.top.equalTo(line5.mas_top).offset(15);
  569. make.size.mas_equalTo(CGSizeMake(70, 15));
  570. }];
  571. _areaField = [[UITextField alloc]init];
  572. _areaField.placeholder =@"请输入房款总额";
  573. _areaField.textAlignment = NSTextAlignmentLeft;
  574. _areaField.textColor = [UIColor blackColor];
  575. _areaField.font = TextFont(15);
  576. [view2 addSubview:_areaField];
  577. [_areaField mas_makeConstraints:^(MASConstraintMaker *make) {
  578. make.size.mas_equalTo(CGSizeMake(kGScreenWidth - 150, 30));
  579. make.left.equalTo(titleLa10.mas_right).offset(18);
  580. make.top.equalTo(line5.mas_top).offset(8);
  581. }];
  582. UIView *line6 = [[UIView alloc]init];
  583. line6.backgroundColor = [UIColor colorWithHexValue:0xf7f8fa];
  584. [view2 addSubview:line6];
  585. [line6 mas_makeConstraints:^(MASConstraintMaker *make) {
  586. make.left.equalTo(view2.mas_left);
  587. make.top.equalTo(view2.mas_bottom).offset(-1);
  588. make.size.mas_equalTo(CGSizeMake(kGScreenWidth,1));
  589. }];
  590. UIView *view4 =[[UIView alloc]init];
  591. view4.backgroundColor = [UIColor whiteColor];
  592. [_scrollView addSubview:view4];
  593. [view4 mas_makeConstraints:^(MASConstraintMaker *make) {
  594. make.size.mas_equalTo(CGSizeMake(kGScreenWidth, 188));
  595. make.left.equalTo(_scrollView.mas_left);
  596. make.top.equalTo(view2.mas_bottom);
  597. }];
  598. UIImageView *xingImage9 = [[UIImageView alloc]init];
  599. xingImage9.image = [UIImage imageNamed:@"redxing"];
  600. [view4 addSubview:xingImage9];
  601. [xingImage9 mas_makeConstraints:^(MASConstraintMaker *make) {
  602. make.left.equalTo(view4.mas_left).offset(15);
  603. make.top.equalTo(view4.mas_top).offset(12);
  604. make.size.mas_equalTo(CGSizeMake(8, 8));
  605. }];
  606. ACSelectMediaView *mediaView = [[ACSelectMediaView alloc] initWithFrame:CGRectMake(22, 0, [[UIScreen mainScreen] bounds].size.width -22, 1)];
  607. mediaView.type = ACMediaTypePhotoAndCamera;
  608. mediaView.maxImageSelected = 6;
  609. mediaView.uploadStr =@"上传凭证:";
  610. mediaView.backgroundColor = [UIColor whiteColor];
  611. mediaView.naviBarBgColor = [UIColor redColor];
  612. mediaView.rowImageCount = 3;
  613. mediaView.lineSpacing = 20;
  614. mediaView.interitemSpacing = 20;
  615. mediaView.sectionInset = UIEdgeInsetsMake(20, 20, 20, 20);
  616. [mediaView observeViewHeight:^(CGFloat mediaHeight) {
  617. _mediaH = mediaHeight;
  618. if (mediaHeight > 200) {
  619. _scrollView.contentSize = CGSizeMake(kGScreenWidth, kGScreenHeight +250);
  620. }else{
  621. _scrollView.contentSize = CGSizeMake(kGScreenWidth, kGScreenHeight +150);
  622. }
  623. [view4 mas_updateConstraints:^(MASConstraintMaker *make) {
  624. make.size.mas_equalTo(CGSizeMake(kGScreenWidth, mediaHeight));
  625. make.left.equalTo(_scrollView.mas_left);
  626. make.top.equalTo(view2.mas_bottom);
  627. }];
  628. }];
  629. [mediaView observeSelectedMediaArray:^(NSArray<ACMediaModel *> *list) {
  630. _imageArr = [NSMutableArray array];
  631. for (ACMediaModel *model in list) {
  632. UIImage *data = model.image;
  633. [_imageArr addObject:data];
  634. }
  635. }];
  636. _mediaView = mediaView;
  637. [view4 addSubview:_mediaView];
  638. UIView *view5 =[[UIView alloc]init];
  639. view5.backgroundColor = [UIColor whiteColor];
  640. [_scrollView addSubview:view5];
  641. [view5 mas_makeConstraints:^(MASConstraintMaker *make) {
  642. make.size.mas_equalTo(CGSizeMake(kGScreenWidth, 155));
  643. make.left.equalTo(_scrollView.mas_left);
  644. make.top.equalTo(view4.mas_bottom).offset(1);
  645. }];
  646. UILabel *titleLa13 = [[UILabel alloc]initWithFrame:CGRectMake(15, 15, 60, 15)];
  647. titleLa13.textColor = [UIColor blackColor];
  648. titleLa13.font = TextFont(15);
  649. [view5 addSubview:titleLa13];
  650. titleLa13.text = @"备注:";
  651. _describeText =[[UITextView alloc]init];
  652. _describeText.textColor = [UIColor blackColor];
  653. _describeText.font = TextFont(15);
  654. _describeText.textAlignment = NSTextAlignmentLeft;
  655. _describeText.backgroundColor = [UIColor colorWithHexValue:0xF7F8FA];
  656. _describeText.textContainerInset = UIEdgeInsetsMake(20, 20, 20, 20);
  657. _describeText.editable = YES;
  658. [view5 addSubview:_describeText];
  659. [_describeText mas_makeConstraints:^(MASConstraintMaker *make) {
  660. make.size.mas_equalTo(CGSizeMake(kGScreenWidth-30, 100));
  661. make.left.equalTo(view5.mas_left).offset(15);
  662. make.top.equalTo(titleLa13.mas_bottom).offset(15);
  663. }];
  664. _lbl = [[UILabel alloc]initWithFrame:CGRectMake(20, 20, 200, 20)];
  665. _lbl.enabled = NO;
  666. _lbl.text = @"请填写备注...";
  667. _lbl.font = [UIFont systemFontOfSize:15];
  668. _lbl.textColor = [[UIColor colorWithHexValue:0xD3D6DD]colorWithAlphaComponent:0.5];
  669. [_describeText addSubview:_lbl];
  670. _describeText.delegate = self;
  671. // Do any additional setup after loading the view.
  672. }
  673. -(void)loadDate{
  674. kWeakSelf(self);
  675. NSMutableDictionary *dic =[NSMutableDictionary dictionary];
  676. [self.sessionManager sendPostHttpRequestWithUrl:getBusinessYeTai params:dic bodyBlock:^(id<AFMultipartFormData> formData) {
  677. } progress:^(NSProgress *progressValue) {
  678. } success:^(NSDictionary *response) {
  679. [ProgressHUD hide];
  680. NSArray *arr =[NSArray arrayWithArray:response[@"data"]];
  681. weakself.dataArr = [yetaiModel mj_objectArrayWithKeyValuesArray:arr];
  682. weakself.dataA = [[NSMutableArray alloc]init];
  683. weakself.dataB = [[NSMutableArray alloc]init];
  684. for (int i = 0 ; i < weakself.dataArr.count;i++){
  685. // yetaiModel *model =[weakself.dataArr objectAtIndex:i];
  686. yetaiModel *model =weakself.dataArr[i];
  687. [weakself.dataA addObject:model.dName];
  688. [weakself.dataB addObject:model.dValue];
  689. }
  690. NSLog(@"%@",response);
  691. } failure:^(NSError *error) {
  692. NSLog(@"%@",error);
  693. [ProgressHUD hide];
  694. }];
  695. }
  696. -(void)dateClick:(UIButton *)sender{
  697. __weak NewListVC * weakself=self;
  698. if (!self.datePicker) {
  699. self.datePicker =[[[NSBundle mainBundle] loadNibNamed:@"DatePickerView" owner:self options:0] lastObject];
  700. self.datePicker.frame =CGRectMake(0, self.view.frame.size.height-260, self.view.frame.size.width, 260);
  701. self.datePicker.Datetitle =@"日期选择";
  702. self.datePicker.cancelBlock = ^{
  703. [UIView animateWithDuration:5 animations:^{
  704. [weakself.datePicker removeFromSuperview];
  705. weakself.datePicker = nil;
  706. }];
  707. };
  708. self.datePicker.sureBlock = ^(NSString *selectDateStr) {
  709. [weakself.dateLab setText:selectDateStr];
  710. [UIView animateWithDuration:5 animations:^{
  711. [weakself.datePicker removeFromSuperview];
  712. weakself.datePicker = nil;
  713. }];
  714. };
  715. [self.view addSubview:self.datePicker];
  716. }
  717. }
  718. -(void)yetaiClick:(UIButton *)sender{
  719. __weak NewListVC * weakself=self;
  720. // if (!self.yetaiPicker) {
  721. self.yetaiPicker = [[UIExPickerView alloc ] initWithFrame:CGRectMake(0, self.view.frame.size.height-260, self.view.frame.size.width, 260) arr:_dataA];
  722. weakself.yetaiPicker.delegate = weakself;
  723. [self.view addSubview:weakself.yetaiPicker];
  724. // }
  725. }
  726. -(void)setUpPhoneTextfield{
  727. [self.numberField addTarget:self action:@selector(textFieldDidEndEditing:) forControlEvents:UIControlEventEditingChanged];
  728. }
  729. -(void)textFieldDidEndEditing:(UITextField *)textField{
  730. if (textField == _numberField) {
  731. [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(keyboardWillbeHiden:) name:UIKeyboardWillHideNotification object:nil];
  732. if ([_numberField.text length] ==11) {
  733. if ([DKGlobal isValidMobileNum:_numberField.text]) {
  734. self.sendBtn.backgroundColor = [UIColor colorWithHexValue:0x64ABFF];
  735. self.sendBtn.userInteractionEnabled = YES;
  736. }else{
  737. [ToastView showToast:@"电话号码格式不正确"];
  738. self.sendBtn.userInteractionEnabled = NO;
  739. self.sendBtn.backgroundColor = [UIColor lightGrayColor];
  740. }
  741. }
  742. }
  743. }
  744. -(void)keyboardWillbeHiden:(NSNotification *)notification{
  745. if ([_numberField.text length]<11) {
  746. [ToastView showToast:@"电话号码格式不正确"];
  747. _sendBtn.userInteractionEnabled = NO;
  748. _sendBtn.backgroundColor = [UIColor lightGrayColor];
  749. }
  750. }
  751. -(BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string{
  752. if (range.length +range.location > textField.text.length) {
  753. return NO;
  754. }
  755. NSUInteger newLength = [textField.text length] +[string length] -range.length;
  756. return newLength <=11;
  757. }
  758. #pragma mark - UITextView的代理方法
  759. - (void)textViewDidChange:(UITextView *)textView
  760. {
  761. if ([textView.text length] == 0) {
  762. [_lbl setHidden:NO];
  763. }else{
  764. [_lbl setHidden:YES];
  765. }
  766. }
  767. -(void)buttonEvent:(UIButton *)sender{
  768. _uploadImages = [NSMutableArray array];
  769. if ([_nameField.text length] ==0) {
  770. [ToastView showToast:@"请输入品牌名称"];
  771. return;
  772. }else if ([_phoneField.text length] == 0){
  773. [ToastView showToast:@"请输入客户姓名"];
  774. return;
  775. }else if ([_numberField.text length] == 0){
  776. [ToastView showToast:@"请输入联系方式"];
  777. return;
  778. }else if([_positionField.text length] == 0){
  779. [ToastView showToast:@"请输入公司职位"];//新增
  780. return;
  781. }
  782. else if(_yetaiStr.wordsCount == 0){
  783. [ToastView showToast:@"请选择业态"];//新增
  784. return;
  785. }
  786. else if([_areaField.text length] == 0){
  787. [ToastView showToast:@"请输入面积"];//新增
  788. return;
  789. }
  790. else if ([_SerialField.text length] == 0){
  791. [ToastView showToast:@"请输入商铺号"];
  792. return;
  793. }else if ([_priceField.text length] == 0){
  794. [ToastView showToast:@"请输入价格"];
  795. return;
  796. }else if ([_dateLab.text length] < 4){
  797. [ToastView showToast:@"请选择认购日期"];
  798. return;
  799. }else if ([_areaField.text length] == 0){
  800. [ToastView showToast:@"请输入总价"];
  801. return;
  802. }else if ([_imageArr count] == 0){
  803. [ToastView showToast:@"请至少上传一张凭证"];
  804. return;
  805. }
  806. // if (![DKGlobal validateIdentityCard:_numberField.text]) {
  807. // [ToastView showToast:@"请输入正确格式的身份证号"];
  808. // return;
  809. // }
  810. _sendBtn.backgroundColor = [UIColor lightGrayColor];
  811. _sendBtn.userInteractionEnabled = NO;
  812. [OSSImageUploader asyncUploadImages:_imageArr complete:^(NSArray<NSString *> *names, UploadImageState state) {
  813. if (state ==1) {
  814. for (NSString *name in names) {
  815. NSString *imageName =[NSString stringWithFormat:@"/%@",name];
  816. [_uploadImages addObject:imageName];
  817. }
  818. NSLog(@"上传成功");
  819. NSLog(@"%@",_uploadImages);
  820. NSMutableDictionary *dic =[NSMutableDictionary dictionary];
  821. dispatch_async(dispatch_get_main_queue(), ^{
  822. dic[@"orderNo"] = self.orderNo;
  823. dic[@"orderStatus"] = @"4";
  824. dic[@"picPath"] =[_uploadImages componentsJoinedByString:@","];
  825. dic[@"customerName"] = _phoneField.text;
  826. dic[@"mobile"] = _numberField.text;
  827. dic[@"roomNo"] = _SerialField.text;
  828. dic[@"price"] = _priceField.text;
  829. dic[@"subscribeTime"] =_dateLab.text;
  830. dic[@"houseMoneyTotal"] = _areaField.text;
  831. dic[@"description"] = _describeText.text;
  832. dic[@"customerPosition"] = _positionField.text;//公司职务
  833. dic[@"customerBusiness"] =self.yetaiStr;//业态
  834. dic[@"brandName"] = _nameField.text;//品牌名称
  835. dic[@"acreage"] = _mianjiField.text;//面积
  836. });
  837. [ProgressHUD show];
  838. kWeakSelf(self);
  839. [self.sessionManager sendPostHttpRequestWithUrl:sendApproveInfo params:dic bodyBlock:^(id<AFMultipartFormData> formData) {
  840. } progress:^(NSProgress *progressValue) {
  841. } success:^(NSDictionary *response) {
  842. [ProgressHUD hide];
  843. NSLog(@"%@",response);
  844. for (UIViewController *controller in weakself.navigationController.viewControllers) {
  845. if ([controller isKindOfClass:[ProjectControlsVC class]]) {
  846. if ([self.typeString isEqualToString:@"待到访"]) {
  847. [DKGlobal sharedInstance].typeName =@"3";
  848. [[NSNotificationCenter defaultCenter]postNotificationName:@"changeIndex1" object:nil];
  849. }else{
  850. [DKGlobal sharedInstance].typeName =@"4";
  851. [[NSNotificationCenter defaultCenter]postNotificationName:@"changeIndex2" object:nil];
  852. }
  853. [DKGlobal sharedInstance].tagString = @"";
  854. if ([self.isSearch isEqualToString:@"1"]) {
  855. ProjectControlsVC *projectVC = [[ProjectControlsVC alloc]init];
  856. projectVC.projectID = self.projectID;
  857. projectVC.projectType = self.projectType;
  858. projectVC.projectName = self.projectName;
  859. projectVC.isSearch = weakself.isSearch;
  860. [weakself.navigationController pushViewController:projectVC animated:YES];
  861. }else{
  862. [weakself.navigationController popToViewController:controller animated:YES];
  863. }
  864. // [weakself.navigationController popToViewController:controller animated:YES];
  865. return;
  866. }
  867. }
  868. } failure:^(NSError *error) {
  869. _sendBtn.backgroundColor = [UIColor colorWithHexValue:0x64ABFF];
  870. _sendBtn.userInteractionEnabled = YES;
  871. NSLog(@"%@",error);
  872. [ProgressHUD hide];
  873. }];
  874. }else{
  875. NSLog(@"上传失败");
  876. }
  877. }];
  878. }
  879. //回调方法
  880. - (void)selectIndex:(NSInteger)index
  881. {
  882. //根据索引取出传入数组的值
  883. NSLog(@"%ld",(long)index);
  884. self.yetaiStr = self.dataB[index];
  885. self.yetaiNum = self.dataB[index];
  886. self.yetaiLLL.text = self.dataA[index];
  887. }
  888. - (void)dealloc {
  889. if (_sessionManager) {
  890. [_sessionManager cancelAllTask];
  891. }
  892. [[NSNotificationCenter defaultCenter] removeObserver:self];
  893. DebugLog(@"%@没有造成循环引用", [self class]);
  894. }
  895. - (void)didReceiveMemoryWarning {
  896. [super didReceiveMemoryWarning];
  897. // Dispose of any resources that can be recreated.
  898. }
  899. @end