Files
yuyin_ios/SweetParty/主类/音悦新增/房间补贴/YYSubsidySearchVC.m

76 lines
2.0 KiB
Mathematica
Raw Normal View History

2025-08-08 11:05:33 +08:00
//
// 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