1
This commit is contained in:
@@ -25,7 +25,6 @@ static NSString * const kKBVipReviewListCellId = @"kKBVipReviewListCellId";
|
||||
@property (nonatomic, strong) UICollectionView *collectionView; // 主列表(竖向滚动)
|
||||
@property (nonatomic, strong) NSArray<KBPayProductModel *> *plans; // 订阅方案数组
|
||||
@property (nonatomic, assign) NSInteger selectedIndex; // 当前选中的方案索引
|
||||
@property (nonatomic, strong) UIButton *restoreButton;
|
||||
@property (nonatomic, strong) UIImageView *bgImageView; // 全屏背景图
|
||||
// Header 自适应测量
|
||||
@property (nonatomic, strong) KBVipPayHeaderView *sizingHeader;
|
||||
@@ -92,12 +91,6 @@ static NSString * const kKBVipReviewListCellId = @"kKBVipReviewListCellId";
|
||||
make.bottom.equalTo(self.payButton.mas_top).offset(-16);
|
||||
}];
|
||||
|
||||
[self.view addSubview:self.restoreButton];
|
||||
[self.restoreButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
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);
|
||||
}];
|
||||
|
||||
// 预计算 Header 高度(由内部约束决定)
|
||||
self.headerHeight = [self kb_calcHeaderHeightForWidth:KB_SCREEN_WIDTH];
|
||||
@@ -334,24 +327,7 @@ static NSString * const kKBVipReviewListCellId = @"kKBVipReviewListCellId";
|
||||
[KBHUD showInfo:KBLocalized(@"Open agreement")];
|
||||
}
|
||||
|
||||
- (void)onTapRestoreButton {
|
||||
[[KBMaiPointReporter sharedReporter] reportClickWithEventName:@"click_vip_restore_btn"
|
||||
pageId:@"vip_pay"
|
||||
elementId:@"restore_btn"
|
||||
extra:nil
|
||||
completion:nil];
|
||||
[KBHUD show];
|
||||
__weak typeof(self) weakSelf = self;
|
||||
[[KBStoreKitBridge shared] restorePurchasesWithCompletion:^(BOOL success, NSString * _Nullable message) {
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
__strong typeof(weakSelf) self = weakSelf;
|
||||
(void)self;
|
||||
[KBHUD dismiss];
|
||||
NSString *tip = message.length ? message : (success ? KBLocalized(@"Success") : KBLocalized(@"Failed"));
|
||||
[KBHUD showInfo:tip];
|
||||
});
|
||||
}];
|
||||
}
|
||||
|
||||
|
||||
#pragma mark - UICollectionView DataSource
|
||||
|
||||
@@ -492,24 +468,7 @@ static NSString * const kKBVipReviewListCellId = @"kKBVipReviewListCellId";
|
||||
|
||||
|
||||
|
||||
- (UIButton *)restoreButton {
|
||||
if (!_restoreButton) {
|
||||
_restoreButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
_restoreButton.backgroundColor = [[UIColor colorWithHex:0xF6F7FB] colorWithAlphaComponent:0.72];
|
||||
_restoreButton.layer.cornerRadius = 8;
|
||||
_restoreButton.layer.masksToBounds = YES;
|
||||
UIImage *icon = [UIImage imageNamed:@"pay_resh_icon"];
|
||||
[_restoreButton setImage:icon forState:UIControlStateNormal];
|
||||
[_restoreButton setTitle:KBLocalized(@"Resume Purchase") forState:UIControlStateNormal];
|
||||
[_restoreButton setTitleColor:[UIColor colorWithHex:0x02BEAC] forState:UIControlStateNormal];
|
||||
_restoreButton.titleLabel.font = [KBFont medium:10];
|
||||
_restoreButton.contentEdgeInsets = UIEdgeInsetsMake(0, 12, 0, 12);
|
||||
_restoreButton.imageEdgeInsets = UIEdgeInsetsMake(0, -4, 0, 4);
|
||||
_restoreButton.titleEdgeInsets = UIEdgeInsetsMake(0, 6, 0, -6);
|
||||
[_restoreButton addTarget:self action:@selector(onTapRestoreButton) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
return _restoreButton;
|
||||
}
|
||||
|
||||
|
||||
- (UIButton *)payButton {
|
||||
if (!_payButton) {
|
||||
|
||||
Reference in New Issue
Block a user