diff --git a/keyBoard/Assets.xcassets/Pay/SVIP_Selected_icon.imageset/Contents.json b/keyBoard/Assets.xcassets/Pay/SVIP_Selected_icon.imageset/Contents.json new file mode 100644 index 0000000..a05cb5d --- /dev/null +++ b/keyBoard/Assets.xcassets/Pay/SVIP_Selected_icon.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "SVIP_Selected_icon@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "SVIP_Selected_icon@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/keyBoard/Assets.xcassets/Pay/SVIP_Selected_icon.imageset/SVIP_Selected_icon@2x.png b/keyBoard/Assets.xcassets/Pay/SVIP_Selected_icon.imageset/SVIP_Selected_icon@2x.png new file mode 100644 index 0000000..30f0004 Binary files /dev/null and b/keyBoard/Assets.xcassets/Pay/SVIP_Selected_icon.imageset/SVIP_Selected_icon@2x.png differ diff --git a/keyBoard/Assets.xcassets/Pay/SVIP_Selected_icon.imageset/SVIP_Selected_icon@3x.png b/keyBoard/Assets.xcassets/Pay/SVIP_Selected_icon.imageset/SVIP_Selected_icon@3x.png new file mode 100644 index 0000000..3fd7538 Binary files /dev/null and b/keyBoard/Assets.xcassets/Pay/SVIP_Selected_icon.imageset/SVIP_Selected_icon@3x.png differ diff --git a/keyBoard/Assets.xcassets/Pay/VIP_Selected_icon.imageset/Contents.json b/keyBoard/Assets.xcassets/Pay/VIP_Selected_icon.imageset/Contents.json new file mode 100644 index 0000000..34cd4ad --- /dev/null +++ b/keyBoard/Assets.xcassets/Pay/VIP_Selected_icon.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "VIP_Selected_icon@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "VIP_Selected_icon@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/keyBoard/Assets.xcassets/Pay/VIP_Selected_icon.imageset/VIP_Selected_icon@2x.png b/keyBoard/Assets.xcassets/Pay/VIP_Selected_icon.imageset/VIP_Selected_icon@2x.png new file mode 100644 index 0000000..cf3edcd Binary files /dev/null and b/keyBoard/Assets.xcassets/Pay/VIP_Selected_icon.imageset/VIP_Selected_icon@2x.png differ diff --git a/keyBoard/Assets.xcassets/Pay/VIP_Selected_icon.imageset/VIP_Selected_icon@3x.png b/keyBoard/Assets.xcassets/Pay/VIP_Selected_icon.imageset/VIP_Selected_icon@3x.png new file mode 100644 index 0000000..0e74509 Binary files /dev/null and b/keyBoard/Assets.xcassets/Pay/VIP_Selected_icon.imageset/VIP_Selected_icon@3x.png differ diff --git a/keyBoard/Class/Pay/VC/KBPayMainVC.m b/keyBoard/Class/Pay/VC/KBPayMainVC.m index 70eff36..b309a13 100644 --- a/keyBoard/Class/Pay/VC/KBPayMainVC.m +++ b/keyBoard/Class/Pay/VC/KBPayMainVC.m @@ -25,16 +25,20 @@ #import "JXCategoryTitleView.h" static const CGFloat JXTableHeaderViewHeight = 224; -static const CGFloat JXheightForHeaderInSection = 50; +static const CGFloat JXheightForHeaderInSection = 39; @interface KBPayMainVC () @property (nonatomic, strong) JXPagerView *pagerView; @property (nonatomic, strong) PagingViewTableHeaderView *userHeaderView; -@property (nonatomic, strong, readonly) JXCategoryTitleView *categoryView; +//@property (nonatomic, strong, readonly) JXCategoryTitleView *categoryView; +@property (nonatomic, strong) JXCategoryImageView *myCategoryView; + @property (nonatomic, assign) BOOL isNeedFooter; @property (nonatomic, assign) BOOL isNeedHeader; - (JXPagerView *)preferredPagingView; -@property (nonatomic, strong) NSArray *titles; +//@property (nonatomic, strong) NSArray *titles; +@property (nonatomic, strong) NSArray *imageNames; + @property (nonatomic, strong) UIView *naviBGView; @property (nonatomic, strong) UIButton *closeButton; // 当前选中的方案索引 @@ -46,33 +50,33 @@ static const CGFloat JXheightForHeaderInSection = 50; [super viewDidLoad]; self.view.backgroundColor = [UIColor whiteColor]; - self.navigationController.navigationBar.translucent = false; - self.edgesForExtendedLayout = UIRectEdgeNone; -// self.kb_navView.hidden = true; - _titles = @[@"VIP", @"SVIP"]; +// self.navigationController.navigationBar.translucent = false; +// self.edgesForExtendedLayout = UIRectEdgeNone; + self.imageNames = @[@"VIP_Normal_icon", @"SVIP_Normal_icon"]; + 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.myCategoryView.imageInfoArray = self.imageNames; + self.myCategoryView.selectedImageInfoArray = selectedImageNames; + self.myCategoryView.loadImageBlock = ^(UIImageView *imageView, id info) { + NSString *imageName = info; + imageView.image = [UIImage imageNamed:imageName]; + }; +// self.myCategoryView.imageZoomEnabled = YES; + self.myCategoryView.imageCornerRadius = 0; + self.myCategoryView.imageSize = CGSizeMake(160, JXheightForHeaderInSection); +// JXCategoryIndicatorLineView *lineView = [[JXCategoryIndicatorLineView alloc] init]; +// lineView.indicatorWidth = 20; +// self.myCategoryView.indicators = @[lineView]; - _categoryView = [[JXCategoryTitleView alloc] initWithFrame:CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, JXheightForHeaderInSection)]; - self.categoryView.titles = self.titles; - self.categoryView.backgroundColor = [UIColor whiteColor]; - self.categoryView.delegate = self; - self.categoryView.titleSelectedColor = [UIColor colorWithRed:105/255.0 green:144/255.0 blue:239/255.0 alpha:1]; - self.categoryView.titleColor = [UIColor blackColor]; - self.categoryView.titleColorGradientEnabled = YES; - self.categoryView.titleLabelZoomEnabled = YES; - self.categoryView.contentScrollViewClickTransitionAnimationEnabled = NO; - - JXCategoryIndicatorLineView *lineView = [[JXCategoryIndicatorLineView alloc] init]; - lineView.indicatorColor = [UIColor colorWithRed:105/255.0 green:144/255.0 blue:239/255.0 alpha:1]; - lineView.indicatorWidth = 30; - self.categoryView.indicators = @[lineView]; _pagerView = [self preferredPagingView]; self.pagerView.mainTableView.gestureDelegate = self; [self.view addSubview:self.pagerView]; - self.categoryView.listContainer = (id)self.pagerView.listContainerView; + self.myCategoryView.listContainer = (id)self.pagerView.listContainerView; //导航栏隐藏的情况,处理扣边返回,下面的代码要加上 // [self.pagerView.listContainerView.scrollView.panGestureRecognizer requireGestureRecognizerToFail:self.navigationController.interactivePopGestureRecognizer]; @@ -94,11 +98,6 @@ static const CGFloat JXheightForHeaderInSection = 50; naviTitleLabel.frame = CGRectMake(0, KB_STATUSBAR_HEIGHT, self.view.bounds.size.width, 44); [self.naviBGView addSubview:naviTitleLabel]; -// UIButton *back = [UIButton buttonWithType:UIButtonTypeSystem]; -// [back setTitle:@"返回" forState:UIControlStateNormal]; -// back.frame = CGRectMake(12, KB_STATUSBAR_HEIGHT, 44, 44); -// [back addTarget:self action:@selector(backButtonClicked:) forControlEvents:UIControlEventTouchUpInside]; -// [self.naviBGView addSubview:back]; [self.view addSubview:self.closeButton]; [self.closeButton mas_makeConstraints:^(MASConstraintMaker *make) { @@ -106,12 +105,14 @@ static const CGFloat JXheightForHeaderInSection = 50; make.left.equalTo(self.view).offset(15); make.width.height.mas_equalTo(36); }]; + + self.pagerView.mainTableView.backgroundColor = [UIColor colorWithHex:0xF6F7FB]; } - (void)viewDidAppear:(BOOL)animated { [super viewDidAppear:animated]; - self.navigationController.interactivePopGestureRecognizer.enabled = (self.categoryView.selectedIndex == 0); + self.navigationController.interactivePopGestureRecognizer.enabled = (self.myCategoryView.selectedIndex == 0); } - (void)viewWillDisappear:(BOOL)animated { @@ -145,12 +146,12 @@ static const CGFloat JXheightForHeaderInSection = 50; } - (UIView *)viewForPinSectionHeaderInPagerView:(JXPagerView *)pagerView { - return self.categoryView; + return self.myCategoryView; } - (NSInteger)numberOfListsInPagerView:(JXPagerView *)pagerView { //和categoryView的item数量一致 - return self.categoryView.titles.count; + return 2; } - (id)pagerView:(JXPagerView *)pagerView initListAtIndex:(NSInteger)index { @@ -174,7 +175,7 @@ static const CGFloat JXheightForHeaderInSection = 50; - (BOOL)mainTableViewGestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer { //禁止categoryView左右滑动的时候,上下和左右都可以滚动 - if (otherGestureRecognizer == self.categoryView.collectionView.panGestureRecognizer) { + if (otherGestureRecognizer == self.myCategoryView.collectionView.panGestureRecognizer) { return NO; } return [gestureRecognizer isKindOfClass:[UIPanGestureRecognizer class]] && [otherGestureRecognizer isKindOfClass:[UIPanGestureRecognizer class]];