RAHomeViewController.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. //
  2. // RAHomeViewController.h
  3. // Apex And Drivers
  4. //
  5. // Created by Jack on 2018/6/1.
  6. // Copyright © 2018年 USAI. All rights reserved.
  7. //
  8. #import "RABaseViewController.h"
  9. #import "RAHomeOrderModel.h"
  10. @protocol RAHomeSectionModelDelegate <NSObject>
  11. - (void)refreshUI;
  12. @end
  13. #pragma mark - Section Model
  14. @interface RAHomeSectionModel : NSObject
  15. @property (nonatomic,assign) RAOrderStatus type;
  16. @property (nonatomic,strong) NSArray <RAHomeOrderModel *> *orders;
  17. @property (nonatomic,copy) NSString *title;
  18. @property (nonatomic,readonly) NSInteger ordersCount;
  19. @property (nonatomic,assign) NSInteger section;
  20. @property (nonatomic,assign) NSInteger totalCount;
  21. @property (nonatomic,assign) NSInteger backendFlagCount;///<后台修改Order的个数
  22. @property (nonatomic,weak) id<RAHomeSectionModelDelegate> delegate;
  23. - (BOOL)hasMoreOrder;
  24. @end
  25. #pragma mark - View Controller
  26. @class RAHomeHeaderView;
  27. @interface RAHomeViewController : RABaseViewController
  28. @property (strong, nonatomic) IBOutlet UITableView *homeOrderTableView;
  29. @property (nonatomic,copy) NSString *currentOrderID;
  30. @property (nonatomic,assign) BOOL reloadFlag;///<视图显示时Reload
  31. @property (nonatomic,strong, readonly) RAHomeHeaderView *headerView;
  32. #pragma mark - Getter
  33. - (NSUInteger)orderSectionCount;
  34. - (RAHomeSectionModel *)modelForSection:(NSInteger)section;
  35. - (NSUInteger)orderCountForSection:(NSInteger)section;
  36. - (RAHomeOrderModel *)orderModelForIndexPath:(NSIndexPath *)indexPath;
  37. - (NSString *)titleForSection:(NSInteger)section;
  38. - (BOOL)hasMoreOrderForSection:(NSInteger)section;
  39. - (NSInteger)backendCountForSection:(NSInteger)section;
  40. #pragma mark - Set/Update
  41. - (void)setBackendFlagCount:(NSInteger)count forSection:(NSInteger)section;
  42. - (void)decreaseBackendFlagCountForSection:(NSInteger)section;
  43. - (void)setHeaderDelegate:(id<RAHomeSectionModelDelegate>) delegate forSection:(NSInteger)section;
  44. #pragma mark - Controller Action
  45. - (void)pushDetailViewControllerForModel:(RAHomeOrderModel *)model;
  46. - (void)showMoreOrderForSection:(NSInteger)section;
  47. @end