房间相册

This commit is contained in:
liyuhua
2023-10-12 11:45:47 +08:00
parent 361a92989e
commit 29ea2bdcd0
51 changed files with 1440 additions and 13 deletions

View File

@@ -67,6 +67,7 @@
//////banner
@property(nonatomic,copy) NSArray *bannerList;
@end
@implementation XPIAPRechargeViewController
@@ -213,11 +214,15 @@
[self showSuccessToast:YMLocalizedString(@"XPIAPRechargeViewController11")];
return;
}
RechargeListModel *model = [self.dataSource safeObjectAtIndex1:self.selectedIndex.row];
if (model.chargeProdId) {
[XNDJTDDLoadingTool showOnlyView:kWindow];
[self.presenter requestIAPRechargeOrderWithChargeProdId:model.chargeProdId];
NSInteger index = self.bannerList.count > 0 ? self.selectedIndex.row - 1 : self.selectedIndex.row;
if(index < self.dataSource.count){
RechargeListModel *model = [self.dataSource safeObjectAtIndex1:index];
if (model.chargeProdId) {
[XNDJTDDLoadingTool showOnlyView:kWindow];
[self.presenter requestIAPRechargeOrderWithChargeProdId:model.chargeProdId];
}
}
}
- (void)protcoloButtonAction:(UIButton *)sender {
@@ -246,6 +251,11 @@
}
- (void)getBannerListSuccessWithList:(NSArray *)list{
self.bannerList = list;
if(self.bannerList.count > 0){
self.selectedIndex = [NSIndexPath indexPathForRow:1 inSection:0];
}else{
self.selectedIndex = [NSIndexPath indexPathForRow:0 inSection:0];
}
[self.collectionView reloadData];
}
///
@@ -467,7 +477,10 @@
#pragma mark - UICollectionViewDelegate
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
return self.dataSource.count + self.bannerList.count;
if(self.bannerList.count > 0){
return self.dataSource.count + 1;
}
return self.dataSource.count;
}
- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath{
return self.bannerList.count > 0 && indexPath.row == 0 ? CGSizeMake(KScreenWidth, kGetScaleWidth(114)) : CGSizeMake(KScreenWidth, kGetScaleWidth(80));