This commit is contained in:
2025-11-06 19:19:12 +08:00
parent a75afbe4c1
commit 6ba1339c0b
195 changed files with 13443 additions and 2729 deletions

View File

@@ -9,6 +9,9 @@
#import "HomeVC.h"
#import "HomeMainVC.h"
#import "MyVC.h"
#import "KBShopVC.h"
#import "KBCommunityVC.h"
#import "BaseNavigationController.h"
#import "KBAuthManager.h"
@interface BaseTabBarController ()

View File

@@ -0,0 +1,16 @@
//
// KBCommunityVC.h
// keyBoard
//
// Created by Mac on 2025/11/6.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface KBCommunityVC : UIViewController
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,31 @@
//
// KBCommunityVC.m
// keyBoard
//
// Created by Mac on 2025/11/6.
//
#import "KBCommunityVC.h"
@interface KBCommunityVC ()
@end
@implementation KBCommunityVC
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
@end

View File

@@ -23,6 +23,8 @@
@property (nonatomic, strong) UIViewController *currentChild;
@property (nonatomic, strong) HomeHotVC *hotVC;
@property (nonatomic, strong) HomeRankVC *rankVC;
@property (nonatomic, assign) NSInteger currentIndex;
@end
@implementation KBPanModalView
@@ -83,6 +85,10 @@
return NO; // short
}
- (CGFloat)topOffset{
return 0.001;
}
/// 穿
- (BOOL)allowsTouchEventsPassingThroughTransitionView {
return YES;
@@ -94,7 +100,10 @@
- (UIScrollView *)panScrollable {
return self.hotVC.tableView;
if (self.currentIndex == 0) {
return self.hotVC.tableView;
}
return self.rankVC.tableView;
}
//
@@ -130,7 +139,7 @@
self.topBar.backgroundColor = [UIColor colorWithWhite:1 alpha:0.9];
[self addSubview:self.topBar];
//
self.topBar.alpha = 0.0;
// self.topBar.alpha = 0.0;
//
self.hotButton = [UIButton buttonWithType:UIButtonTypeCustom];
@@ -200,12 +209,13 @@
- (void)onTapTopButton:(UIButton *)sender {
[self switchToIndex:sender.tag animated:YES];
[self hw_panModalSetNeedsLayoutUpdate];
// [self hw_panModalSetNeedsLayoutUpdate];
}
#pragma mark - Switch Child
- (void)switchToIndex:(NSInteger)index animated:(BOOL)animated {
self.currentIndex = index;
UIViewController *target = (index == 0) ? self.hotVC : self.rankVC;
if (!target) {
if (index == 0) {
@@ -235,11 +245,11 @@
[self.containerView addSubview:target.view];
target.view.backgroundColor = [UIColor colorWithWhite:0.98 alpha:1];
[target.view mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(self.containerView);
make.left.top.right.equalTo(self.containerView);
make.bottom.equalTo(self.containerView).offset(-KB_TABBAR_HEIGHT);
}];
[target didMoveToParentViewController:self];
// [target didMoveToParentViewController:self];
self.currentChild = target;
[self updateButtonStateForIndex:index animated:animated];
}

View File

@@ -0,0 +1,18 @@
//
// HomeRankContentVC.h
// keyBoard
//
// Created by Mac on 2025/11/6.
//
#import <UIKit/UIKit.h>
#import "JXCategoryListContainerView.h"
NS_ASSUME_NONNULL_BEGIN
@interface HomeRankContentVC : UIViewController<JXCategoryListContentViewDelegate>
@property (nonatomic, strong) BaseTableView *tableView;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,96 @@
//
// HomeRankContentVC.m
// keyBoard
//
// Created by Mac on 2025/11/6.
//
#import "HomeRankContentVC.h"
#import "HomeHotCell.h"
@interface HomeRankContentVC () <UITableViewDataSource, UITableViewDelegate>
@property (nonatomic, strong) NSArray<NSDictionary *> *dataSource; //
@end
@implementation HomeRankContentVC
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
//
self.dataSource = @[
@{@"rank":@4, @"title":@"Ambiguous", @"sub":@"Be Neither Too Close Nor Too Distant, Want To ...", @"joined":@NO},
@{@"rank":@5, @"title":@"Ambiguous", @"sub":@"Be Neither Too Close Nor Too Distant, Want To ...", @"joined":@YES},
@{@"rank":@6, @"title":@"Ambiguous", @"sub":@"Be Neither Too Close Nor Too Distant, Want To ...", @"joined":@NO},
@{@"rank":@7, @"title":@"Ambiguous", @"sub":@"Be Neither Too Close Nor Too Distant, Want To ...", @"joined":@NO},
@{@"rank":@4, @"title":@"Ambiguous", @"sub":@"Be Neither Too Close Nor Too Distant, Want To ...", @"joined":@NO},
@{@"rank":@5, @"title":@"Ambiguous", @"sub":@"Be Neither Too Close Nor Too Distant, Want To ...", @"joined":@YES},
@{@"rank":@6, @"title":@"Ambiguous", @"sub":@"Be Neither Too Close Nor Too Distant, Want To ...", @"joined":@NO},
@{@"rank":@7, @"title":@"Ambiguous", @"sub":@"Be Neither Too Close Nor Too Distant, Want To ...", @"joined":@NO},
@{@"rank":@4, @"title":@"Ambiguous", @"sub":@"Be Neither Too Close Nor Too Distant, Want To ...", @"joined":@NO},
@{@"rank":@5, @"title":@"Ambiguous", @"sub":@"Be Neither Too Close Nor Too Distant, Want To ...", @"joined":@YES},
@{@"rank":@6, @"title":@"Ambiguous", @"sub":@"Be Neither Too Close Nor Too Distant, Want To ...", @"joined":@NO},
@{@"rank":@7, @"title":@"Ambiguous", @"sub":@"Be Neither Too Close Nor Too Distant, Want To ...", @"joined":@NO}
];
//
self.view.backgroundColor = COLOR_WITH_RGB(arc4random()%255/255.0, arc4random()%255/255.0, arc4random()%255/255.0, 1);
[self.view addSubview:self.tableView];
[self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.top.right.equalTo(self.view);
make.bottom.equalTo(self.view);
}];
}
#pragma mark - UITableViewDataSource
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return self.dataSource.count;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
HomeHotCell *cell = [tableView dequeueReusableCellWithIdentifier:HomeHotCell.reuseId forIndexPath:indexPath];
NSDictionary *item = self.dataSource[indexPath.row];
// cell
[cell configWithRank:[item[@"rank"] integerValue]
title:item[@"title"]
subtitle:item[@"sub"]
joined:[item[@"joined"] boolValue]];
return cell;
}
#pragma mark - UITableViewDelegate
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
return 84.0;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
[tableView deselectRowAtIndexPath:indexPath animated:YES];
}
- (BaseTableView *)tableView {
if (!_tableView) {
// 使 BaseTableView
_tableView = [[BaseTableView alloc] initWithFrame:CGRectZero style:UITableViewStylePlain];
_tableView.dataSource = self;
_tableView.delegate = self;
_tableView.separatorStyle = UITableViewCellSeparatorStyleNone; // 线
_tableView.showsVerticalScrollIndicator = NO;
_tableView.contentInset = UIEdgeInsetsMake(8, 0, KB_SafeAreaBottom(), 0);
[_tableView registerClass:HomeHotCell.class forCellReuseIdentifier:HomeHotCell.reuseId];
}
return _tableView;
}
#pragma mark - JXCategoryListContentViewDelegate
/**
<JXCategoryListContentViewDelegate>
*/
- (UIView *)listView {
return self.view;
}
@end

View File

@@ -6,11 +6,13 @@
//
#import <UIKit/UIKit.h>
#import "JXCategoryView.h"
#import "JXCategoryListContainerView.h"
NS_ASSUME_NONNULL_BEGIN
@interface HomeRankVC : UIViewController
@interface HomeRankVC : UIViewController<JXCategoryListContainerViewDelegate>
// 列表
@property (nonatomic, strong) BaseTableView *tableView;
@end
NS_ASSUME_NONNULL_END

View File

@@ -6,8 +6,13 @@
//
#import "HomeRankVC.h"
#import "HomeRankContentVC.h"
@interface HomeRankVC ()
@interface HomeRankVC ()<JXCategoryViewDelegate>
@property (nonatomic, strong) NSArray *titles;
@property (nonatomic, strong) JXCategoryTitleImageView *myCategoryView;
@property (nonatomic, strong) JXCategoryListContainerView *listContainerView;
@property (nonatomic, assign) JXCategoryTitleImageType currentType;
@end
@@ -17,16 +22,124 @@
[super viewDidLoad];
// Do any additional setup after loading the view.
self.view.backgroundColor = [UIColor grayColor];
self.titles = @[@"螃蟹啊斯柯达积分卡", @"小龙虾", @"苹果", @"胡萝卜", @"葡萄", @"西瓜"];
[self.view addSubview:self.myCategoryView];
[self.view addSubview:self.listContainerView];
// self.listContainerView.scrollView.scrollEnabled = false;
NSArray *imageNames = @[@"crab", @"lobster", @"apple", @"carrot", @"grape", @"watermelon"];
NSArray *selectedImageNames = @[@"crab_selected", @"lobster_selected", @"apple_selected", @"carrot_selected", @"grape_selected", @"watermelon_selected"];
self.myCategoryView.titles = self.titles;
self.myCategoryView.imageInfoArray = 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.imageZoomScale = 1.3;
self.myCategoryView.averageCellSpacingEnabled = NO;
JXCategoryIndicatorLineView *lineView = [[JXCategoryIndicatorLineView alloc] init];
lineView.indicatorWidth = 20;
self.myCategoryView.indicators = @[lineView];
[self configCategoryViewWithType:JXCategoryTitleImageType_LeftImage];
}
/*
#pragma mark - Navigation
- (void)viewDidLayoutSubviews {
[super viewDidLayoutSubviews];
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
self.myCategoryView.frame = CGRectMake(0, 0, self.view.bounds.size.width, [self preferredCategoryViewHeight]);
self.listContainerView.frame = CGRectMake(0, [self preferredCategoryViewHeight], self.view.bounds.size.width, self.view.bounds.size.height - [self preferredCategoryViewHeight]);
}
//- (JXCategoryBaseView *)preferredCategoryView {
// return [[JXCategoryBaseView alloc] init];
//}
- (CGFloat)preferredCategoryViewHeight {
return 50;
}
- (void)configCategoryViewWithType:(JXCategoryTitleImageType)imageType {
self.currentType = imageType;
if ((NSInteger)imageType == 100) {
NSMutableArray *types = [NSMutableArray array];
for (int i = 0; i < self.titles.count; i++) {
if (i == 2) {
[types addObject:@(JXCategoryTitleImageType_OnlyImage)];
}else if (i == 4) {
[types addObject:@(JXCategoryTitleImageType_LeftImage)];
}else {
[types addObject:@(JXCategoryTitleImageType_OnlyTitle)];
}
}
self.myCategoryView.imageTypes = types;
}else {
NSMutableArray *types = [NSMutableArray array];
for (int i = 0; i < self.titles.count; i++) {
[types addObject:@(imageType)];
}
self.myCategoryView.imageTypes = types;
}
[self.myCategoryView reloadData];
}
//
- (JXCategoryTitleImageView *)myCategoryView {
if (!_myCategoryView) {
_myCategoryView = [[JXCategoryTitleImageView alloc] init];
_myCategoryView.delegate = self;
// !!!: categoryView
_myCategoryView.listContainer = self.listContainerView;
}
return _myCategoryView;
}
//
- (JXCategoryListContainerView *)listContainerView {
if (!_listContainerView) {
_listContainerView = [[JXCategoryListContainerView alloc] initWithType:JXCategoryListContainerType_ScrollView delegate:self];
}
return _listContainerView;
}
#pragma mark - JXCategoryViewDelegate
//
- (void)categoryView:(JXCategoryBaseView *)categoryView didSelectedItemAtIndex:(NSInteger)index {
NSLog(@"%@", NSStringFromSelector(_cmd));
self.
//
self.navigationController.interactivePopGestureRecognizer.enabled = (index == 0);
}
//
- (void)categoryView:(JXCategoryBaseView *)categoryView didScrollSelectedItemAtIndex:(NSInteger)index {
NSLog(@"%@", NSStringFromSelector(_cmd));
}
#pragma mark - JXCategoryListContainerViewDelegate
//
- (NSInteger)numberOfListsInlistContainerView:(JXCategoryListContainerView *)listContainerView {
return self.titles.count;
}
// <JXCategoryListContentViewDelegate>
- (id<JXCategoryListContentViewDelegate>)listContainerView:(JXCategoryListContainerView *)listContainerView initListForIndex:(NSInteger)index {
HomeRankContentVC *list = [[HomeRankContentVC alloc] init];
self.tableView = list.tableView;
return list;
}
#pragma mark - TitleImageSettingViewControllerDelegate
- (void)titleImageSettingVCDidSelectedImageType:(JXCategoryTitleImageType)imageType {
[self configCategoryViewWithType:imageType];
}
*/
@end

View File

@@ -26,12 +26,12 @@
// sheetVC
HomeSheetVC *vc = [[HomeSheetVC alloc] init];
// 使 true
if (KB_DEVICE_HAS_NOTCH) {
vc.minHeight = KB_SCREEN_HEIGHT - topV - 34;
}else{
// if (KB_DEVICE_HAS_NOTCH) {
// vc.minHeight = KB_SCREEN_HEIGHT - topV - 34;
// }else{
vc.minHeight = KB_SCREEN_HEIGHT - topV;
//
}
// }
vc.topInset = 100;
[self presentPanModal:vc];
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 174 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 155 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 156 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 228 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

@@ -0,0 +1,16 @@
//
// KBShopVC.h
// keyBoard
//
// Created by Mac on 2025/11/6.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface KBShopVC : UIViewController
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,31 @@
//
// KBShopVC.m
// keyBoard
//
// Created by Mac on 2025/11/6.
//
#import "KBShopVC.h"
@interface KBShopVC ()
@end
@implementation KBShopVC
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
@end