// // XPGiftUserDataViewController.m // xplan-ios // // Created by duoban on 2022/10/11. // #import "XPGiftUserDataViewController.h" ///Third #import ///Tool #import "AccountInfoStorage.h" ///View #import "XPMineDataGiftTableViewCell.h" ///Model #import "UserInfoModel.h" ///View #import "XPMineUserInfoGiftWallViewController.h" @interface XPGiftUserDataViewController () ///列表 @property (nonatomic,strong) UITableView *tableView; @property (nonatomic, copy) void(^scrollCallback)(UIScrollView *scrollView); @end @implementation XPGiftUserDataViewController - (BOOL)isHiddenNavBar { return YES; } - (void)viewDidLoad { [super viewDidLoad]; [self initHettpRequest]; [self initSubViews]; [self initSubViewConstraints]; } #pragma mark - Http - (void)initHettpRequest { } #pragma mark - Private Method - (void)initSubViews { [self.view addSubview:self.tableView]; } - (void)initSubViewConstraints { [self.tableView mas_makeConstraints:^(MASConstraintMaker *make) { make.edges.mas_equalTo(self.view); }]; } #pragma mark - UITableViewDelegate And UITableViewDataSource - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { return 1; } - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return 1; } - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { return kGetScaleWidth(385); } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { XPMineDataGiftTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPMineDataGiftTableViewCell class])]; if (cell == nil) { cell = [[XPMineDataGiftTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([XPMineDataGiftTableViewCell class])]; } cell.delegate = self; cell.userGiftWall = self.userInfo.userGiftWall; cell.userLuckyBagGiftWall = self.userInfo.userLuckyBagGiftWall; return cell; } #pragma mark - XPMineDataGiftTableViewCellDelegate - (void)xPMineDataGiftTableViewCell:(XPMineDataGiftTableViewCell *)view didClickMore:(UIButton *)sender { XPMineUserInfoGiftWallViewController * giftWallVC = [[XPMineUserInfoGiftWallViewController alloc] init]; giftWallVC.userUid = self.userUid; [self.navigationController pushViewController:giftWallVC animated:YES]; } #pragma mark - JXPagingViewListViewDelegate - (UIView *)listView { return self.view; } - (UIScrollView *)listScrollView { return self.tableView; } - (void)listViewDidScrollCallback:(void (^)(UIScrollView *))callback { self.scrollCallback = callback; } - (void)scrollViewDidScroll:(UIScrollView *)scrollView { self.scrollCallback(scrollView); } #pragma mark - Getters And Setters - (void)setUserInfo:(UserInfoModel *)userInfo { _userInfo = userInfo; [self.tableView reloadData]; // [self.tableView reloadSections:[NSIndexSet indexSetWithIndex:2] withRowAnimation:UITableViewRowAnimationNone]; } - (UITableView *)tableView { if (!_tableView) { _tableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStylePlain]; _tableView.delegate = self; _tableView.dataSource = self; _tableView.tableFooterView = [UIView new]; _tableView.separatorStyle = UITableViewCellSeparatorStyleNone; _tableView.backgroundColor = [UIColor clearColor]; if (@available(iOS 11.0, *)) { _tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever; } [_tableView registerClass:[XPMineDataGiftTableViewCell class] forCellReuseIdentifier:NSStringFromClass([XPMineDataGiftTableViewCell class])]; } return _tableView; } @end