12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- //
- // SignUpSituationViewModel.m
- // LN_School
- //
- // Created by 张嵘 on 2019/7/31.
- // Copyright © 2019 Danson. All rights reserved.
- //
- #import "SignUpSituationViewModel.h"
- #import "SignUpSituationModel.h"
- #import "SignUpSituationHeaderModel.h"
- #import "SignUpSituationSubViewController.h"
- @implementation SignUpSituationViewModel
- - (CGSize)titleSize {
- return CGSizeMake(hd_deviceWidth, 44);
- }
- - (BOOL)headerStop {
- return YES;
- }
- - (NSMutableArray *)titles {
- return @[@"昨日报名",@"今日报名",@"本月报名",@"本季报名"].mutableCopy;
- }
- - (NSMutableArray *)controllers {
- if (!_controllers) {
- NSMutableArray *result = @[].mutableCopy;
- //仅测试,所以放入同一类型VC
- for (int i=0; i<4; i++) {
- SignUpSituationSubViewController *vc = [SignUpSituationSubViewController new];
- vc.subViewControllerSecArr = @[[self makeSecModel]].mutableCopy;
- SignUpSituationHeaderModel *signUpSituationHeaderModel = [[SignUpSituationHeaderModel alloc] init];
- switch (i) {
- case 0: {
- signUpSituationHeaderModel.leftLabelText = @"昨日报名人数:100人";
- break;
- }
- case 1: {
- signUpSituationHeaderModel.leftLabelText = @"今日报名人数:100人";
- break;
- }
- case 2: {
- signUpSituationHeaderModel.leftLabelText = @"本月报名人数:200人";
- break;
- }
- case 3: {
- signUpSituationHeaderModel.leftLabelText = @"本季报名人数:200人";
- break;
- }
-
- default:
- break;
- }
- vc.signUpSituationHeaderModel = signUpSituationHeaderModel;
- [result addObject:vc];
- }
- _controllers = result;
- }
- return _controllers;
- }
- - (HDSectionModel*)makeSecModel {
- NSMutableArray *cellModelArr = @[].mutableCopy;
- NSInteger cellCount = 15;
- for (int i =0; i < cellCount; i++) {
- HDCellModel *model = [HDCellModel new];
- SignUpSituationModel *signUpSituationModel = [SignUpSituationModel new];
- signUpSituationModel.imageName = @"HeaderPlacehold";
- signUpSituationModel.name = @"张三丰";
- signUpSituationModel.sex = @"女";
- signUpSituationModel.school = @"金安驾校";
- model.orgData = signUpSituationModel;
- model.cellSize = CGSizeMake(kScreenWidth, 80);
- model.cellClassStr = @"SignUpSituationCell";
- [cellModelArr addObject:model];
- }
- //该段layout
- HDYogaFlowLayout *layout = [HDYogaFlowLayout new];//isUseSystemFlowLayout为YES时只支持HDBaseLayout
- layout.justify = YGJustifySpaceBetween;
- layout.headerSize = CGSizeMake(kScreenWidth, 50);
- layout.footerSize = CGSizeMake(kScreenWidth, 10);
-
- //该段的所有数据封装
- HDSectionModel *secModel = [HDSectionModel new];
- secModel.sectionHeaderClassStr = @"SignUpSituationHeaderView";
- secModel.sectionFooterClassStr = @"CommonSecFooterView";
- secModel.headerTopStopType = HDHeaderStopOnTopTypeNormal;
- secModel.isNeedAutoCountCellHW = NO;
- secModel.sectionDataArr = cellModelArr;
- secModel.layout = layout;
- return secModel;
- }
- @end
|