admin
2022-01-20 4369e1dd5b6ccc6272f3170290856a2fa58b3c12
bug修改
9个文件已修改
2个文件已添加
339 ■■■■ 已修改文件
BuWanVideo2.0.xcodeproj/project.pbxproj 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
BuWanVideo2.0/DYNovelController.m 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
BuWanVideo2.0/LookNoteController.m 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
BuWanVideo2.0/Recommend/ListControlelr/ListController.m 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
BuWanVideo2.0/Recommend/Recommend/Cell/RecommendVideoCardView.h 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
BuWanVideo2.0/Recommend/Recommend/Cell/RecommendVideoCardView.m 47 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
BuWanVideo2.0/Recommend/Recommend/RecommendController.m 204 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
BuWanVideo2.0/Recommend/RecommendMainController.m 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
BuWanVideo2.0/SearchController.m 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Podfile.lock 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Pods/Manifest.lock 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
BuWanVideo2.0.xcodeproj/project.pbxproj
@@ -11,6 +11,7 @@
        0D98C0FF2792773C0077914D /* DYNewsController.m in Sources */ = {isa = PBXBuildFile; fileRef = 0D98C0FE2792773C0077914D /* DYNewsController.m */; };
        0D98C1022792776D0077914D /* DYNovelController.m in Sources */ = {isa = PBXBuildFile; fileRef = 0D98C1012792776D0077914D /* DYNovelController.m */; };
        0D98C1052792D6870077914D /* DYGridVideoController.m in Sources */ = {isa = PBXBuildFile; fileRef = 0D98C1042792D6870077914D /* DYGridVideoController.m */; };
        0D98C1082797EB3D0077914D /* RecommendVideoCardView.m in Sources */ = {isa = PBXBuildFile; fileRef = 0D98C1072797EB3D0077914D /* RecommendVideoCardView.m */; };
        0DEB34A9279012560008C6A4 /* SDK_Setting_5096047.json in Resources */ = {isa = PBXBuildFile; fileRef = 0DEB34A8279012560008C6A4 /* SDK_Setting_5096047.json */; };
        18052EA31E208379005997FC /* SafariServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 18052EA21E208379005997FC /* SafariServices.framework */; };
        181D3A091E1DFD5300CDBDE9 /* XYRUITextField.m in Sources */ = {isa = PBXBuildFile; fileRef = 181D3A081E1DFD5300CDBDE9 /* XYRUITextField.m */; };
@@ -404,6 +405,8 @@
        0D98C1012792776D0077914D /* DYNovelController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DYNovelController.m; sourceTree = "<group>"; };
        0D98C1032792D6660077914D /* DYGridVideoController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DYGridVideoController.h; sourceTree = "<group>"; };
        0D98C1042792D6870077914D /* DYGridVideoController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DYGridVideoController.m; sourceTree = "<group>"; };
        0D98C1062797EB0E0077914D /* RecommendVideoCardView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RecommendVideoCardView.h; sourceTree = "<group>"; };
        0D98C1072797EB3D0077914D /* RecommendVideoCardView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RecommendVideoCardView.m; sourceTree = "<group>"; };
        0DEB34A8279012560008C6A4 /* SDK_Setting_5096047.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = SDK_Setting_5096047.json; sourceTree = "<group>"; };
        18052EA01E208343005997FC /* Twitter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Twitter.framework; path = System/Library/Frameworks/Twitter.framework; sourceTree = SDKROOT; };
        18052EA21E208379005997FC /* SafariServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SafariServices.framework; path = System/Library/Frameworks/SafariServices.framework; sourceTree = SDKROOT; };
@@ -1899,6 +1902,8 @@
                70ED36E1266264D900E51E79 /* RecommendTwoColumnCell.m */,
                70ED36E326627D4500E51E79 /* RecommendThreeColumnCell.h */,
                70ED36E426627D4500E51E79 /* RecommendThreeColumnCell.m */,
                0D98C1062797EB0E0077914D /* RecommendVideoCardView.h */,
                0D98C1072797EB3D0077914D /* RecommendVideoCardView.m */,
            );
            path = Cell;
            sourceTree = "<group>";
@@ -2934,6 +2939,7 @@
                702904BA2687016200F93618 /* FileOperator.m in Sources */,
                18E943E9205766510019FD04 /* subregionViewController.m in Sources */,
                70ED36F9266280EA00E51E79 /* TADotView.m in Sources */,
                0D98C1082797EB3D0077914D /* RecommendVideoCardView.m in Sources */,
                7B0D3B2E1D59BCAB003E74A8 /* CMuneItem.m in Sources */,
                18E943F52057C5720019FD04 /* JYNetWorking.m in Sources */,
                704C14B8265B72A5009DAB98 /* UIView+ZJFrame.m in Sources */,
@@ -3246,7 +3252,7 @@
                CODE_SIGN_IDENTITY = "iPhone Developer";
                "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
                CODE_SIGN_STYLE = Automatic;
                CURRENT_PROJECT_VERSION = 89;
                CURRENT_PROJECT_VERSION = 91;
                DEVELOPMENT_TEAM = 98HSDT7AP4;
                ENABLE_BITCODE = NO;
                FRAMEWORK_SEARCH_PATHS = (
@@ -3308,7 +3314,7 @@
                    "$(PROJECT_DIR)/BuWanVideo2.0/DKADSet_iOS_SDK_1.2.0_iphoneOS",
                    "$(PROJECT_DIR)/BuWanVideo2.0/GDT_iOS_SDK",
                );
                MARKETING_VERSION = 3.1.3;
                MARKETING_VERSION = 3.1.5;
                ONLY_ACTIVE_ARCH = YES;
                OTHER_LDFLAGS = (
                    "$(inherited)",
@@ -3398,7 +3404,7 @@
                CODE_SIGN_IDENTITY = "iPhone Developer";
                "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
                CODE_SIGN_STYLE = Automatic;
                CURRENT_PROJECT_VERSION = 89;
                CURRENT_PROJECT_VERSION = 91;
                DEVELOPMENT_TEAM = 98HSDT7AP4;
                ENABLE_BITCODE = NO;
                FRAMEWORK_SEARCH_PATHS = (
@@ -3460,7 +3466,7 @@
                    "$(PROJECT_DIR)/BuWanVideo2.0/DKADSet_iOS_SDK_1.2.0_iphoneOS",
                    "$(PROJECT_DIR)/BuWanVideo2.0/GDT_iOS_SDK",
                );
                MARKETING_VERSION = 3.1.3;
                MARKETING_VERSION = 3.1.5;
                ONLY_ACTIVE_ARCH = NO;
                OTHER_LDFLAGS = (
                    "$(inherited)",
BuWanVideo2.0/DYNovelController.m
@@ -41,7 +41,7 @@
    
    UIView *hidden=[[UIView alloc] init];
    hidden.backgroundColor=UIColor.whiteColor;
    hidden.frame=CGRectMake(0, kStatusBarH  , KScreenW/10, KScreenW/10);
    hidden.frame=CGRectMake(0, kStatusBarH  , KScreenW/10, ALNavBarH);
    [self.view addSubview:hidden];
}
BuWanVideo2.0/LookNoteController.m
@@ -73,7 +73,7 @@
 */
-(void)createNavgationBar{
    self.navigationItem.title = @"观看记录";
    self.navigationController.navigationBar.titleTextAttributes =@{NSFontAttributeName:[UIFont systemFontOfSize:18],NSForegroundColorAttributeName:[UIColor whiteColor]};
    self.navigationController.navigationBar.titleTextAttributes =@{NSFontAttributeName:[UIFont systemFontOfSize:18],NSForegroundColorAttributeName:[UIColor blackColor]};
    
    //返回按钮
    UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
BuWanVideo2.0/Recommend/ListControlelr/ListController.m
@@ -362,6 +362,12 @@
            view.titleName = @"热播推荐";
            return view;
        }
        UICollectionReusableView *view = [collectionView dequeueReusableSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:@"UICollectionReusableView" forIndexPath:indexPath];
        return view;
    }else{
        UICollectionReusableView *view = [collectionView dequeueReusableSupplementaryViewOfKind:UICollectionElementKindSectionFooter withReuseIdentifier:@"tempFooterView" forIndexPath:indexPath];
        return view;
    }
    //    else {
    //        if (indexPath.section > 1) {
@@ -376,8 +382,7 @@
    //        }
    //    }
    
    UICollectionReusableView *view = [collectionView dequeueReusableSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:@"UICollectionReusableView" forIndexPath:indexPath];
    return view;
}
- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout referenceSizeForHeaderInSection:(NSInteger)section{
@@ -492,6 +497,8 @@
        
        [_collectionView registerClass:[UICollectionReusableView class] forSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:@"UICollectionReusableView"];
        
        [_collectionView registerClass:[UICollectionReusableView class] forSupplementaryViewOfKind:UICollectionElementKindSectionFooter withReuseIdentifier:@"tempFooterView"];
        [self setHeaderRefresh];
    }
    return _collectionView;
BuWanVideo2.0/Recommend/Recommend/Cell/RecommendVideoCardView.h
New file
@@ -0,0 +1,20 @@
//
//  RecommendVideoCardView.h
//  BuWanVideo2.0
//
//  Created by aeline on 2022/1/19.
//  Copyright © 2022 com.yeshi.buwansheque.ios. All rights reserved.
//
#import <UIKit/UIKit.h>
#import <LCDSDK/LCDSDK.h>
NS_ASSUME_NONNULL_BEGIN
@interface RecommendVideoCardView : UICollectionViewCell
- (void) updateWithElement:(id<LCDViewElement>) element;
@end
NS_ASSUME_NONNULL_END
BuWanVideo2.0/Recommend/Recommend/Cell/RecommendVideoCardView.m
New file
@@ -0,0 +1,47 @@
//
//  RecommendVideoCardView.m
//  BuWanVideo2.0
//
//  Created by aeline on 2022/1/19.
//  Copyright © 2022 com.yeshi.buwansheque.ios. All rights reserved.
//
#import "RecommendVideoCardView.h"
#import <LCDSDK/LCDSDK.h>
@interface RecommendVideoCardView ()
@property (nonatomic) UIView<LCDVideoCardView> *eView;
@end
@implementation RecommendVideoCardView
- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    NSLog(@"RecommendVideoCardView initWithFrame -%f -%f",frame.origin.x,frame.origin.y);
    if (self) {
        [self setupDataConfig];
        [self setupViewConfig];
    }
    return self;
}
- (void)setupDataConfig {
}
- (void)setupViewConfig {
    LCDVideoCardProvider.sharedProvider.cardType=LCDVideoCardType2_4;
    self.eView=[LCDVideoCardProvider.sharedProvider buildView];
    [self.contentView addSubview:self.eView];
//    self.elementView.backgroundColor=UIColor.grayColor;
}
- (void)updateWithElement:(id)element{
    if(self.eView)
    {
        [self.eView refreshData:element];
    }
}
@end
BuWanVideo2.0/Recommend/Recommend/RecommendController.m
@@ -20,20 +20,29 @@
#import "RecommendChangeFooterView.h"
#import "UICollectionViewLeftAlignedLayout.h"
#import "RecommendVideoCardView.h"
//内容联盟
#import <LCDSDK/LCDSDK.h>
@interface RecommendController () <UICollectionViewDelegate, UICollectionViewDataSource, RecommendDelegate>
@interface RecommendController () <UICollectionViewDelegate, UICollectionViewDataSource, RecommendDelegate,LCDVideoCardProviderDelegate>
@property (nonatomic, nullable, strong) UICollectionView *collectionView;
@property (nonatomic, nullable, strong) RecommendHeaderViewCell *cellRecommendHeader;
@property (nonatomic, nullable, strong) RecommendVideoCardView *cellRecommendVideoCard;
@property (nonatomic, assign) NSUInteger page;
@property (nonatomic, assign) NSUInteger position;
@property (nonatomic, nullable, strong) NSDictionary *dictionaryBanaer;
@property (nonatomic, nullable, strong) NSArray *arrayTemp;
@property (nonatomic, nullable, strong) NSMutableArray *arrayContent;
@property (nonatomic, assign) NSUInteger count;
@property (nonatomic) id<LCDViewElement> videoCardElementView;
@end
@implementation RecommendController
@@ -61,13 +70,32 @@
- (void)setupDataConfig {
    self.page = 1;
    _position= self.index ;//_parms[@"Index"];
}
- (void)setupViewConfig {
    [self.view addSubview:self.collectionView];
    LCDVideoCardProvider.sharedProvider.cardType=LCDVideoCardType2_4;
    LCDVideoCardProvider.sharedProvider.shouldShowTitleView=NO;
    LCDVideoCardProvider.sharedProvider.delegate=self;
    LCDVideoCardProvider.sharedProvider.rootViewController=self;
}
- (void) refreshVideoCard{
    if(!_videoCardElementView){
        _videoCardElementView= [LCDVideoCardProvider.sharedProvider buildViewElement];
    }
    [_videoCardElementView loadDataWithCompletion:^(id<LCDViewElement>  _Nonnull element, NSError * _Nonnull error) {
        if(!error)
        {
            [self.cellRecommendVideoCard updateWithElement:element];
        }
    }];
}
-(void)getHomeAd{
    NSLog(@"getHomeAd");
    [SVProgressHUD show];
    dispatch_semaphore_t semaphore = dispatch_semaphore_create(0);
    // 创建全局并行
@@ -80,11 +108,15 @@
            if (isSuccessful) {
                NSDictionary *dic = (NSDictionary *)result;
                self.dictionaryBanaer = dic[@"Data"];
//                [self.collectionView reloadSections:[NSIndexSet indexSetWithIndex:1]];
            }
            NSLog(@"recommend - getHomeAdWithUid");
            dispatch_semaphore_signal(semaphore);
        }];
        
    });
    
    dispatch_group_async(group, queue, ^{
        [[YTHNetInterface startInterface] getHomeTypeWithUid:[YTHsharedManger startManger].Uid vtid:_parms[@"Id"] withSystem:@"1" DataKey:_parms[@"DataKey"] PageSize:10 Page:_page withBlock:^(BOOL isSuccessful, id result, NSString *error) {
@@ -106,8 +138,8 @@
                    }
                }
            }
            dispatch_semaphore_signal(semaphore);
        }];
    });
    
@@ -119,8 +151,11 @@
            [SVProgressHUD dismiss];
            [self.arrayContent addObjectsFromArray:self.arrayTemp];
            [self.collectionView reloadData];
            [self.collectionView reloadSections:[NSIndexSet indexSetWithIndex:0]];
//            [self.collectionView reloadSections:[NSIndexSet indexSetWithIndex:1]];
        });
    });
   [self refreshVideoCard];
}
- (void)loadFooter:(void(^)(void))handel {
@@ -160,12 +195,13 @@
}
- (void)changeData:(NSString *)vid page:(NSUInteger)page index:(NSInteger)index {
    int offset=1+(_position==0?1:0);
    [[YTHNetInterface startInterface] getVideoRecommendWithUid:vid Page:page WithSystem:@"1" withBlock:^(BOOL isSuccessful, id result, NSString *error) {
        if (isSuccessful) {
            NSMutableDictionary *parms = [[NSMutableDictionary alloc] initWithDictionary:self.arrayContent[index-1]];
            NSMutableDictionary *parms = [[NSMutableDictionary alloc] initWithDictionary:self.arrayContent[index-offset]];
            parms[@"page"] = result[@"Data"][@"page"];
            parms[@"HomeVideoList"] = result[@"Data"][@"list"];
            self.arrayContent[index-1] = parms;
            self.arrayContent[index-offset] = parms;
            [self.collectionView reloadSections:[NSIndexSet indexSetWithIndex:index]];
        }
    }];
@@ -253,6 +289,8 @@
- (void)setHeaderRefresh {
    self.collectionView.mj_header=[MJRefreshNormalHeader headerWithRefreshingBlock:^{
        self.page = 1;
        //下拉刷新
        [self refreshVideoCard];
        [self loadFooter:^{
            
        }];
@@ -260,21 +298,29 @@
}
- (void)cellClick:(NSIndexPath *)indexPath {
    int offset=1+(_position==0?1:0);
    if(indexPath.section<offset){
        return;
    }
    NSDictionary *parms = [NSDictionary new];
    BOOL BigPicture = [self.arrayContent[indexPath.section-1][@"HomeVideoList"][0][@"BigPicture"] boolValue];
    BOOL BigPicture = [self.arrayContent[indexPath.section-offset][@"HomeVideoList"][0][@"BigPicture"] boolValue];
    if (BigPicture) {
        parms = self.arrayContent[indexPath.section-1][@"HomeVideoList"][indexPath.row+1][@"Video"];
        parms = self.arrayContent[indexPath.section-offset][@"HomeVideoList"][indexPath.row+1][@"Video"];
        
    } else {
        parms = self.arrayContent[indexPath.section-1][@"HomeVideoList"][indexPath.row][@"Video"];
        parms = self.arrayContent[indexPath.section-offset][@"HomeVideoList"][indexPath.row][@"Video"];
    }
    [self onResult:parms];
}
- (void)headerClick:(NSIndexPath *)indexPath {
    int offset=1+(_position==0?1:0);
    NSDictionary *parms = [NSDictionary new];
    parms = self.arrayContent[indexPath.section-1][@"HomeVideoList"][0][@"Video"];
    parms = self.arrayContent[indexPath.section-offset][@"HomeVideoList"][0][@"Video"];
    [self onResult:parms];
}
@@ -317,22 +363,24 @@
}
- (NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView {
    return self.arrayContent.count+1;
    //TODO 测试
    int offset=1+(_position==0?1:0);
    return self.arrayContent.count+offset;
}
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
    if (section == 0) {
    int offset=1+(_position==0?1:0);
    if (section <offset) {
        return 1;
    } else {
        NSUInteger Columns = [self.arrayContent[section-1][@"Columns"] integerValue];
        NSUInteger Columns = [self.arrayContent[section-offset][@"Columns"] integerValue];
        if (Columns == 2 || Columns == 3) {
            if ([self.arrayContent[section-1][@"HomeVideoList"] count] > 0) {
                BOOL BigPicture = [self.arrayContent[section-1][@"HomeVideoList"][0][@"BigPicture"] boolValue];
            if ([self.arrayContent[section-offset][@"HomeVideoList"] count] > 0) {
                BOOL BigPicture = [self.arrayContent[section-offset][@"HomeVideoList"][0][@"BigPicture"] boolValue];
                if (BigPicture) {
                    return [self.arrayContent[section-1][@"HomeVideoList"] count]-1;
                    return [self.arrayContent[section-offset][@"HomeVideoList"] count]-1;
                }
                return [self.arrayContent[section-1][@"HomeVideoList"] count];
                return [self.arrayContent[section-offset][@"HomeVideoList"] count];
            }
        }
    }
@@ -340,6 +388,9 @@
}
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
    int offset=1+(_position==0?1:0);
    if (indexPath.section == 0) {
        if (!self.cellRecommendHeader) {
            self.cellRecommendHeader = [collectionView dequeueReusableCellWithReuseIdentifier:@"RecommendHeaderViewCell" forIndexPath:indexPath];
@@ -347,23 +398,32 @@
        self.cellRecommendHeader.delegate = self;
        self.cellRecommendHeader.arrayImageData = self.dictionaryBanaer;
        return self.cellRecommendHeader;
    }else if (indexPath.section == 1&&offset==2) {
        if (!self.cellRecommendVideoCard) {
            self.cellRecommendVideoCard = [collectionView dequeueReusableCellWithReuseIdentifier:@"RecommendVideoCardView" forIndexPath:indexPath];
        }
        //刷新数据
        return self.cellRecommendVideoCard;
    } else {
        NSUInteger Columns = [self.arrayContent[indexPath.section-1][@"Columns"] integerValue];
        NSUInteger Columns = [self.arrayContent[indexPath.section-offset][@"Columns"] integerValue];
        if (Columns > 3) {
            ToDayHotCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"ToDayHotCell" forIndexPath:indexPath];
            cell.delegate = self;
            cell.data = self.arrayContent[indexPath.section-1];
            cell.data = self.arrayContent[indexPath.section-offset];
            return cell;
            
        } else if (Columns == 2) {
            if ([self.arrayContent[indexPath.section-1][@"HomeVideoList"] count] > 0) {
            if ([self.arrayContent[indexPath.section-offset][@"HomeVideoList"] count] > 0) {
                RecommendTwoColumnCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"RecommendTwoColumnCell" forIndexPath:indexPath];
                BOOL BigPicture = [self.arrayContent[indexPath.section-1][@"HomeVideoList"][0][@"BigPicture"] boolValue];
                BOOL BigPicture = [self.arrayContent[indexPath.section-offset][@"HomeVideoList"][0][@"BigPicture"] boolValue];
                if (BigPicture) {
                    cell.data = self.arrayContent[indexPath.section-1][@"HomeVideoList"][indexPath.row+1][@"Video"];
                    cell.data = self.arrayContent[indexPath.section-offset][@"HomeVideoList"][indexPath.row+1][@"Video"];
                    
                } else {
                    cell.data = self.arrayContent[indexPath.section-1][@"HomeVideoList"][indexPath.row][@"Video"];
                    cell.data = self.arrayContent[indexPath.section-offset][@"HomeVideoList"][indexPath.row][@"Video"];
                }
                return cell;
                
@@ -373,14 +433,14 @@
            }
            
        } else if (Columns == 3) {
            if ([self.arrayContent[indexPath.section-1][@"HomeVideoList"] count] > 0) {
            if ([self.arrayContent[indexPath.section-offset][@"HomeVideoList"] count] > 0) {
                RecommendThreeColumnCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"RecommendThreeColumnCell" forIndexPath:indexPath];
                BOOL BigPicture = [self.arrayContent[indexPath.section-1][@"HomeVideoList"][0][@"BigPicture"] boolValue];
                BOOL BigPicture = [self.arrayContent[indexPath.section-offset][@"HomeVideoList"][0][@"BigPicture"] boolValue];
                if (BigPicture) {
                    cell.data = self.arrayContent[indexPath.section-1][@"HomeVideoList"][indexPath.row+1][@"Video"];
                    cell.data = self.arrayContent[indexPath.section-offset][@"HomeVideoList"][indexPath.row+1][@"Video"];
                    
                } else {
                    cell.data = self.arrayContent[indexPath.section-1][@"HomeVideoList"][indexPath.row][@"Video"];
                    cell.data = self.arrayContent[indexPath.section-offset][@"HomeVideoList"][indexPath.row][@"Video"];
                }
                return cell;
                
@@ -397,24 +457,35 @@
// 定制collectionView的head和foot
- (UICollectionReusableView *)collectionView:(UICollectionView *)collectionView viewForSupplementaryElementOfKind:(NSString *)kind atIndexPath:(NSIndexPath *)indexPath {
    
    int offset=1+(_position==0?1:0);
    if (kind == UICollectionElementKindSectionHeader) {
        if (indexPath.section > 0) {
        if (indexPath.section > offset-1) {
            RecpmmendTitleView *view = [collectionView dequeueReusableSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:@"RecpmmendTitleView" forIndexPath:indexPath];
            view.delegate = self;
            BOOL BigPicture = NO;
            if ([self.arrayContent[indexPath.section-1][@"HomeVideoList"] count] > 0) {
                BigPicture = [self.arrayContent[indexPath.section-1][@"HomeVideoList"][0][@"BigPicture"] boolValue];
            if ([self.arrayContent[indexPath.section-offset][@"HomeVideoList"] count] > 0) {
                BigPicture = [self.arrayContent[indexPath.section-offset][@"HomeVideoList"][0][@"BigPicture"] boolValue];
            }
            view.isBanaer = BigPicture;
            view.data = self.arrayContent[indexPath.section-1];
            view.data = self.arrayContent[indexPath.section-offset];
            view.index = indexPath.section;
            view.indexPath = indexPath;
            return view;
        }else if(indexPath.section==1&&offset==2){
                RecpmmendTitleView *view = [collectionView dequeueReusableSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:@"RecpmmendTitleView" forIndexPath:indexPath];
                view.delegate = self;
                BOOL BigPicture = NO;
                view.isBanaer = BigPicture;
                view.data = @{@"Name":@"今日必看",@"HomeVideoList":@[],@"RefreshPosition":@"0"};
                view.index = indexPath.section;
                view.indexPath = indexPath;
                return view;
        }
        
    } else if (kind == UICollectionElementKindSectionFooter) {
        if (indexPath.section > 1) {
            NSDictionary *data = self.arrayContent[indexPath.section-1];
        if (indexPath.section > offset) {
            NSDictionary *data = self.arrayContent[indexPath.section-offset];
            if ([data[@"RefreshPosition"] integerValue] == 2) {
                RecommendChangeFooterView *view = [collectionView dequeueReusableSupplementaryViewOfKind:UICollectionElementKindSectionFooter withReuseIdentifier:@"RecommendChangeFooterView" forIndexPath:indexPath];
                view.delegate = self;
@@ -423,32 +494,41 @@
                return view;
            }
        }
        UICollectionReusableView *view = [collectionView dequeueReusableSupplementaryViewOfKind:UICollectionElementKindSectionFooter withReuseIdentifier:@"tempFooterView" forIndexPath:indexPath];
        return view;
    }
    
    UICollectionReusableView *view = [collectionView dequeueReusableSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:@"tempHeaderView" forIndexPath:indexPath];
    return view;
}
- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout referenceSizeForHeaderInSection:(NSInteger)section{
    int offset=1+(_position==0?1:0);
    //宽度随便定,系统会自动取collectionView的宽度
    //高度为分组头的高度
    if (section > 0) {
        if ([self.arrayContent[section-1][@"HomeVideoList"] count] > 0) {
            BOOL BigPicture = [self.arrayContent[section-1][@"HomeVideoList"][0][@"BigPicture"] boolValue];
    if (section > offset-1) {
        if ([self.arrayContent[section-offset][@"HomeVideoList"] count] > 0) {
            BOOL BigPicture = [self.arrayContent[section-offset][@"HomeVideoList"][0][@"BigPicture"] boolValue];
            if (BigPicture) {
                return CGSizeMake(KScreenW, 216 + 40 + 30);
            }
        }
        return CGSizeMake(KScreenW, 47);
    }else if(section==1){
        return CGSizeMake(KScreenW, 47);
    }
    return CGSizeMake(CGFLOAT_MIN, CGFLOAT_MIN);
}
- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout referenceSizeForFooterInSection:(NSInteger)section {
    if (section == 0) {
    int offset=1+(_position==0?1:0);
    if (section <offset) {
        return CGSizeMake(CGFLOAT_MIN, CGFLOAT_MIN);
    }
    NSUInteger Columns = [self.arrayContent[section-1][@"RefreshPosition"] integerValue];
    NSUInteger Columns = [self.arrayContent[section-offset][@"RefreshPosition"] integerValue];
    if (Columns == 2) {
        return CGSizeMake(KScreenW, 41);
        
@@ -458,17 +538,21 @@
}
- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath {
    int offset=1+(_position==0?1:0);
    if (indexPath.section == 0) {
        CGFloat bannerSizeRate = [self.dictionaryBanaer[@"bannerSizeRate"] doubleValue];
        return  CGSizeMake(KScreenW, 5 + (KScreenW * bannerSizeRate));
        
    } else {
        NSUInteger Columns = [self.arrayContent[indexPath.section-1][@"Columns"] integerValue];
    } else  if (indexPath.section == 1&&offset==2) {
//        return  CGSizeMake(KScreenW, KScreenW/2.4 * 1.4);
        return  CGSizeMake(KScreenW, KScreenW/2.4 * 1.4);
    }  else {
        NSUInteger Columns = [self.arrayContent[indexPath.section-offset][@"Columns"] integerValue];
        if (Columns > 3) {
            return  CGSizeMake(KScreenW, 140);
            
        } else if (Columns == 2) {
            if ([self.arrayContent[indexPath.section-1][@"HomeVideoList"] count] > 0) {
            if ([self.arrayContent[indexPath.section-offset][@"HomeVideoList"] count] > 0) {
                return CGSizeMake((KScreenW-9-9-8)/2, 41+(((KScreenW-9-9-8)/2))*0.562);
                
            } else {
@@ -476,7 +560,7 @@
            }
            
        } else if (Columns == 3) {
            if ([self.arrayContent[indexPath.section-1][@"HomeVideoList"] count] > 0) {
            if ([self.arrayContent[indexPath.section-offset][@"HomeVideoList"] count] > 0) {
                return CGSizeMake((KScreenW-9-9-6-6)/3, 41+(((KScreenW-9-9-6-6)/3))*1.39);
                
            } else {
@@ -489,12 +573,12 @@
//协议中的方法,用于返回整个CollectionView上、左、下、右距四边的间距
- (UIEdgeInsets)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout insetForSectionAtIndex:(NSInteger)section {
    if (section == 0) {
    int offset=1+(_position==0?1:0);
    if (section <offset) {
        return UIEdgeInsetsMake(0, 0, 0, 0);
        
    } else {
        NSUInteger Columns = [self.arrayContent[section-1][@"Columns"] integerValue];
    }  else {
        NSUInteger Columns = [self.arrayContent[section-offset][@"Columns"] integerValue];
        if (Columns == 2 || Columns == 3) {
            return UIEdgeInsetsMake(5, 9, 0, 9);
            
@@ -507,11 +591,12 @@
//两行cell之间的间距
- (CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout minimumLineSpacingForSectionAtIndex:(NSInteger)section {
    if (section == 0) {
    int offset=1+(_position==0?1:0);
    if (section <offset) {
        return 0;
        
    } else {
        NSUInteger Columns = [self.arrayContent[section-1][@"Columns"] integerValue];
        NSUInteger Columns = [self.arrayContent[section-offset][@"Columns"] integerValue];
        if (Columns == 2) {
            return 12;
            
@@ -519,16 +604,17 @@
            return 10;
        }
    }
    return 0;;
    return 0;
}
//同一行两个cell的间距
- (CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout minimumInteritemSpacingForSectionAtIndex:(NSInteger)section {
    if (section == 0) {
    int offset=1+(_position==0?1:0);
    if (section <offset) {
        return 0;
        
    } else {
        NSUInteger Columns = [self.arrayContent[section-1][@"Columns"] integerValue];
        NSUInteger Columns = [self.arrayContent[section-offset][@"Columns"] integerValue];
        if (Columns == 2) {
            return 8;
            
@@ -559,6 +645,8 @@
        [_collectionView registerClass:[RecommendTwoColumnCell class] forCellWithReuseIdentifier:@"RecommendTwoColumnCell"];
        [_collectionView registerClass:[RecommendThreeColumnCell class] forCellWithReuseIdentifier:@"RecommendThreeColumnCell"];
        
        [_collectionView registerClass:[RecommendVideoCardView class] forCellWithReuseIdentifier:@"RecommendVideoCardView"];
        [_collectionView registerClass:[UICollectionViewCell class] forCellWithReuseIdentifier:@"UICollectionViewCell"];
        
        [_collectionView registerClass:[RecpmmendTitleView class] forSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:@"RecpmmendTitleView"];
@@ -566,6 +654,8 @@
        [_collectionView registerClass:[RecommendChangeFooterView class] forSupplementaryViewOfKind:UICollectionElementKindSectionFooter withReuseIdentifier:@"RecommendChangeFooterView"];
        
        [_collectionView registerClass:[UICollectionReusableView class] forSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:@"tempHeaderView"];
        [_collectionView registerClass:[UICollectionReusableView class] forSupplementaryViewOfKind:UICollectionElementKindSectionFooter withReuseIdentifier:@"tempFooterView"];
        
        [self setHeaderRefresh];
    }
@@ -579,4 +669,16 @@
    return _arrayContent;
}
- (void)lcdContentRequestStart:(LCDEvent *)event{
    NSLog(@"video-card lcdContentRequestStart");
}
- (void)lcdContentRequestFail:(LCDEvent *)event{
    NSLog(@"video-card lcdContentRequestFail");
}
- (void)lcdContentRequestSuccess:(NSArray<LCDEvent *> *)events{
    NSLog(@"video-card lcdContentRequestSuccess");
}
@end
BuWanVideo2.0/Recommend/RecommendMainController.m
@@ -285,17 +285,17 @@
//当视频广告素材加载失败时调用此方法。
- (void)nativeExpressFullscreenVideoAd:(BUNativeExpressFullscreenVideoAd *)fullscreenVideoAd didFailWithError:(NSError *_Nullable)error {
    NSLog(@"nativeExpressFullscreenVideoAd");
}
//此方法在成功呈现nativeExpressAdView时调用。
- (void)nativeExpressFullscreenVideoAdViewRenderSuccess:(BUNativeExpressFullscreenVideoAd *)rewardedVideoAd {
    NSLog(@"nativeExpressFullscreenVideoAdViewRenderSuccess");
}
//当nativeExpressAdView无法呈现时,将调用此方法
- (void)nativeExpressFullscreenVideoAdViewRenderFail:(BUNativeExpressFullscreenVideoAd *)rewardedVideoAd error:(NSError *_Nullable)error {
    NSLog(@"nativeExpressFullscreenVideoAdViewRenderFail");
}
//当视频缓存成功时调用此方法
- (void)nativeExpressFullscreenVideoAdDidDownLoadVideo:(BUNativeExpressFullscreenVideoAd *)fullscreenVideoAd {
BuWanVideo2.0/SearchController.m
@@ -308,9 +308,16 @@
            view.delegate = self;
            return view;
        }
        UICollectionReusableView *view = [collectionView dequeueReusableSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:@"UICollectionReusableView" forIndexPath:indexPath];
        return view;
    }else if(kind == UICollectionElementKindSectionFooter){
        UICollectionReusableView *view = [collectionView dequeueReusableSupplementaryViewOfKind:UICollectionElementKindSectionFooter withReuseIdentifier:@"emptyFooterView" forIndexPath:indexPath];
        return view;
    }
    UICollectionReusableView *view = [collectionView dequeueReusableSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:@"UICollectionReusableView" forIndexPath:indexPath];
    return view;
}
- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout referenceSizeForHeaderInSection:(NSInteger)section {
@@ -400,6 +407,8 @@
        [_collectionView registerClass:[SearchRecordHeaderView class] forSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:@"SearchRecordHeaderView"];
        
        [_collectionView registerClass:[UICollectionReusableView class] forSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:@"UICollectionReusableView"];
        [_collectionView registerClass:[UICollectionReusableView class] forSupplementaryViewOfKind:UICollectionElementKindSectionFooter withReuseIdentifier:@"emptyFooterView"];
    }
    return _collectionView;
}
Podfile.lock
@@ -1,11 +1,11 @@
PODS:
  - Ads-CN (4.2.0.2):
    - Ads-CN/BUAdSDK (= 4.2.0.2)
  - Ads-CN/BUAdSDK (4.2.0.2):
  - Ads-CN (4.2.0.4):
    - Ads-CN/BUAdSDK (= 4.2.0.4)
  - Ads-CN/BUAdSDK (4.2.0.4):
    - Ads-CN/BUFoundation
    - Ads-CN/Domestic
  - Ads-CN/BUFoundation (4.2.0.2)
  - Ads-CN/Domestic (4.2.0.2)
  - Ads-CN/BUFoundation (4.2.0.4)
  - Ads-CN/Domestic (4.2.0.4)
  - AFNetworking (3.2.1):
    - AFNetworking/NSURLSession (= 3.2.1)
    - AFNetworking/Reachability (= 3.2.1)
@@ -195,7 +195,7 @@
    :tag: 2.5.2
SPEC CHECKSUMS:
  Ads-CN: 9fe60236f2433ea9091842729ea2c93c3bc84134
  Ads-CN: a83895b2011073285ff2e54f0c3b597d7fecb404
  AFNetworking: b6f891fdfaed196b46c7a83cf209e09697b94057
  BDNovelOpenSDK: b4f4987f6f1fae15cd1a7bad4fe2e3048afb77c4
  FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a
Pods/Manifest.lock
@@ -1,11 +1,11 @@
PODS:
  - Ads-CN (4.2.0.2):
    - Ads-CN/BUAdSDK (= 4.2.0.2)
  - Ads-CN/BUAdSDK (4.2.0.2):
  - Ads-CN (4.2.0.4):
    - Ads-CN/BUAdSDK (= 4.2.0.4)
  - Ads-CN/BUAdSDK (4.2.0.4):
    - Ads-CN/BUFoundation
    - Ads-CN/Domestic
  - Ads-CN/BUFoundation (4.2.0.2)
  - Ads-CN/Domestic (4.2.0.2)
  - Ads-CN/BUFoundation (4.2.0.4)
  - Ads-CN/Domestic (4.2.0.4)
  - AFNetworking (3.2.1):
    - AFNetworking/NSURLSession (= 3.2.1)
    - AFNetworking/Reachability (= 3.2.1)
@@ -195,7 +195,7 @@
    :tag: 2.5.2
SPEC CHECKSUMS:
  Ads-CN: 9fe60236f2433ea9091842729ea2c93c3bc84134
  Ads-CN: a83895b2011073285ff2e54f0c3b597d7fecb404
  AFNetworking: b6f891fdfaed196b46c7a83cf209e09697b94057
  BDNovelOpenSDK: b4f4987f6f1fae15cd1a7bad4fe2e3048afb77c4
  FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a