76 lines
2.0 KiB
Objective-C
Executable File
76 lines
2.0 KiB
Objective-C
Executable File
//
|
|
// YYSubsidySearchVC.m
|
|
// SweetParty
|
|
//
|
|
// Created by bj_szd on 2022/6/8.
|
|
//
|
|
|
|
#import "YYSubsidySearchVC.h"
|
|
#import "SPMineQianyueListCell.h"
|
|
|
|
@interface YYSubsidySearchVC ()
|
|
|
|
@end
|
|
|
|
@implementation YYSubsidySearchVC
|
|
|
|
- (void)viewDidLoad {
|
|
[super viewDidLoad];
|
|
|
|
[self showNaviBarWithTitle:@"搜索结果"];
|
|
|
|
[self createUI];
|
|
|
|
[self.dataArray addObjectsFromArray:self.resultArr];
|
|
[self.tableView reloadData];
|
|
}
|
|
|
|
-(void)createUI {
|
|
[self.tableView registerNib:[UINib nibWithNibName:@"SPMineQianyueListCell" bundle:nil] forCellReuseIdentifier:@"SPMineQianyueListCell"];
|
|
self.tableView.rowHeight = 75;
|
|
|
|
[self showPullToRefresh];
|
|
[self showLoadMoreRefresh];
|
|
}
|
|
|
|
#pragma mark - Table view data source
|
|
|
|
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
|
|
return 1;
|
|
}
|
|
|
|
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
|
|
return self.dataArray.count;
|
|
}
|
|
|
|
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
|
|
SPMineQianyueListCell *cell = [tableView dequeueReusableCellWithIdentifier:@"SPMineQianyueListCell" forIndexPath:indexPath];
|
|
cell.selectionStyle = NO;
|
|
SPFocusFansModel *model = self.dataArray[indexPath.row];
|
|
cell.subsidyModel = model;
|
|
|
|
[cell.addButton styleGradiBlueColor];
|
|
|
|
WEAK_SELF
|
|
[cell.addButton buttonAddTaget:^(UIButton *btn) {
|
|
[weakSelf onAddWith:model];
|
|
} forControlEvents:UIControlEventTouchUpInside];
|
|
|
|
return cell;
|
|
}
|
|
|
|
- (void)onAddWith:(SPFocusFansModel *)model {
|
|
NSDictionary *params = @{@"rid":C_string(self.rid), @"uid":model.uid, @"ratio":@(0)};
|
|
[[AFNetworkRequset shared] postRequestWithParams:params Path:@"/api/room/add_room_user_subsidy" Loading:NO Hud:YES Success:^(id _Nonnull responseDic) {
|
|
if (self.onSuccessBlock) {
|
|
self.onSuccessBlock();
|
|
}
|
|
[self.navigationController popViewControllerAnimated:YES];
|
|
|
|
} Failure:^(id _Nonnull errorData) {
|
|
|
|
}];
|
|
}
|
|
|
|
@end
|