Commit 4e0295487c14d4d929476e43648b0ff2537d3a6c

Authored by liushiyu
1 parent b47dfc76

0.1.9

CNLiveCommuntyModule.podspec
... ... @@ -8,7 +8,7 @@
8 8  
9 9 Pod::Spec.new do |s|
10 10 s.name = 'CNLiveCommuntyModule'
11   - s.version = '0.1.8'
  11 + s.version = '0.1.9'
12 12 s.summary = 'A short description of CNLiveCommuntyModule.'
13 13  
14 14 # This description is used to generate tags and improve search results.
... ...
CNLiveCommuntyModule/Classes/View/CNLiveCommuntSubView.m
... ... @@ -525,10 +525,10 @@
525 525 [_statueButton setTitle:repairModel.statusString forState:UIControlStateNormal];
526 526 [_statueButton setTitleColor:![repairModel.status isEqualToString:@"3"]?UIColorHex(#FD862E):UIColorHex(#797979) forState:UIControlStateNormal];
527 527  
528   - for (int i = 0; i < self.repairModel.imgs.count; i++) {
529   - NSString * imageUrl = self.repairModel.imgs[i];
  528 + for (int i = 0; i < 3; i++) {
  529 + NSString * imageUrl = self.repairModel.imgs.count > i ? self.repairModel.imgs[i] : @"";
530 530 UIImageView * imageView = self.tempArray[i];
531   - imageView.hidden = NO;
  531 + imageView.hidden = [imageUrl isEqualToString:@""] ? YES : NO;
532 532 [imageView sd_setImageWithURL:[NSURL URLWithString:imageUrl] placeholderImage:[UIImage imageWithColor:UIColorHex(#f9f9f9)]];
533 533 }
534 534 }
... ...
CNLiveCommuntyModule/Classes/ViewController/CNLiveCommuntInformViewController.m
... ... @@ -215,19 +215,38 @@
215 215 [paramDict setObject:tempContent forKey:name];
216 216 }
217 217 }
218   - if ([[paramDict allValues] containsObject:@""]) {
219   - NSInteger index = [[paramDict allValues] indexOfObject:@""];
220   - NSString * key = [[paramDict allKeys] objectAtIndex:index];
221   - if (![key isEqualToString:@"remark"]) {
222   - if ([key isEqualToString:@"userName"]) [QMUITips showWithText:@"联系人不能为空"];
223   - if ([key isEqualToString:@"address"]) [QMUITips showWithText:@"联系地址不能为空"];
224   - if ([key isEqualToString:@"phone"]) [QMUITips showWithText:@"联系电话不能为空"];
225   - if ([key isEqualToString:@"repairProject"]) [QMUITips showWithText:@"报修项目不能为空"];
226   - if ([key isEqualToString:@"beginTime"]) [QMUITips showWithText:@"请选择上门时间"];
227   - if ([key isEqualToString:@"endTime"]) [QMUITips showWithText:@"请选择上门时间"];
228   - return;
229   - }
  218 +
  219 + NSString * userName = [paramDict stringValueForKey:@"userName" default:@""];
  220 + if (![userName isNotBlank]) {
  221 + [QMUITips showWithText:@"联系人不能为空"];
  222 + return;
  223 + }
  224 + NSString * address = [paramDict stringValueForKey:@"address" default:@""];
  225 + if (![address isNotBlank]) {
  226 + [QMUITips showWithText:@"联系地址不能为空"];
  227 + return;
  228 + }
  229 + NSString * phone = [paramDict stringValueForKey:@"phone" default:@""];
  230 + if (![phone isNotBlank]) {
  231 + [QMUITips showWithText:@"联系电话不能为空"];
  232 + return;
230 233 }
  234 + NSString * repairProject = [paramDict stringValueForKey:@"repairProject" default:@""];
  235 + if (![repairProject isNotBlank]) {
  236 + [QMUITips showWithText:@"报修项目不能为空"];
  237 + return;
  238 + }
  239 + NSString * beginTime = [paramDict stringValueForKey:@"beginTime" default:@""];
  240 + if (![beginTime isNotBlank]) {
  241 + [QMUITips showWithText:@"请选择上门时间"];
  242 + return;
  243 + }
  244 + NSString * endTime = [paramDict stringValueForKey:@"endTime" default:@""];
  245 + if (![endTime isNotBlank]) {
  246 + [QMUITips showWithText:@"请选择上门时间"];
  247 + return;
  248 + }
  249 +
231 250 NSArray * array = @[[paramDict stringValueForKey:@"userName" default:@""],[paramDict stringValueForKey:@"address" default:@""],[paramDict stringValueForKey:@"phone" default:@""]];
232 251 [CNLiveRespCacheManager cachePathWithObject:array FileName:[NSString stringWithFormat:@"CNLiveCommunityRepirContentKey_%@",[CNUserInfoManager manager].userInfoModel.uid]];
233 252 __weak typeof(self) weakSelf = self;
... ... @@ -516,14 +535,14 @@
516 535 }
517 536 - (void)pushTZImagePickerController:(NSInteger)index
518 537 {
519   - CNImagePickerController *imagePickerVc = [[CNImagePickerController alloc] initWithMaxImagesCount:3 columnNumber:3 delegate:self pushPhotoPickerVc:YES];
  538 + TZImagePickerController *imagePickerVc = [[TZImagePickerController alloc] initWithMaxImagesCount:3 columnNumber:3 delegate:self pushPhotoPickerVc:YES];
520 539 imagePickerVc.modalPresentationStyle = UIModalPresentationFullScreen;
521   - [imagePickerVc configTZImagePicker];//配置
  540 +// [imagePickerVc configTZImagePicker];//配置
522 541 imagePickerVc.isSelectOriginalPhoto = NO;//是否选择原图
523 542 // 1.设置目前已经选中的图片数组
524 543 imagePickerVc.selectedAssets = self.assetArray;
525   - imagePickerVc.maxEditVideoTime = 60;//编辑长度
526   - imagePickerVc.maxVideoDuration = 120;//编辑视频最大长度
  544 +// imagePickerVc.maxEditVideoTime = 0;//编辑长度
  545 +// imagePickerVc.maxVideoDuration = 0;//编辑视频最大长度
527 546 // 3. Set allow picking video & photo & originalPhoto or not
528 547 // 3. 设置是否可以选择视频/图片/原图
529 548 imagePickerVc.allowPickingMultipleVideo = NO;
... ...
CNLiveCommuntyModule/Classes/ViewController/CNLiveCommuntyOrderViewController.m
... ... @@ -53,13 +53,18 @@
53 53 [super viewDidAppear:animated];
54 54 if (self.showType == CNLiveCommuntyOrderShowTypeChatYetOrder
55 55 || self.showType == CNLiveCommuntyOrderShowTypeChatReadyOrder
56   - || self.showType == CNLiveCommuntyOrderShowTypeChatCompletOrder) {
  56 + || self.showType == CNLiveCommuntyOrderShowTypeChatCompletOrder
  57 + || self.createMdoel) {
57 58 NSMutableArray * tempArray = [[NSMutableArray alloc] initWithArray:self.navigationController.viewControllers];
58 59 for (UIViewController * vc in self.navigationController.viewControllers) {
59 60 if ([vc isKindOfClass:CNLiveCommuntInformViewController.class]) {
60 61 [tempArray removeObject:vc];
61 62 break;
62 63 }
  64 + if ([vc isKindOfClass:CNLiveCommuntInformViewController.class]) {
  65 + [tempArray removeObject:vc];
  66 + break;
  67 + }
63 68 }
64 69 self.navigationController.viewControllers = tempArray;
65 70 }
... ... @@ -238,6 +243,8 @@
238 243 self.tableView.dataSource = self;
239 244 self.tableView.emptyDataSetSource = self;
240 245 self.tableView.emptyDataSetDelegate = self;
  246 + self.tableView.shouldIgnoreScrollingAdjustment = YES;
  247 + self.tableView.shouldRestoreScrollViewContentOffset = YES;
241 248 self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
242 249 self.tableView.tableFooterView = [[UIView alloc] init];
243 250 self.tableView.backgroundColor = UIColorHex(#f9f9f9);
... ... @@ -300,7 +307,7 @@
300 307 {
301 308 if (self.createMdoel) {
302 309 if (self.showType == CNLiveCommuntyOrderShowTypeListYetOrder) return 2;
303   - if (self.showType == CNLiveCommuntyOrderShowTypeListReadyOrder) return 2;
  310 + if (self.showType == CNLiveCommuntyOrderShowTypeListReadyOrder) return 3;
304 311 if (self.showType == CNLiveCommuntyOrderShowTypeListCompletOrder) return 3;
305 312 if (self.showType == CNLiveCommuntyOrderShowTypeListFailureOrder) return 2;
306 313 if (self.showType == CNLiveCommuntyOrderShowTypeChatYetOrder) return 1;
... ... @@ -317,7 +324,6 @@
317 324 if (section == 0) return self.createMdoel.infoArray.count;
318 325 }
319 326 if (self.showType == CNLiveCommuntyOrderShowTypeListYetOrder
320   - || self.showType == CNLiveCommuntyOrderShowTypeListReadyOrder
321 327 || self.showType == CNLiveCommuntyOrderShowTypeListFailureOrder) {
322 328 if (section == 0) return self.createMdoel.infoArray.count;
323 329 if (section == 1) return self.createMdoel.processArray.count;
... ... @@ -326,7 +332,8 @@
326 332 if (section == 0) return self.createMdoel.infoArray.count;
327 333 if (section == 1) return 1;
328 334 }
329   - if (self.showType == CNLiveCommuntyOrderShowTypeListCompletOrder) {
  335 + if (self.showType == CNLiveCommuntyOrderShowTypeListCompletOrder
  336 + || self.showType == CNLiveCommuntyOrderShowTypeListReadyOrder) {
330 337 if (section == 0) return self.createMdoel.infoArray.count;
331 338 if (section == 1) return 1;
332 339 if (section == 2) return self.createMdoel.processArray.count;
... ... @@ -341,7 +348,6 @@
341 348 return [CNLiveCommuntSignUpOrderViewCell setTableView:tableView Dict:self.createMdoel.infoArray[indexPath.row]];
342 349 }
343 350 if (self.showType == CNLiveCommuntyOrderShowTypeListYetOrder
344   - || self.showType == CNLiveCommuntyOrderShowTypeListReadyOrder
345 351 || self.showType == CNLiveCommuntyOrderShowTypeListFailureOrder) {
346 352 if (indexPath.section == 0) return [CNLiveCommuntSignUpOrderViewCell setTableView:tableView Dict:self.createMdoel.infoArray[indexPath.row]];
347 353 if (indexPath.section == 1) return [CNLiveCommuntSignUpDetailViewCell setTableView:tableView isTop:indexPath.row == 0 isBottom:indexPath.row == (self.createMdoel.processArray.count - 1) Dict:self.createMdoel.processArray[indexPath.row]];
... ... @@ -353,7 +359,8 @@
353 359 [weakSelf reloadDataWithDataSource];
354 360 }];
355 361 }
356   - if (self.showType == CNLiveCommuntyOrderShowTypeListCompletOrder) {
  362 + if (self.showType == CNLiveCommuntyOrderShowTypeListCompletOrder
  363 + || self.showType == CNLiveCommuntyOrderShowTypeListReadyOrder) {
357 364 if (indexPath.section == 0) return [CNLiveCommuntSignUpOrderViewCell setTableView:tableView Dict:self.createMdoel.infoArray[indexPath.row]];
358 365 if (indexPath.section == 1) return [CNLiveCommuntSignUpContactViewCell setTableView:tableView CreateModel:self.createMdoel];
359 366 if (indexPath.section == 2) return [CNLiveCommuntSignUpDetailViewCell setTableView:tableView isTop:indexPath.row == 0 isBottom:indexPath.row == (self.createMdoel.processArray.count - 1) Dict:self.createMdoel.processArray[indexPath.row]];
... ... @@ -369,14 +376,13 @@
369 376 return height > 30 ? height : 30;
370 377 }
371 378 if (self.showType == CNLiveCommuntyOrderShowTypeListYetOrder
372   - || self.showType == CNLiveCommuntyOrderShowTypeListReadyOrder
373 379 || self.showType == CNLiveCommuntyOrderShowTypeListFailureOrder) {
374 380 if (indexPath.section == 0) {
375 381 NSDictionary * subDict = self.createMdoel.infoArray[indexPath.row];
376 382 CGFloat height = [[subDict stringValueForKey:@"value" default:@""] calculateSizeWithUIWidth:kScreenWidth - 125 font:[UIFont systemFontOfSize:15.0]].height;
377 383 return height > 30 ? height : 30;
378 384 }
379   - if (indexPath.section == 1) return 70;
  385 + if (indexPath.section == 2) return 70;
380 386 }
381 387 if (self.showType == CNLiveCommuntyOrderShowTypeChatReadyOrder) {
382 388 if (indexPath.section == 0) {
... ... @@ -386,7 +392,8 @@
386 392 }
387 393 if (indexPath.section == 1) return 130;
388 394 }
389   - if (self.showType == CNLiveCommuntyOrderShowTypeListCompletOrder) {
  395 + if (self.showType == CNLiveCommuntyOrderShowTypeListCompletOrder
  396 + || self.showType == CNLiveCommuntyOrderShowTypeListReadyOrder) {
390 397 if (indexPath.section == 0) {
391 398 NSDictionary * subDict = self.createMdoel.infoArray[indexPath.row];
392 399 CGFloat height = [[subDict stringValueForKey:@"value" default:@""] calculateSizeWithUIWidth:kScreenWidth - 125 font:[UIFont systemFontOfSize:15.0]].height;
... ... @@ -399,11 +406,11 @@
399 406 }
400 407 -(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
401 408 {
402   - return section == 0 || ((self.showType == CNLiveCommuntyOrderShowTypeListReadyOrder || self.showType == CNLiveCommuntyOrderShowTypeListYetOrder || self.showType == CNLiveCommuntyOrderShowTypeListFailureOrder) && section == 1) || (self.showType == CNLiveCommuntyOrderShowTypeListCompletOrder && section == 2) ? 50 : 0;
  409 + return section == 0 || ((self.showType == CNLiveCommuntyOrderShowTypeListYetOrder || self.showType == CNLiveCommuntyOrderShowTypeListFailureOrder) && section == 1) || ((self.showType == CNLiveCommuntyOrderShowTypeListCompletOrder || self.showType == CNLiveCommuntyOrderShowTypeListReadyOrder) && section == 2) ? 50 : 0;
403 410 }
404 411 -(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
405 412 {
406   - if (section == 0 || ((self.showType == CNLiveCommuntyOrderShowTypeListReadyOrder || self.showType == CNLiveCommuntyOrderShowTypeListYetOrder || self.showType == CNLiveCommuntyOrderShowTypeListFailureOrder) && section == 1) || (self.showType == CNLiveCommuntyOrderShowTypeListCompletOrder && section == 2)) {
  413 + if (section == 0 || ((self.showType == CNLiveCommuntyOrderShowTypeListYetOrder || self.showType == CNLiveCommuntyOrderShowTypeListFailureOrder) && section == 1) || ((self.showType == CNLiveCommuntyOrderShowTypeListCompletOrder || self.showType == CNLiveCommuntyOrderShowTypeListReadyOrder) && section == 2)) {
407 414 UIView * view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, 50)];
408 415 view.backgroundColor = [UIColor clearColor];
409 416  
... ... @@ -439,12 +446,12 @@
439 446 -(CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section
440 447 {
441 448 CGFloat height = section == 0 && self.createMdoel.imgs.count > 0 ? (kScreenWidth - 60)/3 + 20 : 10;
442   - return section == 0 || ((self.showType == CNLiveCommuntyOrderShowTypeListReadyOrder || self.showType == CNLiveCommuntyOrderShowTypeListYetOrder || self.showType == CNLiveCommuntyOrderShowTypeListFailureOrder) && section == 1) || (self.showType == CNLiveCommuntyOrderShowTypeListCompletOrder && section == 2) ? height : 0;
  449 + return section == 0 || ((self.showType == CNLiveCommuntyOrderShowTypeListYetOrder || self.showType == CNLiveCommuntyOrderShowTypeListFailureOrder) && section == 1) || ((self.showType == CNLiveCommuntyOrderShowTypeListCompletOrder || self.showType == CNLiveCommuntyOrderShowTypeListReadyOrder) && section == 2) ? height : 0;
443 450 }
444 451 -(UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section
445 452 {
446 453 CGFloat height = section == 0 && self.createMdoel.imgs.count > 0 ? (kScreenWidth - 60)/3 + 20 : 10;
447   - if (section == 0 || ((self.showType == CNLiveCommuntyOrderShowTypeListReadyOrder || self.showType == CNLiveCommuntyOrderShowTypeListYetOrder || self.showType == CNLiveCommuntyOrderShowTypeListFailureOrder) && section == 1) || (self.showType == CNLiveCommuntyOrderShowTypeListCompletOrder && section == 2)) {
  454 + if (section == 0 || ((self.showType == CNLiveCommuntyOrderShowTypeListYetOrder || self.showType == CNLiveCommuntyOrderShowTypeListFailureOrder) && section == 1) || ((self.showType == CNLiveCommuntyOrderShowTypeListCompletOrder || self.showType == CNLiveCommuntyOrderShowTypeListReadyOrder) && section == 2)) {
448 455 UIView * view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, height)];
449 456 view.backgroundColor = [UIColor clearColor];
450 457  
... ...
Example/CNLiveCommuntyModule/CNLIVEViewController.m
... ... @@ -144,15 +144,15 @@
144 144 [self.navigationController pushViewController:signUpView animated:YES];
145 145 }
146 146 if (indexPath.row == 6) {
147   -// NSString * cmnt_id = [[NSUserDefaults standardUserDefaults] objectForKey:@"cmnt_id"];
148   -// if ([cmnt_id isNotBlank]) {
149   -// CNLiveCommuntyOrderViewController * orderVC = [[CNLiveCommuntyOrderViewController alloc] initWithMaintenId:cmnt_id];
150   -// [self.navigationController pushViewController:orderVC animated:YES];
151   -// }else{
  147 + NSString * cmnt_id = [[NSUserDefaults standardUserDefaults] objectForKey:@"cmnt_id"];
  148 + if ([cmnt_id isNotBlank]) {
  149 + CNLiveCommuntyOrderViewController * orderVC = [[CNLiveCommuntyOrderViewController alloc] initWithMaintenId:cmnt_id];
  150 + [self.navigationController pushViewController:orderVC animated:YES];
  151 + }else{
152 152  
153 153 CNLiveCommuntyOrderViewController * orderVC = [[CNLiveCommuntyOrderViewController alloc] initWithMaintenId:@"cm2022032420637"];
154 154 [self.navigationController pushViewController:orderVC animated:YES];
155   -// }
  155 + }
156 156  
157 157 }
158 158 if (indexPath.row == 7) {
... ...