Prechádzať zdrojové kódy

更新js.db 添加 cell库 manager

openlockPPP 1 rok pred
rodič
commit
dd6d8dd140
21 zmenil súbory, kde vykonal 228 pridanie a 114 odobranie
  1. BIN
      jiaPei.xcworkspace/xcuserdata/mimasigeling.xcuserdatad/UserInterfaceState.xcuserstate
  2. 2 2
      jiaPei/Modules/HomePageModule/View/HomePage/RQHomePageADCell.m
  3. 3 2
      jiaPei/Modules/HomePageModule/ViewModel/HomePage/RQHomePageSubjectOneOrFourViewModel.m
  4. 0 1
      jiaPei/Modules/OtherModules/ExerciseModule/Model/RQExerciseModel.m
  5. 2 1
      jiaPei/Modules/OtherModules/ExerciseModule/View/ExercisePage/RQExerciseVideoExplainCell.m
  6. 44 5
      jiaPei/Modules/OtherModules/ExerciseModule/ViewModel/ExercisePage/itemViewModel/RQExerciseAnswerItemViewModel.m
  7. 0 1
      jiaPei/Modules/OtherModules/ExerciseModule/ViewModel/ExercisePage/itemViewModel/RQExerciseOptionItemViewModel.m
  8. 9 5
      jiaPei/Modules/OtherModules/ExerciseModule/ViewModel/ExercisePage/itemViewModel/RQExerciseQuestionItemViewModel.m
  9. 5 6
      jiaPei/Modules/OtherModules/VIPModule/RQVIPModule.m
  10. 1 1
      jiaPei/Modules/OtherModules/VideoModule/Controller/RQDspVideoDetailViewController.m
  11. 26 8
      jiaPei/Modules/OtherModules/VideoModule/Controller/RQVideoDetailViewController.m
  12. 2 0
      jiaPei/Modules/OtherModules/VideoModule/RQVideoModule.h
  13. 62 55
      jiaPei/Modules/OtherModules/VideoModule/RQVideoModule.m
  14. 1 1
      jiaPei/Modules/OtherModules/VideoModule/ViewModel/RQDspVideoDetailViewModel.m
  15. 28 11
      jiaPei/Modules/OtherModules/YDTQuestionModule/Model/RQYDTJSModel.h
  16. 25 12
      jiaPei/Modules/OtherModules/YDTQuestionModule/Model/RQYDTJSModel.m
  17. 12 1
      jiaPei/Modules/OtherModules/YDTQuestionModule/Model/RQYDTQuestionModel.m
  18. 1 1
      jiaPei/Modules/OtherModules/YDTQuestionModule/Modules/RQYDTJSQuestionModule.m
  19. 2 0
      jiaPei/Modules/OtherModules/YDTQuestionModule/Modules/RQYDTXCQuestionModule.m
  20. BIN
      jiaPei/Modules/OtherModules/YDTQuestionModule/Resources/js.db
  21. 3 1
      jiaPei/Utils/Manager/UserManager/RQUserManager.m

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


+ 2 - 2
jiaPei/Modules/HomePageModule/View/HomePage/RQHomePageADCell.m

@@ -84,8 +84,8 @@
 - (SDCycleScrollView *)myCycleScrollView {
     if (!_myCycleScrollView) {
         _myCycleScrollView = [SDCycleScrollView cycleScrollViewWithFrame:CGRectMake(16, 16, RQ_SCREEN_WIDTH - 32.f, (RQ_SCREEN_WIDTH - 32.f) * (80 / 345.f)) imageNamesGroup:@[@"adPlaceHolder"]];
-        _myCycleScrollView.layer.cornerRadius = 10.f;
-        _myCycleScrollView.layer.masksToBounds = YES;
+//        _myCycleScrollView.layer.cornerRadius = 10.f;
+//        _myCycleScrollView.layer.masksToBounds = YES;
         _myCycleScrollView.localizationImageNamesGroup = @[@"adPlaceHolder"];
         _myCycleScrollView.delegate = self;
         _myCycleScrollView.autoScrollTimeInterval = 5;

+ 3 - 2
jiaPei/Modules/HomePageModule/ViewModel/HomePage/RQHomePageSubjectOneOrFourViewModel.m

@@ -135,8 +135,9 @@
 }
 
 - (NSArray *)dataSourceWithItems:(NSArray *)items treeListModel:(RQTreeListModel *)treeListModel section:(NSInteger)section {
+    WeakSelf(weakSelf)
     NSArray *viewModels = [items.rac_sequence map:^(VideosItem *videosItem) {
-        videosItem.subject = self.homePageSubjectType;
+        videosItem.subject = weakSelf.homePageSubjectType;
         RQHomeSubPageVideoItemViewModel *homeSubPageVideoItemViewModel = [[RQHomeSubPageVideoItemViewModel alloc] initWithVideosItem:videosItem];
         CGFloat cellWidth = (RQ_SCREEN_WIDTH - (16  * 3)) / 2.f;
         homeSubPageVideoItemViewModel.itemSize = CGSizeMake(cellWidth, cellWidth * (122.f / 167.f));
@@ -145,7 +146,7 @@
                 RQViewModelUtilKey          : treeListModel,
                 RQVideoItemIndexKey         : @(0),
                 RQVideoItemIndexPathKey     : [NSIndexPath indexPathForRow:[items indexOfObject:videosItem] inSection:section],
-                RQHomePageSubjectTypeKey    : @(self.homePageSubjectType),
+                RQHomePageSubjectTypeKey    : @(weakSelf.homePageSubjectType),
             }];
             if ([RQ_Video_Module isCanWatchWithVideosItem:videosItem]) {
                 [RQ_APPDELEGATE.services pushViewModel:videoDetailViewModel animated:YES];

+ 0 - 1
jiaPei/Modules/OtherModules/ExerciseModule/Model/RQExerciseModel.m

@@ -11,7 +11,6 @@
 
 + (id)exerciseModelWithRQYDTQuestionModel:(RQYDTQuestionModel *)ydtQuestionModel {
     RQExerciseModel *exerciseModel = [[RQExerciseModel alloc] init];
-    
     exerciseModel.ydtQuestionModel = ydtQuestionModel;
     exerciseModel.userAnswer = (ydtQuestionModel.Type == 3)? @[@"预选Option"] : @[];
     

+ 2 - 1
jiaPei/Modules/OtherModules/ExerciseModule/View/ExercisePage/RQExerciseVideoExplainCell.m

@@ -38,7 +38,8 @@
     
     RAC(self.tryLookLabel, text) = [[RACObserve(RQ_USER_MANAGER, tryLookCount) takeUntil:self.rac_prepareForReuseSignal] map:^id _Nullable(id  _Nullable value) {
         @strongify(self)
-        if ((RQ_VIP_Module.isSubject1Vip && [viewModel.ydtJSModel.kemu isEqualToString:@"1"]) || (RQ_VIP_Module.isSubject4Vip && [viewModel.ydtJSModel.kemu isEqualToString:@"4"])) {
+//        if ((RQ_VIP_Module.isSubject1Vip && [viewModel.ydtJSModel.kemu isEqualToString:@"1"]) || (RQ_VIP_Module.isSubject4Vip && [viewModel.ydtJSModel.kemu isEqualToString:@"4"])) {
+        if ((RQ_VIP_Module.isSubject1Vip) || (RQ_VIP_Module.isSubject4Vip)) {
             self.tryLookView.hidden = YES;
             self.tryLookCoverImageView.hidden = YES;
             self.tryLookBottomView.hidden = YES;

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

@@ -34,25 +34,41 @@
                 [answerOptionArr addObject:[allOptionsArr objectAtIndex:indexStr.integerValue - 1]];
             }
             self.ydtJSModel = [RQ_YDT_JS_Question_Module getQuestionJSWithQuestionId:exerciseModel.ydtQuestionModel.ID];
-            //ning 2023-5-24 一点通db 解题答案数据有异常-新整jq库进行修正。
-            self.ydtJSModel.qb_read_analyse = [YN_YDT_JQ_Question_Module getQuestionKTJQWithQuestionId:exerciseModel.ydtQuestionModel.ID];
+//            //ning 2023-5-24 一点通db 解题答案数据有异常-新整jq库进行修正。
+//            self.ydtJSModel.qb_read_analyse = [YN_YDT_JQ_Question_Module getQuestionKTJQWithQuestionId:exerciseModel.ydtQuestionModel.ID];
+            //于2023-08-18 年更新db完成-解决此问题
             self.answerString = [NSString stringWithFormat:@"答案 %@",[answerOptionArr.mutableCopy componentsJoinedByString:@" "]];
             __block CGFloat space = 0.f;
             if (RQObjectIsNil(self.ydtJSModel)) {
                 self.skillHeight = 0.f;
                 space = 0.f;
             } else {
-                NSMutableAttributedString *text = [[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@"解题技巧讲解:%@",self.ydtJSModel.qb_read_analyse]];
-                text.yy_font = [UIFont boldSystemFontOfSize:RQ_Exercise_Module.exerciseFontSize];
+                NSArray *knameList = [self getKeyRangeList:self.ydtJSModel.qb_analyse readText:self.ydtJSModel.qb_read_analyse];//获取关键字
+                NSMutableAttributedString *text = [[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@"%@",self.ydtJSModel.qb_read_analyse]];
+                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.skillString = text;
                 NSInteger line = RQ_COMMON_MANAGER.APP_SWITCH? 0 : ((RQ_VIP_Module.isSubject1Vip && RQ_YDTQuestion_Module.subject == RQHomePageSubjectType_SubjectOne)? 0 : ((RQ_VIP_Module.isSubject4Vip && RQ_YDTQuestion_Module.subject == RQHomePageSubjectType_SubjectFour)? 0 : 1));
                 CGFloat height = (line == 0)? [self getMessageHeightWithAttributedStr:text andLabel:self.yyLabel] : RQ_FIT_HORIZONTAL(34.f);
                 self.skillHeight = height;
                 space = 6.f;
             }
-            self.rowHeight = [_answerString heightForFont:[UIFont boldSystemFontOfSize:19] width:RQ_SCREEN_WIDTH - (16 * 2) - (8 * 2)] + (8 * 2) + (16 * 2) + space + self.skillHeight;
+            self.rowHeight = [_answerString heightForFont:[UIFont systemFontOfSize:19] width:RQ_SCREEN_WIDTH - (16 * 2) - (8 * 2)] + (8 * 2) + (16 * 2) + space + self.skillHeight;
         });
         
         
@@ -60,6 +76,29 @@
     return self;
 }
 
+//获取字典
+- (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),@(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;

+ 0 - 1
jiaPei/Modules/OtherModules/ExerciseModule/ViewModel/ExercisePage/itemViewModel/RQExerciseOptionItemViewModel.m

@@ -31,7 +31,6 @@
         self.btnBgColor = RQ_MAIN_TEXT_COLOR_WHITE;
         self.labelHeight = [self getMessageHeightWithAttributedStr:self.optsString andLabel:self.yyLabel];
         self.rowHeight = 10.f + ((self.labelHeight < RQ_FIT_HORIZONTAL(30.f)? RQ_FIT_HORIZONTAL(30.f) : self.labelHeight)) + 10.f;
-
         NSArray *allOptionsArr = [@[self.exerciseModel.ydtQuestionModel.An1,self.exerciseModel.ydtQuestionModel.An2,self.exerciseModel.ydtQuestionModel.An3,self.exerciseModel.ydtQuestionModel.An4].rac_sequence.signal filter:^BOOL(NSString *optStr) {
             return RQStringIsNotEmpty(optStr);
         }].toArray;

+ 9 - 5
jiaPei/Modules/OtherModules/ExerciseModule/ViewModel/ExercisePage/itemViewModel/RQExerciseQuestionItemViewModel.m

@@ -29,7 +29,6 @@
     if (self = [super init]) {
         @weakify(self)
         self.exerciseModel = exerciseModel;
-        
         dispatch_async(dispatch_get_main_queue(), ^{
             @strongify(self)
             self.qusetionString = [self dealQuestionStrWithRQExerciseModel:exerciseModel];
@@ -54,17 +53,22 @@
             self.imageString = @"";
             self.videoString = @"";
         }
-        
-        if (RQStringIsNotEmpty(exerciseModel.ydtQuestionModel.sinaimg) && RQStringIsNotEmpty(exerciseModel.ydtQuestionModel.media_url)) {
+        if (RQStringIsNotEmpty(exerciseModel.ydtQuestionModel.sinaimg) || RQStringIsNotEmpty(exerciseModel.ydtQuestionModel.media_url)) {
             if (!RQObjectIsNil(exerciseModel.ydtQuestionModel.media_content)) {
                 NSString *imageStr = [exerciseModel.ydtQuestionModel.media_content base64EncodedStringWithOptions:NSDataBase64Encoding64CharacterLineLength];
                 UIImage *sinaImage = [UIImage sd_imageWithData:[NSData dataWithBase64EncodedString:imageStr] scale:1 firstFrameOnly:YES];
                 exerciseModel.ydtQuestionModel.sinaImage = sinaImage;
             } else {
                 NSString *media_name;
-                if ([exerciseModel.ydtQuestionModel.media_url containsString:@"https://"]) {
-                    media_name = [exerciseModel.ydtQuestionModel.media_url componentsSeparatedByString:@"/"].lastObject;
+                if(RQStringIsNotEmpty(exerciseModel.ydtQuestionModel.sinaimg)){//不为空
+                    media_name = exerciseModel.ydtQuestionModel.sinaimg;
+                    self.imageString = exerciseModel.ydtQuestionModel.sinaimg;
+                }else{
+                    if ([exerciseModel.ydtQuestionModel.media_url containsString:@"https://"]) {
+                        media_name = [exerciseModel.ydtQuestionModel.media_url componentsSeparatedByString:@"/"].lastObject;
+                    }
                 }
+                
                 NSData *mediaData = [RQ_YDTQuestion_Module getMediaDataWithMediaName:media_name];
                 if (mediaData) {
                     NSString *imageStr = [mediaData base64EncodedStringWithOptions:NSDataBase64Encoding64CharacterLineLength];

+ 5 - 6
jiaPei/Modules/OtherModules/VIPModule/RQVIPModule.m

@@ -38,21 +38,20 @@ static id rq_VIPModule = nil;
 }
 
 - (void)gotoBuyVipWithVipPageType:(RQVIPPageType)vipPageType subject:(RQHomePageSubjectType)subject {
-    @weakify(self)
+    WeakSelf(weakSelf)
     [RQ_VIP_Module isActiveWithCcomplete:^(RQActivationModel * _Nullable activationModel, BOOL isSuccess) {
-        @strongify(self)
         if (isSuccess) {
             if (activationModel.isShare) {
                 if (vipPageType == RQVIPPageType_Alert) {
-                    [self showVipAlertWithDictType:RQ_USER_MANAGER.currentUser.city subject:subject];
+                    [weakSelf showVipAlertWithDictType:RQ_USER_MANAGER.currentUser.city subject:subject];
                 } else  {
-                    [self gotoVipViewWithDictType:RQ_USER_MANAGER.currentUser.city subject:subject];
+                    [weakSelf gotoVipViewWithDictType:RQ_USER_MANAGER.currentUser.city subject:subject];
                 }
             } else {
                 if (vipPageType == RQVIPPageType_Alert) {
-                    [self showVipAlertWithDictType:@"vip_package" subject:subject];
+                    [weakSelf showVipAlertWithDictType:@"vip_package" subject:subject];
                 } else  {
-                    [self gotoVipViewWithDictType:@"vip_package" subject:subject];
+                    [weakSelf gotoVipViewWithDictType:@"vip_package" subject:subject];
                 }
             }
         }

+ 1 - 1
jiaPei/Modules/OtherModules/VideoModule/Controller/RQDspVideoDetailViewController.m

@@ -146,7 +146,7 @@ static NSString *kIdentifier = @"kIdentifier";
 
 //- (void)loadDrawvodAd {
 //    // 2、加载沉浸式视频广告
-//    [self.drawvodAd load:4];
+//    [self.drawvodAd load:1];
 //}
 
 - (void)backClick:(UIButton *)sender {

+ 26 - 8
jiaPei/Modules/OtherModules/VideoModule/Controller/RQVideoDetailViewController.m

@@ -122,19 +122,37 @@
         /// set up ...
         [self.view addSubview:self.pagerView];
     }
-    
+    [RQNotificationCenter removeObserver:self name:RQPlayVideoUrlNotification object:nil];
     /// 播放
+    WeakSelf(weakSelf)
+    [RQ_Video_Module.playerController stop];
+    RQ_Video_Module.videoDetailViewController = self;
+//    [[RQNotificationCenter rac_addObserverForName:RQPlayVideoUrlNotification object:nil] subscribeNext:^(NSNotification *note) {
+//        [weakSelf myVideoUrlNotification:note];
+//    }];
     [[[[RQNotificationCenter rac_addObserverForName:RQPlayVideoUrlNotification object:nil] takeUntil:self.rac_willDeallocSignal] deliverOnMainThread] subscribeNext:^(NSNotification * note) {
-        @strongify(self)
-        VideosItem *videosItem = note.object[RQPlayVideoItemKey];
-        NSArray *videoItemArr = note.object[RQPlayVideoItemArrKey];
-        RQVideoDetailSubPageViewController *videoDetailSubPageViewController = (RQVideoDetailSubPageViewController *)self.pagerView.listContainerView.validListDict[@(self.pagerView.listContainerView.currentIndex)];
-        if ([RQ_Video_Module isCanWatchWithVideosItem:videosItem]) {
-            [RQ_Video_Module playVideoWithVideosItem:videosItem videosItemArr:videoItemArr playView:self.headerView scrollView:videoDetailSubPageViewController.tableView];
-        }
+        [weakSelf myVideoUrlNotification:note];
+        //@strongify(self)
+//        NSLog(@"RQNotificationCenter-----播放");
+//        VideosItem *videosItem = note.object[RQPlayVideoItemKey];
+//        NSArray *videoItemArr = note.object[RQPlayVideoItemArrKey];
+//        RQVideoDetailSubPageViewController *videoDetailSubPageViewController = (RQVideoDetailSubPageViewController *)self.pagerView.listContainerView.validListDict[@(self.pagerView.listContainerView.currentIndex)];
+//        if ([RQ_Video_Module isCanWatchWithVideosItem:videosItem]) {
+//            [RQ_Video_Module playVideoWithVideosItem:videosItem videosItemArr:videoItemArr playView:self.headerView scrollView:videoDetailSubPageViewController.tableView];
+//        }
     }];
 }
 
+- (void)myVideoUrlNotification:(NSNotification *)note{
+    NSLog(@"RQNotificationCenter-----播放---AD-广告");
+    VideosItem *videosItem = note.object[RQPlayVideoItemKey];
+    NSArray *videoItemArr = note.object[RQPlayVideoItemArrKey];
+    RQVideoDetailSubPageViewController *videoDetailSubPageViewController = (RQVideoDetailSubPageViewController *)self.pagerView.listContainerView.validListDict[@(self.pagerView.listContainerView.currentIndex)];
+    if ([RQ_Video_Module isCanWatchWithVideosItem:videosItem]) {
+        [RQ_Video_Module playVideoWithVideosItem:videosItem videosItemArr:videoItemArr playView:self.headerView scrollView:videoDetailSubPageViewController.tableView];
+    }
+}
+
 - (NSString *)lineFeedWithStr:(NSString *)str {
     if (str.length > 8) {
         NSMutableString *strs = [[NSMutableString alloc] initWithString:str];

+ 2 - 0
jiaPei/Modules/OtherModules/VideoModule/RQVideoModule.h

@@ -89,9 +89,11 @@ typedef NS_ENUM(NSUInteger, RQVideoDetailSubPageUpdateDataType) {
 @interface RQVideoModule : NSObject
 /// 单例
 + (instancetype) sharedInstance;
+@property (nonatomic, readwrite, assign) int payState;
 @property (nonatomic, readwrite, strong) VideosItem *currentpPlayVideosItem;
 @property (nonatomic, readwrite, strong) MPPlayerController *playerController;
 @property (nonatomic, readwrite, strong) ZFPlayerController *zfPlayerController;
+@property (nonatomic, readwrite, weak) RQVideoDetailViewController *videoDetailViewController;
 
 - (BOOL)isCanWatchWithVideosItem:(VideosItem *)videosItem;
 - (void)playVideoWithVideosItem:(VideosItem *)videosItem videosItemArr:(NSArray *)videosItemArr playView:(UIView *)playView scrollView:(UIScrollView *)scrollView;

+ 62 - 55
jiaPei/Modules/OtherModules/VideoModule/RQVideoModule.m

@@ -118,7 +118,7 @@ static id rq_VideoModule = nil;
 }
 
 - (void)requestDataWithVideosItem:(VideosItem *)videoItem videosItemArr:(NSArray *)videosItemArr {
-    @weakify(self)
+    WeakSelf(weakSelf)
     if (RQ_Video_Module.currentpPlayVideosItem.isPlaying) {
         RQ_Video_Module.currentpPlayVideosItem.isPlaying = NO;
     }
@@ -130,12 +130,18 @@ static id rq_VideoModule = nil;
 
     } else {
         [self.playerController.currentPlayerManager pause];
+        if (_payState>0) return;
+        NSLog(@"AD-广告");
         [RQ_AD_MANAGER loadAdWithAdType:RQADType_native customView:self.playView];
+        _payState = 1;
+        dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
+            _payState = 0;
+        });
         [RQ_AD_MANAGER initCloseBlock:^(RQADDoType adDoType) {
             dispatch_async(dispatch_get_main_queue(), ^{
-                @strongify(self)
-                self.adDoType  = adDoType;
-                ZFPlayerPlaybackState playState = self.playerController.currentPlayerManager.playState;
+//                @strongify(self)
+                weakSelf.adDoType  = adDoType;
+                ZFPlayerPlaybackState playState = weakSelf.playerController.currentPlayerManager.playState;
                 if (adDoType == RQADDoType_Miss) {
 
                 }
@@ -144,7 +150,7 @@ static id rq_VideoModule = nil;
                     case RQADDoType_Success:
                     case RQADDoType_Click:{
                         if (playState == ZFPlayerPlayStatePlaying) {
-                            [self.playerController.currentPlayerManager pause];
+                            [weakSelf.playerController.currentPlayerManager pause];
                         }
                         break;
                     }
@@ -152,20 +158,20 @@ static id rq_VideoModule = nil;
                     case RQADDoType_Faild:
                     case RQADDoType_Close:{
                         if (playState == ZFPlayerPlayStatePaused) {
-                            if (!self.playerController.player.isFullScreen) {
+                            if (!weakSelf.playerController.player.isFullScreen) {
                                 //延时
                                 [[[[RACSignal createSignal:^RACDisposable *(id<RACSubscriber> subscriber) {
                                     [subscriber sendNext:@"延时.2f秒"];
                                     return nil;
                                 }] delay:.2f] deliverOnMainThread] subscribeNext:^(id x) {
-                                    @strongify(self)
-                                    [self.playerController.currentPlayerManager play];
-                                    self.adDoType = RQADDoType_Miss;
+//                                    @strongify(self)
+                                    [weakSelf.playerController.currentPlayerManager play];
+                                    weakSelf.adDoType = RQADDoType_Miss;
                                 }];
                             } else {
                                 if ([NSStringFromClass([RQControllerHelper.currentViewController class]) isEqualToString:@"ZFLandscapeViewController"]) {
-                                    [self.playerController.currentPlayerManager play];
-                                    self.adDoType = RQADDoType_Miss;
+                                    [weakSelf.playerController.currentPlayerManager play];
+                                    weakSelf.adDoType = RQADDoType_Miss;
                                 }
                             }
                         }
@@ -186,24 +192,24 @@ static id rq_VideoModule = nil;
     
     if (!RQ_COMMON_MANAGER.APP_SWITCH) {
         self.playerController.player.playerPlayTimeChanged = ^(id<ZFPlayerMediaPlayback>  _Nonnull asset, NSTimeInterval currentTime, NSTimeInterval duration) {
-            @strongify(self)
+//            @strongify(self)
             if (videoItem.permission == 1) {
                 if (videoItem.videoType == RQVideoType_KaoChang) {
                     if (!isBuy) {
                         NSInteger tryLookSecond = RQStringIsEmpty(videoItem.placeVideoListModel.tryLookSecond)? 0 : videoItem.placeVideoListModel.tryLookSecond.integerValue;
                         if (tryLookSecond > 0) {
-                            if (self.playerController.player.currentTime >= tryLookSecond) {
-                                [self.playerController.currentPlayerManager pause];
-                                self.vipPlaceHolderView.myTitleLabel.text = @"试看结束,开通考场会员观看完整视频";
-                                [self.playerController.containerView addSubview:self.vipPlaceHolderView];
-                                [self.vipPlaceHolderView.reLookBtn setTapActionWithBlock:^(UITapGestureRecognizer *tap) {
-                                    [self.vipPlaceHolderView removeFromSuperview];
-                                    self.controlView = nil;
-                                    self.playerController.controlView = self.controlView;
-                                    [self.controlView showTitle:videoItem.title coverURLString:videoItem.coverFileUrl placeholderImage:RQWebVideoImagePlaceholder() fullScreenMode:ZFFullScreenModeAutomatic];
-                                    [self.playerController playWithPlayable:videoItem];
+                            if (weakSelf.playerController.player.currentTime >= tryLookSecond) {
+                                [weakSelf.playerController.currentPlayerManager pause];
+                                weakSelf.vipPlaceHolderView.myTitleLabel.text = @"试看结束,开通考场会员观看完整视频";
+                                [weakSelf.playerController.containerView addSubview:weakSelf.vipPlaceHolderView];
+                                [weakSelf.vipPlaceHolderView.reLookBtn setTapActionWithBlock:^(UITapGestureRecognizer *tap) {
+                                    [weakSelf.vipPlaceHolderView removeFromSuperview];
+                                    weakSelf.controlView = nil;
+                                    weakSelf.playerController.controlView = weakSelf.controlView;
+                                    [weakSelf.controlView showTitle:videoItem.title coverURLString:videoItem.coverFileUrl placeholderImage:RQWebVideoImagePlaceholder() fullScreenMode:ZFFullScreenModeAutomatic];
+                                    [weakSelf.playerController playWithPlayable:videoItem];
                                 }];
-                                [self.vipPlaceHolderView.openBtn setTapActionWithBlock:^(UITapGestureRecognizer *tap) {
+                                [weakSelf.vipPlaceHolderView.openBtn setTapActionWithBlock:^(UITapGestureRecognizer *tap) {
                                     [RQ_APPDELEGATE.services popViewModelAnimated:YES];
                                 }];
                             }
@@ -213,35 +219,35 @@ static id rq_VideoModule = nil;
                     if ((videoItem.subject == 1 && RQ_VIP_Module.isSubject2Vip) || (videoItem.subject == 2 && RQ_VIP_Module.isSubject3Vip)) {
                         
                     } else {
-                        if (self.playerController.player.currentTime >= 15) {
-                            [self.playerController.currentPlayerManager pause];
+                        if (weakSelf.playerController.player.currentTime >= 15) {
+                            [weakSelf.playerController.currentPlayerManager pause];
                             switch (videoItem.subject) {
                                 case 0:
-                                    self.vipPlaceHolderView.myTitleLabel.text = @"试看结束,开通科一会员观看完整视频";
+                                    weakSelf.vipPlaceHolderView.myTitleLabel.text = @"试看结束,开通科一会员观看完整视频";
                                     break;
                                 case 1:
-                                    self.vipPlaceHolderView.myTitleLabel.text = @"试看结束,开通科二会员观看完整视频";
+                                    weakSelf.vipPlaceHolderView.myTitleLabel.text = @"试看结束,开通科二会员观看完整视频";
                                     break;
                                 case 2:
-                                    self.vipPlaceHolderView.myTitleLabel.text = @"试看结束,开通科三会员观看完整视频";
+                                    weakSelf.vipPlaceHolderView.myTitleLabel.text = @"试看结束,开通科三会员观看完整视频";
                                     break;
                                 case 3:
-                                    self.vipPlaceHolderView.myTitleLabel.text = @"试看结束,开通科四会员观看完整视频";
+                                    weakSelf.vipPlaceHolderView.myTitleLabel.text = @"试看结束,开通科四会员观看完整视频";
                                     break;
                                     
                                 default:
-                                    self.vipPlaceHolderView.myTitleLabel.text = @"试看结束,开通会员观看完整视频";
+                                    weakSelf.vipPlaceHolderView.myTitleLabel.text = @"试看结束,开通会员观看完整视频";
                                     break;
                             }
-                            [self.playerController.containerView addSubview:self.vipPlaceHolderView];
-                            [self.vipPlaceHolderView.reLookBtn setTapActionWithBlock:^(UITapGestureRecognizer *tap) {
-                                [self.vipPlaceHolderView removeFromSuperview];
-                                self.controlView = nil;
-                                self.playerController.controlView = self.controlView;
-                                [self.controlView showTitle:videoItem.title coverURLString:videoItem.coverFileUrl placeholderImage:RQWebVideoImagePlaceholder() fullScreenMode:ZFFullScreenModeAutomatic];
-                                [self.playerController playWithPlayable:videoItem];
+                            [weakSelf.playerController.containerView addSubview:weakSelf.vipPlaceHolderView];
+                            [weakSelf.vipPlaceHolderView.reLookBtn setTapActionWithBlock:^(UITapGestureRecognizer *tap) {
+                                [weakSelf.vipPlaceHolderView removeFromSuperview];
+                                weakSelf.controlView = nil;
+                                weakSelf.playerController.controlView = weakSelf.controlView;
+                                [weakSelf.controlView showTitle:videoItem.title coverURLString:videoItem.coverFileUrl placeholderImage:RQWebVideoImagePlaceholder() fullScreenMode:ZFFullScreenModeAutomatic];
+                                [weakSelf.playerController playWithPlayable:videoItem];
                             }];
-                            [self.vipPlaceHolderView.openBtn setTapActionWithBlock:^(UITapGestureRecognizer *tap) {
+                            [weakSelf.vipPlaceHolderView.openBtn setTapActionWithBlock:^(UITapGestureRecognizer *tap) {
                                 [RQ_VIP_Module gotoBuyVipWithVipPageType:RQVIPPageType_Full];
                             }];
                         }
@@ -253,21 +259,21 @@ static id rq_VideoModule = nil;
     
     
     self.playerController.currentPlayerManager.playerDidToEnd = ^(id<ZFPlayerMediaPlayback>  _Nonnull asset) {
-        @strongify(self)
-        if (!self.playerController.player.isFullScreen) {
+//        @strongify(self)
+        if (!weakSelf.playerController.player.isFullScreen) {
             NSInteger currentIndex = [videosItemArr indexOfObject:videoItem];
-            NSInteger nextIndex = (currentIndex + 1 >= self.playerController.playableArray.count)? 0 : currentIndex + 1;
+            NSInteger nextIndex = (currentIndex + 1 >= weakSelf.playerController.playableArray.count)? 0 : currentIndex + 1;
             VideosItem *nextVideoItem = (VideosItem *)videosItemArr[nextIndex];
-            if ([self isCanWatchWithVideosItem:nextVideoItem]) {
+            if ([weakSelf isCanWatchWithVideosItem:nextVideoItem]) {
                 videoItem.isPlaying = NO;
                 nextVideoItem.isPlaying = YES;
-                [self requestDataWithVideosItem:nextVideoItem videosItemArr:videosItemArr];
+                [weakSelf requestDataWithVideosItem:nextVideoItem videosItemArr:videosItemArr];
             }
         } else {
             NSInteger currentIndex = [videosItemArr indexOfObject:RQ_Video_Module.currentpPlayVideosItem];
-            NSInteger nextIndex = (currentIndex + 1 >= self.playerController.playableArray.count)? 0 : currentIndex + 1;
+            NSInteger nextIndex = (currentIndex + 1 >= weakSelf.playerController.playableArray.count)? 0 : currentIndex + 1;
             VideosItem *nextVideoItem = (VideosItem *)videosItemArr[nextIndex];
-            if ([self isCanWatchWithVideosItem:nextVideoItem]) {
+            if ([weakSelf isCanWatchWithVideosItem:nextVideoItem]) {
                 if ((videoItem.subject == 1 && RQ_VIP_Module.isSubject2Vip) || (videoItem.subject == 2 && RQ_VIP_Module.isSubject3Vip)) {
                     
                 } else {
@@ -282,10 +288,10 @@ static id rq_VideoModule = nil;
                 [alert addButton:@"立即播放 " actionBlock:^(void) {
                     isSure = YES;
                     RQ_Video_Module.currentpPlayVideosItem.isPlaying = NO;
-                    [self.playerController playWithPlayable:nextVideoItem];
+                    [weakSelf.playerController playWithPlayable:nextVideoItem];
                     nextVideoItem.isPlaying = YES;
-                    [self.playerController.currentPlayerManager pause];
-                    [self.controlView updateTitle:nextVideoItem.title coverURLString:nextVideoItem.coverFileUrl placeholderImage:RQWebVideoImagePlaceholder() fullScreenMode:ZFFullScreenModeAutomatic];
+                    [weakSelf.playerController.currentPlayerManager pause];
+                    [weakSelf.controlView updateTitle:nextVideoItem.title coverURLString:nextVideoItem.coverFileUrl placeholderImage:RQWebVideoImagePlaceholder() fullScreenMode:ZFFullScreenModeAutomatic];
                     RQ_Video_Module.currentpPlayVideosItem = nextVideoItem;
                 }];
                 [alert addTimerToButtonIndex:0 reverse:YES];
@@ -321,22 +327,23 @@ static id rq_VideoModule = nil;
 - (ZFPlayerControlView *)controlView {
     if (!_controlView) {
         _controlView = [[ZFPlayerControlView alloc] init];
-        @weakify(self, _controlView)
+//        @weakify(self)
+        WeakSelf(weakSelf)
         [_controlView.portraitControlView.backBtn setTapActionWithBlock:^(UITapGestureRecognizer *tap) {
-            @strongify(self)
-            [self.playerController stop];
+            [RQNotificationCenter removeObserver:weakSelf.videoDetailViewController name:RQPlayVideoUrlNotification object:nil];
+            [weakSelf.playerController stop];
             [RQ_APPDELEGATE.services popViewModelAnimated:YES];
         }];
         _controlView.portraitControlView.topToolView.alpha = 1;
         _controlView.portraitControlView.topToolView.zf_y  = 0;
-        [[[[RACObserve(_controlView, portraitControlView.topToolView.alpha) deliverOnMainThread] distinctUntilChanged] takeUntil:self.rac_willDeallocSignal] subscribeNext:^(id  _Nullable x) {
-            @strongify(_controlView)
+        [[[[RACObserve(_controlView, portraitControlView.topToolView.alpha) deliverOnMainThread] distinctUntilChanged] takeUntil:weakSelf.rac_willDeallocSignal] subscribeNext:^(id  _Nullable x) {
+//            @strongify(_controlView)
             if (_controlView.portraitControlView.topToolView.alpha < 1) {
                 _controlView.portraitControlView.topToolView.alpha = 1;
             }
         }];
-        [[[[RACObserve(_controlView, portraitControlView.topToolView.zf_y) deliverOnMainThread] distinctUntilChanged] takeUntil:self.rac_willDeallocSignal] subscribeNext:^(id  _Nullable x) {
-            @strongify(_controlView)
+        [[[[RACObserve(_controlView, portraitControlView.topToolView.zf_y) deliverOnMainThread] distinctUntilChanged] takeUntil:weakSelf.rac_willDeallocSignal] subscribeNext:^(id  _Nullable x) {
+//            @strongify(_controlView)
             if (_controlView.portraitControlView.topToolView.zf_y < 0) {
                 _controlView.portraitControlView.topToolView.zf_y  = 0;
             }

+ 1 - 1
jiaPei/Modules/OtherModules/VideoModule/ViewModel/RQDspVideoDetailViewModel.m

@@ -95,7 +95,7 @@
 
 - (void)loadDrawvodAd {
     // 2、加载沉浸式视频广告
-    [self.drawvodAd load:4];
+    [self.drawvodAd load:1];
 }
 
 #pragma mark - ADSuyiSDKDrawvodAdDelegate

+ 28 - 11
jiaPei/Modules/OtherModules/YDTQuestionModule/Model/RQYDTJSModel.h

@@ -11,26 +11,43 @@
 NS_ASSUME_NONNULL_BEGIN
 
 @interface RQYDTJSModel : RQBaseModel
+
 @property (nonatomic, readwrite, assign) NSInteger id;
-@property (nonatomic, readwrite, copy) NSString * kemu;
 @property (nonatomic, readwrite, copy) NSString * qb_analyse;
-@property (nonatomic, readwrite, copy) NSString * qb_content;
 @property (nonatomic, readwrite, copy) NSString * qb_read_analyse;
-@property (nonatomic, readwrite, copy) NSString * qb_skill_picture;
-@property (nonatomic, readwrite, copy) NSString * qb_answers;
-@property (nonatomic, readwrite, copy) NSString * questionIds;
-@property (nonatomic, readwrite, copy) NSString * short_video_duration;
-@property (nonatomic, readwrite, copy) NSString * short_video_size;
+@property (nonatomic, readwrite, copy) NSString * qb_skill_audio_link;
+@property (nonatomic, readwrite, copy) NSString * fir_tilte;
+@property (nonatomic, readwrite, copy) NSString * sec_title;
+@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 * ydt_analyse;
-@property (nonatomic, readwrite, copy) NSString * ydt_analyse_pic;
 @property (nonatomic, readwrite, copy) NSString * ydt_video;
-@property (nonatomic, readwrite, copy) NSString * ydt_video_len;
 @property (nonatomic, readwrite, copy) NSString * ydt_video_pic;
-@property (nonatomic, readwrite, copy) NSString * ydt_video_size;
 @property (nonatomic, readwrite, copy) NSString * create_time;
 @property (nonatomic, readwrite, copy) NSString * update_time;
+
+///----------------------------------------------------------------------------------------///
+//@property (nonatomic, readwrite, assign) NSInteger id;
+//@property (nonatomic, readwrite, copy) NSString * kemu;
+//@property (nonatomic, readwrite, copy) NSString * qb_analyse;
+//@property (nonatomic, readwrite, copy) NSString * qb_content;
+//@property (nonatomic, readwrite, copy) NSString * qb_read_analyse;
+//@property (nonatomic, readwrite, copy) NSString * qb_skill_picture;
+//@property (nonatomic, readwrite, copy) NSString * qb_answers;
+//@property (nonatomic, readwrite, copy) NSString * questionIds;
+//@property (nonatomic, readwrite, copy) NSString * short_video_duration;
+//@property (nonatomic, readwrite, copy) NSString * short_video_size;
+//@property (nonatomic, readwrite, copy) NSString * short_video_url;
+//@property (nonatomic, readwrite, copy) NSString * short_video_image;
+//@property (nonatomic, readwrite, copy) NSString * ydt_analyse;
+//@property (nonatomic, readwrite, copy) NSString * ydt_analyse_pic;
+//@property (nonatomic, readwrite, copy) NSString * ydt_video;
+//@property (nonatomic, readwrite, copy) NSString * ydt_video_len;
+//@property (nonatomic, readwrite, copy) NSString * ydt_video_pic;
+//@property (nonatomic, readwrite, copy) NSString * ydt_video_size;
+//@property (nonatomic, readwrite, copy) NSString * create_time;
+//@property (nonatomic, readwrite, copy) NSString * update_time;
+
 + (id)ydtjsModelWithFMResultSet:(FMResultSet *)resultSet;
 @end
 

+ 25 - 12
jiaPei/Modules/OtherModules/YDTQuestionModule/Model/RQYDTJSModel.m

@@ -11,27 +11,40 @@
 @implementation RQYDTJSModel
 + (id)ydtjsModelWithFMResultSet:(FMResultSet *)resultSet {
     RQYDTJSModel *ydtjsModel = [[RQYDTJSModel alloc] init];
-    
     ydtjsModel.id = [resultSet intForColumn:@"id"];
-    ydtjsModel.kemu = [resultSet stringForColumn:@"kemu"];
     ydtjsModel.qb_analyse = [resultSet stringForColumn:@"qb_analyse"];
-    ydtjsModel.qb_content = [resultSet stringForColumn:@"qb_content"];
     ydtjsModel.qb_read_analyse = [resultSet stringForColumn:@"qb_read_analyse"];
-    ydtjsModel.qb_skill_picture = [resultSet stringForColumn:@"qb_skill_picture"];
-    ydtjsModel.qb_answers = [resultSet stringForColumn:@"qb_answers"];
-    ydtjsModel.questionIds = [resultSet stringForColumn:@"questionIds"];
-    ydtjsModel.short_video_duration = [resultSet stringForColumn:@"short_video_duration"];
-    ydtjsModel.short_video_size = [resultSet stringForColumn:@"short_video_size"];
+    ydtjsModel.qb_skill_audio_link = [resultSet stringForColumn:@"qb_skill_audio_link"];
+    ydtjsModel.fir_tilte = [resultSet stringForColumn:@"fir_tilte"];
+    ydtjsModel.sec_title = [resultSet stringForColumn:@"sec_title"];
+    ydtjsModel.word = [resultSet stringForColumn:@"word"];
     ydtjsModel.short_video_url = [resultSet stringForColumn:@"short_video_url"];
     ydtjsModel.short_video_image = [resultSet stringForColumn:@"short_video_image"];
-    ydtjsModel.ydt_analyse = [resultSet stringForColumn:@"ydt_analyse"];
-    ydtjsModel.ydt_analyse_pic = [resultSet stringForColumn:@"ydt_analyse_pic"];
     ydtjsModel.ydt_video = [resultSet stringForColumn:@"ydt_video"];
-    ydtjsModel.ydt_video_len = [resultSet stringForColumn:@"ydt_video_len"];
     ydtjsModel.ydt_video_pic = [resultSet stringForColumn:@"ydt_video_pic"];
-    ydtjsModel.ydt_video_size = [resultSet stringForColumn:@"ydt_video_size"];
     ydtjsModel.create_time = [resultSet stringForColumn:@"create_time"];
     ydtjsModel.update_time = [resultSet stringForColumn:@"update_time"];
+    ///-----------------------------------------旧-----------------------------------------------///
+//    ydtjsModel.id = [resultSet intForColumn:@"id"];
+//    ydtjsModel.kemu = [resultSet stringForColumn:@"kemu"];
+//    ydtjsModel.qb_analyse = [resultSet stringForColumn:@"qb_analyse"];
+//    ydtjsModel.qb_content = [resultSet stringForColumn:@"qb_content"];
+//    ydtjsModel.qb_read_analyse = [resultSet stringForColumn:@"qb_read_analyse"];
+//    ydtjsModel.qb_skill_picture = [resultSet stringForColumn:@"qb_skill_picture"];
+//    ydtjsModel.qb_answers = [resultSet stringForColumn:@"qb_answers"];
+//    ydtjsModel.questionIds = [resultSet stringForColumn:@"questionIds"];
+//    ydtjsModel.short_video_duration = [resultSet stringForColumn:@"short_video_duration"];
+//    ydtjsModel.short_video_size = [resultSet stringForColumn:@"short_video_size"];
+//    ydtjsModel.short_video_url = [resultSet stringForColumn:@"short_video_url"];
+//    ydtjsModel.short_video_image = [resultSet stringForColumn:@"short_video_image"];
+//    ydtjsModel.ydt_analyse = [resultSet stringForColumn:@"ydt_analyse"];
+//    ydtjsModel.ydt_analyse_pic = [resultSet stringForColumn:@"ydt_analyse_pic"];
+//    ydtjsModel.ydt_video = [resultSet stringForColumn:@"ydt_video"];
+//    ydtjsModel.ydt_video_len = [resultSet stringForColumn:@"ydt_video_len"];
+//    ydtjsModel.ydt_video_pic = [resultSet stringForColumn:@"ydt_video_pic"];
+//    ydtjsModel.ydt_video_size = [resultSet stringForColumn:@"ydt_video_size"];
+//    ydtjsModel.create_time = [resultSet stringForColumn:@"create_time"];
+//    ydtjsModel.update_time = [resultSet stringForColumn:@"update_time"];
 
 
 

+ 12 - 1
jiaPei/Modules/OtherModules/YDTQuestionModule/Model/RQYDTQuestionModel.m

@@ -35,6 +35,7 @@
     ydtQuestionModel.moretypes = [resultSet stringForColumn:@"moretypes"];
     ydtQuestionModel.chapterid = [resultSet intForColumn:@"chapterid"];
     ydtQuestionModel.sinaimg = [resultSet stringForColumn:@"sinaimg"];
+    
     ydtQuestionModel.video_url = [resultSet stringForColumn:@"video_url"];
     ydtQuestionModel.diff_degree = [resultSet intForColumn:@"diff_degree"];
     ydtQuestionModel.cityid = [resultSet intForColumn:@"cityid"];
@@ -44,9 +45,19 @@
     ydtQuestionModel.media_url = [resultSet stringForColumn:@"media_url"];
     ydtQuestionModel.media_content = [resultSet columnIsNull:@"media_content"]? nil : [resultSet dataForColumn:@"media_content"];
     ydtQuestionModel.video_url = RQStringIsNotEmpty(ydtQuestionModel.media_url)? ([ydtQuestionModel.media_url containsString:@".mp4"]? ydtQuestionModel.media_url : @"") : @"";
-    if (ydtQuestionModel.Type == 1 && RQStringIsEmpty(ydtQuestionModel.An1) && RQStringIsEmpty(ydtQuestionModel.An2)) {
+    if(ydtQuestionModel.ID==33800){
+        NSLog(@"%zd",ydtQuestionModel.ID)
+    }
+//    if (ydtQuestionModel.Type == 1 && RQStringIsEmpty(ydtQuestionModel.An1) && RQStringIsEmpty(ydtQuestionModel.An2)) {
+    if (ydtQuestionModel.Type == 1 ) {//只要是判断题
         ydtQuestionModel.An1 = @"正确";
         ydtQuestionModel.An2 = @"错误";
+        for(int i=0;i<7;i++){//使用runtime kvc
+            if(i>1){
+                NSString *key = [NSString stringWithFormat:@"An%d",i+1];
+                [ydtQuestionModel setValue:@"" forKey:key];
+            }
+        }
     }
     ydtQuestionModel.show_option_type = [resultSet intForColumn:@"show_option_type"];
     ydtQuestionModel.question_source = [resultSet intForColumn:@"question_source"];

+ 1 - 1
jiaPei/Modules/OtherModules/YDTQuestionModule/Modules/RQYDTJSQuestionModule.m

@@ -10,7 +10,7 @@
 
 static NSString *dbNameStr = @"js";
 static NSString *dbTypeStr = @"db";
-static NSString *tableNameStr = @"question_jsjp_js";
+static NSString *tableNameStr = @"web_note_js"; //@"question_jsjp_js";
 
 @interface RQYDTJSQuestionModule ()
 @property (nonatomic, readwrite, strong) FMDatabaseQueue *databaseQueue;

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

@@ -471,6 +471,7 @@ static id rq_ydtXcQuestionModule = nil;
 
 - (NSArray *)queryQuestionWithQueryStr:(NSString *)queryStr {
     NSMutableArray *arr = @[].mutableCopy;
+    queryStr = [queryStr stringByReplacingOccurrencesOfString:@"cityid = 0" withString:[NSString stringWithFormat:@"(cityid = 0 or cityid = %@)",RQ_USER_MANAGER.city_dbId]];
     [_databaseQueue inDatabase:^(FMDatabase * _Nonnull db) {
         NSString *sqlStr = [NSString stringWithFormat:@"ATTACH DATABASE '%@' AS jsjp_user_db",RQ_YDT_USER_Question_Module.dbPath];
         bool success = [db executeStatements:sqlStr];
@@ -483,6 +484,7 @@ static id rq_ydtXcQuestionModule = nil;
         while ([resultSet next]) {
             RQYDTQuestionModel *ydtQuestionModel = [RQYDTQuestionModel ydtQuestionModelWithFMResultSet:resultSet];
             ydtQuestionModel.num = num;
+            NSLog(@"QT index = %zd ID=%zd qt=%@",num,ydtQuestionModel.ID,ydtQuestionModel.Question);
             [arr addObject:ydtQuestionModel];
             num ++;
         }

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


+ 3 - 1
jiaPei/Utils/Manager/UserManager/RQUserManager.m

@@ -344,7 +344,9 @@ static id rq_userManager = nil;
 
 - (NSString *)city_dbId{
     if(!_city_dbId){
-        _city_dbId = [self getCityidByName:RQ_USER_MANAGER.currentUser.cityName];
+        _city_dbId = [self getCityidByCode:RQ_USER_MANAGER.currentUser.city];
+//        _city_dbId = [self getCityidByName:RQ_USER_MANAGER.currentUser.cityName];
+        
     }
     return _city_dbId;
 }