diff --git a/keyBoard/Assets.xcassets/Home/home_hg_icon.imageset/Contents.json b/keyBoard/Assets.xcassets/Home/home_hg_icon.imageset/Contents.json new file mode 100644 index 0000000..9411071 --- /dev/null +++ b/keyBoard/Assets.xcassets/Home/home_hg_icon.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "home_hg_icon@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "home_hg_icon@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/keyBoard/Assets.xcassets/Home/home_hg_icon.imageset/home_hg_icon@2x.png b/keyBoard/Assets.xcassets/Home/home_hg_icon.imageset/home_hg_icon@2x.png new file mode 100644 index 0000000..1cb0e2b Binary files /dev/null and b/keyBoard/Assets.xcassets/Home/home_hg_icon.imageset/home_hg_icon@2x.png differ diff --git a/keyBoard/Assets.xcassets/Home/home_hg_icon.imageset/home_hg_icon@3x.png b/keyBoard/Assets.xcassets/Home/home_hg_icon.imageset/home_hg_icon@3x.png new file mode 100644 index 0000000..1c68189 Binary files /dev/null and b/keyBoard/Assets.xcassets/Home/home_hg_icon.imageset/home_hg_icon@3x.png differ diff --git a/keyBoard/Assets.xcassets/Home/home_left_image.imageset/Contents.json b/keyBoard/Assets.xcassets/Home/home_left_image.imageset/Contents.json new file mode 100644 index 0000000..e32fee0 --- /dev/null +++ b/keyBoard/Assets.xcassets/Home/home_left_image.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "微信图片_20251107143422_215_763.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "微信图片_20251107143422_215_763 1.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/keyBoard/Assets.xcassets/Home/home_left_image.imageset/微信图片_20251107143422_215_763 1.png b/keyBoard/Assets.xcassets/Home/home_left_image.imageset/微信图片_20251107143422_215_763 1.png new file mode 100644 index 0000000..0886ec6 Binary files /dev/null and b/keyBoard/Assets.xcassets/Home/home_left_image.imageset/微信图片_20251107143422_215_763 1.png differ diff --git a/keyBoard/Assets.xcassets/Home/home_left_image.imageset/微信图片_20251107143422_215_763.png b/keyBoard/Assets.xcassets/Home/home_left_image.imageset/微信图片_20251107143422_215_763.png new file mode 100644 index 0000000..0886ec6 Binary files /dev/null and b/keyBoard/Assets.xcassets/Home/home_left_image.imageset/微信图片_20251107143422_215_763.png differ diff --git a/keyBoard/Assets.xcassets/Home/home_person_icon.imageset/Contents.json b/keyBoard/Assets.xcassets/Home/home_person_icon.imageset/Contents.json new file mode 100644 index 0000000..f018f56 --- /dev/null +++ b/keyBoard/Assets.xcassets/Home/home_person_icon.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "home_person_icon@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "home_person_icon@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/keyBoard/Assets.xcassets/Home/home_person_icon.imageset/home_person_icon@2x.png b/keyBoard/Assets.xcassets/Home/home_person_icon.imageset/home_person_icon@2x.png new file mode 100644 index 0000000..2481ac6 Binary files /dev/null and b/keyBoard/Assets.xcassets/Home/home_person_icon.imageset/home_person_icon@2x.png differ diff --git a/keyBoard/Assets.xcassets/Home/home_person_icon.imageset/home_person_icon@3x.png b/keyBoard/Assets.xcassets/Home/home_person_icon.imageset/home_person_icon@3x.png new file mode 100644 index 0000000..89cfb46 Binary files /dev/null and b/keyBoard/Assets.xcassets/Home/home_person_icon.imageset/home_person_icon@3x.png differ diff --git a/keyBoard/Assets.xcassets/Home/home_right_image.imageset/Contents.json b/keyBoard/Assets.xcassets/Home/home_right_image.imageset/Contents.json new file mode 100644 index 0000000..346861f --- /dev/null +++ b/keyBoard/Assets.xcassets/Home/home_right_image.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "微信图片_20251107143423_216_763.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "微信图片_20251107143423_216_763 1.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/keyBoard/Assets.xcassets/Home/home_right_image.imageset/微信图片_20251107143423_216_763 1.png b/keyBoard/Assets.xcassets/Home/home_right_image.imageset/微信图片_20251107143423_216_763 1.png new file mode 100644 index 0000000..65a3eda Binary files /dev/null and b/keyBoard/Assets.xcassets/Home/home_right_image.imageset/微信图片_20251107143423_216_763 1.png differ diff --git a/keyBoard/Assets.xcassets/Home/home_right_image.imageset/微信图片_20251107143423_216_763.png b/keyBoard/Assets.xcassets/Home/home_right_image.imageset/微信图片_20251107143423_216_763.png new file mode 100644 index 0000000..65a3eda Binary files /dev/null and b/keyBoard/Assets.xcassets/Home/home_right_image.imageset/微信图片_20251107143423_216_763.png differ diff --git a/keyBoard/Class/Home/V/KBPanModalView.m b/keyBoard/Class/Home/V/KBPanModalView.m index 38ff135..a0ac7d2 100644 --- a/keyBoard/Class/Home/V/KBPanModalView.m +++ b/keyBoard/Class/Home/V/KBPanModalView.m @@ -14,6 +14,13 @@ @property (nonatomic, strong) KBDirectionIndicatorView *indicator; // 顶部切换按钮与指示条 @property (nonatomic, strong) UIView *topBar; +@property (nonatomic, strong) UIView *contentView; +@property (nonatomic, strong) UIImageView *leftImageView; +@property (nonatomic, strong) UIImageView *rightImageView; +/// 皇冠👑 +@property (nonatomic, strong) UIImageView *hgImageView; + + @property (nonatomic, strong) UIButton *hotButton; @property (nonatomic, strong) UIButton *rankButton; @property (nonatomic, strong) UIView *underlineView; // 选中下划线 @@ -34,6 +41,30 @@ // HWBackgroundConfig *config = [HWBackgroundConfig configWithBehavior:HWBackgroundBehaviorDefault]; // config.backgroundAlpha = 0; // [self.hw_dimmedView reloadConfig:config]; + + // 添加容器 + [self addSubview:self.contentView]; + [self.contentView mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.right.equalTo(self).inset(16); + make.top.equalTo(self).offset(48); + make.bottom.equalTo(self); + }]; + + [self.contentView addSubview:self.leftImageView]; + [self.contentView addSubview:self.rightImageView]; + [self.leftImageView mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.right.equalTo(self.contentView); + make.top.equalTo(self.contentView); + make.height.mas_equalTo(79); + }]; + [self.rightImageView mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.right.equalTo(self.contentView); + make.top.equalTo(self.contentView); + make.height.equalTo(self.leftImageView); + + }]; + + // 顶部按钮 + 容器 [self setupTopButtonsAndContainer]; // 默认展示“热门” @@ -43,9 +74,9 @@ } - (HWBackgroundConfig *)backgroundConfig { -// return [HWBackgroundConfig configWithBehavior:HWBackgroundBehaviorSystemVisualEffect]; HWBackgroundConfig *config = [HWBackgroundConfig configWithBehavior:HWBackgroundBehaviorDefault]; config.backgroundAlpha = 0; + config.blurTintColor = [UIColor clearColor]; return config; } @@ -142,7 +173,7 @@ - (void)setupTopButtonsAndContainer { // 顶部栏 self.topBar = [[UIView alloc] init]; - self.topBar.backgroundColor = [UIColor colorWithWhite:1 alpha:0.9]; +// self.topBar.backgroundColor = [UIColor colorWithWhite:1 alpha:0.9]; [self addSubview:self.topBar]; // 首次展示时先隐藏,待转场完成后再淡入,避免“自底向上滑入”的错觉 // self.topBar.alpha = 0.0; @@ -174,12 +205,12 @@ // 容器视图 self.containerView = [[UIView alloc] init]; - self.containerView.backgroundColor = [UIColor whiteColor]; + self.containerView.backgroundColor = [UIColor redColor]; self.containerView.clipsToBounds = YES; [self addSubview:self.containerView]; // Masonry 约束 - CGFloat topPadding = 12; // 与顶部小指示器留点空间 + CGFloat topPadding = 47; // 与顶部小指示器留点空间 [self.topBar mas_makeConstraints:^(MASConstraintMaker *make) { make.left.right.equalTo(self); make.top.equalTo(self).offset(topPadding); @@ -280,4 +311,40 @@ [self.topBar layoutIfNeeded]; } } + +- (UIView *)contentView{ + if (!_contentView) { + _contentView = [[UIView alloc] init]; + } + return _contentView; +} + +- (UIImageView *)leftImageView{ + if (!_leftImageView) { + _leftImageView = [[UIImageView alloc] init]; + _leftImageView.image = [UIImage imageNamed:@"home_left_image"]; + _leftImageView.contentMode = UIViewContentModeScaleToFill; + } + return _leftImageView; +} + +- (UIImageView *)rightImageView{ + if (!_rightImageView) { + _rightImageView = [[UIImageView alloc] init]; + _rightImageView.image = [UIImage imageNamed:@"home_right_image"]; + _rightImageView.contentMode = UIViewContentModeScaleToFill; + _rightImageView.hidden = true; + } + return _rightImageView; +} + +- (UIImageView *)hgImageView{ + if (!_hgImageView) { + _hgImageView = [[UIImageView alloc] init]; + _hgImageView.image = [UIImage imageNamed:@"home_hg_icon"]; + _hgImageView.contentMode = UIViewContentModeScaleToFill; + } + return _hgImageView; +} + @end diff --git a/keyBoard/Class/Home/VC/HomeRankVC.m b/keyBoard/Class/Home/VC/HomeRankVC.m index 1973b31..c7476f0 100644 --- a/keyBoard/Class/Home/VC/HomeRankVC.m +++ b/keyBoard/Class/Home/VC/HomeRankVC.m @@ -25,7 +25,7 @@ self.titles = @[@"螃蟹啊斯柯达积分卡", @"小龙虾", @"苹果", @"胡萝卜", @"葡萄", @"西瓜"]; [self.view addSubview:self.myCategoryView]; [self.view addSubview:self.listContainerView]; -// self.listContainerView.scrollView.scrollEnabled = false; + 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"];