From ce4eaddf9eb835f01e6bf5845a063d306f322b24 Mon Sep 17 00:00:00 2001
From: Aeline <liu9421wen@163.com>
Date: 星期一, 08 三月 2021 18:16:51 +0800
Subject: [PATCH] al

---
 BuWanVideo2.0/XYRDetailViewController.m |   50 +++++++++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 45 insertions(+), 5 deletions(-)

diff --git a/BuWanVideo2.0/XYRDetailViewController.m b/BuWanVideo2.0/XYRDetailViewController.m
index aae5d28..ca0d975 100755
--- a/BuWanVideo2.0/XYRDetailViewController.m
+++ b/BuWanVideo2.0/XYRDetailViewController.m
@@ -9,6 +9,7 @@
 #import "AppDelegate.h"
 
 #import "XYRDetailViewController.h"
+#import "PPTVController.h"
 #import "XYRVideoDetailModel.h"
 #import "UIImageView+WebCache.h"
 
@@ -173,10 +174,6 @@
     [self addTitleBackView];
     //鍔犺浇瑙嗛璇︽儏椤甸潰鐨勬暟鎹�
     [self getVideoDetailViewWithMovieId:self.Model.Id WithThirdType:self.Model.ThirdType WithResourceId:nil];
-    
-    if ([YTHsharedManger startManger].ad[@"videoDetailFullVideo"] && [[YTHsharedManger startManger].ad[@"videoDetailFullVideo"] isEqualToString:@"csj"]) {
-        [self loadFullscreenVideoAd];
-    }
 }
 
 - (void)loadFullscreenVideoAd {
@@ -1291,6 +1288,31 @@
     return UIInterfaceOrientationPortrait;
 }
 
+- (UIViewController *)fetchCurrentViewController {
+    UIViewController* currentViewController = [UIApplication sharedApplication].keyWindow.rootViewController;
+    BOOL runLoopFind = YES;
+    while (runLoopFind) {
+        if (currentViewController.presentedViewController) {
+            currentViewController = currentViewController.presentedViewController;
+        } else if ([currentViewController isKindOfClass:[UINavigationController class]]) {
+            UINavigationController* navigationController = (UINavigationController* )currentViewController;
+            currentViewController = [navigationController.childViewControllers lastObject];
+        } else if ([currentViewController isKindOfClass:[UITabBarController class]]) {
+            UITabBarController* tabBarController = (UITabBarController* )currentViewController;
+            currentViewController = tabBarController.selectedViewController;
+        } else {
+            NSUInteger childViewControllerCount = currentViewController.childViewControllers.count;
+            if (childViewControllerCount > 0) {
+                currentViewController = currentViewController.childViewControllers.lastObject;
+                return currentViewController;
+            } else {
+                return currentViewController;
+            }
+        }
+    }
+    return currentViewController;
+}
+
 /***********(浠ヤ笅)鏁版嵁缃戣矾鍔犺浇**************/
 /**
  *  鑾峰彇瑙嗛鐨勮缁嗕俊鎭苟鍔犺浇
@@ -1309,7 +1331,23 @@
             //鐎戝竷娴佹粦鍔ㄥ埌椤堕儴
             [self.collectionView setContentOffset:CGPointMake(0, 0) animated:YES];
             NSDictionary *dictionaryDta = (NSDictionary *)result;
-            _DetailModel=[XYRVideoDetailModel yy_modelWithDictionary:dictionaryDta];
+            
+            if ([dictionaryDta[@"Data"][@"pptv"] boolValue]) {
+                [SVProgressHUD dismiss];
+                // 鎷︽埅璺宠浆鐣岄潰
+                PPTVController *vc = [[PPTVController alloc] init];
+                vc.parms = dictionaryDta[@"Data"];
+                vc.hidesBottomBarWhenPushed = YES;
+                [[YTHsharedManger startManger].preController.navigationController pushViewController:vc animated:YES];
+          
+                [self dismissViewControllerAnimated:NO completion:^{}];
+                return;
+            }
+            if ([YTHsharedManger startManger].ad[@"videoDetailFullVideo"] && [[YTHsharedManger startManger].ad[@"videoDetailFullVideo"] isEqualToString:@"csj"]) {
+                [self loadFullscreenVideoAd];
+            }
+            
+            _DetailModel = [XYRVideoDetailModel yy_modelWithDictionary:dictionaryDta];
             //鏇存柊璇︽儏椤电殑瑙嗛鍥剧墖
             [self.image setYthImageWithURL:_DetailModel.Data.PlayPicture placeholderImage:[UIImage imageNamed:@"榛樿鍔犺浇鍥剧墖"]];
             //鍦ㄨ繖閲屽垽鏂富婕斿拰涓昏鍐呭鏄惁涓虹┖锛屽鏋滃悓鏃朵负绌猴紝灏遍殣钘忕畝浠�
@@ -2464,6 +2502,8 @@
 //    }];
 //}
 
+
+
 - (void)dealloc {
     
     

--
Gitblit v1.8.0