Bob před 6 roky
rodič
revize
7ccae6623b
20 změnil soubory, kde provedl 377 přidání a 150 odebrání
  1. 6 6
      HappyJob/HappyJob.xcodeproj/project.pbxproj
  2. binární
      HappyJob/HappyJob.xcworkspace/xcuserdata/Bob.xcuserdatad/UserInterfaceState.xcuserstate
  3. 3 1
      HappyJob/HappyJob/Home_首页/HJHomeViewController.m
  4. 11 6
      HappyJob/HappyJob/JobList_工作列表信息/HJPositionDataBox.m
  5. 3 5
      HappyJob/HappyJob/Join_拼工/All_所有拼工/HJJoinAllJoinPanelViewController.m
  6. 11 6
      HappyJob/HappyJob/Join_拼工/Apply_申请拼工/HJJoinApplyContentView.m
  7. 11 6
      HappyJob/HappyJob/Join_拼工/Apply_申请拼工/HJJoinApplyingContentView.m
  8. 52 29
      HappyJob/HappyJob/Join_拼工/HJJoinDetailViewController.m
  9. 1 0
      HappyJob/HappyJob/Join_拼工/HJJoinTableViewCell.m
  10. 11 6
      HappyJob/HappyJob/Join_拼工/HJJoinViewController.m
  11. 56 38
      HappyJob/HappyJob/Join_拼工/Joining_马上拼/HJJoinJoinPanelViewController.m
  12. 1 1
      HappyJob/HappyJob/Join_拼工/拼工规则/HJJoinAgreementViewController.m
  13. 0 1
      HappyJob/HappyJob/Login_登录/HJLoginBindingPhoneViewController.m
  14. 0 2
      HappyJob/HappyJob/Login_登录/HJLoginViewController.m
  15. 1 1
      HappyJob/HappyJob/Me_我/HJMeViewController.m
  16. 22 4
      HappyJob/HappyJob/Me_我/Resume_个人简历/求职意向/HJExpectationViewController.m
  17. 0 17
      HappyJob/HappyJob/Me_我/Resume_个人简历/求职意向/HJSiteMenuView.h
  18. 0 21
      HappyJob/HappyJob/Me_我/Resume_个人简历/求职意向/HJSiteMenuView.m
  19. 21 0
      HappyJob/HappyJob/Me_我/Resume_个人简历/求职意向/HJSitePickerView.h
  20. 167 0
      HappyJob/HappyJob/Me_我/Resume_个人简历/求职意向/HJSitePickerView.m

+ 6 - 6
HappyJob/HappyJob.xcodeproj/project.pbxproj

@@ -196,7 +196,7 @@
 		C49612BA226489D700898E55 /* HJExpectationViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C49612B9226489D700898E55 /* HJExpectationViewController.m */; };
 		C49612BE2264955D00898E55 /* HJLabelTextFieldView.m in Sources */ = {isa = PBXBuildFile; fileRef = C49612BD2264955D00898E55 /* HJLabelTextFieldView.m */; };
 		C49612C822655F8900898E55 /* HJTextFieldPopMenuView.m in Sources */ = {isa = PBXBuildFile; fileRef = C49612C722655F8900898E55 /* HJTextFieldPopMenuView.m */; };
-		C49612CE226584CC00898E55 /* HJSiteMenuView.m in Sources */ = {isa = PBXBuildFile; fileRef = C49612CD226584CC00898E55 /* HJSiteMenuView.m */; };
+		C49612CE226584CC00898E55 /* HJSitePickerView.m in Sources */ = {isa = PBXBuildFile; fileRef = C49612CD226584CC00898E55 /* HJSitePickerView.m */; };
 		C49612D12265A25C00898E55 /* HJConfirmPanelViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C49612D02265A25C00898E55 /* HJConfirmPanelViewController.m */; };
 		C49612D52265AB5700898E55 /* HJBasicInfoViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C49612D42265AB5700898E55 /* HJBasicInfoViewController.m */; };
 		C49612E12265D80300898E55 /* HJExperienceViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C49612E02265D80300898E55 /* HJExperienceViewController.m */; };
@@ -613,8 +613,8 @@
 		C49612BD2264955D00898E55 /* HJLabelTextFieldView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = HJLabelTextFieldView.m; sourceTree = "<group>"; };
 		C49612C622655F8900898E55 /* HJTextFieldPopMenuView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HJTextFieldPopMenuView.h; sourceTree = "<group>"; };
 		C49612C722655F8900898E55 /* HJTextFieldPopMenuView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = HJTextFieldPopMenuView.m; sourceTree = "<group>"; };
-		C49612CC226584CC00898E55 /* HJSiteMenuView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HJSiteMenuView.h; sourceTree = "<group>"; };
-		C49612CD226584CC00898E55 /* HJSiteMenuView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = HJSiteMenuView.m; sourceTree = "<group>"; };
+		C49612CC226584CC00898E55 /* HJSitePickerView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HJSitePickerView.h; sourceTree = "<group>"; };
+		C49612CD226584CC00898E55 /* HJSitePickerView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = HJSitePickerView.m; sourceTree = "<group>"; };
 		C49612CF2265A25C00898E55 /* HJConfirmPanelViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HJConfirmPanelViewController.h; sourceTree = "<group>"; };
 		C49612D02265A25C00898E55 /* HJConfirmPanelViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = HJConfirmPanelViewController.m; sourceTree = "<group>"; };
 		C49612D32265AB5700898E55 /* HJBasicInfoViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HJBasicInfoViewController.h; sourceTree = "<group>"; };
@@ -1784,8 +1784,8 @@
 		C49612B72264892B00898E55 /* 求职意向 */ = {
 			isa = PBXGroup;
 			children = (
-				C49612CC226584CC00898E55 /* HJSiteMenuView.h */,
-				C49612CD226584CC00898E55 /* HJSiteMenuView.m */,
+				C49612CC226584CC00898E55 /* HJSitePickerView.h */,
+				C49612CD226584CC00898E55 /* HJSitePickerView.m */,
 				C49612B8226489D700898E55 /* HJExpectationViewController.h */,
 				C49612B9226489D700898E55 /* HJExpectationViewController.m */,
 				C410512722A15A1C00560009 /* HJExpectationView.h */,
@@ -2271,7 +2271,7 @@
 				C4109C472251E935007A2FC1 /* HJWeiXinAPIManager.m in Sources */,
 				C412B2302269BB3A002B0C44 /* HJAuthSectionView.m in Sources */,
 				C414D8862266B8E500719CE0 /* HJBasicInfoHeaderView.m in Sources */,
-				C49612CE226584CC00898E55 /* HJSiteMenuView.m in Sources */,
+				C49612CE226584CC00898E55 /* HJSitePickerView.m in Sources */,
 				C4F657A7224CF70B00E1E625 /* HJLoginGetAuthCodeAPIManager.m in Sources */,
 				C40F6EEE225E13430034BEF8 /* HJBenefitDetailViewController.m in Sources */,
 				C412B22D2269AC86002B0C44 /* HJAuthViewController.m in Sources */,

binární
HappyJob/HappyJob.xcworkspace/xcuserdata/Bob.xcuserdatad/UserInterfaceState.xcuserstate


+ 3 - 1
HappyJob/HappyJob/Home_首页/HJHomeViewController.m

@@ -316,7 +316,9 @@
         }
         // 解决底部被UITabBar遮挡的问题
         self.edgesForExtendedLayout = UIRectEdgeNone;
-        //_pageListView.tableView.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth;
+        _pageListView.tableView.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth;
+        //解决tabBar变灰问题,在退出登录然后重新登录进首页的时候
+        self.tabBarController.tabBar.backgroundColor = [UIColor whiteColor];
     }
     return _pageListView;
 }

+ 11 - 6
HappyJob/HappyJob/JobList_工作列表信息/HJPositionDataBox.m

@@ -244,12 +244,17 @@ static NSString * const HJJoinTableViewCellIdentifier = @"HJJoinTableViewCell";
         NSDate *fromeDate = [NSDate fb_dateWithTimeIntervalString:model.currentTime];
         NSDate *toDate = [NSDate fb_dateWithTimeIntervalString:model.groupEndTime];
         NSDateComponents *dateComponents = [NSDate fb_dateComponentsFromDate:fromeDate toDate:toDate];
-        NSMutableAttributedString *clockString = [[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@"距离结束还有:%02ld天%02ld小时%02ld分%02ld秒", (long)dateComponents.day, (long)dateComponents.hour, (long)dateComponents.minute, (long)dateComponents.second]];
-        [clockString addAttribute:NSForegroundColorAttributeName value:[UIColor colorWithRed:255/255.0 green:143/255.0 blue:1/255.0 alpha:1.0] range:NSMakeRange(7, 2)];
-        [clockString addAttribute:NSForegroundColorAttributeName value:[UIColor colorWithRed:255/255.0 green:143/255.0 blue:1/255.0 alpha:1.0] range:NSMakeRange(10, 2)];
-        [clockString addAttribute:NSForegroundColorAttributeName value:[UIColor colorWithRed:255/255.0 green:143/255.0 blue:1/255.0 alpha:1.0] range:NSMakeRange(14, 2)];
-        [clockString addAttribute:NSForegroundColorAttributeName value:[UIColor colorWithRed:255/255.0 green:143/255.0 blue:1/255.0 alpha:1.0] range:NSMakeRange(17, 2)];
-        cell.clockLabel.attributedText = clockString;
+        if (dateComponents.second < 0) {
+            //倒计时秒数出现负数表示活动已结束
+            cell.clockLabel.attributedText = [[NSAttributedString alloc] initWithString:@"该活动已结束"];
+        } else {
+            NSMutableAttributedString *clockString = [[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@"距离结束还有:%02ld天%02ld小时%02ld分%02ld秒", (long)dateComponents.day, (long)dateComponents.hour, (long)dateComponents.minute, (long)dateComponents.second]];
+            [clockString addAttribute:NSForegroundColorAttributeName value:[UIColor colorWithRed:255/255.0 green:143/255.0 blue:1/255.0 alpha:1.0] range:NSMakeRange(7, 2)];
+            [clockString addAttribute:NSForegroundColorAttributeName value:[UIColor colorWithRed:255/255.0 green:143/255.0 blue:1/255.0 alpha:1.0] range:NSMakeRange(10, 2)];
+            [clockString addAttribute:NSForegroundColorAttributeName value:[UIColor colorWithRed:255/255.0 green:143/255.0 blue:1/255.0 alpha:1.0] range:NSMakeRange(14, 2)];
+            [clockString addAttribute:NSForegroundColorAttributeName value:[UIColor colorWithRed:255/255.0 green:143/255.0 blue:1/255.0 alpha:1.0] range:NSMakeRange(17, 2)];
+            cell.clockLabel.attributedText = clockString;
+        }
         
         return cell;
     } else {

+ 3 - 5
HappyJob/HappyJob/Join_拼工/All_所有拼工/HJJoinAllJoinPanelViewController.m

@@ -132,11 +132,9 @@ static NSString * const HJJoinAllJoinTableViewCellIdentifier = @"HJJoinAllJoinTa
 #pragma mark - HJJoinAllJoinTableViewCellDelegate
 
 - (void)cell:(HJJoinAllJoinTableViewCell *)cell joinDidSelectAtIndex:(NSInteger)index {
-    [self dismissViewControllerAnimated:YES completion:^{
-        if ([self.delegate respondsToSelector:@selector(joinAllJoinPanelViewController:didSelectAtIndex:)]) {
-            [self.delegate joinAllJoinPanelViewController:self didSelectAtIndex:index];
-        }
-    }];
+    if ([self.delegate respondsToSelector:@selector(joinAllJoinPanelViewController:didSelectAtIndex:)]) {
+        [self.delegate joinAllJoinPanelViewController:self didSelectAtIndex:index];
+    }
 }
 
 #pragma mark - event response

+ 11 - 6
HappyJob/HappyJob/Join_拼工/Apply_申请拼工/HJJoinApplyContentView.m

@@ -89,12 +89,17 @@
         NSDate *fromeDate = [NSDate fb_dateWithTimeIntervalString:[NSString stringWithFormat:@"%f", self.startTimeInterval]];
         NSDate *toDate = [NSDate fb_dateWithTimeIntervalString:groupEndTimeStr];
         NSDateComponents *dateComponents = [NSDate fb_dateComponentsFromDate:fromeDate toDate:toDate];
-        NSMutableAttributedString *clockString = [[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@"距离结束还有:%02ld天%02ld小时%02ld分%02ld秒", (long)dateComponents.day, (long)dateComponents.hour, (long)dateComponents.minute, (long)dateComponents.second]];
-        [clockString addAttribute:NSForegroundColorAttributeName value:[UIColor colorWithRed:255/255.0 green:143/255.0 blue:1/255.0 alpha:1.0] range:NSMakeRange(7, 2)];
-        [clockString addAttribute:NSForegroundColorAttributeName value:[UIColor colorWithRed:255/255.0 green:143/255.0 blue:1/255.0 alpha:1.0] range:NSMakeRange(10, 2)];
-        [clockString addAttribute:NSForegroundColorAttributeName value:[UIColor colorWithRed:255/255.0 green:143/255.0 blue:1/255.0 alpha:1.0] range:NSMakeRange(14, 2)];
-        [clockString addAttribute:NSForegroundColorAttributeName value:[UIColor colorWithRed:255/255.0 green:143/255.0 blue:1/255.0 alpha:1.0] range:NSMakeRange(17, 2)];
-        self.clockLabel.attributedText = clockString;
+        if (dateComponents.second < 0) {
+            //倒计时秒数出现负数表示活动已结束
+            self.clockLabel.attributedText = [[NSAttributedString alloc] initWithString:@"该活动已结束"];
+        } else {
+            NSMutableAttributedString *clockString = [[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@"距离结束还有:%02ld天%02ld小时%02ld分%02ld秒", (long)dateComponents.day, (long)dateComponents.hour, (long)dateComponents.minute, (long)dateComponents.second]];
+            [clockString addAttribute:NSForegroundColorAttributeName value:[UIColor colorWithRed:255/255.0 green:143/255.0 blue:1/255.0 alpha:1.0] range:NSMakeRange(7, 2)];
+            [clockString addAttribute:NSForegroundColorAttributeName value:[UIColor colorWithRed:255/255.0 green:143/255.0 blue:1/255.0 alpha:1.0] range:NSMakeRange(10, 2)];
+            [clockString addAttribute:NSForegroundColorAttributeName value:[UIColor colorWithRed:255/255.0 green:143/255.0 blue:1/255.0 alpha:1.0] range:NSMakeRange(14, 2)];
+            [clockString addAttribute:NSForegroundColorAttributeName value:[UIColor colorWithRed:255/255.0 green:143/255.0 blue:1/255.0 alpha:1.0] range:NSMakeRange(17, 2)];
+            self.clockLabel.attributedText = clockString;
+        }
     }];
     [self.bgView addSubview:self.clockLabel];
     if ([self.bgView.subviews indexOfObject:self.portraitGroupView] != NSNotFound) {

+ 11 - 6
HappyJob/HappyJob/Join_拼工/Apply_申请拼工/HJJoinApplyingContentView.m

@@ -90,12 +90,17 @@
         NSDate *fromeDate = [NSDate fb_dateWithTimeIntervalString:[NSString stringWithFormat:@"%f", self.startTimeInterval]];
         NSDate *toDate = [NSDate fb_dateWithTimeIntervalString:groupEndTimeStr];
         NSDateComponents *dateComponents = [NSDate fb_dateComponentsFromDate:fromeDate toDate:toDate];
-        NSMutableAttributedString *clockString = [[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@"距离结束还有:%02ld天%02ld小时%02ld分%02ld秒", (long)dateComponents.day, (long)dateComponents.hour, (long)dateComponents.minute, (long)dateComponents.second]];
-        [clockString addAttribute:NSForegroundColorAttributeName value:[UIColor colorWithRed:255/255.0 green:143/255.0 blue:1/255.0 alpha:1.0] range:NSMakeRange(7, 2)];
-        [clockString addAttribute:NSForegroundColorAttributeName value:[UIColor colorWithRed:255/255.0 green:143/255.0 blue:1/255.0 alpha:1.0] range:NSMakeRange(10, 2)];
-        [clockString addAttribute:NSForegroundColorAttributeName value:[UIColor colorWithRed:255/255.0 green:143/255.0 blue:1/255.0 alpha:1.0] range:NSMakeRange(14, 2)];
-        [clockString addAttribute:NSForegroundColorAttributeName value:[UIColor colorWithRed:255/255.0 green:143/255.0 blue:1/255.0 alpha:1.0] range:NSMakeRange(17, 2)];
-        self.clockLabel.attributedText = clockString;
+        if (dateComponents.second < 0) {
+            //倒计时秒数出现负数表示活动已结束
+            self.clockLabel.attributedText = [[NSAttributedString alloc] initWithString:@"该活动已结束"];
+        } else {
+            NSMutableAttributedString *clockString = [[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@"距离结束还有:%02ld天%02ld小时%02ld分%02ld秒", (long)dateComponents.day, (long)dateComponents.hour, (long)dateComponents.minute, (long)dateComponents.second]];
+            [clockString addAttribute:NSForegroundColorAttributeName value:[UIColor colorWithRed:255/255.0 green:143/255.0 blue:1/255.0 alpha:1.0] range:NSMakeRange(7, 2)];
+            [clockString addAttribute:NSForegroundColorAttributeName value:[UIColor colorWithRed:255/255.0 green:143/255.0 blue:1/255.0 alpha:1.0] range:NSMakeRange(10, 2)];
+            [clockString addAttribute:NSForegroundColorAttributeName value:[UIColor colorWithRed:255/255.0 green:143/255.0 blue:1/255.0 alpha:1.0] range:NSMakeRange(14, 2)];
+            [clockString addAttribute:NSForegroundColorAttributeName value:[UIColor colorWithRed:255/255.0 green:143/255.0 blue:1/255.0 alpha:1.0] range:NSMakeRange(17, 2)];
+            self.clockLabel.attributedText = clockString;
+        }
     }];
     [self.bgView addSubview:self.clockLabel];
     if ([self.bgView.subviews indexOfObject:self.portraitGroupView] != NSNotFound) {

+ 52 - 29
HappyJob/HappyJob/Join_拼工/HJJoinDetailViewController.m

@@ -58,6 +58,8 @@
 @property (nonatomic, assign) NSUInteger myGroupID;
 @property (nonatomic, strong) CountDown *countDown;
 @property (nonatomic, assign) NSTimeInterval startTimeInterval;
+@property (nonatomic, strong) HJJoinAllJoinPanelViewController *allJoinPanel;
+@property (nonatomic, strong) HJJoinJoinPanelViewController *joinPanel;
 @end
 
 @implementation HJJoinDetailViewController
@@ -210,23 +212,12 @@
 #pragma mark - HJJoinViewDelegate
 
 - (void)joinViewJoinButtonClicked:(HJJoinDetailJoinView *)joinView didSelectAtIndex:(NSInteger)index {
-    HJJoinJoinPanelViewController *vc = [[HJJoinJoinPanelViewController alloc] init];
-    vc.delegate = self;
-    vc.dataBox = self.detailDataBox;
-    vc.group = [self.detailDataBox.detail[kHJJoinPositionKeyJoinGroupArray] objectAtIndex:index];
-    vc.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
-    vc.modalPresentationStyle = UIModalPresentationOverCurrentContext;
-    [self presentViewController:vc animated:YES completion:nil];
+    self.joinPanel.group = [self.detailDataBox.detail[kHJJoinPositionKeyJoinGroupArray] objectAtIndex:index];
+    [self presentViewController:self.joinPanel animated:YES completion:nil];
 }
 
 - (void)joinViewAllJoinButtonClicked:(HJJoinDetailJoinView *)joinView {
-    HJJoinAllJoinPanelViewController *vc = [[HJJoinAllJoinPanelViewController alloc] init];
-    vc.delegate = self;
-    vc.dataBox = self.detailDataBox;
-    // 该效果属性不能放在HJConfirmPanelViewController内设置,不然设置透明度后不会显示底下视图的内容
-    vc.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
-    vc.modalPresentationStyle = UIModalPresentationOverCurrentContext;
-    [self presentViewController:vc animated:YES completion:nil];
+    [self presentViewController:self.allJoinPanel animated:YES completion:nil];
 }
 
 #pragma mark - HJJoinJoinPanelDelegate
@@ -236,24 +227,29 @@
     NSUInteger gId = [dict[@"groupId"] integerValue];
     NSUInteger pId = [dict[@"positionId"] integerValue];
     NSUInteger pType = [dict[@"positionCategory"] integerValue];
-    
     HJJoinApplyViewController *vc = [[HJJoinApplyViewController alloc] init];
     vc.positionID = pId;
     vc.positionType = pType;
     vc.groupID = gId;
-    [self.navigationController pushViewController:vc animated:YES];
+    
+    if (viewController.presentingViewController == self.allJoinPanel) {
+        [viewController dismissViewControllerAnimated:NO completion:^{
+            [self.allJoinPanel dismissViewControllerAnimated:NO completion:^{
+                [self.navigationController pushViewController:vc animated:YES];
+            }];
+        }];
+    } else {
+        [viewController dismissViewControllerAnimated:NO completion:^{
+            [self.navigationController pushViewController:vc animated:YES];
+        }];
+    }
 }
 
 #pragma mark - HJJoinAllJoinPanelDelegate
 
 - (void)joinAllJoinPanelViewController:(HJJoinAllJoinPanelViewController *)viewController didSelectAtIndex:(NSInteger)index {
-    HJJoinJoinPanelViewController *vc = [[HJJoinJoinPanelViewController alloc] init];
-    vc.delegate = self;
-    vc.dataBox = self.detailDataBox;
-    vc.group = [self.detailDataBox.detail[kHJJoinPositionKeyJoinGroupArray] objectAtIndex:index];
-    vc.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
-    vc.modalPresentationStyle = UIModalPresentationOverCurrentContext;
-    [self presentViewController:vc animated:YES completion:nil];
+    self.joinPanel.group = [self.detailDataBox.detail[kHJJoinPositionKeyJoinGroupArray] objectAtIndex:index];
+    [viewController presentViewController:self.joinPanel animated:YES completion:nil];
 }
 
 #pragma mark - FBAPIManagerInterceptor
@@ -407,12 +403,17 @@
         NSDate *fromeDate = [NSDate fb_dateWithTimeIntervalString:[NSString stringWithFormat:@"%f", self.startTimeInterval]];
         NSDate *toDate = [NSDate fb_dateWithTimeIntervalString:model.position.groupEndTime];
         NSDateComponents *dateComponents = [NSDate fb_dateComponentsFromDate:fromeDate toDate:toDate];
-        NSMutableAttributedString *clockString = [[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@"距离结束还有:%02ld天%02ld小时%02ld分%02ld秒", (long)dateComponents.day, (long)dateComponents.hour, (long)dateComponents.minute, (long)dateComponents.second]];
-        [clockString addAttribute:NSForegroundColorAttributeName value:[UIColor colorWithRed:255/255.0 green:143/255.0 blue:1/255.0 alpha:1.0] range:NSMakeRange(7, 2)];
-        [clockString addAttribute:NSForegroundColorAttributeName value:[UIColor colorWithRed:255/255.0 green:143/255.0 blue:1/255.0 alpha:1.0] range:NSMakeRange(10, 2)];
-        [clockString addAttribute:NSForegroundColorAttributeName value:[UIColor colorWithRed:255/255.0 green:143/255.0 blue:1/255.0 alpha:1.0] range:NSMakeRange(14, 2)];
-        [clockString addAttribute:NSForegroundColorAttributeName value:[UIColor colorWithRed:255/255.0 green:143/255.0 blue:1/255.0 alpha:1.0] range:NSMakeRange(17, 2)];
-        self.timerLabel.text = [clockString string];
+        if (dateComponents.second < 0) {
+            //倒计时秒数出现负数表示活动已结束
+            self.timerLabel.text = @"该活动已结束";
+        } else {
+            NSMutableAttributedString *clockString = [[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@"距离结束还有:%02ld天%02ld小时%02ld分%02ld秒", (long)dateComponents.day, (long)dateComponents.hour, (long)dateComponents.minute, (long)dateComponents.second]];
+            [clockString addAttribute:NSForegroundColorAttributeName value:[UIColor colorWithRed:255/255.0 green:143/255.0 blue:1/255.0 alpha:1.0] range:NSMakeRange(7, 2)];
+            [clockString addAttribute:NSForegroundColorAttributeName value:[UIColor colorWithRed:255/255.0 green:143/255.0 blue:1/255.0 alpha:1.0] range:NSMakeRange(10, 2)];
+            [clockString addAttribute:NSForegroundColorAttributeName value:[UIColor colorWithRed:255/255.0 green:143/255.0 blue:1/255.0 alpha:1.0] range:NSMakeRange(14, 2)];
+            [clockString addAttribute:NSForegroundColorAttributeName value:[UIColor colorWithRed:255/255.0 green:143/255.0 blue:1/255.0 alpha:1.0] range:NSMakeRange(17, 2)];
+            self.timerLabel.text = [clockString string];
+        }
     }];
     
     [self.scrollLayoutView.headerView addSubview:self.titleView];
@@ -547,4 +548,26 @@
     return _countDown;
 }
 
+- (HJJoinAllJoinPanelViewController *)allJoinPanel {
+    if (_allJoinPanel == nil) {
+        _allJoinPanel = [[HJJoinAllJoinPanelViewController alloc] init];
+        _allJoinPanel.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
+        _allJoinPanel.modalPresentationStyle = UIModalPresentationOverCurrentContext;
+        _allJoinPanel.delegate = self;
+        _allJoinPanel.dataBox = self.detailDataBox;
+    }
+    return _allJoinPanel;
+}
+
+- (HJJoinJoinPanelViewController *)joinPanel {
+    if (_joinPanel == nil) {
+        _joinPanel = [[HJJoinJoinPanelViewController alloc] init];
+        _joinPanel.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
+        _joinPanel.modalPresentationStyle = UIModalPresentationOverCurrentContext;
+        _joinPanel.delegate = self;
+        _joinPanel.dataBox = self.detailDataBox;
+    }
+    return _joinPanel;
+}
+
 @end

+ 1 - 0
HappyJob/HappyJob/Join_拼工/HJJoinTableViewCell.m

@@ -257,6 +257,7 @@
         _clockLabel = [[UILabel alloc] init];
         _clockLabel.font = [UIFont systemFontOfSize:10];
         _clockLabel.textColor = [UIColor colorWithRed:136/255.0 green:136/255.0 blue:136/255.0 alpha:1.0];
+        _clockLabel.textAlignment = NSTextAlignmentRight;
     }
     return _clockLabel;
 }

+ 11 - 6
HappyJob/HappyJob/Join_拼工/HJJoinViewController.m

@@ -96,12 +96,17 @@
     NSDate *fromeDate = [NSDate fb_dateWithTimeIntervalString:startTime];
     NSDate *toDate = [NSDate fb_dateWithTimeIntervalString:endTime];
     NSDateComponents *dateComponents = [NSDate fb_dateComponentsFromDate:fromeDate toDate:toDate];
-    NSMutableAttributedString *clockString = [[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@"距离结束还有:%02ld天%02ld小时%02ld分%02ld秒", (long)dateComponents.day, (long)dateComponents.hour, (long)dateComponents.minute, (long)dateComponents.second]];
-    [clockString addAttribute:NSForegroundColorAttributeName value:[UIColor colorWithRed:255/255.0 green:143/255.0 blue:1/255.0 alpha:1.0] range:NSMakeRange(7, 2)];
-    [clockString addAttribute:NSForegroundColorAttributeName value:[UIColor colorWithRed:255/255.0 green:143/255.0 blue:1/255.0 alpha:1.0] range:NSMakeRange(10, 2)];
-    [clockString addAttribute:NSForegroundColorAttributeName value:[UIColor colorWithRed:255/255.0 green:143/255.0 blue:1/255.0 alpha:1.0] range:NSMakeRange(14, 2)];
-    [clockString addAttribute:NSForegroundColorAttributeName value:[UIColor colorWithRed:255/255.0 green:143/255.0 blue:1/255.0 alpha:1.0] range:NSMakeRange(17, 2)];
-    return clockString;
+    if (dateComponents.second < 0) {
+        //倒计时秒数出现负数表示活动已结束
+        return [[NSAttributedString alloc] initWithString:@"该活动已结束"];
+    } else {
+        NSMutableAttributedString *clockString = [[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@"距离结束还有:%02ld天%02ld小时%02ld分%02ld秒", (long)dateComponents.day, (long)dateComponents.hour, (long)dateComponents.minute, (long)dateComponents.second]];
+        [clockString addAttribute:NSForegroundColorAttributeName value:[UIColor colorWithRed:255/255.0 green:143/255.0 blue:1/255.0 alpha:1.0] range:NSMakeRange(7, 2)];
+        [clockString addAttribute:NSForegroundColorAttributeName value:[UIColor colorWithRed:255/255.0 green:143/255.0 blue:1/255.0 alpha:1.0] range:NSMakeRange(10, 2)];
+        [clockString addAttribute:NSForegroundColorAttributeName value:[UIColor colorWithRed:255/255.0 green:143/255.0 blue:1/255.0 alpha:1.0] range:NSMakeRange(14, 2)];
+        [clockString addAttribute:NSForegroundColorAttributeName value:[UIColor colorWithRed:255/255.0 green:143/255.0 blue:1/255.0 alpha:1.0] range:NSMakeRange(17, 2)];
+        return clockString;
+    }
 }
 
 #pragma mark - getters and setters

+ 56 - 38
HappyJob/HappyJob/Join_拼工/Joining_马上拼/HJJoinJoinPanelViewController.m

@@ -64,12 +64,17 @@
         NSDate *fromeDate = [NSDate fb_dateWithTimeIntervalString:[NSString stringWithFormat:@"%f", self.startTimeInterval]];
         NSDate *toDate = [NSDate fb_dateWithTimeIntervalString:model.position.groupEndTime];
         NSDateComponents *dateComponents = [NSDate fb_dateComponentsFromDate:fromeDate toDate:toDate];
-        NSMutableAttributedString *clockString = [[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@"距离结束还有:%02ld天%02ld小时%02ld分%02ld秒", (long)dateComponents.day, (long)dateComponents.hour, (long)dateComponents.minute, (long)dateComponents.second]];
-        [clockString addAttribute:NSForegroundColorAttributeName value:[UIColor colorWithRed:255/255.0 green:143/255.0 blue:1/255.0 alpha:1.0] range:NSMakeRange(7, 2)];
-        [clockString addAttribute:NSForegroundColorAttributeName value:[UIColor colorWithRed:255/255.0 green:143/255.0 blue:1/255.0 alpha:1.0] range:NSMakeRange(10, 2)];
-        [clockString addAttribute:NSForegroundColorAttributeName value:[UIColor colorWithRed:255/255.0 green:143/255.0 blue:1/255.0 alpha:1.0] range:NSMakeRange(14, 2)];
-        [clockString addAttribute:NSForegroundColorAttributeName value:[UIColor colorWithRed:255/255.0 green:143/255.0 blue:1/255.0 alpha:1.0] range:NSMakeRange(17, 2)];
-        self.clockLabel.attributedText = clockString;
+        if (dateComponents.second < 0) {
+            //倒计时秒数出现负数表示活动已结束
+            self.clockLabel.attributedText = [[NSAttributedString alloc] initWithString:@"该活动已结束"];
+        } else {
+            NSMutableAttributedString *clockString = [[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@"距离结束还有:%02ld天%02ld小时%02ld分%02ld秒", (long)dateComponents.day, (long)dateComponents.hour, (long)dateComponents.minute, (long)dateComponents.second]];
+            [clockString addAttribute:NSForegroundColorAttributeName value:[UIColor colorWithRed:255/255.0 green:143/255.0 blue:1/255.0 alpha:1.0] range:NSMakeRange(7, 2)];
+            [clockString addAttribute:NSForegroundColorAttributeName value:[UIColor colorWithRed:255/255.0 green:143/255.0 blue:1/255.0 alpha:1.0] range:NSMakeRange(10, 2)];
+            [clockString addAttribute:NSForegroundColorAttributeName value:[UIColor colorWithRed:255/255.0 green:143/255.0 blue:1/255.0 alpha:1.0] range:NSMakeRange(14, 2)];
+            [clockString addAttribute:NSForegroundColorAttributeName value:[UIColor colorWithRed:255/255.0 green:143/255.0 blue:1/255.0 alpha:1.0] range:NSMakeRange(17, 2)];
+            self.clockLabel.attributedText = clockString;
+        }
     }];
 }
 
@@ -101,11 +106,11 @@
         make.centerX.equalTo(self.contentView);
     }];
     [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
-        make.top.equalTo(self.portraitGroupView.mas_bottom).with.offset(20);
+        make.bottom.equalTo(self.clockLabel.mas_top).with.offset(-12);
         make.centerX.equalTo(self.contentView);
     }];
     [self.clockLabel mas_makeConstraints:^(MASConstraintMaker *make) {
-        make.top.equalTo(self.titleLabel.mas_bottom).with.offset(12);
+        make.bottom.equalTo(self.lineH.mas_top).with.offset(-28);
         make.centerX.equalTo(self.contentView);
     }];
     [self.cancelButton mas_makeConstraints:^(MASConstraintMaker *make) {
@@ -127,11 +132,9 @@
 #pragma mark - event response
 
 - (void)okButtonClicked:(UIButton *)sender {
-    [self dismissViewControllerAnimated:YES completion:^{
-        if ([self.delegate respondsToSelector:@selector(joinPanelDidJoining:)]) {
-            [self.delegate joinPanelDidJoining:self];
-        }
-    }];
+    if ([self.delegate respondsToSelector:@selector(joinPanelDidJoining:)]) {
+        [self.delegate joinPanelDidJoining:self];
+    }
 }
 
 - (void)cancelButtonClicked:(UIButton *)sender {
@@ -144,6 +147,45 @@
 
 #pragma mark - getters and setters
 
+- (void)setGroup:(NSArray *)group {
+    _group = [group copy];
+    
+    if ([self.contentView.subviews indexOfObject:self.portraitGroupView] != NSNotFound) {
+        [self.portraitGroupView removeFromSuperview];
+    }
+    id imageURLStringArray = [group valueForKeyPath:@"hpResumeAPI.headImg"];
+    if ([imageURLStringArray isKindOfClass:[NSArray class]]) {
+        self.portraitGroupView = [[HJPortraitGroupView alloc] initWithImages:imageURLStringArray spacing:-20];
+    } else {
+        self.portraitGroupView = [[HJPortraitGroupView alloc] initWithImages:@[]];
+    }
+    [self.contentView addSubview:self.portraitGroupView];
+    [self.portraitGroupView mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.top.equalTo(self.contentView).with.offset(30);
+        make.centerX.equalTo(self.contentView);
+    }];
+    
+    //满足三个人就可以成团,计算还差几个人成团
+    id name = [group valueForKeyPath:@"hpResumeAPI.realName"];
+    NSUInteger count = 0;
+    if ([group isKindOfClass:[NSArray class]] && [group count] < 3) {
+        count = 3 - [group count];
+    }
+    NSString *leaderName = @"";
+    if ([name isKindOfClass:[NSArray class]]) {
+        leaderName = [name firstObject];
+    }
+    NSMutableAttributedString *leaderAttributedString = [[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@"%@ 的拼工", leaderName]];
+    if (count > 0) {
+        NSMutableAttributedString *numStr = [[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@" 还差 %@ 位伙伴", @(count)]];
+        NSDictionary *numAttributes = @{NSForegroundColorAttributeName: [UIColor colorWithRed:255/255.0 green:143/255.0 blue:1/255.0 alpha:1.0],
+                                        NSFontAttributeName: [UIFont boldSystemFontOfSize:11]};
+        [numStr addAttributes:numAttributes range:NSMakeRange(4, 1)];
+        [leaderAttributedString appendAttributedString:numStr];
+    }
+    self.titleLabel.attributedText = leaderAttributedString;
+}
+
 - (UIView *)contentView {
     if (_contentView == nil) {
         _contentView = [[UIView alloc] init];
@@ -172,12 +214,7 @@
 
 - (HJPortraitGroupView *)portraitGroupView {
     if (_portraitGroupView == nil) {
-        id imageURLStringArray = [self.group valueForKeyPath:@"hpResumeAPI.headImg"];
-        if ([imageURLStringArray isKindOfClass:[NSArray class]]) {
-            _portraitGroupView = [[HJPortraitGroupView alloc] initWithImages:imageURLStringArray spacing:-20];
-        } else {
-            _portraitGroupView = [[HJPortraitGroupView alloc] initWithImages:@[]];
-        }
+        _portraitGroupView = [[HJPortraitGroupView alloc] initWithImages:@[]];
     }
     return _portraitGroupView;
 }
@@ -187,25 +224,6 @@
         _titleLabel = [[UILabel alloc] init];
         _titleLabel.font = [UIFont systemFontOfSize:16];
         _titleLabel.textColor = [UIColor colorWithRed:153/255.0 green:153/255.0 blue:153/255.0 alpha:1.0];
-        //满足三个人就可以成团,计算还差几个人成团
-        id name = [self.group valueForKeyPath:@"hpResumeAPI.realName"];
-        NSUInteger count = 0;
-        if ([self.group isKindOfClass:[NSArray class]] && [self.group count] < 3) {
-            count = 3 - [self.group count];
-        }
-        NSString *leaderName = @"";
-        if ([name isKindOfClass:[NSArray class]]) {
-            leaderName = [name firstObject];
-        }
-        NSMutableAttributedString *leaderAttributedString = [[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@"%@ 的拼工", leaderName]];
-        if (count > 0) {
-            NSMutableAttributedString *numStr = [[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@" 还差 %@ 位伙伴", @(count)]];
-            NSDictionary *numAttributes = @{NSForegroundColorAttributeName: [UIColor colorWithRed:255/255.0 green:143/255.0 blue:1/255.0 alpha:1.0],
-                                            NSFontAttributeName: [UIFont boldSystemFontOfSize:11]};
-            [numStr addAttributes:numAttributes range:NSMakeRange(4, 1)];
-            [leaderAttributedString appendAttributedString:numStr];
-        }
-        _titleLabel.attributedText = leaderAttributedString;
     }
     return _titleLabel;
 }

+ 1 - 1
HappyJob/HappyJob/Join_拼工/拼工规则/HJJoinAgreementViewController.m

@@ -43,7 +43,7 @@
                                              "3、 拼团总人数达5人或5人以上,可叠加奖励金,具体以当天实际情况为准;\n\n"
                                              "4、 奖励金领取规则,依据返费规则,并与返费同时发放;\n\n"
                                              "5、 拼团奖励金以当天实际情况为准;\n\n"
-                                             "6、 每天每个用户只能参加一次拼团,拼团结束时可再次参加;\n\n"
+                                             "6、 用户同一时间只能参加一个拼工,当前拼工结束才可参加另一个拼工;\n\n"
                                              "7、 拼团规则不与经纪人规则同时适用;\n\n"
                                              "8、 具体可咨询客服电话:400-692-0099;\n\n"
                                              "9、 本活动最终解释权归开心工作所有。"

+ 0 - 1
HappyJob/HappyJob/Login_登录/HJLoginBindingPhoneViewController.m

@@ -91,7 +91,6 @@
         make.top.equalTo(self.topLabel.mas_bottom).with.offset(HJVerticalScale(90));
         make.left.equalTo(contentView).with.offset(HJHorizontalScale(70));
         make.right.equalTo(contentView).with.offset(-HJHorizontalScale(70));
-        make.height.mas_equalTo(100);
     }];
     [self.bindingButton mas_makeConstraints:^(MASConstraintMaker *make) {
         make.top.equalTo(self.loginFieldView.mas_bottom).with.offset(HJVerticalScale(40));

+ 0 - 2
HappyJob/HappyJob/Login_登录/HJLoginViewController.m

@@ -60,7 +60,6 @@
     [self.scrollLayoutView.contentView addSubview:self.loginButton];
     [self.scrollLayoutView.contentView addSubview:self.agreementView];
     [self.scrollLayoutView.contentView addSubview:self.wechatLoginButton];
-    
     [self.scrollLayoutView makeConstraints];
     
     _wxAPIManager = [HJWeiXinAPIManager sharedManager];
@@ -85,7 +84,6 @@
         make.top.equalTo(self.logoImageView.mas_bottom).with.offset(HJVerticalScale(30));
         make.left.equalTo(contentView).with.offset(HJHorizontalScale(70));
         make.right.equalTo(contentView).with.offset(-HJHorizontalScale(70));
-        make.height.mas_equalTo(100);
     }];
     [self.loginButton mas_makeConstraints:^(MASConstraintMaker *make) {
         make.top.equalTo(self.loginFieldView.mas_bottom).with.offset(HJVerticalScale(30));

+ 1 - 1
HappyJob/HappyJob/Me_我/HJMeViewController.m

@@ -286,7 +286,7 @@
         }
         // 解决底部被UITabBar遮挡的问题
         self.edgesForExtendedLayout = UIRectEdgeNone;
-        //_tableView.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth;
+        _tableView.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth;
         // 修改分割线样式
         _tableView.separatorInset = UIEdgeInsetsZero;
         _tableView.separatorColor = [UIColor colorWithRed:221/255.0 green:221/255.0 blue:221/255.0 alpha:1.0];

+ 22 - 4
HappyJob/HappyJob/Me_我/Resume_个人简历/求职意向/HJExpectationViewController.m

@@ -17,6 +17,7 @@
 #import <IQPreviousNextView.h>
 #import "HJSaveExpectationAPIManager.h"
 #import "UIView+FBProgressHUD.h"
+#import "HJSitePickerView.h"
 
 @interface HJExpectationViewController () <FBScrollLayoutViewDelegate, FBFlowLayoutDelegate, FBFlowLayoutDataSource, FBAPIManagerDelegate, UIPickerViewDelegate, UIPickerViewDataSource, UITextFieldDelegate>
 @property (nonatomic, strong) FBScrollLayoutView *scrollLayoutView;
@@ -27,6 +28,7 @@
 @property (nonatomic, strong) UIButton *saveButton;
 @property (nonatomic, strong) UIScrollView *positionScrollView;
 @property (nonatomic, strong) FBFlowLayoutView *positionFlowLayoutView;
+@property (nonatomic, strong) HJSitePickerView *sitePickerView;
 @property (nonatomic, strong) UIPickerView *salaryPickerView;
 @property (nonatomic, strong) HJSaveExpectationAPIManager *saveExpectationAPIManager;
 @property (nonatomic, strong) HJResumeDataBox *resumeDataBox;
@@ -135,6 +137,12 @@
             self.salaryView.contentTextField.text = self.resumeDataBox.salaryDataSource[row];
         }
     }
+    
+    if (textField == self.siteView.contentTextField) {
+        if (self.sitePickerView.selectedRowInPro > -1 && self.sitePickerView.selectedRowInCity > -1 && self.sitePickerView.selectedRowInDistrict > -1) {
+            self.siteView.contentTextField.text = self.sitePickerView.siteText;
+        }
+    }
 }
 
 #pragma mark - FBFlowLayoutDelegate
@@ -227,10 +235,11 @@
             self.saveExpectationAPIManager.positionIndexArray = indexArray;
         }
         
-        self.saveExpectationAPIManager.provinceCode = @"320000";
-        self.saveExpectationAPIManager.cityCode = @"320200";
-        self.saveExpectationAPIManager.countryCode = @"320214";
-        self.saveExpectationAPIManager.address = @"江苏-无锡-新吴区";
+        NSArray *code = self.sitePickerView.codeArray;
+        self.saveExpectationAPIManager.provinceCode = code[0];
+        self.saveExpectationAPIManager.cityCode = code[1];
+        self.saveExpectationAPIManager.countryCode = code[2];
+        self.saveExpectationAPIManager.address = self.siteView.contentTextField.text;
         self.saveExpectationAPIManager.salaryIndex = [self.resumeDataBox.salaryDataSource indexOfObject:self.salaryView.contentTextField.text];
         [self.saveExpectationAPIManager start];
     }
@@ -263,6 +272,13 @@
     return _salaryPickerView;
 }
 
+- (HJSitePickerView *)sitePickerView {
+    if (_sitePickerView == nil) {
+        _sitePickerView = [[HJSitePickerView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 250)];
+    }
+    return _sitePickerView;
+}
+
 - (UIScrollView *)positionScrollView {
     if (_positionScrollView == nil) {
         _positionScrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 250)];
@@ -299,6 +315,8 @@
         _siteView = [[HJLabelTextFieldView alloc] init];
         _siteView.titleLabel.text = @"期望地点";
         _siteView.contentTextField.placeholder = @"选择期望的公司地理位置";
+        _siteView.contentTextField.inputView = self.sitePickerView;
+        _siteView.contentTextField.delegate = self;
         _siteView.contentTextField.text = self.resumeDataBox.resume[kHJResumeKeyWorkPlace];
     }
     return _siteView;

+ 0 - 17
HappyJob/HappyJob/Me_我/Resume_个人简历/求职意向/HJSiteMenuView.h

@@ -1,17 +0,0 @@
-//
-//  HJSiteMenuView.h
-//  HappyJob
-//
-//  Created by Bob on 2019/4/16.
-//  Copyright © 2019 Bob. All rights reserved.
-//
-
-#import "HJTextFieldPopMenuView.h"
-
-NS_ASSUME_NONNULL_BEGIN
-
-@interface HJSiteMenuView : HJTextFieldPopMenuView
-
-@end
-
-NS_ASSUME_NONNULL_END

+ 0 - 21
HappyJob/HappyJob/Me_我/Resume_个人简历/求职意向/HJSiteMenuView.m

@@ -1,21 +0,0 @@
-//
-//  HJSiteMenuView.m
-//  HappyJob
-//
-//  Created by Bob on 2019/4/16.
-//  Copyright © 2019 Bob. All rights reserved.
-//
-
-#import "HJSiteMenuView.h"
-
-@implementation HJSiteMenuView
-
-/*
-// Only override drawRect: if you perform custom drawing.
-// An empty implementation adversely affects performance during animation.
-- (void)drawRect:(CGRect)rect {
-    // Drawing code
-}
-*/
-
-@end

+ 21 - 0
HappyJob/HappyJob/Me_我/Resume_个人简历/求职意向/HJSitePickerView.h

@@ -0,0 +1,21 @@
+//
+//  HJSitePickerView.h
+//  HappyJob
+//
+//  Created by Bob on 2019/4/16.
+//  Copyright © 2019 Bob. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface HJSitePickerView : UIView
+@property (nonatomic, assign, readonly) NSInteger selectedRowInPro;            //用于记录选中哪个省的索引
+@property (nonatomic, assign, readonly) NSInteger selectedRowInCity;           //用于记录选中哪个市的索引
+@property (nonatomic, assign, readonly) NSInteger selectedRowInDistrict;       //用于记录选中哪个区的索引
+@property (nonatomic, copy, readonly) NSString *siteText;                      //省市区显示文本
+@property (nonatomic, copy, readonly) NSArray<NSString *> *codeArray;          //省市区code码数组
+@end
+
+NS_ASSUME_NONNULL_END

+ 167 - 0
HappyJob/HappyJob/Me_我/Resume_个人简历/求职意向/HJSitePickerView.m

@@ -0,0 +1,167 @@
+//
+//  HJSitePickerView.m
+//  HappyJob
+//
+//  Created by Bob on 2019/4/16.
+//  Copyright © 2019 Bob. All rights reserved.
+//
+
+#import "HJSitePickerView.h"
+
+@interface HJSitePickerView () <UIPickerViewDelegate, UIPickerViewDataSource>
+@property (nonatomic, strong) UIPickerView *pickView;                   //最主要的选择器
+@property (nonatomic, copy) NSArray *AllARY;                            //取出所有数据(json类型,在pilst里面)
+@property (nonatomic, strong) NSMutableArray *ProvinceAry;              //只装省份的数组
+@property (nonatomic, strong) NSMutableArray *CityAry;                  //只装城市的数组
+@property (nonatomic, strong) NSMutableArray *DistrictAry;              //只装区的数组(还有县)
+@property (nonatomic, assign, readwrite) NSInteger proIndex;            //用于记录选中哪个省的索引
+@property (nonatomic, assign, readwrite) NSInteger cityIndex;           //用于记录选中哪个市的索引
+@property (nonatomic, assign, readwrite) NSInteger districtIndex;       //用于记录选中哪个区的索引
+@end
+
+@implementation HJSitePickerView
+
+- (instancetype)initWithFrame:(CGRect)frame {
+    if (self = [super initWithFrame:frame]) {
+        self.pickView.frame = frame;
+        [self addSubview:self.pickView];
+        
+        self.ProvinceAry = [NSMutableArray arrayWithArray:self.AllARY];
+
+        self.CityAry = [NSMutableArray arrayWithArray:[[self.ProvinceAry objectAtIndex:self.proIndex] objectForKey:@"cityList"]];
+        [self.pickView reloadComponent:1];
+        [self.pickView selectRow:0 inComponent:1 animated:YES];
+        
+        self.DistrictAry = [NSMutableArray arrayWithArray:[[self.CityAry objectAtIndex:self.cityIndex] objectForKey:@"areaList"]];
+        [self.pickView reloadComponent:2];
+        [self.pickView selectRow:0 inComponent:2 animated:YES];
+    }
+    return self;
+}
+
+#pragma mark - UIPickerViewDelegate & UIPickerViewDataSource
+
+//自定义每个pickview的label
+- (UIView*)pickerView:(UIPickerView *)pickerView viewForRow:(NSInteger)row forComponent:(NSInteger)component reusingView:(UIView *)view {
+    UILabel* pickerLabel = [UILabel new];
+    pickerLabel.numberOfLines = 0;
+    pickerLabel.textAlignment = NSTextAlignmentCenter;
+    [pickerLabel setFont:[UIFont systemFontOfSize:12]];
+    pickerLabel.text=[self pickerView:pickerView titleForRow:row forComponent:component];
+    return pickerLabel;
+}
+
+- (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component {
+    if (component == 0) {
+        self.proIndex = row;
+        self.cityIndex = 0;
+        self.districtIndex = 0;
+        
+        self.CityAry = [NSMutableArray arrayWithArray:[[self.ProvinceAry objectAtIndex:self.proIndex] objectForKey:@"cityList"]];
+        [self.pickView reloadComponent:1];
+        [self.pickView selectRow:0 inComponent:1 animated:YES];
+        
+        self.DistrictAry = [NSMutableArray arrayWithArray:[[self.CityAry objectAtIndex:self.cityIndex] objectForKey:@"areaList"]];
+        [self.pickView reloadComponent:2];
+        [self.pickView selectRow:0 inComponent:2 animated:YES];
+        
+    }
+    
+    if (component == 1) {
+        self.cityIndex = row;
+        self.districtIndex = 0;
+        
+        self.DistrictAry = [NSMutableArray arrayWithArray:[[self.CityAry objectAtIndex:self.cityIndex] objectForKey:@"areaList"]];
+        [self.pickView reloadComponent:2];
+        [self.pickView selectRow:0 inComponent:2 animated:YES];
+    }
+    
+    if (component == 2) {
+        self.districtIndex = row;
+    }
+}
+
+- (NSString*)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component {
+    if (component == 0) {
+        return [[self.ProvinceAry objectAtIndex:row] objectForKey:@"name"];
+    } else if (component == 1) {
+        return [[self.CityAry objectAtIndex:row] objectForKey:@"name"];
+    } else if (component == 2) {
+        return [[self.DistrictAry objectAtIndex:row] objectForKey:@"name"];
+    }
+    
+    return nil;
+}
+
+- (NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component {
+    if (component == 0) {
+        return self.ProvinceAry.count;
+    } else if (component == 1) {
+        return self.CityAry.count;
+    } else if (component == 2) {
+        return self.DistrictAry.count;
+    }
+    
+    return 0;
+}
+
+- (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView {
+    return 3;
+}
+
+#pragma mark - getters and setters
+
+- (NSInteger)selectedRowInPro {
+    return [self.pickView selectedRowInComponent:0];
+}
+
+- (NSInteger)selectedRowInCity {
+    return [self.pickView selectedRowInComponent:1];
+}
+
+- (NSInteger)selectedRowInDistrict {
+    return [self.pickView selectedRowInComponent:2];
+}
+
+- (NSString *)siteText {
+    NSString *proStr = [[self.ProvinceAry objectAtIndex:self.proIndex] objectForKey:@"name"];
+    NSString *cityStr = [[self.CityAry objectAtIndex:self.cityIndex] objectForKey:@"name"];
+    NSString *disStr = [[self.DistrictAry objectAtIndex:self.districtIndex] objectForKey:@"name"];
+    NSString *text = [NSString stringWithFormat:@"%@-%@-%@", proStr, cityStr, disStr];
+    return text;
+}
+
+- (NSArray *)codeArray {
+    NSString *pcode = [[self.ProvinceAry objectAtIndex:self.proIndex] objectForKey:@"code"];
+    NSString *ccode = [[self.CityAry objectAtIndex:self.cityIndex] objectForKey:@"code"];
+    NSString *dcode = [[self.DistrictAry objectAtIndex:self.districtIndex] objectForKey:@"code"];
+    NSArray *array = @[pcode, ccode, dcode];
+    return array;
+}
+
+- (NSArray *)AllARY {
+    if (_AllARY == nil) {
+        NSBundle *bundle = [NSBundle bundleWithPath:[[NSBundle mainBundle] pathForResource:@"HJCityPickerViewControllerSource" ofType:@"bundle"]];
+        _AllARY = [NSArray arrayWithContentsOfFile:[bundle pathForResource:@"HJCityPickerAreas" ofType:@"plist"]];
+    }
+    return _AllARY;
+}
+
+- (UIPickerView *)pickView {
+    if (_pickView == nil) {
+        _pickView = [[UIPickerView alloc] init];
+        _pickView.delegate = self;
+        _pickView.dataSource = self;
+        _pickView.backgroundColor = [UIColor whiteColor];
+    }
+    return _pickView;
+}
+
+- (void)setDistrictAry:(NSMutableArray *)DistrictAry {
+    NSDictionary *allDict = @{@"name": @"所有地区", @"code": @"0"};
+    [DistrictAry insertObject:allDict atIndex:0];
+    _DistrictAry = DistrictAry;
+}
+
+@end
+