diff --git a/keyBoard/Assets.xcassets/Pay/SVIP_Normal_icon.imageset/Contents.json b/keyBoard/Assets.xcassets/Pay/SVIP_Normal_icon.imageset/Contents.json new file mode 100644 index 0000000..cef7109 --- /dev/null +++ b/keyBoard/Assets.xcassets/Pay/SVIP_Normal_icon.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "SVIP_Normal_icon@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "SVIP_Normal_icon@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/keyBoard/Assets.xcassets/Pay/SVIP_Normal_icon.imageset/SVIP_Normal_icon@2x.png b/keyBoard/Assets.xcassets/Pay/SVIP_Normal_icon.imageset/SVIP_Normal_icon@2x.png new file mode 100644 index 0000000..de0bd77 Binary files /dev/null and b/keyBoard/Assets.xcassets/Pay/SVIP_Normal_icon.imageset/SVIP_Normal_icon@2x.png differ diff --git a/keyBoard/Assets.xcassets/Pay/SVIP_Normal_icon.imageset/SVIP_Normal_icon@3x.png b/keyBoard/Assets.xcassets/Pay/SVIP_Normal_icon.imageset/SVIP_Normal_icon@3x.png new file mode 100644 index 0000000..94efa00 Binary files /dev/null and b/keyBoard/Assets.xcassets/Pay/SVIP_Normal_icon.imageset/SVIP_Normal_icon@3x.png differ diff --git a/keyBoard/Assets.xcassets/Pay/VIP_Normal_icon.imageset/Contents.json b/keyBoard/Assets.xcassets/Pay/VIP_Normal_icon.imageset/Contents.json new file mode 100644 index 0000000..c048cad --- /dev/null +++ b/keyBoard/Assets.xcassets/Pay/VIP_Normal_icon.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "VIP_Normal_icon@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "VIP_Normal_icon@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/keyBoard/Assets.xcassets/Pay/VIP_Normal_icon.imageset/VIP_Normal_icon@2x.png b/keyBoard/Assets.xcassets/Pay/VIP_Normal_icon.imageset/VIP_Normal_icon@2x.png new file mode 100644 index 0000000..44264f9 Binary files /dev/null and b/keyBoard/Assets.xcassets/Pay/VIP_Normal_icon.imageset/VIP_Normal_icon@2x.png differ diff --git a/keyBoard/Assets.xcassets/Pay/VIP_Normal_icon.imageset/VIP_Normal_icon@3x.png b/keyBoard/Assets.xcassets/Pay/VIP_Normal_icon.imageset/VIP_Normal_icon@3x.png new file mode 100644 index 0000000..7069252 Binary files /dev/null and b/keyBoard/Assets.xcassets/Pay/VIP_Normal_icon.imageset/VIP_Normal_icon@3x.png differ diff --git a/keyBoard/Assets.xcassets/Pay/pay_ais_icon.imageset/Contents.json b/keyBoard/Assets.xcassets/Pay/pay_ais_icon.imageset/Contents.json new file mode 100644 index 0000000..1d75e1f --- /dev/null +++ b/keyBoard/Assets.xcassets/Pay/pay_ais_icon.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "pay_ai_icon@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "pay_ai_icon@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/keyBoard/Assets.xcassets/Pay/pay_ais_icon.imageset/pay_ai_icon@2x.png b/keyBoard/Assets.xcassets/Pay/pay_ais_icon.imageset/pay_ai_icon@2x.png new file mode 100644 index 0000000..a196195 Binary files /dev/null and b/keyBoard/Assets.xcassets/Pay/pay_ais_icon.imageset/pay_ai_icon@2x.png differ diff --git a/keyBoard/Assets.xcassets/Pay/pay_ais_icon.imageset/pay_ai_icon@3x.png b/keyBoard/Assets.xcassets/Pay/pay_ais_icon.imageset/pay_ai_icon@3x.png new file mode 100644 index 0000000..9b3e54f Binary files /dev/null and b/keyBoard/Assets.xcassets/Pay/pay_ais_icon.imageset/pay_ai_icon@3x.png differ diff --git a/keyBoard/Assets.xcassets/Pay/pay_chats_icon.imageset/Contents.json b/keyBoard/Assets.xcassets/Pay/pay_chats_icon.imageset/Contents.json new file mode 100644 index 0000000..afb1043 --- /dev/null +++ b/keyBoard/Assets.xcassets/Pay/pay_chats_icon.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "pay_chat_icon@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "pay_chat_icon@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/keyBoard/Assets.xcassets/Pay/pay_chats_icon.imageset/pay_chat_icon@2x.png b/keyBoard/Assets.xcassets/Pay/pay_chats_icon.imageset/pay_chat_icon@2x.png new file mode 100644 index 0000000..bd6486a Binary files /dev/null and b/keyBoard/Assets.xcassets/Pay/pay_chats_icon.imageset/pay_chat_icon@2x.png differ diff --git a/keyBoard/Assets.xcassets/Pay/pay_chats_icon.imageset/pay_chat_icon@3x.png b/keyBoard/Assets.xcassets/Pay/pay_chats_icon.imageset/pay_chat_icon@3x.png new file mode 100644 index 0000000..248af78 Binary files /dev/null and b/keyBoard/Assets.xcassets/Pay/pay_chats_icon.imageset/pay_chat_icon@3x.png differ diff --git a/keyBoard/Assets.xcassets/Pay/pay_history_icon.imageset/Contents.json b/keyBoard/Assets.xcassets/Pay/pay_history_icon.imageset/Contents.json new file mode 100644 index 0000000..cf29db3 --- /dev/null +++ b/keyBoard/Assets.xcassets/Pay/pay_history_icon.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "pay_history_icon@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "pay_history_icon@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/keyBoard/Assets.xcassets/Pay/pay_history_icon.imageset/pay_history_icon@2x.png b/keyBoard/Assets.xcassets/Pay/pay_history_icon.imageset/pay_history_icon@2x.png new file mode 100644 index 0000000..0fff34e Binary files /dev/null and b/keyBoard/Assets.xcassets/Pay/pay_history_icon.imageset/pay_history_icon@2x.png differ diff --git a/keyBoard/Assets.xcassets/Pay/pay_history_icon.imageset/pay_history_icon@3x.png b/keyBoard/Assets.xcassets/Pay/pay_history_icon.imageset/pay_history_icon@3x.png new file mode 100644 index 0000000..e68b7ee Binary files /dev/null and b/keyBoard/Assets.xcassets/Pay/pay_history_icon.imageset/pay_history_icon@3x.png differ diff --git a/keyBoard/Assets.xcassets/Pay/pay_keyboards_icon.imageset/Contents.json b/keyBoard/Assets.xcassets/Pay/pay_keyboards_icon.imageset/Contents.json new file mode 100644 index 0000000..23e1a9b --- /dev/null +++ b/keyBoard/Assets.xcassets/Pay/pay_keyboards_icon.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "pay_keyboard_icon@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "pay_keyboard_icon@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/keyBoard/Assets.xcassets/Pay/pay_keyboards_icon.imageset/pay_keyboard_icon@2x.png b/keyBoard/Assets.xcassets/Pay/pay_keyboards_icon.imageset/pay_keyboard_icon@2x.png new file mode 100644 index 0000000..eccaaa1 Binary files /dev/null and b/keyBoard/Assets.xcassets/Pay/pay_keyboards_icon.imageset/pay_keyboard_icon@2x.png differ diff --git a/keyBoard/Assets.xcassets/Pay/pay_keyboards_icon.imageset/pay_keyboard_icon@3x.png b/keyBoard/Assets.xcassets/Pay/pay_keyboards_icon.imageset/pay_keyboard_icon@3x.png new file mode 100644 index 0000000..bdd5c39 Binary files /dev/null and b/keyBoard/Assets.xcassets/Pay/pay_keyboards_icon.imageset/pay_keyboard_icon@3x.png differ diff --git a/keyBoard/Assets.xcassets/Pay/pay_oks_icon.imageset/Contents.json b/keyBoard/Assets.xcassets/Pay/pay_oks_icon.imageset/Contents.json new file mode 100644 index 0000000..084acfd --- /dev/null +++ b/keyBoard/Assets.xcassets/Pay/pay_oks_icon.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "pay_oks_icon@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "pay_oks_icon@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/keyBoard/Assets.xcassets/Pay/pay_oks_icon.imageset/pay_oks_icon@2x.png b/keyBoard/Assets.xcassets/Pay/pay_oks_icon.imageset/pay_oks_icon@2x.png new file mode 100644 index 0000000..6549fb9 Binary files /dev/null and b/keyBoard/Assets.xcassets/Pay/pay_oks_icon.imageset/pay_oks_icon@2x.png differ diff --git a/keyBoard/Assets.xcassets/Pay/pay_oks_icon.imageset/pay_oks_icon@3x.png b/keyBoard/Assets.xcassets/Pay/pay_oks_icon.imageset/pay_oks_icon@3x.png new file mode 100644 index 0000000..89d127f Binary files /dev/null and b/keyBoard/Assets.xcassets/Pay/pay_oks_icon.imageset/pay_oks_icon@3x.png differ diff --git a/keyBoard/Assets.xcassets/Pay/pay_person_icon.imageset/Contents.json b/keyBoard/Assets.xcassets/Pay/pay_person_icon.imageset/Contents.json new file mode 100644 index 0000000..037dba9 --- /dev/null +++ b/keyBoard/Assets.xcassets/Pay/pay_person_icon.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "pay_person_icon@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "pay_person_icon@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/keyBoard/Assets.xcassets/Pay/pay_person_icon.imageset/pay_person_icon@2x.png b/keyBoard/Assets.xcassets/Pay/pay_person_icon.imageset/pay_person_icon@2x.png new file mode 100644 index 0000000..0dc4ce5 Binary files /dev/null and b/keyBoard/Assets.xcassets/Pay/pay_person_icon.imageset/pay_person_icon@2x.png differ diff --git a/keyBoard/Assets.xcassets/Pay/pay_person_icon.imageset/pay_person_icon@3x.png b/keyBoard/Assets.xcassets/Pay/pay_person_icon.imageset/pay_person_icon@3x.png new file mode 100644 index 0000000..fa0112e Binary files /dev/null and b/keyBoard/Assets.xcassets/Pay/pay_person_icon.imageset/pay_person_icon@3x.png differ diff --git a/keyBoard/Assets.xcassets/Pay/pay_phone_icon.imageset/Contents.json b/keyBoard/Assets.xcassets/Pay/pay_phone_icon.imageset/Contents.json new file mode 100644 index 0000000..dd2ce49 --- /dev/null +++ b/keyBoard/Assets.xcassets/Pay/pay_phone_icon.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "pay_phone_icon@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "pay_phone_icon@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/keyBoard/Assets.xcassets/Pay/pay_phone_icon.imageset/pay_phone_icon@2x.png b/keyBoard/Assets.xcassets/Pay/pay_phone_icon.imageset/pay_phone_icon@2x.png new file mode 100644 index 0000000..9c56723 Binary files /dev/null and b/keyBoard/Assets.xcassets/Pay/pay_phone_icon.imageset/pay_phone_icon@2x.png differ diff --git a/keyBoard/Assets.xcassets/Pay/pay_phone_icon.imageset/pay_phone_icon@3x.png b/keyBoard/Assets.xcassets/Pay/pay_phone_icon.imageset/pay_phone_icon@3x.png new file mode 100644 index 0000000..d560f28 Binary files /dev/null and b/keyBoard/Assets.xcassets/Pay/pay_phone_icon.imageset/pay_phone_icon@3x.png differ diff --git a/keyBoard/Assets.xcassets/Pay/pay_soon_icon.imageset/Contents.json b/keyBoard/Assets.xcassets/Pay/pay_soon_icon.imageset/Contents.json new file mode 100644 index 0000000..ac0b134 --- /dev/null +++ b/keyBoard/Assets.xcassets/Pay/pay_soon_icon.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "pay_soon_icon@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "pay_soon_icon@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/keyBoard/Assets.xcassets/Pay/pay_soon_icon.imageset/pay_soon_icon@2x.png b/keyBoard/Assets.xcassets/Pay/pay_soon_icon.imageset/pay_soon_icon@2x.png new file mode 100644 index 0000000..82d04b3 Binary files /dev/null and b/keyBoard/Assets.xcassets/Pay/pay_soon_icon.imageset/pay_soon_icon@2x.png differ diff --git a/keyBoard/Assets.xcassets/Pay/pay_soon_icon.imageset/pay_soon_icon@3x.png b/keyBoard/Assets.xcassets/Pay/pay_soon_icon.imageset/pay_soon_icon@3x.png new file mode 100644 index 0000000..4ea11d4 Binary files /dev/null and b/keyBoard/Assets.xcassets/Pay/pay_soon_icon.imageset/pay_soon_icon@3x.png differ diff --git a/keyBoard/Assets.xcassets/Pay/pay_speed_icon.imageset/Contents.json b/keyBoard/Assets.xcassets/Pay/pay_speed_icon.imageset/Contents.json new file mode 100644 index 0000000..97e99b9 --- /dev/null +++ b/keyBoard/Assets.xcassets/Pay/pay_speed_icon.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "pay_speed_icon@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "pay_speed_icon@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/keyBoard/Assets.xcassets/Pay/pay_speed_icon.imageset/pay_speed_icon@2x.png b/keyBoard/Assets.xcassets/Pay/pay_speed_icon.imageset/pay_speed_icon@2x.png new file mode 100644 index 0000000..da0f6c5 Binary files /dev/null and b/keyBoard/Assets.xcassets/Pay/pay_speed_icon.imageset/pay_speed_icon@2x.png differ diff --git a/keyBoard/Assets.xcassets/Pay/pay_speed_icon.imageset/pay_speed_icon@3x.png b/keyBoard/Assets.xcassets/Pay/pay_speed_icon.imageset/pay_speed_icon@3x.png new file mode 100644 index 0000000..5249ded Binary files /dev/null and b/keyBoard/Assets.xcassets/Pay/pay_speed_icon.imageset/pay_speed_icon@3x.png differ diff --git a/keyBoard/Class/Pay/V/KBSvipBenefitBgView.m b/keyBoard/Class/Pay/V/KBSvipBenefitBgView.m index 6af130d..8a09e0b 100644 --- a/keyBoard/Class/Pay/V/KBSvipBenefitBgView.m +++ b/keyBoard/Class/Pay/V/KBSvipBenefitBgView.m @@ -11,7 +11,7 @@ - (instancetype)initWithFrame:(CGRect)frame { if (self = [super initWithFrame:frame]) { - self.backgroundColor = [UIColor whiteColor]; + self.backgroundColor = [UIColor colorWithHex:0xF6F7FB]; self.layer.cornerRadius = 15; self.layer.masksToBounds = YES; } diff --git a/keyBoard/Class/Pay/V/KBSvipBenefitCell.m b/keyBoard/Class/Pay/V/KBSvipBenefitCell.m index b3b9cbb..c16132b 100644 --- a/keyBoard/Class/Pay/V/KBSvipBenefitCell.m +++ b/keyBoard/Class/Pay/V/KBSvipBenefitCell.m @@ -8,6 +8,8 @@ #import "KBSvipBenefitCell.h" @interface KBSvipBenefitCell () +@property (nonatomic, strong) UIView *coverView; // 左侧图标 + @property (nonatomic, strong) UIImageView *iconView; // 左侧图标 @property (nonatomic, strong) UILabel *titleLabel; // 权益文字 @property (nonatomic, strong) UIImageView *checkView; // 右侧勾选 @@ -18,26 +20,33 @@ - (instancetype)initWithFrame:(CGRect)frame { if (self = [super initWithFrame:frame]) { self.contentView.backgroundColor = [UIColor clearColor]; - + [self.contentView addSubview:self.coverView]; [self.contentView addSubview:self.iconView]; - [self.contentView addSubview:self.titleLabel]; - [self.contentView addSubview:self.checkView]; + [self.coverView addSubview:self.titleLabel]; + [self.coverView addSubview:self.checkView]; + + + [self.coverView mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.right.equalTo(self.contentView).inset(8); + make.centerY.equalTo(self.contentView); + make.height.mas_equalTo(46); + }]; [self.iconView mas_makeConstraints:^(MASConstraintMaker *make) { - make.left.equalTo(self.contentView).offset(16); - make.centerY.equalTo(self.contentView); - make.width.height.mas_equalTo(40); + make.left.equalTo(self.coverView).offset(16); + make.top.equalTo(self.contentView); + make.width.height.mas_equalTo(38); }]; [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) { make.left.equalTo(self.iconView.mas_right).offset(12); - make.centerY.equalTo(self.contentView); + make.centerY.equalTo(self.coverView); make.right.lessThanOrEqualTo(self.checkView.mas_left).offset(-12); }]; [self.checkView mas_makeConstraints:^(MASConstraintMaker *make) { - make.right.equalTo(self.contentView).offset(-16); - make.centerY.equalTo(self.contentView); + make.right.equalTo(self.coverView).offset(-16); + make.centerY.equalTo(self.coverView); make.width.height.mas_equalTo(20); }]; } @@ -75,14 +84,20 @@ if (!_checkView) { _checkView = [UIImageView new]; _checkView.contentMode = UIViewContentModeScaleAspectFit; - // 使用 SF Symbol 勾选图标 - if (@available(iOS 13.0, *)) { - UIImageSymbolConfiguration *config = [UIImageSymbolConfiguration configurationWithWeight:UIImageSymbolWeightMedium]; - _checkView.image = [UIImage systemImageNamed:@"checkmark" withConfiguration:config]; - } - _checkView.tintColor = [UIColor colorWithHex:KBColorValue]; + _checkView.image = [UIImage imageNamed:@"pay_oks_icon"]; } return _checkView; } + +- (UIView *)coverView{ + if (!_coverView) { + _coverView = [[UIView alloc] init]; + _coverView.backgroundColor = [UIColor whiteColor]; + _coverView.layer.cornerRadius = 8; + _coverView.layer.masksToBounds = true; + } + return _coverView; +} + @end diff --git a/keyBoard/Class/Pay/V/KBVipPayHeaderView.m b/keyBoard/Class/Pay/V/KBVipPayHeaderView.m index 6f5e948..51ba72d 100644 --- a/keyBoard/Class/Pay/V/KBVipPayHeaderView.m +++ b/keyBoard/Class/Pay/V/KBVipPayHeaderView.m @@ -27,7 +27,7 @@ - (instancetype)initWithFrame:(CGRect)frame { if (self = [super initWithFrame:frame]) { - self.backgroundColor = [UIColor clearColor]; + self.backgroundColor = [UIColor colorWithHex:0xF6F7FB]; [self addSubview:self.containerView]; [self.containerView mas_makeConstraints:^(MASConstraintMaker *make) { @@ -47,7 +47,7 @@ CGFloat spacing = 16; [g1 mas_makeConstraints:^(MASConstraintMaker *make) { make.left.equalTo(self.containerView).inset(KBFit(27)); - make.top.equalTo(self.containerView).offset(KB_NAV_TOTAL_HEIGHT + 25); + make.top.equalTo(self.containerView).offset(25); make.height.mas_equalTo(((KBFit(122)))); }]; [g2 mas_makeConstraints:^(MASConstraintMaker *make) { diff --git a/keyBoard/Class/Pay/VC/KBPayMainVC.m b/keyBoard/Class/Pay/VC/KBPayMainVC.m index b309a13..365f35e 100644 --- a/keyBoard/Class/Pay/VC/KBPayMainVC.m +++ b/keyBoard/Class/Pay/VC/KBPayMainVC.m @@ -23,6 +23,7 @@ #import "JXPagerView.h" #import "PagingViewTableHeaderView.h" #import "JXCategoryTitleView.h" +#import "keyBoard-Swift.h" static const CGFloat JXTableHeaderViewHeight = 224; static const CGFloat JXheightForHeaderInSection = 39; @@ -31,6 +32,7 @@ static const CGFloat JXheightForHeaderInSection = 39; @property (nonatomic, strong) JXPagerView *pagerView; @property (nonatomic, strong) PagingViewTableHeaderView *userHeaderView; //@property (nonatomic, strong, readonly) JXCategoryTitleView *categoryView; +@property (nonatomic, strong) UIView *categoryContainer; // categoryView 容器 @property (nonatomic, strong) JXCategoryImageView *myCategoryView; @property (nonatomic, assign) BOOL isNeedFooter; @@ -41,6 +43,7 @@ static const CGFloat JXheightForHeaderInSection = 39; @property (nonatomic, strong) UIView *naviBGView; @property (nonatomic, strong) UIButton *closeButton; // 当前选中的方案索引 +@property (nonatomic, strong) UIButton *restoreButton; @end @@ -56,8 +59,23 @@ static const CGFloat JXheightForHeaderInSection = 39; NSArray *selectedImageNames = @[@"VIP_Selected_icon", @"SVIP_Selected_icon"]; _userHeaderView = [[PagingViewTableHeaderView alloc] init]; - self.myCategoryView = [[JXCategoryImageView alloc] initWithFrame:CGRectMake(24, 0, KB_SCREEN_WIDTH - 48, JXheightForHeaderInSection)]; - self.myCategoryView.backgroundColor = [UIColor redColor]; + + // 创建容器视图 + self.categoryContainer = [[UIView alloc] initWithFrame:CGRectMake(0, 0, KB_SCREEN_WIDTH, JXheightForHeaderInSection)]; + self.categoryContainer.backgroundColor = [UIColor clearColor]; + + // categoryView 放在容器内 + self.myCategoryView = [[JXCategoryImageView alloc] init]; + self.myCategoryView.backgroundColor = [UIColor whiteColor]; + self.myCategoryView.layer.cornerRadius = JXheightForHeaderInSection * 0.5; + self.myCategoryView.layer.masksToBounds = true; + [self.categoryContainer addSubview:self.myCategoryView]; + [self.myCategoryView mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.equalTo(self.categoryContainer).offset(KBFit(24)); + make.right.equalTo(self.categoryContainer).offset(-KBFit(24)); + make.top.bottom.equalTo(self.categoryContainer); + }]; + self.myCategoryView.imageInfoArray = self.imageNames; self.myCategoryView.selectedImageInfoArray = selectedImageNames; self.myCategoryView.loadImageBlock = ^(UIImageView *imageView, id info) { @@ -66,6 +84,10 @@ static const CGFloat JXheightForHeaderInSection = 39; }; // self.myCategoryView.imageZoomEnabled = YES; self.myCategoryView.imageCornerRadius = 0; + self.myCategoryView.contentEdgeInsetLeft = 0; + self.myCategoryView.contentEdgeInsetRight = 0; + self.myCategoryView.cellSpacing = 4; + self.myCategoryView.imageSize = CGSizeMake(160, JXheightForHeaderInSection); // JXCategoryIndicatorLineView *lineView = [[JXCategoryIndicatorLineView alloc] init]; // lineView.indicatorWidth = 20; @@ -84,7 +106,7 @@ static const CGFloat JXheightForHeaderInSection = 39; self.automaticallyAdjustsScrollViewInsets = NO; CGFloat naviHeight = KB_NAV_TOTAL_HEIGHT; - self.pagerView.pinSectionHeaderVerticalOffset = naviHeight; + self.pagerView.pinSectionHeaderVerticalOffset = naviHeight + 16; self.naviBGView = [[UIView alloc] init]; self.naviBGView.alpha = 0; @@ -93,7 +115,7 @@ static const CGFloat JXheightForHeaderInSection = 39; [self.view addSubview:self.naviBGView]; UILabel *naviTitleLabel = [[UILabel alloc] init]; - naviTitleLabel.text = @"导航栏隐藏"; + naviTitleLabel.text = KBLocalized(@"Member recharge"); naviTitleLabel.textAlignment = NSTextAlignmentCenter; naviTitleLabel.frame = CGRectMake(0, KB_STATUSBAR_HEIGHT, self.view.bounds.size.width, 44); [self.naviBGView addSubview:naviTitleLabel]; @@ -101,12 +123,22 @@ static const CGFloat JXheightForHeaderInSection = 39; [self.view addSubview:self.closeButton]; [self.closeButton mas_makeConstraints:^(MASConstraintMaker *make) { - make.top.equalTo(self.view).offset(KB_NAV_TOTAL_HEIGHT - 30); + make.top.equalTo(self.view).offset(KB_NAV_TOTAL_HEIGHT - 40); 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.width.mas_equalTo(90); + make.height.mas_equalTo(32); + }]; + + self.pagerView.mainTableView.backgroundColor = [UIColor colorWithHex:0xF6F7FB]; + } - (void)viewDidAppear:(BOOL)animated { @@ -146,7 +178,7 @@ static const CGFloat JXheightForHeaderInSection = 39; } - (UIView *)viewForPinSectionHeaderInPagerView:(JXPagerView *)pagerView { - return self.myCategoryView; + return self.categoryContainer; } - (NSInteger)numberOfListsInPagerView:(JXPagerView *)pagerView { @@ -199,6 +231,25 @@ static const CGFloat JXheightForHeaderInSection = 39; [self.navigationController popViewControllerAnimated:true]; } +- (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 - lazy - (UIButton *)closeButton { if (!_closeButton) { @@ -208,4 +259,22 @@ static const CGFloat JXheightForHeaderInSection = 39; } return _closeButton; } +- (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; +} @end diff --git a/keyBoard/Class/Pay/VC/KBPaySvipVC.m b/keyBoard/Class/Pay/VC/KBPaySvipVC.m index 9714eeb..095da96 100644 --- a/keyBoard/Class/Pay/VC/KBPaySvipVC.m +++ b/keyBoard/Class/Pay/VC/KBPaySvipVC.m @@ -92,14 +92,14 @@ static NSString * const kKBSvipBenefitHeaderId = @"kKBSvipBenefitHeaderId"; // 权益列表数据(使用现有图标资源) self.benefits = @[ - @{@"icon": @"pay_ai_icon", @"title": KBLocalized(@"Wireless Sub-ai Dialogue")}, - @{@"icon": @"pay_keyboard_icon", @"title": KBLocalized(@"Personalized Keyboard")}, - @{@"icon": @"pay_chat_icon", @"title": KBLocalized(@"Chat Persona")}, - @{@"icon": @"pay_emotion_icon", @"title": KBLocalized(@"Emotional Counseling")}, - @{@"icon": @"pay_chat_icon", @"title": KBLocalized(@"Longer Chat History")}, - @{@"icon": @"pay_chat_icon", @"title": KBLocalized(@"Unlimited Chatting")}, - @{@"icon": @"pay_ai_icon", @"title": KBLocalized(@"Chat Without Speed Limits")}, - @{@"icon": @"pay_vip_icon", @"title": KBLocalized(@"Coming Soon")}, + @{@"icon": @"pay_ais_icon", @"title": KBLocalized(@"Wireless Sub-ai Dialogue")}, + @{@"icon": @"pay_keyboards_icon", @"title": KBLocalized(@"Personalized Keyboard")}, + @{@"icon": @"pay_person_icon", @"title": KBLocalized(@"Chat Persona")}, + @{@"icon": @"pay_phone_icon", @"title": KBLocalized(@"Emotional Counseling")}, + @{@"icon": @"pay_history_icon", @"title": KBLocalized(@"Longer Chat History")}, + @{@"icon": @"pay_chats_icon", @"title": KBLocalized(@"Unlimited Chatting")}, + @{@"icon": @"pay_speed_icon", @"title": KBLocalized(@"Chat Without Speed Limits")}, + @{@"icon": @"pay_soon_icon", @"title": KBLocalized(@"Coming Soon")}, ]; } diff --git a/keyBoard/Class/Pay/VC/KBVipPay.m b/keyBoard/Class/Pay/VC/KBVipPay.m index e4c6662..478027f 100644 --- a/keyBoard/Class/Pay/VC/KBVipPay.m +++ b/keyBoard/Class/Pay/VC/KBVipPay.m @@ -25,7 +25,6 @@ static NSString * const kKBVipReviewListCellId = @"kKBVipReviewListCellId"; @property (nonatomic, strong) UICollectionView *collectionView; // 主列表(竖向滚动) @property (nonatomic, strong) NSArray *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) {