This commit is contained in:
2025-12-17 20:43:16 +08:00
parent 85012eab78
commit 857822c49c

View File

@@ -120,6 +120,26 @@ typedef NS_ENUM(NSInteger, KBSkinDetailSection) {
return [UICollectionViewCell new]; return [UICollectionViewCell new];
} }
#pragma mark - UICollectionView Delegate
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
if (indexPath.section != KBSkinDetailSectionGrid) { return; }
if (indexPath.item >= self.recommendedThemes.count) { return; }
KBShopThemeModel *model = self.recommendedThemes[indexPath.item];
NSString *nextThemeId = [model.themeId stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
if (nextThemeId.length == 0) { return; }
if ([nextThemeId isEqualToString:self.themeId ?: @""]) { return; }
// themeId
self.themeId = nextThemeId;
self.detailModel = nil;
self.tags = @[];
[self updateBottomBarAppearance];
[self.collectionView setContentOffset:CGPointZero animated:NO];
[self.collectionView reloadData];
[self fetchThemeDetailIfNeeded];
}
#pragma mark - UICollectionView DelegateFlowLayout #pragma mark - UICollectionView DelegateFlowLayout
- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath { - (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath {