1
This commit is contained in:
@@ -34,6 +34,9 @@ static NSString * const kKBJfPayCellId = @"kKBJfPayCellId";
|
||||
// 底部按钮/协议
|
||||
@property (nonatomic, strong) UIButton *payButton; // 充值按钮
|
||||
@property (nonatomic, strong) UILabel *agreementLabel; // 协议提示
|
||||
@property (nonatomic, strong) UIView *documentContainer;
|
||||
@property (nonatomic, strong) UIButton *privacyButton;
|
||||
@property (nonatomic, strong) UILabel *documentSeparatorLabel;
|
||||
@property (nonatomic, strong) UIButton *agreementButton;
|
||||
|
||||
// 数据
|
||||
@@ -77,7 +80,10 @@ static NSString * const kKBJfPayCellId = @"kKBJfPayCellId";
|
||||
[self.listContainerView addSubview:self.collectionView];
|
||||
[self.view addSubview:self.payButton];
|
||||
[self.view addSubview:self.agreementLabel];
|
||||
[self.view addSubview:self.agreementButton];
|
||||
[self.view addSubview:self.documentContainer];
|
||||
[self.documentContainer addSubview:self.privacyButton];
|
||||
[self.documentContainer addSubview:self.documentSeparatorLabel];
|
||||
[self.documentContainer addSubview:self.agreementButton];
|
||||
|
||||
|
||||
// 布局(mas)
|
||||
@@ -120,13 +126,24 @@ static NSString * const kKBJfPayCellId = @"kKBJfPayCellId";
|
||||
make.top.equalTo(self.smallLeftIcon.mas_bottom).offset(19);
|
||||
}];
|
||||
|
||||
[self.agreementButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
[self.documentContainer mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerX.equalTo(self.view);
|
||||
make.bottom.equalTo(self.view).offset(-KB_SAFE_BOTTOM - 15);
|
||||
}];
|
||||
[self.privacyButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.top.bottom.equalTo(self.documentContainer);
|
||||
}];
|
||||
[self.documentSeparatorLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.equalTo(self.privacyButton.mas_right).offset(6);
|
||||
make.centerY.equalTo(self.documentContainer);
|
||||
}];
|
||||
[self.agreementButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.equalTo(self.documentSeparatorLabel.mas_right).offset(6);
|
||||
make.top.right.bottom.equalTo(self.documentContainer);
|
||||
}];
|
||||
[self.agreementLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerX.equalTo(self.view);
|
||||
make.bottom.equalTo(self.agreementButton.mas_top).offset(0);
|
||||
make.bottom.equalTo(self.documentContainer.mas_top).offset(0);
|
||||
}];
|
||||
|
||||
// 底部按钮
|
||||
@@ -361,6 +378,10 @@ static NSString * const kKBJfPayCellId = @"kKBJfPayCellId";
|
||||
[KBWebViewViewController presentLegalDocumentType:KBLegalDocumentTypeMembershipAgreement fromViewController:self];
|
||||
}
|
||||
|
||||
- (void)privacyButtonAction {
|
||||
[KBWebViewViewController presentLegalDocumentType:KBLegalDocumentTypePrivacyPolicy fromViewController:self];
|
||||
}
|
||||
|
||||
#pragma mark - Lazy UI
|
||||
- (UILabel *)myPointsTitleLabel {
|
||||
if (!_myPointsTitleLabel) {
|
||||
@@ -464,6 +485,35 @@ static NSString * const kKBJfPayCellId = @"kKBJfPayCellId";
|
||||
}
|
||||
return _agreementLabel;
|
||||
}
|
||||
|
||||
- (UIView *)documentContainer {
|
||||
if (!_documentContainer) {
|
||||
_documentContainer = [UIView new];
|
||||
}
|
||||
return _documentContainer;
|
||||
}
|
||||
|
||||
- (UIButton *)privacyButton {
|
||||
if (!_privacyButton) {
|
||||
_privacyButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[_privacyButton setTitle:KBLocalized(@"Privacy Policy") forState:UIControlStateNormal];
|
||||
[_privacyButton setTitleColor:[UIColor colorWithHex:KBColorValue] forState:UIControlStateNormal];
|
||||
_privacyButton.titleLabel.font = [KBFont regular:12];
|
||||
[_privacyButton addTarget:self action:@selector(privacyButtonAction) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
return _privacyButton;
|
||||
}
|
||||
|
||||
- (UILabel *)documentSeparatorLabel {
|
||||
if (!_documentSeparatorLabel) {
|
||||
_documentSeparatorLabel = [UILabel new];
|
||||
_documentSeparatorLabel.text = @"|";
|
||||
_documentSeparatorLabel.textColor = [UIColor colorWithWhite:0.45 alpha:1.0];
|
||||
_documentSeparatorLabel.font = [KBFont regular:12];
|
||||
}
|
||||
return _documentSeparatorLabel;
|
||||
}
|
||||
|
||||
- (UIButton *)agreementButton {
|
||||
if (!_agreementButton) {
|
||||
_agreementButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
|
||||
Reference in New Issue
Block a user