处理kbpayvip

This commit is contained in:
2026-02-04 12:33:01 +08:00
parent 305326aa9a
commit 68a610e0a8
11 changed files with 470 additions and 100 deletions

View File

@@ -20,10 +20,11 @@ static NSString * const kKBVipSubscribeCellId = @"kKBVipSubscribeCellId";
static NSString * const kKBVipReviewListCellId = @"kKBVipReviewListCellId";
@interface KBVipPay () <UICollectionViewDataSource, UICollectionViewDelegateFlowLayout>
@property (nonatomic, copy) void(^scrollCallback)(UIScrollView *scrollView);
@property (nonatomic, strong) UICollectionView *collectionView; //
@property (nonatomic, strong) NSArray<KBPayProductModel *> *plans; //
@property (nonatomic, assign) NSInteger selectedIndex; //
@property (nonatomic, strong) UIButton *closeButton; //
@property (nonatomic, strong) UIButton *restoreButton;
@property (nonatomic, strong) UIImageView *bgImageView; //
// Header
@@ -90,16 +91,10 @@ static NSString * const kKBVipReviewListCellId = @"kKBVipReviewListCellId";
make.top.equalTo(self.view).offset(0);
make.bottom.equalTo(self.payButton.mas_top).offset(-16);
}];
[self.view addSubview:self.closeButton];
[self.closeButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(self.view).offset(KB_NAV_TOTAL_HEIGHT - 30);
make.left.equalTo(self.view).offset(15);
make.width.height.mas_equalTo(36);
}];
[self.view addSubview:self.restoreButton];
[self.restoreButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.equalTo(self.closeButton);
make.right.equalTo(self.view).offset(-15);
make.top.equalTo(self.view).offset(KB_NAV_TOTAL_HEIGHT - 30); make.right.equalTo(self.view).offset(-15);
make.width.mas_equalTo(123);
make.height.mas_equalTo(32);
}];
@@ -292,14 +287,14 @@ static NSString * const kKBVipReviewListCellId = @"kKBVipReviewListCellId";
}
#pragma mark - Action
- (void)onTapClose{
[[KBMaiPointReporter sharedReporter] reportClickWithEventName:@"click_vip_close_btn"
pageId:@"vip_pay"
elementId:@"close_btn"
extra:nil
completion:nil];
[self.navigationController popViewControllerAnimated:true];
}
//- (void)onTapClose{
// [[KBMaiPointReporter sharedReporter] reportClickWithEventName:@"click_vip_close_btn"
// pageId:@"vip_pay"
// elementId:@"close_btn"
// extra:nil
// completion:nil];
// [self.navigationController popViewControllerAnimated:true];
//}
#pragma mark - Bottom Actions
- (void)onTapPayButton {
@@ -495,14 +490,7 @@ static NSString * const kKBVipReviewListCellId = @"kKBVipReviewListCellId";
}
- (UIButton *)closeButton {
if (!_closeButton) {
_closeButton = [UIButton buttonWithType:UIButtonTypeCustom];
[_closeButton setImage:[UIImage imageNamed:@"close_white2_icon"] forState:UIControlStateNormal];
[_closeButton addTarget:self action:@selector(onTapClose) forControlEvents:UIControlEventTouchUpInside];
}
return _closeButton;
}
- (UIButton *)restoreButton {
if (!_restoreButton) {
@@ -575,4 +563,21 @@ static NSString * const kKBVipReviewListCellId = @"kKBVipReviewListCellId";
[layout invalidateLayout];
}
}
#pragma mark - UIScrollView Delegate
- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
!self.scrollCallback ?: self.scrollCallback(scrollView);
}
#pragma mark - JXPagingViewListViewDelegate
- (UIView *)listView { return self.view; }
- (UIScrollView *)listScrollView { return self.collectionView; }
- (void)listViewDidScrollCallback:(void (^)(UIScrollView *))callback { self.scrollCallback = callback; }
- (void)listWillAppear { NSLog(@"%@:%@", self.title, NSStringFromSelector(_cmd)); }
- (void)listDidAppear { NSLog(@"%@:%@", self.title, NSStringFromSelector(_cmd)); }
- (void)listWillDisappear { NSLog(@"%@:%@", self.title, NSStringFromSelector(_cmd)); }
- (void)listDidDisappear { NSLog(@"%@:%@", self.title, NSStringFromSelector(_cmd)); }
@end