12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- //
- // XYVoiceMatchOrderListViewController.m
- // Starbuds
- //
- // Created by 翟玉磊 on 2020/11/20.
- // Copyright © 2020 翟玉磊. All rights reserved.
- //
- #import "XYVoiceMatchOrderListViewController.h"
- #import "XYVoiceMatchOrderListViewModel.h"
- #import "XYVoiceMatchOrderCellModel.h"
- #import "XYVoiceMatchOrderListTableViewCell.h"
- #import "XYVoiceMatchOrderDetailsViewController.h"
- @interface XYVoiceMatchOrderListViewController ()
- @property (nonatomic, strong) XYVoiceMatchOrderListViewModel *viewModel;
- @end
- @implementation XYVoiceMatchOrderListViewController
- - (void)viewDidLoad {
- [super viewDidLoad];
- // Do any additional setup after loading the view.
- }
- #pragma mark — Override
- - (void)bindViewModel {
- self.viewModel = XYVoiceMatchOrderListViewModel.new;
- self.viewModel.orderStatus = self.orderStatus;
- }
- - (UIEdgeInsets)contentInset {
- return UIEdgeInsetsMake(0, 0, NAVGATION_HEIGHT + 48.0f, 0);
- }
- - (void)tableViewDidTriggerHeaderRefresh {
- self.viewModel.pullDown = YES;
- [self.viewModel loadData:^(id _Nullable responseModel) {
-
- [self tableViewDidFinishTriggerHeader:YES reload:YES];
- [self.tableView zyl_configEmptyViewWithType:ZYLEmptyDataViewTypeDefault emptyInfo:@"" errorInfo:@"" offsetTop:250.0f hasData:self.viewModel.dataSource.count>0 hasError:NO reloadBlock:nil];
- } failure:^(ZYLNetworkError * _Nullable error) {
- [self tableViewDidFinishTriggerHeader:YES reload:NO];
- [self.tableView zyl_configEmptyViewWithType:ZYLEmptyDataViewTypeDefault emptyInfo:@"" errorInfo:error.domain offsetTop:250.0f hasData:self.viewModel.dataSource.count>0 hasError:error!=nil reloadBlock:nil];
- }];
- }
- - (void)tableViewDidTriggerFooterRefresh {
- [super tableViewDidTriggerFooterRefresh];
- }
- - (UITableViewCell *)tableView:(UITableView *)tableView dequeueReusableCellWithIdentifier:(NSString *)identifier forIndexPath:(NSIndexPath *)indexPath {
- return [XYVoiceMatchOrderListTableViewCell cellWithTableView:tableView];
- }
- - (void)configureCell:(XYVoiceMatchOrderListTableViewCell *)cell atIndexPath:(NSIndexPath *)indexPath withObject:(id)object {
- [cell configureModel:object];
- }
- - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
- return 182.0f;
- }
- - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
- [tableView deselectRowAtIndexPath:indexPath animated:YES];
-
- XYVoiceMatchOrderCellModel *model = self.viewModel.dataSource[indexPath.row];
-
- XYVoiceMatchOrderDetailsViewController *controller = XYVoiceMatchOrderDetailsViewController.new;
- controller.orderId = [model.hisId copy];
- [self.navigationController pushViewController:controller animated:YES];
- }
- #pragma mark — JXCategoryListContentViewDelegate
- /**
- 如果列表是VC,就返回VC.view
- 如果列表是View,就返回View自己
- @return 返回列表视图
- */
- - (UIView *)listView {
- return self.view;
- }
- @end
|