RAHomeViewController.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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. @interface RAHomeViewController : RABaseViewController
  27. @property (strong, nonatomic) IBOutlet UITableView *homeOrderTableView;
  28. @property (nonatomic,copy) NSString *currentOrderID;
  29. @property (nonatomic,assign) BOOL reloadFlag;///<视图显示时Reload
  30. #pragma mark - Getter
  31. - (NSUInteger)orderSectionCount;
  32. - (RAHomeSectionModel *)modelForSection:(NSInteger)section;
  33. - (NSUInteger)orderCountForSection:(NSInteger)section;
  34. - (RAHomeOrderModel *)orderModelForIndexPath:(NSIndexPath *)indexPath;
  35. - (NSString *)titleForSection:(NSInteger)section;
  36. - (BOOL)hasMoreOrderForSection:(NSInteger)section;
  37. - (NSInteger)backendCountForSection:(NSInteger)section;
  38. #pragma mark - Set/Update
  39. - (void)setBackendFlagCount:(NSInteger)count forSection:(NSInteger)section;
  40. - (void)decreaseBackendFlagCountForSection:(NSInteger)section;
  41. - (void)setHeaderDelegate:(id<RAHomeSectionModelDelegate>) delegate forSection:(NSInteger)section;
  42. #pragma mark - Controller Action
  43. - (void)pushDetailViewControllerForModel:(RAHomeOrderModel *)model;
  44. - (void)showMoreOrderForSection:(NSInteger)section;
  45. @end