1
@@ -52,6 +52,7 @@
|
||||
047C65582EBCC06D0035E841 /* HomeRankCardCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 047C65572EBCC06D0035E841 /* HomeRankCardCell.m */; };
|
||||
047C655C2EBCD0F80035E841 /* UIView+KBShadow.m in Sources */ = {isa = PBXBuildFile; fileRef = 047C655B2EBCD08E0035E841 /* UIView+KBShadow.m */; };
|
||||
047C655E2EBCD5B20035E841 /* UIImage+KBColor.m in Sources */ = {isa = PBXBuildFile; fileRef = 047C655D2EBCD5B20035E841 /* UIImage+KBColor.m */; };
|
||||
048908BC2EBE1FCB00FABA60 /* BaseViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 048908BB2EBE1FCB00FABA60 /* BaseViewController.m */; };
|
||||
04A9FE0F2EB481100020DB6D /* KBHUD.m in Sources */ = {isa = PBXBuildFile; fileRef = 04FC97082EB31B14007BD342 /* KBHUD.m */; };
|
||||
04A9FE132EB4D0D20020DB6D /* KBFullAccessManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 04A9FE112EB4D0D20020DB6D /* KBFullAccessManager.m */; };
|
||||
04A9FE162EB873C80020DB6D /* UIViewController+Extension.m in Sources */ = {isa = PBXBuildFile; fileRef = 04A9FE152EB873C80020DB6D /* UIViewController+Extension.m */; };
|
||||
@@ -194,6 +195,8 @@
|
||||
047C655B2EBCD08E0035E841 /* UIView+KBShadow.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "UIView+KBShadow.m"; sourceTree = "<group>"; };
|
||||
047C655C2EBCD5B20035E841 /* UIImage+KBColor.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "UIImage+KBColor.h"; sourceTree = "<group>"; };
|
||||
047C655D2EBCD5B20035E841 /* UIImage+KBColor.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "UIImage+KBColor.m"; sourceTree = "<group>"; };
|
||||
048908BA2EBE1FCB00FABA60 /* BaseViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BaseViewController.h; sourceTree = "<group>"; };
|
||||
048908BB2EBE1FCB00FABA60 /* BaseViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BaseViewController.m; sourceTree = "<group>"; };
|
||||
04A9A67D2EB9E1690023B8F4 /* KBResponderUtils.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KBResponderUtils.h; sourceTree = "<group>"; };
|
||||
04A9FE102EB4D0D20020DB6D /* KBFullAccessManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KBFullAccessManager.h; sourceTree = "<group>"; };
|
||||
04A9FE112EB4D0D20020DB6D /* KBFullAccessManager.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = KBFullAccessManager.m; sourceTree = "<group>"; };
|
||||
@@ -738,6 +741,8 @@
|
||||
04FC95C82EB1E4C9007BD342 /* BaseNavigationController.m */,
|
||||
04FC95CA2EB1E780007BD342 /* BaseTabBarController.h */,
|
||||
04FC95CB2EB1E780007BD342 /* BaseTabBarController.m */,
|
||||
048908BA2EBE1FCB00FABA60 /* BaseViewController.h */,
|
||||
048908BB2EBE1FCB00FABA60 /* BaseViewController.m */,
|
||||
);
|
||||
path = VC;
|
||||
sourceTree = "<group>";
|
||||
@@ -1171,6 +1176,7 @@
|
||||
04FC95F12EB339A7007BD342 /* LoginViewController.m in Sources */,
|
||||
04FC96142EB34E00007BD342 /* KBLoginSheetViewController.m in Sources */,
|
||||
04A9FE1B2EB892460020DB6D /* KBLocalizationManager.m in Sources */,
|
||||
048908BC2EBE1FCB00FABA60 /* BaseViewController.m in Sources */,
|
||||
04FC95D72EB1EA16007BD342 /* BaseTableView.m in Sources */,
|
||||
0477BDF32EBB7B850055D639 /* KBDirectionIndicatorView.m in Sources */,
|
||||
04FC95D82EB1EA16007BD342 /* BaseCell.m in Sources */,
|
||||
|
||||
22
keyBoard/Assets.xcassets/Home/hoem_love_key.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "hoem_love_key@2x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "hoem_love_key@3x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
BIN
keyBoard/Assets.xcassets/Home/hoem_love_key.imageset/hoem_love_key@2x.png
vendored
Normal file
|
After Width: | Height: | Size: 185 KiB |
BIN
keyBoard/Assets.xcassets/Home/hoem_love_key.imageset/hoem_love_key@3x.png
vendored
Normal file
|
After Width: | Height: | Size: 380 KiB |
22
keyBoard/Assets.xcassets/Home/home_ai_icon.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "home_ai_icon@2x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "home_ai_icon@3x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
BIN
keyBoard/Assets.xcassets/Home/home_ai_icon.imageset/home_ai_icon@2x.png
vendored
Normal file
|
After Width: | Height: | Size: 9.4 KiB |
BIN
keyBoard/Assets.xcassets/Home/home_ai_icon.imageset/home_ai_icon@3x.png
vendored
Normal file
|
After Width: | Height: | Size: 18 KiB |
22
keyBoard/Assets.xcassets/Home/home_chat_icon.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "home_chat_icon@2x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "home_chat_icon@3x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
BIN
keyBoard/Assets.xcassets/Home/home_chat_icon.imageset/home_chat_icon@2x.png
vendored
Normal file
|
After Width: | Height: | Size: 8.2 KiB |
BIN
keyBoard/Assets.xcassets/Home/home_chat_icon.imageset/home_chat_icon@3x.png
vendored
Normal file
|
After Width: | Height: | Size: 16 KiB |
22
keyBoard/Assets.xcassets/Home/home_emotion_icon.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "home_emotion_icon@2x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "home_emotion_icon@3x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
BIN
keyBoard/Assets.xcassets/Home/home_emotion_icon.imageset/home_emotion_icon@2x.png
vendored
Normal file
|
After Width: | Height: | Size: 9.3 KiB |
BIN
keyBoard/Assets.xcassets/Home/home_emotion_icon.imageset/home_emotion_icon@3x.png
vendored
Normal file
|
After Width: | Height: | Size: 18 KiB |
22
keyBoard/Assets.xcassets/Home/home_keyboard_icon.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "home_keyboard_icon@2x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "home_keyboard_icon@3x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
BIN
keyBoard/Assets.xcassets/Home/home_keyboard_icon.imageset/home_keyboard_icon@2x.png
vendored
Normal file
|
After Width: | Height: | Size: 12 KiB |
BIN
keyBoard/Assets.xcassets/Home/home_keyboard_icon.imageset/home_keyboard_icon@3x.png
vendored
Normal file
|
After Width: | Height: | Size: 25 KiB |
22
keyBoard/Assets.xcassets/Home/home_topvip_icon.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "home_topvip_icon@2x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "home_topvip_icon@3x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
BIN
keyBoard/Assets.xcassets/Home/home_topvip_icon.imageset/home_topvip_icon@2x.png
vendored
Normal file
|
After Width: | Height: | Size: 117 KiB |
BIN
keyBoard/Assets.xcassets/Home/home_topvip_icon.imageset/home_topvip_icon@3x.png
vendored
Normal file
|
After Width: | Height: | Size: 211 KiB |
16
keyBoard/Class/Base/VC/BaseViewController.h
Normal file
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// BaseViewController.h
|
||||
// keyBoard
|
||||
//
|
||||
// Created by Mac on 2025/11/7.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface BaseViewController : UIViewController
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
32
keyBoard/Class/Base/VC/BaseViewController.m
Normal file
@@ -0,0 +1,32 @@
|
||||
//
|
||||
// BaseViewController.m
|
||||
// keyBoard
|
||||
//
|
||||
// Created by Mac on 2025/11/7.
|
||||
//
|
||||
|
||||
#import "BaseViewController.h"
|
||||
|
||||
@interface BaseViewController ()
|
||||
|
||||
@end
|
||||
|
||||
@implementation BaseViewController
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
// Do any additional setup after loading the view.
|
||||
self.view.backgroundColor = [UIColor whiteColor];
|
||||
}
|
||||
|
||||
/*
|
||||
#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
|
||||
@@ -11,6 +11,8 @@
|
||||
|
||||
|
||||
@interface HomeHeadView()
|
||||
@property (nonatomic, strong) UIImageView *loveKeyImageView;
|
||||
|
||||
// 顶部会员卡图片
|
||||
@property (nonatomic, strong) UIImageView *vipImageView;
|
||||
// 主/副标题
|
||||
@@ -43,6 +45,7 @@
|
||||
|
||||
#pragma mark - UI
|
||||
- (void)setupViews {
|
||||
// [self addSubview:self.loveKeyImageView];
|
||||
[self addSubview:self.vipImageView];
|
||||
[self addSubview:self.titleLabel];
|
||||
[self addSubview:self.subTitleLabel];
|
||||
@@ -58,6 +61,13 @@
|
||||
make.width.mas_equalTo(217);
|
||||
make.height.mas_equalTo(166);
|
||||
}];
|
||||
|
||||
// [self.loveKeyImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
// make.top.equalTo(self.vipImageView.mas_centerY).offset(0);
|
||||
// make.right.equalTo(self).offset(-16);
|
||||
// make.width.mas_equalTo(335);
|
||||
// make.height.mas_equalTo(117);
|
||||
// }];
|
||||
|
||||
// 主标题
|
||||
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
@@ -82,7 +92,7 @@
|
||||
make.top.equalTo(self.subTitleLabel.mas_bottom).offset(16);
|
||||
make.left.equalTo(self.mas_left).offset(16);
|
||||
make.right.equalTo(self.mas_right).offset(-16);
|
||||
make.height.mas_equalTo(94);
|
||||
make.height.mas_equalTo(80);
|
||||
}];
|
||||
|
||||
// 四个按钮等宽分布
|
||||
@@ -128,7 +138,11 @@
|
||||
@"Personalized\nKeyboard",
|
||||
@"Chat\nPersona",
|
||||
@"Emotional\nCounseling"];
|
||||
[self configureFeatureTitles:titles images:nil];
|
||||
NSArray *images = @[[UIImage imageNamed:@"home_ai_icon"],
|
||||
[UIImage imageNamed:@"home_keyboard_icon"],
|
||||
[UIImage imageNamed:@"home_chat_icon"],
|
||||
[UIImage imageNamed:@"home_emotion_icon"]];
|
||||
[self configureFeatureTitles:titles images:images];
|
||||
}
|
||||
|
||||
#pragma mark - Public
|
||||
@@ -141,21 +155,6 @@
|
||||
btn.textLabel.text = titles[i];
|
||||
}
|
||||
UIImage *img = (i < images.count) ? images[i] : nil;
|
||||
if (!img) {
|
||||
// 生成一张柔和的渐变占位图
|
||||
CGSize s = btn.iconSize;
|
||||
CGFloat cr = MIN(s.width, s.height) * 0.26;
|
||||
UIColor *c1 = [UIColor colorWithHex:0xC9F7E9];
|
||||
UIColor *c2 = [UIColor colorWithHex:0xA6E6FF];
|
||||
if (i == 1) { c1 = [UIColor colorWithHex:0xD7E5FF]; c2 = [UIColor colorWithHex:0xBFD2FF]; }
|
||||
if (i == 2) { c1 = [UIColor colorWithHex:0xEBD8FF]; c2 = [UIColor colorWithHex:0xDDBBFF]; }
|
||||
if (i == 3) { c1 = [UIColor colorWithHex:0xD1F5DE]; c2 = [UIColor colorWithHex:0xB6EBCE]; }
|
||||
img = [UIImage kb_gradientImageWithColors:@[c1, c2]
|
||||
locations:nil
|
||||
size:s
|
||||
direction:KBGradientDirectionLeftTopToRightBottom
|
||||
cornerRadius:cr];
|
||||
}
|
||||
btn.iconView.image = img;
|
||||
}
|
||||
}
|
||||
@@ -169,12 +168,19 @@
|
||||
- (UIImageView *)vipImageView{
|
||||
if (!_vipImageView) {
|
||||
_vipImageView = [[UIImageView alloc] init];
|
||||
_vipImageView.image = [UIImage imageNamed:@"home_vip_card"];
|
||||
_vipImageView.image = [UIImage imageNamed:@"home_topvip_icon"];
|
||||
_vipImageView.contentMode = UIViewContentModeScaleAspectFit;
|
||||
_vipImageView.backgroundColor = [UIColor redColor];
|
||||
}
|
||||
return _vipImageView;
|
||||
}
|
||||
- (UIImageView *)loveKeyImageView{
|
||||
if (!_loveKeyImageView) {
|
||||
_loveKeyImageView = [[UIImageView alloc] init];
|
||||
_loveKeyImageView.image = [UIImage imageNamed:@"hoem_love_key"];
|
||||
_loveKeyImageView.contentMode = UIViewContentModeScaleAspectFit;
|
||||
}
|
||||
return _loveKeyImageView;
|
||||
}
|
||||
|
||||
- (UILabel *)titleLabel {
|
||||
if (!_titleLabel) {
|
||||
@@ -206,8 +212,8 @@
|
||||
NSMutableArray *arr = [NSMutableArray arrayWithCapacity:4];
|
||||
for (int i = 0; i < 4; i++) {
|
||||
KBTopImageButton *btn = [[KBTopImageButton alloc] init];
|
||||
btn.iconSize = CGSizeMake(46, 46);
|
||||
btn.spacing = 5;
|
||||
btn.iconSize = CGSizeMake(54, 44);
|
||||
btn.spacing = 0;
|
||||
[self.featuresContainer addSubview:btn];
|
||||
[arr addObject:btn];
|
||||
}
|
||||
|
||||
@@ -39,14 +39,14 @@
|
||||
[self.avatarView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.equalTo(self.rankLabel.mas_right).offset(12);
|
||||
make.centerY.equalTo(self.contentView);
|
||||
make.width.height.mas_equalTo(52);
|
||||
make.width.height.mas_equalTo(56);
|
||||
}];
|
||||
|
||||
[self.actionButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerY.equalTo(self.contentView);
|
||||
make.right.equalTo(self.contentView).offset(-16);
|
||||
make.width.mas_equalTo(64);
|
||||
make.height.mas_equalTo(36);
|
||||
make.width.mas_equalTo(56);
|
||||
make.height.mas_equalTo(38);
|
||||
}];
|
||||
|
||||
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
@@ -104,8 +104,8 @@
|
||||
- (UILabel *)titleLabel {
|
||||
if (!_titleLabel) {
|
||||
_titleLabel = [[UILabel alloc] init];
|
||||
_titleLabel.font = [UIFont systemFontOfSize:18 weight:UIFontWeightSemibold];
|
||||
_titleLabel.textColor = [UIColor colorWithWhite:0.1 alpha:1];
|
||||
_titleLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightSemibold];
|
||||
_titleLabel.textColor = [UIColor colorWithHex:0x1B1F1A];
|
||||
}
|
||||
return _titleLabel;
|
||||
}
|
||||
@@ -113,9 +113,9 @@
|
||||
- (UILabel *)subLabel {
|
||||
if (!_subLabel) {
|
||||
_subLabel = [[UILabel alloc] init];
|
||||
_subLabel.font = [UIFont systemFontOfSize:13];
|
||||
_subLabel.textColor = [UIColor colorWithWhite:0.5 alpha:1];
|
||||
_subLabel.numberOfLines = 1;
|
||||
_subLabel.font = [UIFont systemFontOfSize:12];
|
||||
_subLabel.textColor = [UIColor colorWithHex:0x9A9A9A];
|
||||
_subLabel.numberOfLines = 2;
|
||||
}
|
||||
return _subLabel;
|
||||
}
|
||||
@@ -123,7 +123,7 @@
|
||||
- (UIButton *)actionButton {
|
||||
if (!_actionButton) {
|
||||
_actionButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
_actionButton.layer.cornerRadius = 18;
|
||||
_actionButton.layer.cornerRadius = 12;
|
||||
_actionButton.layer.masksToBounds = YES;
|
||||
_actionButton.titleLabel.font = [UIFont systemFontOfSize:20 weight:UIFontWeightBold];
|
||||
}
|
||||
|
||||
@@ -45,7 +45,8 @@
|
||||
// 该背景色会被 HWPanModal 用来设置容器的 _contentView 背景色
|
||||
// 参考 Pods/HWPanModal/Sources/View/PanModal/HWPanModalContainerView.m: adjustPanContainerBackgroundColor
|
||||
// 想要改变外层白色底(截图中 _contentView)的颜色,只需改这里即可
|
||||
self.backgroundColor = [UIColor colorWithHex:0xE8FFF4]; // 柔和的绿色
|
||||
// self.backgroundColor = [UIColor colorWithHex:0xE8FFF4]; // 柔和的绿色
|
||||
self.backgroundColor = [UIColor clearColor];
|
||||
// HWBackgroundConfig *config = [HWBackgroundConfig configWithBehavior:HWBackgroundBehaviorDefault];
|
||||
// config.backgroundAlpha = 0;
|
||||
// [self.hw_dimmedView reloadConfig:config];
|
||||
@@ -180,11 +181,11 @@
|
||||
|
||||
[self.leftBgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.top.equalTo(self.secWhiteContentView);
|
||||
make.bottom.equalTo(self.secWhiteContentView);
|
||||
// make.bottom.equalTo(self.secWhiteContentView);
|
||||
}];
|
||||
[self.rightBgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.top.equalTo(self.secWhiteContentView);
|
||||
make.bottom.equalTo(self.secWhiteContentView);
|
||||
// make.bottom.equalTo(self.secWhiteContentView);
|
||||
}];
|
||||
|
||||
|
||||
@@ -231,7 +232,7 @@
|
||||
[self.topBar addSubview:self.underlineImageView];
|
||||
|
||||
// Masonry 约束
|
||||
CGFloat topPadding = 0; // 与顶部小指示器留点空间
|
||||
CGFloat topPadding = 12; // 与顶部小指示器留点空间
|
||||
[self.topBar mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.equalTo(self.secWhiteContentView);
|
||||
make.top.equalTo(self.secWhiteContentView).offset(topPadding);
|
||||
@@ -259,14 +260,14 @@
|
||||
|
||||
[self.containerView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.equalTo(self.topBar.mas_bottom).offset(8);
|
||||
make.left.right.equalTo(self.secWhiteContentView).inset(16);
|
||||
make.left.right.equalTo(self.secWhiteContentView).inset(20);
|
||||
make.bottom.equalTo(self.secWhiteContentView);
|
||||
}];
|
||||
|
||||
[self.personImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
// 仍按页面整体的左右边距定位,保持与改层级前的视觉一致
|
||||
make.left.equalTo(self).offset(46);
|
||||
make.bottom.equalTo(self.topBar.mas_top).offset(20);
|
||||
make.bottom.equalTo(self.topBar.mas_top).offset(11);
|
||||
make.width.mas_equalTo(53);
|
||||
make.height.mas_equalTo(81);
|
||||
}];
|
||||
@@ -283,7 +284,7 @@
|
||||
#pragma mark - Action
|
||||
|
||||
- (void)onTapTopButton:(UIButton *)sender {
|
||||
[self switchToIndex:sender.tag animated:YES];
|
||||
[self switchToIndex:sender.tag animated:false];
|
||||
// [self hw_panModalSetNeedsLayoutUpdate];
|
||||
}
|
||||
|
||||
@@ -318,7 +319,6 @@
|
||||
// 添加目标
|
||||
// [self addChildViewController:target];
|
||||
[self.containerView addSubview:target.view];
|
||||
target.view.backgroundColor = [UIColor colorWithWhite:0.98 alpha:1];
|
||||
[target.view mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.top.right.equalTo(self.containerView);
|
||||
make.bottom.equalTo(self.containerView).offset(-KB_TABBAR_HEIGHT);
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
[self.cardImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.equalTo(self.avatarCircleView.mas_bottom).offset(-34); // 顶部悬浮重叠
|
||||
make.left.right.equalTo(self);
|
||||
make.height.mas_equalTo(KBFit(148));
|
||||
make.height.mas_equalTo(KBFit(158));
|
||||
}];
|
||||
|
||||
|
||||
@@ -129,6 +129,9 @@
|
||||
@property (nonatomic, strong) KBTopThreeCardView *rightCard;
|
||||
/// 统一的底部加号按钮(移出卡片,放到 KBTopThreeView)
|
||||
@property (nonatomic, strong) UIButton *plusButton;
|
||||
/// 左右卡片底部也有 plus 按钮
|
||||
@property (nonatomic, strong) UIButton *leftPlusButton;
|
||||
@property (nonatomic, strong) UIButton *rightPlusButton;
|
||||
@end
|
||||
|
||||
@implementation KBTopThreeView
|
||||
@@ -146,6 +149,8 @@
|
||||
[self addSubview:self.centerCard];
|
||||
[self addSubview:self.rightCard];
|
||||
[self addSubview:self.plusButton];
|
||||
[self addSubview:self.leftPlusButton];
|
||||
[self addSubview:self.rightPlusButton];
|
||||
|
||||
// 横向均分布局
|
||||
[self.centerCard mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
@@ -173,11 +178,25 @@
|
||||
// 用 plusButton 来“撑起”本视图,且底部对齐
|
||||
[self.plusButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.equalTo(self.centerCard.mas_bottom).offset(12);
|
||||
make.centerX.equalTo(self);
|
||||
make.width.mas_equalTo(52);
|
||||
make.centerX.equalTo(self); // 或改为 equalTo(self.centerCard) 以严格与中卡居中
|
||||
make.width.mas_equalTo(60);
|
||||
make.height.mas_equalTo(28);
|
||||
make.bottom.equalTo(self).offset(-8);
|
||||
}];
|
||||
|
||||
// 左右 plus 按钮,同样底部对齐,用它们一起撑起视图
|
||||
[self.leftPlusButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.equalTo(self.leftCard.mas_bottom).offset(12);
|
||||
make.centerX.equalTo(self.leftCard);
|
||||
make.width.height.equalTo(self.plusButton);
|
||||
make.bottom.equalTo(self).offset(-8);
|
||||
}];
|
||||
[self.rightPlusButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.equalTo(self.rightCard.mas_bottom).offset(12);
|
||||
make.centerX.equalTo(self.rightCard);
|
||||
make.width.height.equalTo(self.plusButton);
|
||||
make.bottom.equalTo(self).offset(-8);
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)configWithItems:(NSArray<NSDictionary *> *)items {
|
||||
@@ -214,4 +233,30 @@
|
||||
return _plusButton;
|
||||
}
|
||||
|
||||
- (UIButton *)leftPlusButton {
|
||||
if (!_leftPlusButton) {
|
||||
_leftPlusButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[_leftPlusButton setTitle:@"+" forState:UIControlStateNormal];
|
||||
[_leftPlusButton setTitleColor:[UIColor colorWithRed:0.20 green:0.65 blue:0.50 alpha:1.0] forState:UIControlStateNormal];
|
||||
_leftPlusButton.titleLabel.font = [UIFont systemFontOfSize:18 weight:UIFontWeightSemibold];
|
||||
_leftPlusButton.layer.cornerRadius = 14.0;
|
||||
_leftPlusButton.layer.masksToBounds = YES;
|
||||
_leftPlusButton.backgroundColor = [[UIColor colorWithRed:0.20 green:0.65 blue:0.50 alpha:1.0] colorWithAlphaComponent:0.15];
|
||||
}
|
||||
return _leftPlusButton;
|
||||
}
|
||||
|
||||
- (UIButton *)rightPlusButton {
|
||||
if (!_rightPlusButton) {
|
||||
_rightPlusButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[_rightPlusButton setTitle:@"+" forState:UIControlStateNormal];
|
||||
[_rightPlusButton setTitleColor:[UIColor colorWithRed:0.20 green:0.65 blue:0.50 alpha:1.0] forState:UIControlStateNormal];
|
||||
_rightPlusButton.titleLabel.font = [UIFont systemFontOfSize:18 weight:UIFontWeightSemibold];
|
||||
_rightPlusButton.layer.cornerRadius = 14.0;
|
||||
_rightPlusButton.layer.masksToBounds = YES;
|
||||
_rightPlusButton.backgroundColor = [[UIColor colorWithRed:0.20 green:0.65 blue:0.50 alpha:1.0] colorWithAlphaComponent:0.15];
|
||||
}
|
||||
return _rightPlusButton;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface HomeHotVC : UIViewController
|
||||
@interface HomeHotVC : BaseViewController
|
||||
// 列表
|
||||
@property (nonatomic, strong) BaseTableView *tableView;
|
||||
@end
|
||||
|
||||
@@ -29,8 +29,6 @@
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
self.view.backgroundColor = [UIColor whiteColor];
|
||||
|
||||
// 构建数据(演示)
|
||||
self.dataSource = @[
|
||||
@{@"rank":@4, @"title":@"Ambiguous", @"sub":@"Be Neither Too Close Nor Too Distant, Want To ...", @"joined":@NO},
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#import "JXCategoryListContainerView.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface HomeRankVC : UIViewController<JXCategoryListContainerViewDelegate>
|
||||
@interface HomeRankVC : BaseViewController<JXCategoryListContainerViewDelegate>
|
||||
// 列表
|
||||
@property (nonatomic, strong) UICollectionView *collectionView;
|
||||
@end
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
- (void)viewDidLoad {
|
||||
[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];
|
||||
|
||||
@@ -33,6 +33,8 @@
|
||||
#import "BaseNavigationController.h"
|
||||
#import "BaseTableView.h"
|
||||
#import "BaseCell.h"
|
||||
#import "BaseViewController.h"
|
||||
|
||||
#import "KBLocalizationManager.h" // 全局多语言封装
|
||||
|
||||
|
||||
|
||||