瀏覽代碼

理论计时 和 从业计时 UI 重构,逻辑理顺。

openlockPPP 1 年之前
父節點
當前提交
c42a89dd04

+ 10 - 4
jiaPei.xcodeproj/project.pbxproj

@@ -89,6 +89,7 @@
 		900A2DE42A1FA89700395C1F /* RQAppEventModuleManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 900A2DDE2A1FA89700395C1F /* RQAppEventModuleManager.m */; };
 		900A2DE52A1FA89700395C1F /* RQAppEventAnnotation.m in Sources */ = {isa = PBXBuildFile; fileRef = 900A2DE02A1FA89700395C1F /* RQAppEventAnnotation.m */; };
 		900A2DE62A1FA89700395C1F /* RQBaseAppEventModule.m in Sources */ = {isa = PBXBuildFile; fileRef = 900A2DE12A1FA89700395C1F /* RQBaseAppEventModule.m */; };
+		9043ADB42A56C739005F6F81 /* NYChooseTypeAlertViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9043ADB32A56C739005F6F81 /* NYChooseTypeAlertViewController.m */; };
 		90626F3D2A204BC400C8FA05 /* kt_jq.db in Resources */ = {isa = PBXBuildFile; fileRef = 90626F3C2A204BC300C8FA05 /* kt_jq.db */; };
 		90626F402A20540600C8FA05 /* YNYDTJQQuestionModule.m in Sources */ = {isa = PBXBuildFile; fileRef = 90626F3F2A20540600C8FA05 /* YNYDTJQQuestionModule.m */; };
 		90798AFE2A5159BB00E68461 /* CollectionViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 90798AFD2A5159BB00E68461 /* CollectionViewCell.m */; };
@@ -1802,6 +1803,8 @@
 		900A2DE02A1FA89700395C1F /* RQAppEventAnnotation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RQAppEventAnnotation.m; sourceTree = "<group>"; };
 		900A2DE12A1FA89700395C1F /* RQBaseAppEventModule.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RQBaseAppEventModule.m; sourceTree = "<group>"; };
 		900A2DE22A1FA89700395C1F /* RQAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RQAppDelegate.h; sourceTree = "<group>"; };
+		9043ADB22A56C739005F6F81 /* NYChooseTypeAlertViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NYChooseTypeAlertViewController.h; sourceTree = "<group>"; };
+		9043ADB32A56C739005F6F81 /* NYChooseTypeAlertViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = NYChooseTypeAlertViewController.m; sourceTree = "<group>"; };
 		90626F3C2A204BC300C8FA05 /* kt_jq.db */ = {isa = PBXFileReference; lastKnownFileType = file; path = kt_jq.db; sourceTree = "<group>"; };
 		90626F3E2A20540600C8FA05 /* YNYDTJQQuestionModule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = YNYDTJQQuestionModule.h; sourceTree = "<group>"; };
 		90626F3F2A20540600C8FA05 /* YNYDTJQQuestionModule.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = YNYDTJQQuestionModule.m; sourceTree = "<group>"; };
@@ -4592,6 +4595,8 @@
 				90BA2E852A3177DE0029A54A /* NYGetjobTimeVC.m */,
 				90BA2E892A317BEB0029A54A /* NYBasetjTimeVC.h */,
 				90BA2E8A2A317BEB0029A54A /* NYBasetjTimeVC.m */,
+				9043ADB22A56C739005F6F81 /* NYChooseTypeAlertViewController.h */,
+				9043ADB32A56C739005F6F81 /* NYChooseTypeAlertViewController.m */,
 			);
 			path = NewTheory;
 			sourceTree = "<group>";
@@ -11292,6 +11297,7 @@
 				D0ED401D28F6BF1B00086901 /* RQVipContentNewCell.m in Sources */,
 				1D4D5BB71E7FBA0400518BA5 /* TimingBaseVC.m in Sources */,
 				D07426DC280E535A00CD7EFF /* RQHeadImageView.m in Sources */,
+				9043ADB42A56C739005F6F81 /* NYChooseTypeAlertViewController.m in Sources */,
 				D09E5D3C25E3AA260099E87C /* UIColor+BDFaceColorUtils.m in Sources */,
 				D00A15FA2754B86F00793046 /* RQTrack.m in Sources */,
 				D04DF6C227006C57006E3633 /* RQWebViewViewController.m in Sources */,
@@ -11664,7 +11670,7 @@
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
 				"CODE_SIGN_RESOURCE_RULES_PATH[sdk=*]" = "";
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 1982023070501;
+				CURRENT_PROJECT_VERSION = 2012023070501;
 				DEBUG_INFORMATION_FORMAT = dwarf;
 				DEVELOPMENT_TEAM = K7T6CU5SW5;
 				ENABLE_BITCODE = NO;
@@ -11700,7 +11706,7 @@
 					"$(PROJECT_DIR)/jiaPei/Vendor/BaiDuFaceSDK/BDFaceSDK/lib",
 					"$(PROJECT_DIR)/jiaPei/Vendor/QiNiu_IMSDK/Vendors/Voice",
 				);
-				MARKETING_VERSION = 1.9.8;
+				MARKETING_VERSION = 2.0.1;
 				ONLY_ACTIVE_ARCH = YES;
 				OTHER_CFLAGS = (
 					"$(inherited)",
@@ -11745,7 +11751,7 @@
 				CODE_SIGN_IDENTITY = "iPhone Developer";
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 1982023070501;
+				CURRENT_PROJECT_VERSION = 2012023070501;
 				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
 				DEVELOPMENT_TEAM = K7T6CU5SW5;
 				ENABLE_BITCODE = NO;
@@ -11781,7 +11787,7 @@
 					"$(PROJECT_DIR)/jiaPei/Vendor/BaiDuFaceSDK/BDFaceSDK/lib",
 					"$(PROJECT_DIR)/jiaPei/Vendor/QiNiu_IMSDK/Vendors/Voice",
 				);
-				MARKETING_VERSION = 1.9.8;
+				MARKETING_VERSION = 2.0.1;
 				ONLY_ACTIVE_ARCH = NO;
 				OTHER_CFLAGS = (
 					"$(inherited)",

二進制
jiaPei.xcworkspace/xcuserdata/mimasigeling.xcuserdatad/UserInterfaceState.xcuserstate


+ 2 - 2
jiaPei/AppDelegate.h

@@ -88,8 +88,8 @@
 @property (strong, nonatomic) NSTimer* timer;
 
 //将理论计时页面放在这里 然后定时器也在这里面
-@property (strong, nonatomic) PeriodVC *tPeriodVC;
-//@property (strong, nonatomic) NYBasetjTimeVC *tPeriodVC;
+//@property (strong, nonatomic) PeriodVC *tPeriodVC;
+@property (strong, nonatomic) NYBasetjTimeVC *tPeriodVC;
 
 
 //将实操计时页面放在这里 然后定时器也在这里面

+ 23 - 0
jiaPei/Images.xcassets/Modules/TimeModule/铃铛.imageset/Contents.json

@@ -0,0 +1,23 @@
+{
+  "images" : [
+    {
+      "filename" : "铃铛.png",
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "filename" : "铃铛@2x.png",
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "filename" : "铃铛@3x.png",
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

二進制
jiaPei/Images.xcassets/Modules/TimeModule/铃铛.imageset/铃铛.png


二進制
jiaPei/Images.xcassets/Modules/TimeModule/铃铛.imageset/铃铛@2x.png


二進制
jiaPei/Images.xcassets/Modules/TimeModule/铃铛.imageset/铃铛@3x.png


+ 34 - 28
jiaPei/Modules/TimeModule/ViewModel/itemViewModel/RQTimeSingleItemViewModel.m

@@ -14,8 +14,9 @@
 #import "NYGetjobTimeViewModel.h"
 
 @interface RQTimeSingleItemViewModel () {
-    PeriodVC                   *KVOPeriodVC;
-//    NYBasetjTimeVC             *KVOPeriodVC;
+//    PeriodVC                   *KVOPeriodVC;
+    NYBasetjTimeVC             *KVOPeriodVC;
+//    NYBasetjTimeVC             *KVOCYPeriodVC;//从业
     ShiCaoPeriodVC             *KVOSCPeriodVC;
     
     NSString                *orderId;            // 订单ID
@@ -71,39 +72,43 @@
 
 - (void)gotoPeriod:(int)type {
     
-//    NYBasetjTimeVC *vc = nil;
-//    if(type==0){
-//        if ([myDelegate.tPeriodVC isKindOfClass:[NYTheoryTimeVC class]]) {
-//            vc = myDelegate.tPeriodVC;
-//        }else {
-//            KVOPeriodVC = [self getNYTheoryTimeVC] ;
-//            vc = KVOPeriodVC;
-//        }
-//    }else if(type==1){
-//        if ([myDelegate.tPeriodVC isKindOfClass:[NYGetjobTimeVC class]]) {
-//            vc = myDelegate.tPeriodVC;
-//        }else {
-//            KVOPeriodVC = [self getNYGetjobTimeVC];
-//            vc = KVOPeriodVC;
-//        }
-//    }
-//    if(vc)[self navPushHideTabbarToVC:vc];
-    
-    PeriodVC *vc = nil;
-    if (myDelegate.tPeriodVC) {
-        vc = myDelegate.tPeriodVC;
-    }else {
-        KVOPeriodVC = [[PeriodVC alloc] init];
-        vc = KVOPeriodVC;
+    NYBasetjTimeVC *vc = nil;
+    if(type==0){
+        if(RQ_USER_MANAGER.isCykh){
+            ShowMsg(@"您是从业资格人员,请点击从业计时");
+            return;
+        }
+        if ([myDelegate.tPeriodVC isKindOfClass:[NYTheoryTimeVC class]]) {
+            vc = myDelegate.tPeriodVC;
+        }else {
+            KVOPeriodVC = [self getNYTheoryTimeVC] ;
+            vc = KVOPeriodVC;
+        }
+    }else if(type==1){
+        if ([myDelegate.tPeriodVC isKindOfClass:[NYGetjobTimeVC class]]) {
+            vc = myDelegate.tPeriodVC;
+        }else {
+            KVOPeriodVC = [self getNYGetjobTimeVC];
+            vc = KVOPeriodVC;
+        }
     }
-    [self navPushHideTabbarToVC:vc];
+    if(vc)[self navPushHideTabbarToVC:vc];
+    
+//    PeriodVC *vc = nil;
+//    if (myDelegate.tPeriodVC) {
+//        vc = myDelegate.tPeriodVC;
+//    }else {
+//        KVOPeriodVC = [[PeriodVC alloc] init];
+//        vc = KVOPeriodVC;
+//    }
+//    [self navPushHideTabbarToVC:vc];
 }
 
 - (NYBasetjTimeVC *)getNYTheoryTimeVC{
     
     NYTheoryTimeViewModel *viewModel = [[NYTheoryTimeViewModel alloc]  initWithServices:RQ_APPDELEGATE.services params:nil];
     NYTheoryTimeVC *timeViewController = [[NYTheoryTimeVC alloc] initWithViewModel:viewModel];
-
+    timeViewController.vcType = TimeVCTypeTheory;
     return timeViewController;
 }
 
@@ -111,6 +116,7 @@
     
     NYGetjobTimeViewModel *viewModel = [[NYGetjobTimeViewModel alloc]  initWithServices:RQ_APPDELEGATE.services params:nil];
     NYGetjobTimeVC *timeViewController = [[NYGetjobTimeVC alloc] initWithViewModel:viewModel];
+    timeViewController.vcType = TimeVCTypeAJob;
     return timeViewController;
 }
 

+ 8 - 0
jiaPei/NewTheory/NYBasetjTimeVC.h

@@ -10,9 +10,16 @@
 
 NS_ASSUME_NONNULL_BEGIN
 
+typedef NS_ENUM(NSUInteger, TimeVCType) {
+    TimeVCTypeTheory, // 普通理论
+    TimeVCTypeAJob, // 从业理论
+};
+
 @interface NYBasetjTimeVC : RQCommonCollectionViewController
 
 @property (nonatomic, copy) NSString *secondString;
+//vc理论类型
+@property (nonatomic, assign) TimeVCType vcType;
 
 //暴露出去,让子类-赋值
 @property (strong, nonatomic) UILabel         *timeLabel;
@@ -21,6 +28,7 @@ NS_ASSUME_NONNULL_BEGIN
 //计时事件
 - (void)btnClick:(UIButton *)sender;
 
+
 @end
 
 NS_ASSUME_NONNULL_END

+ 34 - 28
jiaPei/NewTheory/NYBasetjTimeVC.m

@@ -56,12 +56,13 @@ typedef enum {
 
 - (void)startTimingWithResultBlock:(void (^)(BOOL isSuccess))resultBlock {
     @weakify(self)
-    if (RQ_USER_MANAGER.isCykh) {
-        if (![self checkCykhChooseStr]) {
-            !resultBlock? : resultBlock(NO);
-            return;
-        }
-    }
+    
+//    if (RQ_USER_MANAGER.isCykh) {
+//        if (![self checkCykhChooseStr]) {
+//            !resultBlock? : resultBlock(NO);
+//            return;
+//        }
+//    }
     
     [self getCurrentPXKWithComplete:^(BOOL isSuccess, NSString *pxkm) {
         @strongify(self)
@@ -69,7 +70,11 @@ typedef enum {
             !resultBlock? : resultBlock(NO);
             return;
         }
-        [RQ_USER_MANAGER.currentUser updatePxjdWithPxjd:pxkm];
+        if(self.vcType == TimeVCTypeTheory){//普通理论
+            [RQ_USER_MANAGER.currentUser updatePxjdWithPxjd:pxkm.intValue >1 ?@"4": pxkm];
+        }else {
+            [RQ_USER_MANAGER.currentUser updatePxjdWithPxjd:pxkm];
+        }
 
         /// 理论计时类型二地市编号:null (暂无地市;在科目二可以进行科目四的理论计时,科目三暂无理论计时)
         if ([RQ_SHARE_FUNCTION.theoryOfTimingTypeTwoCityCodeArr containsObject:RQ_USER_MANAGER.currentUser.city] && [pxkm isEqualToString:@"3"]) {
@@ -103,14 +108,8 @@ typedef enum {
                         if (([pxkm isEqualToString:@"2"] || [pxkm isEqualToString:@"3"])) {
                             pxkm = @"4";
                         }
-                        
-                        if (RQ_USER_MANAGER.isCykh) {
-                            if (![self checkCykhChooseStr]) {
-                                !resultBlock? : resultBlock(NO);
-                                return;
-                            } else {
-                                pxkm = RQ_USER_MANAGER.cykhPxkmStr;
-                            }
+                        if (self.vcType == TimeVCTypeAJob) { //从业
+                            pxkm = RQ_USER_MANAGER.cykhPxkmStr;
                         }
                         
                         NSArray* array = [DB_Helper quearyTrain:RQStringIsNotEmpty(RQ_USER_MANAGER.currentUser.outId)? RQ_USER_MANAGER.currentUser.outId : @"" Subject:pxkm];
@@ -594,14 +593,17 @@ typedef enum {
                             if (([pxkm isEqualToString:@"2"] || [pxkm isEqualToString:@"3"])) {
                                 pxkm = @"4";
                             }
-                            if (RQ_USER_MANAGER.isCykh) {
-                                if (![self checkCykhChooseStr]) {
-                                    !resultBlock? : resultBlock(YES);
-                                    return;
-                                } else {
-                                    pxkm = RQ_USER_MANAGER.cykhPxkmStr;
-                                }
+                            if(self.vcType == TimeVCTypeAJob){//从业
+                                pxkm = RQ_USER_MANAGER.cykhPxkmStr;
                             }
+//                            if (RQ_USER_MANAGER.isCykh) {
+//                                if (![self checkCykhChooseStr]) {
+//                                    !resultBlock? : resultBlock(YES);
+//                                    return;
+//                                } else {
+//                                    pxkm = RQ_USER_MANAGER.cykhPxkmStr;
+//                                }
+//                            }
                             NSArray* array = [DB_Helper quearyTrain:RQStringIsNotEmpty(RQ_USER_MANAGER.currentUser.outId)? RQ_USER_MANAGER.currentUser.outId : @"" Subject:pxkm];
                             if (array.count < 1) {
                                 !resultBlock? : resultBlock(YES);
@@ -741,13 +743,17 @@ typedef enum {
         pxkm = @"4";
     }
     
-    if (RQ_USER_MANAGER.isCykh) {
-        if (![self checkCykhChooseStr]) {
-            return;
-        } else {
-            pxkm = RQ_USER_MANAGER.cykhPxkmStr;
-        }
+    if(self.vcType == TimeVCTypeAJob){//从业
+        pxkm = RQ_USER_MANAGER.cykhPxkmStr;
     }
+    
+//    if (RQ_USER_MANAGER.isCykh) {
+//        if (![self checkCykhChooseStr]) {
+//            return;
+//        } else {
+//            pxkm = RQ_USER_MANAGER.cykhPxkmStr;
+//        }
+//    }
         
     NSArray* array =   [DB_Helper quearyTrain:RQStringIsNotEmpty(RQ_USER_MANAGER.currentUser.outId)? RQ_USER_MANAGER.currentUser.outId : @"" Subject:pxkm];
     if (array.count < 1) {

+ 30 - 0
jiaPei/NewTheory/NYChooseTypeAlertViewController.h

@@ -0,0 +1,30 @@
+//
+//  NYChooseTypeAlertViewController.h
+//  jiaPei
+//
+//  Created by Ning.ge on 2023/7/6.
+//  Copyright © 2023 JCZ. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface NYChooseTypeAlertViewController : QMUICommonViewController<QMUIModalPresentationContentViewControllerProtocol>
+
+@property (nonatomic,weak) UILabel *title_label;
+
+@property (nonatomic,weak) UIImageView *icon_imageview;
+
+@property (nonatomic,weak) UILabel *content_label;
+//完成
+@property (nonatomic, copy) void(^chooseFinishBlock)(NSInteger type);
+//取消
+@property (nonatomic, copy) void(^chooseCancelBlock)(void);
+
+//默认 科1 科2 对应 5678
+@property (nonatomic,assign) NSInteger type;
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 121 - 0
jiaPei/NewTheory/NYChooseTypeAlertViewController.m

@@ -0,0 +1,121 @@
+//
+//  NYChooseTypeAlertViewController.m
+//  jiaPei
+//
+//  Created by Ning.ge on 2023/7/6.
+//  Copyright © 2023 JCZ. All rights reserved.
+//
+
+#import "NYChooseTypeAlertViewController.h"
+
+@interface NYChooseTypeAlertViewController ()
+
+@property (nonatomic,weak) QMUIButton *cancel_button;
+
+@property (nonatomic,weak) QMUIButton *finish_button;
+
+@end
+
+@implementation NYChooseTypeAlertViewController
+
+- (void)dealloc{
+    NSLog(@"NYChooseTypeAlertViewController");
+}
+
+- (void)viewDidLoad {
+    [super viewDidLoad];
+    [self loadBasicUI];
+}
+#pragma mark - UI
+-(void)loadBasicUI{
+    self.view.backgroundColor = UIColorWhite;
+    self.view.layer.cornerRadius = 12.f;
+    self.view.layer.masksToBounds = YES;
+    
+    UILabel *title_label = [[UILabel alloc] init];
+    title_label.textColor = UIColorMakeWithHex(@"#0A1A33");
+    title_label.text = @"提示";
+    title_label.textAlignment = NSTextAlignmentCenter;
+    title_label.font = [UIFont boldSystemFontOfSize:21.f];
+    [self.view addSubview:title_label];
+    self.title_label = title_label;
+    [title_label mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.top.equalTo(self.view).offset(25.f);
+        make.left.right.equalTo(self.view);
+        make.height.mas_equalTo(29.f);
+    }];
+    
+    UIImageView *icon_imageview = [[UIImageView alloc] init];
+    icon_imageview.image = [UIImage imageNamed:@"铃铛"];
+    icon_imageview.contentMode = UIViewContentModeScaleToFill;
+    [self.view addSubview:icon_imageview];
+    self.icon_imageview = icon_imageview;
+    [icon_imageview mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.top.equalTo(title_label.mas_bottom).offset(22.f);
+        make.size.mas_equalTo(CGSizeMake(62, 70));
+        make.centerX.mas_equalTo(self.view);
+    }];
+    
+    UILabel *content_label = [[UILabel alloc] init];
+    content_label.textColor = UIColorMakeWithHex(@"#0A1A33");
+    content_label.text = @"确定选择该科目吗?";
+    content_label.textAlignment = NSTextAlignmentCenter;
+    content_label.font = [UIFont systemFontOfSize:14.f];
+    [self.view addSubview:content_label];
+    self.content_label = content_label;
+    [content_label mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.top.equalTo(icon_imageview.mas_bottom).offset(22.f);
+        make.left.right.equalTo(self.view);
+        make.height.mas_equalTo(20.f);
+    }];
+    
+    QMUIButton *cancel_button = [QMUIButton buttonWithType:UIButtonTypeCustom];
+    cancel_button.cornerRadius = 20.f;
+    cancel_button.layer.borderWidth = 1.f;
+    cancel_button.layer.borderColor = [UIColorMakeWithHex(@"#707070") CGColor];
+    cancel_button.backgroundColor = UIColor.whiteColor;
+    [cancel_button setTitleColor:UIColorMakeWithHex(@"#707070") forState:UIControlStateNormal];
+    [cancel_button setTitleNormal:@"关闭"];
+    [cancel_button addTarget:self action:@selector(buttonActionClosedo:) forControlEvents:UIControlEventTouchUpInside];
+    [self.view addSubview:cancel_button];
+    self.cancel_button = cancel_button;
+    [cancel_button mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.top.equalTo(content_label.mas_bottom).offset(35.f);
+        make.left.equalTo(self.view).offset(15);
+        make.size.mas_equalTo(CGSizeMake(125, 40));
+    }];
+    
+    QMUIButton *finish_button = [QMUIButton buttonWithType:UIButtonTypeCustom];
+    finish_button.cornerRadius = 20.f;
+    finish_button.backgroundColor = UIColorMakeWithHex(@"#498EF5");
+    [finish_button setTitleColor:UIColor.whiteColor forState:UIControlStateNormal];
+    [finish_button setTitleNormal:@"确认"];
+    [finish_button addTarget:self action:@selector(buttonActionFinishdo:) forControlEvents:UIControlEventTouchUpInside];
+    [self.view addSubview:finish_button];
+    self.finish_button = finish_button;
+    [finish_button mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.top.equalTo(content_label.mas_bottom).offset(35.f);
+        make.right.equalTo(self.view).offset(-15);
+        make.size.mas_equalTo(CGSizeMake(125, 40));
+    }];
+    
+    
+}
+
+//关闭
+- (void)buttonActionClosedo:(UIButton *)btn
+{
+    if(self.chooseCancelBlock){
+        self.chooseCancelBlock();
+    }
+}
+//确认
+- (void)buttonActionFinishdo:(UIButton *)btn
+{
+    if(self.chooseFinishBlock){
+        self.chooseFinishBlock(self.type);
+    }
+}
+
+
+@end

+ 8 - 2
jiaPei/NewTheory/NYGetjobTimeVC.m

@@ -8,7 +8,7 @@
 
 #import "NYGetjobTimeVC.h"
 #import "NYGetjobTimeViewModel.h"
-
+#import "NYGetjobStartRuleCell.h"
 
 @interface NYGetjobTimeVC ()
 /// viewModel
@@ -55,7 +55,13 @@
 - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView dequeueReusableCellWithIdentifier:(NSString *)identifier forIndexPath:(NSIndexPath *)indexPath {
     RQCommonGroupViewModel *groupViewModel = self.viewModel.dataSource[indexPath.section];
     RQCommonCollectionItemViewModel *itemViewModel = groupViewModel.itemViewModels[indexPath.row];
-    
+    if([itemViewModel.itemClassName isEqualToString:@"NYGetjobStartRuleCell"]){
+        NYGetjobStartRuleCell *cell = [NSClassFromString(itemViewModel.itemClassName) cellWithCollectionView:collectionView forIndexPath:indexPath];
+        [cell.time_Button addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
+        self.timeLabel = cell.time_Label;
+        self.on_offBtn = cell.time_Button;
+        return cell;
+    }
     return [NSClassFromString(itemViewModel.itemClassName) cellWithCollectionView:collectionView forIndexPath:indexPath];
 }
 

+ 2 - 0
jiaPei/NewTheory/NYTheoryTimeVC.m

@@ -53,6 +53,8 @@
     if([itemViewModel.itemClassName isEqualToString:@"NYTimeStartRuleCell"]){
         NYTimeStartRuleCell *cell = [NSClassFromString(itemViewModel.itemClassName) cellWithCollectionView:collectionView forIndexPath:indexPath];
         [cell.time_Button addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
+        self.timeLabel = cell.time_Label;
+        self.on_offBtn = cell.time_Button;
         return cell;
     }
     return [NSClassFromString(itemViewModel.itemClassName) cellWithCollectionView:collectionView forIndexPath:indexPath];

+ 2 - 0
jiaPei/NewTheory/View/NYGetjobStartRuleCell.h

@@ -26,6 +26,8 @@ NS_ASSUME_NONNULL_BEGIN
 @property (weak, nonatomic) IBOutlet UIButton *time_Button;
 
 @property (strong, nonatomic) UIButton *current_Button;
+//默认 科1 科2 对应 5678
+@property (nonatomic,assign) NSInteger type;
 
 @end
 

+ 53 - 16
jiaPei/NewTheory/View/NYGetjobStartRuleCell.m

@@ -7,7 +7,7 @@
 //
 
 #import "NYGetjobStartRuleCell.h"
-
+#import "NYChooseTypeAlertViewController.h"
 
 @interface NYGetjobStartRuleCell ()
 
@@ -22,8 +22,34 @@
     [collectionView registerNib:[UINib nibWithNibName:ID bundle:nil] forCellWithReuseIdentifier:ID];
     NYGetjobStartRuleCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:ID forIndexPath:indexPath];
     if (!cell) cell = [self rq_viewFromXib];
-    cell.current_Button = cell.k1_button;
-    cell.k1_button.selected = YES;
+    if(RQ_USER_MANAGER.cykhPxkmStr.length>0){
+        switch (RQ_USER_MANAGER.cykhPxkmStr.intValue) {
+            case 5:{
+                cell.current_Button = cell.k1_button;
+                cell.k1_button.selected = YES;
+                }break;
+            case 6:{
+                cell.current_Button = cell.k2_button;
+                cell.k2_button.selected = YES;
+                }break;
+            case 7:{
+                cell.current_Button = cell.k3_button;
+                cell.k3_button.selected = YES;
+                }break;
+            case 8:{
+                cell.current_Button = cell.k4_button;
+                cell.k4_button.selected = YES;
+                }break;
+            default:
+                cell.current_Button = cell.k1_button;
+                cell.k1_button.selected = YES;
+                break;
+        }
+    }else {
+        cell.current_Button = cell.k1_button;
+        cell.k1_button.selected = YES;
+        RQ_USER_MANAGER.cykhPxkmStr = @"5";
+    }
     return cell;
 }
 
@@ -54,19 +80,30 @@
 - (IBAction)actionSubjectButton:(QMUIButton *)sender {
     
     NSLog(@"点击了");
-    self.current_Button.selected = NO;
-    sender.selected = YES;
-    self.current_Button = sender;
-//    //弹窗-提示
-//    UIViewController *chooseFilterViewController = [[UIViewController alloc] init];
-//
-//    QMUIModalPresentationViewController *modalPresentationViewController = [[QMUIModalPresentationViewController alloc] init];
-//    modalPresentationViewController.contentViewController = chooseFilterViewController;
-//
-//    modalPresentationViewController.willHideByDimmingViewTappedBlock = ^{
-//
-//    };
-//    [modalPresentationViewController showWithAnimated:YES completion:nil];
+    CGFloat width = 290.f,height = 283.f;
+    CGFloat ctY = (SL_kScreenHeight - height)*0.5;
+    CGFloat ctX = (SL_kScreenWidth - width)*0.5;
+    //弹窗-提示
+    @weakify(self)
+    NYChooseTypeAlertViewController *chooseTypeAlertViewController = [[NYChooseTypeAlertViewController alloc] init];
+    chooseTypeAlertViewController.type = sender.tag;
+    QMUIModalPresentationViewController *modalPresentationViewController = [[QMUIModalPresentationViewController alloc] init];
+    chooseTypeAlertViewController.chooseFinishBlock = ^(NSInteger type) {
+        self.current_Button.selected = NO;
+        sender.selected = YES;
+        self.current_Button = sender;
+        RQ_USER_MANAGER.cykhPxkmStr = [NSString stringWithFormat:@"%zd",type];//从业阶段
+        [modalPresentationViewController hideWithAnimated:YES
+                                               completion:nil];
+    };
+    chooseTypeAlertViewController.chooseCancelBlock = ^{
+        [modalPresentationViewController hideWithAnimated:YES
+                                               completion:nil];
+    };
+    modalPresentationViewController.contentViewMargins = UIEdgeInsetsMake(ctY, ctX , ctY, ctX);
+    modalPresentationViewController.contentViewController = chooseTypeAlertViewController;
+    modalPresentationViewController.modal = YES;
+    [modalPresentationViewController showWithAnimated:YES completion:nil];
     
 }
 

+ 4 - 4
jiaPei/NewTheory/View/NYGetjobStartRuleCell.xib

@@ -52,7 +52,7 @@
                             <color key="titleColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                         </state>
                     </button>
-                    <button opaque="NO" tag="1" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="ZTJ-5b-jja" customClass="QMUIButton">
+                    <button opaque="NO" tag="5" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="ZTJ-5b-jja" customClass="QMUIButton">
                         <rect key="frame" x="16" y="20" width="60" height="90"/>
                         <constraints>
                             <constraint firstAttribute="width" constant="60" id="Mpf-Nz-g1N"/>
@@ -68,7 +68,7 @@
                             <action selector="actionSubjectButton:" destination="gTV-IL-0wX" eventType="touchUpInside" id="SJk-oX-IdI"/>
                         </connections>
                     </button>
-                    <button opaque="NO" tag="2" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="kPx-ke-bH0" customClass="QMUIButton">
+                    <button opaque="NO" tag="6" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="kPx-ke-bH0" customClass="QMUIButton">
                         <rect key="frame" x="92" y="20" width="60" height="90"/>
                         <constraints>
                             <constraint firstAttribute="height" constant="90" id="FtW-yT-RvR"/>
@@ -84,7 +84,7 @@
                             <action selector="actionSubjectButton:" destination="gTV-IL-0wX" eventType="touchUpInside" id="ga5-6D-wNX"/>
                         </connections>
                     </button>
-                    <button opaque="NO" tag="3" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="MY0-Z0-eto" customClass="QMUIButton">
+                    <button opaque="NO" tag="7" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="MY0-Z0-eto" customClass="QMUIButton">
                         <rect key="frame" x="168" y="20" width="60" height="90"/>
                         <constraints>
                             <constraint firstAttribute="width" constant="60" id="ga5-I2-TfQ"/>
@@ -100,7 +100,7 @@
                             <action selector="actionSubjectButton:" destination="gTV-IL-0wX" eventType="touchUpInside" id="Mvr-ie-8Sa"/>
                         </connections>
                     </button>
-                    <button opaque="NO" tag="4" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="HXn-51-4k3" customClass="QMUIButton">
+                    <button opaque="NO" tag="8" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="HXn-51-4k3" customClass="QMUIButton">
                         <rect key="frame" x="244" y="20" width="60" height="90"/>
                         <constraints>
                             <constraint firstAttribute="height" constant="90" id="ZTi-8g-kQW"/>

+ 1 - 1
jiaPei/NewTheory/View/NYTimeRuleCell.m

@@ -33,7 +33,7 @@
     if(isCykh){
         self.backgroundColor = UIColor.clearColor;
         self.contentView.backgroundColor = UIColor.clearColor;
-        self.bgBootomImg.hidden = NO;
+        self.bgBootomImg.hidden = YES;
     }
     else
     {

+ 1 - 1
jiaPei/NewTheory/ViewModel/NYTimeRuleItemViewModel.m

@@ -16,7 +16,7 @@
 @implementation NYTimeRuleItemViewModel
 - (instancetype)init {
     if (self = [super init]) {
-        self.itemSize = CGSizeMake(RQ_SCREEN_WIDTH, RQ_FIT_HORIZONTAL(568.f) + (10 * 6)+30);
+        self.itemSize = CGSizeMake(RQ_SCREEN_WIDTH, RQ_FIT_HORIZONTAL(458.f) + (10 * 6)+30);
     }
     return self;
 }