2
This commit is contained in:
@@ -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 {
|
||||||
|
|||||||
Reference in New Issue
Block a user