Bladeren bron

v2.0.7 更新库 减少到1600题,题目解释修改。计时tab判断。 优化几个bug

openlockPPP 1 jaar geleden
bovenliggende
commit
49c1151cdc

+ 4 - 4
jiaPei.xcodeproj/project.pbxproj

@@ -11726,7 +11726,7 @@
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
 				"CODE_SIGN_RESOURCE_RULES_PATH[sdk=*]" = "";
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 2052023082501;
+				CURRENT_PROJECT_VERSION = 2072023092501;
 				DEBUG_INFORMATION_FORMAT = dwarf;
 				DEVELOPMENT_TEAM = K7T6CU5SW5;
 				ENABLE_BITCODE = NO;
@@ -11763,7 +11763,7 @@
 					"$(PROJECT_DIR)/jiaPei/Vendor/BaiDuFaceSDK/BDFaceSDK/lib",
 					"$(PROJECT_DIR)/jiaPei/Vendor/QiNiu_IMSDK/Vendors/Voice",
 				);
-				MARKETING_VERSION = 2.0.5;
+				MARKETING_VERSION = 2.0.7;
 				ONLY_ACTIVE_ARCH = YES;
 				OTHER_CFLAGS = (
 					"$(inherited)",
@@ -11808,7 +11808,7 @@
 				CODE_SIGN_IDENTITY = "iPhone Developer";
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 2052023082501;
+				CURRENT_PROJECT_VERSION = 2072023092501;
 				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
 				DEVELOPMENT_TEAM = K7T6CU5SW5;
 				ENABLE_BITCODE = NO;
@@ -11845,7 +11845,7 @@
 					"$(PROJECT_DIR)/jiaPei/Vendor/BaiDuFaceSDK/BDFaceSDK/lib",
 					"$(PROJECT_DIR)/jiaPei/Vendor/QiNiu_IMSDK/Vendors/Voice",
 				);
-				MARKETING_VERSION = 2.0.5;
+				MARKETING_VERSION = 2.0.7;
 				ONLY_ACTIVE_ARCH = NO;
 				OTHER_CFLAGS = (
 					"$(inherited)",

BIN
jiaPei.xcworkspace/xcuserdata/mimasigeling.xcuserdatad/UserInterfaceState.xcuserstate


+ 3 - 0
jiaPei/Modules/BaseModule/Common/ViewModel/RQCommonItemViewModel.h

@@ -49,4 +49,7 @@
 /// init title
 + (instancetype)itemViewModelWithTitle:(NSString *)title;
 
+//获取字典
+- (NSArray *)getKeyRangeList:(NSString *)originalText readText:(NSString*)readText;
+
 @end

+ 25 - 0
jiaPei/Modules/BaseModule/Common/ViewModel/RQCommonItemViewModel.m

@@ -34,4 +34,29 @@
 - (NSString *)itemClassName {
     return @"RQCommonCell";
 }
+
+//获取字典
+- (NSArray *)getKeyRangeList:(NSString *)originalText readText:(NSString*)readText {
+    NSError *error = nil;
+    NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:@"【(.*?)】" options:0 error:&error];
+    NSMutableArray *array = nil;
+    if (!error) {
+        NSLog(@"readText=%@",readText);
+        array = @[].mutableCopy;
+        NSArray<NSTextCheckingResult *> *matches = [regex matchesInString:originalText options:0 range:NSMakeRange(0, originalText.length)];
+        for (NSTextCheckingResult *match in matches) {
+            NSMutableDictionary *dict = [NSMutableDictionary dictionary];
+            NSRange matchedRange = [match rangeAtIndex:1];
+            NSString *extractedText = [originalText substringWithRange:matchedRange];
+            NSRange range = [readText rangeOfString:extractedText];
+            dict[extractedText] = @[@(range.location),@(range.length)];
+            [array addObject:dict];
+            NSLog(@"Extracted Text: %@", extractedText);
+            NSLog(@"Matched Range: %@", NSStringFromRange(matchedRange));
+        }
+    } else {
+        NSLog(@"Regex Error: %@", error.localizedDescription);
+    }
+    return array;
+}
 @end

+ 7 - 3
jiaPei/Modules/MainModule/ViewController/RQMainTabBarViewController.m

@@ -83,9 +83,13 @@
 	});
 
 	/// 添加到tabBarController的子视图
-    self.tabBarController.viewControllers = @[homePageNavigationController, timePageNavigationController, profileNavigationController];
-
-    
+    self.tabBarController.viewControllers = @[homePageNavigationController, profileNavigationController];
+    if(RQ_USER_MANAGER.currentUser.stuNum){
+        NSLog(@"%@",RQ_USER_MANAGER.currentUser.stuNum);
+        if (RQ_USER_MANAGER.isLogin&&![RQ_USER_MANAGER.currentUser.stuNum isEqualToString:@""]) {//已经,登录并且stunum不为空
+            self.tabBarController.viewControllers = @[homePageNavigationController, timePageNavigationController, profileNavigationController];//开启计时tab
+        }
+    }
     
 	/// 配置栈底
 	[RQSharedAppDelegate.navigationControllerStack pushNavigationController:homePageNavigationController];

+ 3 - 3
jiaPei/Modules/OtherModules/ExerciseModule/View/ExercisePage/RQExerciseAnswerCell.m

@@ -82,12 +82,12 @@
             if (RQ_VIP_Module.isSubject4Vip) {
                 self.coverImageView.hidden = YES;
                 self.lookSkillBtn.hidden = YES;
-                self.jqmd_label.hidden =  YES;
-                self.jqmd_label.hidden =  RQObjectIsNil(ydtJSModel);
+                self.jqmd_label.hidden = YES;
+                self.tryseeView.hidden = YES;
             } else if(RQ_USER_MANAGER.tryLookCount>0){//是否试看
                 self.coverImageView.hidden = YES;
                 self.lookSkillBtn.hidden = YES;
-                self.jqmd_label.hidden =  YES;
+                self.jqmd_label.hidden = YES;
                 self.tryseeView.hidden = NO;
             } else {
                 self.coverImageView.hidden = RQObjectIsNil(ydtJSModel);

+ 20 - 2
jiaPei/Modules/OtherModules/ExerciseModule/ViewModel/ExercisePage/itemViewModel/RQExercisExplainItemViewModel.m

@@ -21,17 +21,35 @@
         @weakify(self)
         dispatch_async(dispatch_get_main_queue(), ^{
             @strongify(self)
-            
+//            getKeyRangeList
             self.exerciseModel = exerciseModel;
             CGFloat headerHeight = 16.f + 26.f + 16.f;
             CGFloat textHeight = 0;
             CGFloat footerHeight = 16.f + 18.f + 16.f;
             if (!RQObjectIsNil(exerciseModel.ydtQuestionModel)) {
                 if (RQStringIsNotEmpty(exerciseModel.ydtQuestionModel.explain)) {
-                    NSMutableAttributedString *text = [[NSMutableAttributedString alloc] initWithString:exerciseModel.ydtQuestionModel.explain];
+                    NSString *readText = [[exerciseModel.ydtQuestionModel.explain stringByReplacingOccurrencesOfString:@"【" withString:@""] stringByReplacingOccurrencesOfString:@"】" withString:@""];
+                    NSArray *knameList = [self getKeyRangeList:exerciseModel.ydtQuestionModel.explain readText:readText];//获取关键字
+                    NSMutableAttributedString *text = [[NSMutableAttributedString alloc] initWithString:readText];
+                    NSMutableAttributedString *analyseString = [[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@"%@",readText]];
+                    [text appendAttributedString:analyseString];
                     text.yy_font = [UIFont systemFontOfSize:RQ_Exercise_Module.exerciseFontSize];
                     text.yy_lineSpacing = 8;
                     text.yy_color = RQ_MAIN_TEXT_COLOR_1;
+                    if(knameList){//替换关键字标红
+                        @try {
+                            for (NSDictionary *item in knameList) {
+                                NSArray *values = item.allValues.firstObject;
+                                NSString *replacementString = item.allKeys.firstObject;
+                                NSRange range = NSMakeRange([values[0] intValue], [values[1] intValue]);
+                                NSDictionary *attributes = @{ NSForegroundColorAttributeName: RGB_COLOR(244, 0, 47),NSFontAttributeName: [UIFont systemFontOfSize:RQ_Exercise_Module.exerciseFontSize]};
+                                [text replaceCharactersInRange:range withString:replacementString];
+                                [text setAttributes:attributes range:NSMakeRange(range.location, range.length)];
+                            }
+                        } @catch (NSException *exception) {
+                            NSLog(@"替换替换发生错误");
+                        }
+                    }
                     self.explainString = text;
                     CGFloat height = [self getMessageHeightWithAttributedStr:text andLabel:self.yyLabel];
                     textHeight = height;

+ 5 - 27
jiaPei/Modules/OtherModules/ExerciseModule/ViewModel/ExercisePage/itemViewModel/RQExerciseAnswerItemViewModel.m

@@ -38,6 +38,7 @@
                 [answerOptionArr addObject:[allOptionsArr objectAtIndex:indexStr.integerValue - 1]];
             }
             self.ydtJSModel = [RQ_YDT_JS_Question_Module getQuestionJSWithQuestionId:exerciseModel.ydtQuestionModel.ID];
+            exerciseModel.ydtQuestionModel.explain = self.ydtJSModel.best_explain_new;//2023.9.25
 //            //ning 2023-5-24 一点通db 解题答案数据有异常-新整jq库进行修正。
 //            self.ydtJSModel.qb_read_analyse = [YN_YDT_JQ_Question_Module getQuestionKTJQWithQuestionId:exerciseModel.ydtQuestionModel.ID];
             //于2023-08-18 年更新db完成-解决此问题
@@ -47,7 +48,8 @@
                 self.skillHeight = 0.f;
                 space = 0.f;
             } else {
-                NSArray *knameList = [self getKeyRangeList:self.ydtJSModel.qb_analyse readText:self.ydtJSModel.qb_read_analyse];//获取关键字
+                NSString *readText = [[self.ydtJSModel.qb_analyse stringByReplacingOccurrencesOfString:@"【" withString:@""] stringByReplacingOccurrencesOfString:@"】" withString:@""];
+                NSArray *knameList = [self getKeyRangeList:self.ydtJSModel.qb_analyse readText:readText];//获取关键字
                 NSMutableAttributedString *text = [[NSMutableAttributedString alloc] init];
                 //播放-答案
                 if (RQ_COMMON_MANAGER.JSJP_APP_VOICE) {//读题-是否开启
@@ -69,7 +71,7 @@
                     self.readBtn = readBtn;
                     [text appendAttributedString:readAttachment];
                 }
-                NSMutableAttributedString *analyseString = [[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@"%@",self.ydtJSModel.qb_read_analyse]];
+                NSMutableAttributedString *analyseString = [[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@"%@",readText]];
                 [text appendAttributedString:analyseString];
                 text.yy_font = [UIFont systemFontOfSize:RQ_Exercise_Module.exerciseFontSize];
                 text.yy_lineSpacing = 8;
@@ -79,7 +81,7 @@
                         for (NSDictionary *item in knameList) {
                             NSArray *values = item.allValues.firstObject;
                             NSString *replacementString = item.allKeys.firstObject;
-                            NSRange range = NSMakeRange([values[0] intValue], [values[1] intValue]);
+                            NSRange range = NSMakeRange([values[0] intValue]+1, [values[1] intValue]);
                             NSDictionary *attributes = @{ NSForegroundColorAttributeName: RGB_COLOR(244, 0, 47),NSFontAttributeName: [UIFont systemFontOfSize:RQ_Exercise_Module.exerciseFontSize]};
                             [text replaceCharactersInRange:range withString:replacementString];
                             [text setAttributes:attributes range:NSMakeRange(range.location, range.length)];
@@ -125,30 +127,6 @@
     return rowH;
 }
 
-//获取字典
-- (NSArray *)getKeyRangeList:(NSString *)originalText readText:(NSString*)readText {
-    NSError *error = nil;
-    NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:@"【(.*?)】" options:0 error:&error];
-    NSMutableArray *array = nil;
-    if (!error) {
-        array = @[].mutableCopy;
-        NSArray<NSTextCheckingResult *> *matches = [regex matchesInString:originalText options:0 range:NSMakeRange(0, originalText.length)];
-        for (NSTextCheckingResult *match in matches) {
-            NSMutableDictionary *dict = [NSMutableDictionary dictionary];
-            NSRange matchedRange = [match rangeAtIndex:1];
-            NSString *extractedText = [originalText substringWithRange:matchedRange];
-            NSRange range = [readText rangeOfString:extractedText];
-            dict[extractedText] = @[@(range.location+1),@(range.length)];
-            [array addObject:dict];
-            NSLog(@"Extracted Text: %@", extractedText);
-            NSLog(@"Matched Range: %@", NSStringFromRange(matchedRange));
-        }
-    } else {
-        NSLog(@"Regex Error: %@", error.localizedDescription);
-    }
-    return array;
-}
-
 - (CGFloat)getMessageHeightWithAttributedStr:(NSMutableAttributedString *)attributedStr andLabel:(YYLabel *)lb {
     lb.attributedText = attributedStr;
     CGSize introSize = CGSizeMake(RQ_SCREEN_WIDTH - (16 * 2) - (8 * 2), CGFLOAT_MAX);

+ 1 - 0
jiaPei/Modules/OtherModules/YDTQuestionModule/Model/RQYDTJSModel.h

@@ -21,6 +21,7 @@ NS_ASSUME_NONNULL_BEGIN
 @property (nonatomic, readwrite, copy) NSString * word;
 @property (nonatomic, readwrite, copy) NSString * short_video_url;
 @property (nonatomic, readwrite, copy) NSString * short_video_image;
+@property (nonatomic, readwrite, copy) NSString * best_explain_new;
 @property (nonatomic, readwrite, copy) NSString * ydt_video;
 @property (nonatomic, readwrite, copy) NSString * ydt_video_pic;
 @property (nonatomic, readwrite, copy) NSString * create_time;

+ 2 - 0
jiaPei/Modules/OtherModules/YDTQuestionModule/Model/RQYDTJSModel.m

@@ -21,6 +21,8 @@
     ydtjsModel.short_video_url = [resultSet stringForColumn:@"short_video_url"];
     ydtjsModel.short_video_image = [resultSet stringForColumn:@"short_video_image"];
     ydtjsModel.ydt_video = [resultSet stringForColumn:@"ydt_video"];
+    ydtjsModel.best_explain_new = [[resultSet stringForColumn:@"best_explain_new"] stringByReplacingOccurrencesOfString:@"\\n" withString:@"\n"];
+    //[[resultSet stringForColumn:@"best_explain_new"] stringByReplacingOccurrencesOfString:@"\n" withString:@"\\n"]; //替换/n
     ydtjsModel.ydt_video_pic = [resultSet stringForColumn:@"ydt_video_pic"];
     ydtjsModel.create_time = [resultSet stringForColumn:@"create_time"];
     ydtjsModel.update_time = [resultSet stringForColumn:@"update_time"];

+ 2 - 2
jiaPei/Modules/OtherModules/YDTQuestionModule/Modules/RQYDTXCQuestionModule.m

@@ -297,7 +297,7 @@ static id rq_ydtXcQuestionModule = nil;
 - (NSArray *)getPoint {
     NSString *queryCarTypeStr = [NSString stringWithFormat:@"gs LIKE '%%%@%%'",RQ_YDTQuestion_Module.carTypeStr];
     NSString *querySubjectTypeStr = [NSString stringWithFormat:@"kemu = '%@'",RQ_YDTQuestion_Module.subjectStr];
-    NSString *queryStr = [NSString stringWithFormat:@"SELECT * FROM %@ WHERE %@ AND %@", @"Point", queryCarTypeStr, querySubjectTypeStr];
+    NSString *queryStr = [NSString stringWithFormat:@"SELECT * FROM %@ WHERE %@ AND %@ AND isfrequent_use = 1", @"Point", queryCarTypeStr, querySubjectTypeStr];
     return [self queryPointWithQueryStr:queryStr];
 }
 
@@ -557,7 +557,7 @@ static id rq_ydtXcQuestionModule = nil;
              @"道路交通信号",
              @"安全行车、文明驾驶基础知识",
              @"机动车驾驶操作相关基础知识",
-             @"交通事故救护常识",];
+             @"交通事故救护常识",@"安全行车和急救知识"];
 }
 
 - (NSArray *)chapterNameSubjectFourArr {

+ 5 - 4
jiaPei/Modules/OtherModules/YDTQuestionModule/RQYDTQuestionModule.m

@@ -621,9 +621,9 @@ static id rq_ydtQuestionModule = nil;
 
 /// 做到哪一题
 - (NSInteger)getHistoryQuestionNum {
-    NSString *key = [NSString stringWithFormat:@"HistoryQuestionNum%ld-%ld-%@",self.carType,RQ_Exercise_Module.currentExerciseType,RQStringIsNotEmpty(RQ_USER_MANAGER.currentUser.stuNum)? RQ_USER_MANAGER.currentUser.stuNum : @"0"];
+    NSString *key = [NSString stringWithFormat:@"HistoryQuestionNum%ld-%ld-%@",self.carType,RQ_Exercise_Module.currentExerciseType,RQStringIsNotEmpty(RQ_USER_MANAGER.currentUser.loginCode)? RQ_USER_MANAGER.currentUser.loginCode : @"0"];
     if ((RQ_Exercise_Module.currentExerciseType == RQExerciseType_Point || RQ_Exercise_Module.currentExerciseType == RQExerciseType_Chapter) && RQStringIsNotEmpty(RQ_Exercise_Module.otherStr)) {
-        key = [NSString stringWithFormat:@"HistoryQuestionNum%ld-%ld-%@-%@",self.carType,RQ_Exercise_Module.currentExerciseType,RQStringIsNotEmpty(RQ_USER_MANAGER.currentUser.stuNum)? RQ_USER_MANAGER.currentUser.stuNum : @"0", RQ_Exercise_Module.otherStr];
+        key = [NSString stringWithFormat:@"HistoryQuestionNum%ld-%ld-%@-%@",self.carType,RQ_Exercise_Module.currentExerciseType,RQStringIsNotEmpty(RQ_USER_MANAGER.currentUser.loginCode)? RQ_USER_MANAGER.currentUser.loginCode : @"0", RQ_Exercise_Module.otherStr];
     }
     id object = [RQ_COMMON_MANAGER getObjectWithKey:key];
     if (RQObjectIsNil(object)) {
@@ -635,9 +635,10 @@ static id rq_ydtQuestionModule = nil;
 }
 
 - (void)saveHistoryQuestionNumWithQuestionId:(NSInteger)questionId {
-    NSString *key = [NSString stringWithFormat:@"HistoryQuestionNum%ld-%ld-%@",self.carType,RQ_Exercise_Module.currentExerciseType,RQStringIsNotEmpty(RQ_USER_MANAGER.currentUser.stuNum)? RQ_USER_MANAGER.currentUser.stuNum : @"0"];
+    
+    NSString *key = [NSString stringWithFormat:@"HistoryQuestionNum%ld-%ld-%@",self.carType,RQ_Exercise_Module.currentExerciseType,RQStringIsNotEmpty(RQ_USER_MANAGER.currentUser.loginCode)? RQ_USER_MANAGER.currentUser.loginCode : @"0"];
     if ((RQ_Exercise_Module.currentExerciseType == RQExerciseType_Point || RQ_Exercise_Module.currentExerciseType == RQExerciseType_Chapter) && RQStringIsNotEmpty(RQ_Exercise_Module.otherStr)) {
-        key = [NSString stringWithFormat:@"HistoryQuestionNum%ld-%ld-%@-%@",self.carType,RQ_Exercise_Module.currentExerciseType,RQStringIsNotEmpty(RQ_USER_MANAGER.currentUser.stuNum)? RQ_USER_MANAGER.currentUser.stuNum : @"0", RQ_Exercise_Module.otherStr];
+        key = [NSString stringWithFormat:@"HistoryQuestionNum%ld-%ld-%@-%@",self.carType,RQ_Exercise_Module.currentExerciseType,RQStringIsNotEmpty(RQ_USER_MANAGER.currentUser.loginCode)? RQ_USER_MANAGER.currentUser.loginCode : @"0", RQ_Exercise_Module.otherStr];
     }
     [RQ_SHARE_FUNCTION saveObjectWithObject:@(questionId) ForKey:key];
 }

BIN
jiaPei/Modules/OtherModules/YDTQuestionModule/Resources/hc.db


BIN
jiaPei/Modules/OtherModules/YDTQuestionModule/Resources/js.db


BIN
jiaPei/Modules/OtherModules/YDTQuestionModule/Resources/kc.db


BIN
jiaPei/Modules/OtherModules/YDTQuestionModule/Resources/mtc.db


BIN
jiaPei/Modules/OtherModules/YDTQuestionModule/Resources/xc.db