12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- //
- // AppointmentManageViewModel.m
- // LN_School
- //
- // Created by 张嵘 on 2019/7/31.
- // Copyright © 2019 Danson. All rights reserved.
- //
- #import "AppointmentManageViewModel.h"
- #import "AppointmentManageSubViewController.h"
- #import "AppointmentManageModel.h"
- @implementation AppointmentManageViewModel
- - (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 < self.titles.count; i ++) {
- AppointmentManageSubViewController *vc = [AppointmentManageSubViewController new];
- vc.subViewControllerSecArr = @[[self makeSecTwoModel]].mutableCopy;
- [result addObject:vc];
- }
- _controllers = result;
- }
- return _controllers;
- }
- - (HDSectionModel*)makeSecZeroModel {
-
- //该段layout
- HDYogaFlowLayout *layout = [HDYogaFlowLayout new];
- layout.headerSize = CGSizeMake(kScreenWidth, kScreenWidth * 0.25);
- //该段的所有数据封装
- HDSectionModel *secModel = [HDSectionModel new];
- secModel.sectionHeaderClassStr = @"TrainSummaryHeaderView";
- secModel.layout = layout;
- return secModel;
- }
- - (HDSectionModel*)makeSecTwoModel {
- NSMutableArray *cellModelArr = @[].mutableCopy;
- NSInteger cellCount = 15;
- for (int i =0; i < cellCount; i++) {
- HDCellModel *model = [HDCellModel new];
- AppointmentManageModel *appointmentManageModel = [AppointmentManageModel new];
- appointmentManageModel.date = @"2019-08-08";
- appointmentManageModel.name = @"张小凡";
- appointmentManageModel.object = @"科目一";
- appointmentManageModel.status = (i%2 == 0)? @"结业" : @"科四培训";
- model.orgData = appointmentManageModel;
- model.cellSize = CGSizeMake(kScreenWidth, 88);
- model.cellClassStr = @"AppointmentManageCell";
- [cellModelArr addObject:model];
- }
- //该段layout
- HDYogaFlowLayout *layout = [HDYogaFlowLayout new];//isUseSystemFlowLayout为YES时只支持HDBaseLayout
- layout.secInset = UIEdgeInsetsMake(10, 0, 0, 0);
- layout.justify = YGJustifySpaceBetween;
- layout.verticalGap = 10;
- layout.footerSize = CGSizeMake(kScreenWidth, 10);
-
- //该段的所有数据封装
- HDSectionModel *secModel = [HDSectionModel new];
- secModel.sectionHeaderClassStr = @"HomePageNumHeaderView";
- secModel.sectionFooterClassStr = @"CommonSecFooterView";
- secModel.headerTopStopType = HDHeaderStopOnTopTypeNormal;
- secModel.isNeedAutoCountCellHW = NO;
- secModel.sectionDataArr = cellModelArr;
- secModel.layout = layout;
- return secModel;
- }
- @end
|