
#import "SLPageViewModel.h"

@implementation SLPageViewModel

- (instancetype)initWith:(SLPageModel *)pageModel cellClass:(nullable Class)cellClass viewSize:(CGSize)viewSize headerSize:(CGSize)headerSize
{
    SLPageViewModel *viewModel = [[SLPageViewModel alloc] init];
    viewModel.pageModel = pageModel;
    viewModel.cellClass = cellClass;
    viewModel.viewSize = viewSize;
    viewModel.headerSize = headerSize;
    return viewModel;
}


+ (NSMutableArray<SLPageViewModel *> *)myPageViewModels {
    NSMutableArray<SLPageViewModel *> *viewModels = [NSMutableArray array];
    SLPageModel *model = [[SLPageModel alloc] init];
    SLPageViewModel *vm = [[SLPageViewModel alloc] initWith:model cellClass:SLMeHeaderCollectionViewCell.class viewSize:CGSizeMake(kSCREEN_WIDTH, 205 * KScaleW) headerSize:CGSizeMake(kSCREEN_WIDTH, 0)];
    [viewModels addObject:vm];
    
    SLPageModel *model2 = [[SLPageModel alloc] init];
    SLPageViewModel *vm2 = [[SLPageViewModel alloc] initWith:model2 cellClass:SLMySpeedCollectionViewCell.class viewSize:CGSizeMake(kSCREEN_WIDTH, 195 * KScaleW) headerSize:CGSizeMake(kSCREEN_WIDTH, 0)];
    [viewModels addObject:vm2];
    
    SLPageModel *model1 = [[SLPageModel alloc] init];
    model1.modelDetails = @[[SLPageModelDetail initWithTitle:@"收藏" bgImage:@"icon_my_sc"],
                            [SLPageModelDetail initWithTitle:@"朋友圈" bgImage:@"icon_my_pyq"],
                            [SLPageModelDetail initWithTitle:@"设置" bgImage:@"icon_my_set"],
                           [SLPageModelDetail initWithTitle:@"评价与反馈" bgImage:@"icon_my_yj"]];
    SLPageViewModel *vm1 = [[SLPageViewModel alloc] initWith:model1 cellClass:SLMyListCollectionViewCell.class viewSize:CGSizeMake(kSCREEN_WIDTH, model1.modelDetails.count * 56 * KScaleW + 12) headerSize:CGSizeMake(kSCREEN_WIDTH, 0)];
    [viewModels addObject:vm1];
    
    SLPageModel *model4 = [[SLPageModel alloc] init];
    SLPageViewModel *vm4 = [[SLPageViewModel alloc] initWith:model4 cellClass:SLPlaceholderCell.class viewSize:CGSizeMake(kSCREEN_WIDTH, 20) headerSize:CGSizeMake(kSCREEN_WIDTH, 0)];
    [viewModels addObject:vm4];
    return viewModels;
}

+ (NSMutableArray<SLPageViewModel *> *)userCenterPageViewModels {
    NSMutableArray<SLPageViewModel *> *viewModels = [NSMutableArray array];
    SLPageModel *model = [[SLPageModel alloc] init];
    SLPageViewModel *vm1 = [[SLPageViewModel alloc] initWith:model cellClass:SLBaseCollectionViewCell.class viewSize:CGSizeMake(kSCREEN_WIDTH, 50) headerSize:CGSizeMake(kSCREEN_WIDTH, 0)];
    [viewModels addObject:vm1];
    SLPageViewModel *vm2 = [[SLPageViewModel alloc] initWith:model cellClass:SLBaseCollectionViewCell.class viewSize:CGSizeMake(kSCREEN_WIDTH, 50) headerSize:CGSizeMake(kSCREEN_WIDTH, 0)];
    [viewModels addObject:vm2];
    return viewModels;
}

+ (NSMutableArray<SLPageViewModel *> *)homePageViewModelsWith:(NSArray *)chatList {    NSMutableArray<SLPageViewModel *> *viewModels = [NSMutableArray array];
//    [chatList enumerateObjectsUsingBlock:^(id  _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
//        SLPageModel *model1 = [[SLPageModel alloc] init];
//        model1.chatListModel = obj;
//        SLPageViewModel *vm1 = [[SLPageViewModel alloc] initWith:model1 cellClass:SLHomeMsgCollectionViewCell.class viewSize:CGSizeMake(kSCREEN_WIDTH, 74 * KScaleW) headerSize:CGSizeMake(kSCREEN_WIDTH, 0)];
//        [viewModels addObject:vm1];
//    }];
    SLPageModel *model4 = [[SLPageModel alloc] init];
    SLPageViewModel *vm4 = [[SLPageViewModel alloc] initWith:model4 cellClass:SLPlaceholderCell.class viewSize:CGSizeMake(kSCREEN_WIDTH, 20) headerSize:CGSizeMake(kSCREEN_WIDTH, 0)];
    [viewModels addObject:vm4];
    return viewModels;
}

+ (NSMutableArray<SLPageViewModel *> *)lxPageViewModels {
    NSMutableArray<SLPageViewModel *> *viewModels = [NSMutableArray array];
    SLPageModel *model = [[SLPageModel alloc] init];
    SLPageViewModel *vm = [[SLPageViewModel alloc] initWith:model cellClass:SLLxTopCell.class viewSize:CGSizeMake(kSCREEN_WIDTH, 207 * KScaleW) headerSize:CGSizeMake(kSCREEN_WIDTH, 0)];
    [viewModels addObject:vm];
    
    SLPageModel *model1 = [[SLPageModel alloc] init];
    SLPageViewModel *vm1 = [[SLPageViewModel alloc] initWith:model1 cellClass:SLVocabularyCell.class viewSize:CGSizeMake(kSCREEN_WIDTH, 150 * KScaleW) headerSize:CGSizeMake(kSCREEN_WIDTH, 0)];
    [viewModels addObject:vm1];
    
    SLPageModel *model2 = [[SLPageModel alloc] init];
    model2.itemTitel = @"剑雅真题";
    model2.modelDetails = @[[SLPageModelDetail initWithTitle:@"剑雅口语" subTitle:@"4-17范文案例" bgImage:@"icon_lx_yj_ky"],
                            [SLPageModelDetail initWithTitle:@"剑雅听力" subTitle:@"4-17精讲解析" bgImage:@"icon_lx_yj_tl"],
                            [SLPageModelDetail initWithTitle:@"剑雅阅读" subTitle:@"4-17翻译解析" bgImage:@"icon_lx_yj_yd"],
                            [SLPageModelDetail initWithTitle:@"剑雅写作" subTitle:@"4-17翻译解析" bgImage:@"icon_lx_yj_xz"],];
    SLPageViewModel *vm2 = [[SLPageViewModel alloc] initWith:model2 cellClass:SLHorScrBtnsCell.class viewSize:CGSizeMake(kSCREEN_WIDTH, 200 * KScaleW) headerSize:CGSizeMake(kSCREEN_WIDTH, 0)];
    [viewModels addObject:vm2];
    
    SLPageModel *model3 = [[SLPageModel alloc] init];
    model3.itemTitel = @"专项提升  ";//暂处
    model3.modelDetails = @[[SLPageModelDetail initWithTitle:@"口语练习" subTitle:@"当季最新口语题库" bgImage:@"icon_lx_ts_ky"],
                            [SLPageModelDetail initWithTitle:@"听力练习" subTitle:@"当季最新听力题库" bgImage:@"icon_lx_ts_tl"],
                            [SLPageModelDetail initWithTitle:@"阅读练习" subTitle:@"当季最新阅读题库" bgImage:@"icon_lx_ts_yd"],
                            [SLPageModelDetail initWithTitle:@"写作练习" subTitle:@"当季最新写作题库" bgImage:@"icon_lx_ts_xz"],];
    SLPageViewModel *vm3 = [[SLPageViewModel alloc] initWith:model3 cellClass:SLHorScrBtnsCell.class viewSize:CGSizeMake(kSCREEN_WIDTH, (80 * 4 + 71) * KScaleW) headerSize:CGSizeMake(kSCREEN_WIDTH, 0)];
    [viewModels addObject:vm3];
    
    SLPageModel *model4 = [[SLPageModel alloc] init];
    SLPageViewModel *vm4 = [[SLPageViewModel alloc] initWith:model4 cellClass:SLPlaceholderCell.class viewSize:CGSizeMake(kSCREEN_WIDTH, 20) headerSize:CGSizeMake(kSCREEN_WIDTH, 0)];
    [viewModels addObject:vm4];
    return viewModels;
}


@end
