1.0.18 feat:增加图片资源,修正游戏列表 UI 问题

This commit is contained in:
eggmanQQQ
2024-10-22 17:14:20 +08:00
parent 37f9457532
commit d5572c204a
26 changed files with 277 additions and 42 deletions

View File

@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "room_candy_tree_back@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 278 KiB

View File

@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "room_candy_tree_buy_love_bg@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

View File

@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "room_candy_tree_buy_love_but_btn@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

View File

@@ -1,7 +1,6 @@
{
"images" : [
{
"filename" : "room_candy_tree_buy_love_title_en.png",
"idiom" : "universal",
"scale" : "1x"
},
@@ -10,6 +9,7 @@
"scale" : "2x"
},
{
"filename" : "room_candy_tree_buy_love_title@3x.png",
"idiom" : "universal",
"scale" : "3x"
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

View File

@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "room_candy_tree_confirm_buy_bg@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

View File

@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "room_candy_tree_rank@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

View File

@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "v4 12@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

View File

@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "v4 8@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.8 KiB

View File

@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "v4 9@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

View File

@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "v4 10@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View File

@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "v4 11@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

View File

@@ -0,0 +1,16 @@
//
// VipSettingViewController.h
// YuMi
//
// Created by P on 2024/10/22.
//
#import "MvpViewController.h"
NS_ASSUME_NONNULL_BEGIN
@interface VipSettingViewController : MvpViewController
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,31 @@
//
// VipSettingViewController.m
// YuMi
//
// Created by P on 2024/10/22.
//
#import "VipSettingViewController.h"
@interface VipSettingViewController ()
@end
@implementation VipSettingViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
@end

View File

@@ -18,6 +18,7 @@ static const NSInteger kItemsPerRow = 5;
@property(nonatomic,strong) UICollectionView *collectionView;
@property (nonatomic, assign) CGFloat itemHeight;
@property (nonatomic, assign) CGFloat emptyHeight;
@end
@implementation MSRoomMenuGameView
@@ -27,6 +28,7 @@ static const NSInteger kItemsPerRow = 5;
if(self){
self.itemHeight = kGetScaleWidth(80);
self.emptyHeight = kGetScaleWidth(100);
self.dataSource = @[].mutableCopy;
[self installUI];
@@ -34,12 +36,14 @@ static const NSInteger kItemsPerRow = 5;
}
return self;
}
-(void)installUI{
self.backgroundColor = [UIColor clearColor];
[self addSubview:self.backBtn];
[self addSubview:self.ms_bgView];
[self addSubview:self.collectionView];
}
-(void)installConstraints{
[self.backBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(self);
@@ -54,11 +58,13 @@ static const NSInteger kItemsPerRow = 5;
make.height.mas_equalTo(kGetScaleWidth(246));
}];
}
-(void)backBtnAction{
if (self.delegate && [self.delegate respondsToSelector:@selector(didClickBackBtnAction)]){
[self.delegate didClickBackBtnAction];
}
}
-(void)setPlayList:(NSMutableArray *)playList {
_playList = playList;
[self.dataSource addObjectsFromArray:playList];
@@ -81,20 +87,11 @@ static const NSInteger kItemsPerRow = 5;
if (count == 0) {
return;
}
NSInteger lineNum = MIN(3, (count + kItemsPerRow - 1)/kItemsPerRow);
if (lineNum == 1) {
self.itemHeight = kGetScaleWidth(100);
}
CGFloat calHeight = kGetScaleWidth(80);
if (lineNum < 3) {
calHeight = kGetScaleWidth(100);
}
NSInteger lineNum = (count + kItemsPerRow - 1)/kItemsPerRow;// MIN(3, (count + kItemsPerRow - 1)/kItemsPerRow);
CGFloat calHeight = self.itemHeight;
CGFloat height = 20 + 56 * lineNum + 44 * (lineNum - 1) + 70;
height = calHeight * lineNum;
// [_ms_bgView setCornerWithLeftTopCorner:kGetScaleWidth(12) rightTopCorner:kGetScaleWidth(12) bottomLeftCorner:0 bottomRightCorner:0 size:CGSizeMake(KScreenWidth, height-48)];
[self.ms_bgView mas_updateConstraints:^(MASConstraintMaker *make) {
make.height.mas_equalTo(kGetScaleWidth(height + 12));
}];
@@ -110,10 +107,10 @@ static const NSInteger kItemsPerRow = 5;
#pragma mark- UICollectionViewDelegate,UICollectionViewDataSource,UICollectionViewDelegateFlowLayout
- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath{
CGFloat width = (KScreenWidth-kGetScaleWidth(6))/5;
return [self countOfCurrentType] > 0 ? CGSizeMake(width, self.itemHeight): CGSizeMake(KScreenWidth, kGetScaleWidth(200));
return [self countOfCurrentType] > 0 ? CGSizeMake(width, self.itemHeight) : CGSizeMake(KScreenWidth, self.emptyHeight);
}
- (UIEdgeInsets)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout insetForSectionAtIndex:(NSInteger)section{
return [self countOfCurrentType] > 0 ? UIEdgeInsetsMake(0, kGetScaleWidth(3), 0, kGetScaleWidth(3)): UIEdgeInsetsMake(0, 0, 0, 0);
return [self countOfCurrentType] > 0 ? UIEdgeInsetsMake(0, kGetScaleWidth(3), 0, kGetScaleWidth(3)) : UIEdgeInsetsZero;
}
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section{
return [self countOfCurrentType] > 0 ? [self countOfCurrentType] : 1;
@@ -123,26 +120,19 @@ static const NSInteger kItemsPerRow = 5;
MSRoomMenuGameEmptyCell * cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([MSRoomMenuGameEmptyCell class]) forIndexPath:indexPath];
return cell;
}
MSRoomMenuGameCell * cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([MSRoomMenuGameCell class]) forIndexPath:indexPath];
// if (_littleGameList.count > 0){
// cell.littleGameModel = [self.littleGameList xpSafeObjectAtIndex:indexPath.row];
// } else {
id model = [self.dataSource xpSafeObjectAtIndex:indexPath.row];
if ([model isKindOfClass:[XPRoomMoreItemModel class]]) {
cell.moreItemModel = model;
} else if ([model isKindOfClass:[ActivityInfoModel class]]) {
cell.model = model;
} else {
cell.littleGameModel = model;
}
// }
MSRoomMenuGameCell * cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([MSRoomMenuGameCell class]) forIndexPath:indexPath];
id model = [self.dataSource xpSafeObjectAtIndex:indexPath.row];
if ([model isKindOfClass:[XPRoomMoreItemModel class]]) {
cell.moreItemModel = model;
} else if ([model isKindOfClass:[ActivityInfoModel class]]) {
cell.model = model;
} else {
cell.littleGameModel = model;
}
return cell;
}
-(void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath{
if (self.dataSource.count > 0 && self.delegate) {
id model = [self.dataSource xpSafeObjectAtIndex:indexPath.row];
if ([model isKindOfClass:[LittleGameInfoModel class]]) {
@@ -154,17 +144,6 @@ static const NSInteger kItemsPerRow = 5;
[self.delegate ms_didSelectItemAtIndexPath:model];
}
}
// if (self.littleGameList != nil &&
// self.littleGameList.count > 0 &&
// [self.delegate respondsToSelector:@selector(ms_didSelectLittleGameItemAtIndexPath:)]) {
// [self.delegate ms_didSelectLittleGameItemAtIndexPath:[self.littleGameList xpSafeObjectAtIndex:indexPath.row]];
// }
// else if (self.playList != nil &&
// self.playList.count > 0 &&
// [self.delegate respondsToSelector:@selector(ms_didSelectItemAtIndexPath:)]) {
// [self.delegate ms_didSelectItemAtIndexPath:[self.playList xpSafeObjectAtIndex:indexPath.row]];
// }
}
}
#pragma mark -
@@ -181,7 +160,6 @@ static const NSInteger kItemsPerRow = 5;
_ms_bgView.backgroundColor = UIColorFromRGB(0x2D1E4D);
_ms_bgView.layer.cornerRadius = 12;
_ms_bgView.layer.masksToBounds = YES;
// [_ms_bgView setCornerWithLeftTopCorner:kGetScaleWidth(12) rightTopCorner:kGetScaleWidth(12) bottomLeftCorner:0 bottomRightCorner:0 size:CGSizeMake(KScreenWidth, kGetScaleWidth(247))];
}
return _ms_bgView;
}