处理kbpayvip
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user