修正首页排行榜显示判断

This commit is contained in:
eggmanQQQ
2024-06-24 17:07:56 +08:00
parent 7320401f5d
commit b88be57677
2 changed files with 10 additions and 6 deletions

View File

@@ -113,8 +113,12 @@
- (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
XPNewHomeItemCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([XPNewHomeItemCell class]) forIndexPath:indexPath];
if(indexPath.row < self.itemList.count){
cell.itemModel = self.itemList[indexPath.row];
cell.rankAvatarsModelArray = self.rankAvatars;
if (indexPath.row == 0) {
cell.rankAvatarsModelArray = self.rankAvatars;
cell.itemModel = self.itemList[indexPath.row];
} else {
cell.itemModel = self.itemList[indexPath.row];
}
}
@kWeakify(self);
cell.didTapRankArea = ^{

View File

@@ -165,7 +165,7 @@
}
-(void)setItemModel:(PIHomeItemModel *)itmeModel{
_itemModel = itmeModel;
if ([itmeModel.ID isEqualToString:@"3"]) {
if (self.rankAvatarsModelArray.count > 0) {
_bgImageView.image = [UIImage imageNamed:@"home_rank_Heads_bg"];
} else {
_bgImageView.layer.cornerRadius = kGetScaleWidth(12);
@@ -178,9 +178,9 @@
}
- (void)setRankAvatarsModelArray:(NSArray<HomeRankAvatarModel *> *)rankAvatarsModelArray {
if (![self.itemModel.ID isEqualToString:@"3"]) {
return;
}
// if (![self.itemModel.ID isEqualToString:@"3"]) {
// return;
// }
if (rankAvatarsModelArray.count>0) {
_rankAvatarsModelArray = rankAvatarsModelArray;
if (!self.pi_BannerView.superview) {