| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- //
- // RAHomeViewController+HomeTableDelegate.m
- // Apex And Drivers
- //
- // Created by Jack on 2018/6/1.
- // Copyright © 2018年 USAI. All rights reserved.
- //
- #import "RAHomeViewController+HomeTableDelegate.h"
- #import "RAHomeOrderModel.h"
- #import "RABadgeNumberView.h"
- #import "RAHomeSectionHeaderView.h"
- @implementation RAHomeViewController (HomeTableDelegate)
- #pragma mark - TableView Delegate
- - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
- return 140.0f;
- }
- - (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
- RAHomeSectionHeaderView *header = [RAHomeSectionHeaderView homeSectionHeader];
- RAHomeSectionModel *model = [self modelForSection:section];
- header.model = model;
-
- [header addMoreClickTarget:self selector:@selector(sectionExpandSwithBtnClick:)];
- return header;
- }
- - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
- return 44.f;
- }
- - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
-
- RAHomeOrderModel *order = [self orderModelForIndexPath:indexPath];
-
- if (order.backendFlag) {
- order.backendFlag = !order.backendFlag;
- [self decreaseBackendFlagCountForSection:indexPath.section];
- }
- self.currentOrderID = order.orderID;
- [self pushDetailViewControllerForModel:order];
- }
- #pragma mark - Action
- - (void)sectionExpandSwithBtnClick:(UIButton *)sender {
- [self showMoreOrderForSection:sender.tag - TagBase];
- }
- @end
|