新增勋章 VIP 控制相关的资源,包括 medals_control_vip4、medals_control_vip6、medals_control_vip7 和 medals_control_vip9 的 Contents.json 文件及其对应的 vip@3x.png 图片,保持代码结构一致性。
This commit is contained in:
21
YuMi/Assets.xcassets/20.20.61/medals_control_vip4.imageset/Contents.json
vendored
Normal file
21
YuMi/Assets.xcassets/20.20.61/medals_control_vip4.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "vip@3x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
BIN
YuMi/Assets.xcassets/20.20.61/medals_control_vip4.imageset/vip@3x.png
vendored
Normal file
BIN
YuMi/Assets.xcassets/20.20.61/medals_control_vip4.imageset/vip@3x.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.9 KiB |
21
YuMi/Assets.xcassets/20.20.61/medals_control_vip6.imageset/Contents.json
vendored
Normal file
21
YuMi/Assets.xcassets/20.20.61/medals_control_vip6.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "vip@3x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
BIN
YuMi/Assets.xcassets/20.20.61/medals_control_vip6.imageset/vip@3x.png
vendored
Normal file
BIN
YuMi/Assets.xcassets/20.20.61/medals_control_vip6.imageset/vip@3x.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.9 KiB |
21
YuMi/Assets.xcassets/20.20.61/medals_control_vip7.imageset/Contents.json
vendored
Normal file
21
YuMi/Assets.xcassets/20.20.61/medals_control_vip7.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "vip@3x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
BIN
YuMi/Assets.xcassets/20.20.61/medals_control_vip7.imageset/vip@3x.png
vendored
Normal file
BIN
YuMi/Assets.xcassets/20.20.61/medals_control_vip7.imageset/vip@3x.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.9 KiB |
21
YuMi/Assets.xcassets/20.20.61/medals_control_vip9.imageset/Contents.json
vendored
Normal file
21
YuMi/Assets.xcassets/20.20.61/medals_control_vip9.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "vip@3x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
BIN
YuMi/Assets.xcassets/20.20.61/medals_control_vip9.imageset/vip@3x.png
vendored
Normal file
BIN
YuMi/Assets.xcassets/20.20.61/medals_control_vip9.imageset/vip@3x.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.9 KiB |
@@ -57,7 +57,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface MineAllMedalModel : PIBaseModel
|
||||
@property (nonatomic, copy) NSArray <MedalVo *> *allMedals;
|
||||
@property (nonatomic, copy) NSArray <VipMedalSeatVo *>*vipMedalSeatVos;
|
||||
@property (nonatomic, copy) NSDictionary <NSString *,NSArray *> *vipMedalSeatVos;
|
||||
@property (nonatomic, copy) NSArray *useMedals;
|
||||
@property (nonatomic, assign) NSInteger vipLevel;
|
||||
@property (nonatomic, assign) NSInteger medalNum;
|
||||
|
@@ -44,7 +44,7 @@
|
||||
+ (NSDictionary *)mj_objectClassInArray {
|
||||
return @{
|
||||
@"allMedals" : [MedalVo class],
|
||||
@"vipMedalSeatVos" : [VipMedalSeatVo class],
|
||||
// @"vipMedalSeatVos" : [VipMedalSeatVo class],
|
||||
// @"allMedals" : [MedalVo class],
|
||||
};
|
||||
}
|
||||
|
@@ -53,12 +53,15 @@
|
||||
}
|
||||
|
||||
- (void)mineAllMedals:(NSInteger)page {
|
||||
@kWeakify(self);
|
||||
[Api medalMineAll:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
@kStrongify(self);
|
||||
if ([[self getView] respondsToSelector:@selector(mineAllMedalsSuccess:)]) {
|
||||
MineAllMedalModel *m = [MineAllMedalModel modelWithJSON:data.data];
|
||||
[[self getView] mineAllMedalsSuccess:m];
|
||||
}
|
||||
} fail:^(NSInteger code, NSString * _Nullable msg) {
|
||||
@kStrongify(self);
|
||||
if ([[self getView] respondsToSelector:@selector(mineAllMedalsFailure)]) {
|
||||
[[self getView] mineAllMedalsFailure];
|
||||
}
|
||||
|
@@ -394,6 +394,28 @@ typedef enum : NSInteger {
|
||||
|
||||
- (void)userMedalsFailure {
|
||||
[self endReresh];
|
||||
|
||||
// 如果是加载更多失败,页码需要回退
|
||||
switch (self.currentTabType) {
|
||||
case MedalsCenterTab_TaskMedals:
|
||||
if (self.currentPageTaskMedals > 1) {
|
||||
self.currentPageTaskMedals--;
|
||||
}
|
||||
break;
|
||||
case MedalsCenterTab_ActivityMedals:
|
||||
if (self.currentPageActivityMedals > 1) {
|
||||
self.currentPageActivityMedals--;
|
||||
}
|
||||
break;
|
||||
case MedalsCenterTab_GloryMedals:
|
||||
if (self.currentPageGloryMedals > 1) {
|
||||
self.currentPageGloryMedals--;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
[self _updateDataSource:@[]];
|
||||
}
|
||||
|
||||
@@ -404,6 +426,27 @@ typedef enum : NSInteger {
|
||||
|
||||
- (void)squareMedalsFailure {
|
||||
[self endReresh];
|
||||
|
||||
// 如果是加载更多失败,页码需要回退
|
||||
switch (self.currentTabType) {
|
||||
case MedalsCenterTab_TaskMedals:
|
||||
if (self.currentPageTaskMedals > 1) {
|
||||
self.currentPageTaskMedals--;
|
||||
}
|
||||
break;
|
||||
case MedalsCenterTab_ActivityMedals:
|
||||
if (self.currentPageActivityMedals > 1) {
|
||||
self.currentPageActivityMedals--;
|
||||
}
|
||||
break;
|
||||
case MedalsCenterTab_GloryMedals:
|
||||
if (self.currentPageGloryMedals > 1) {
|
||||
self.currentPageGloryMedals--;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
- (void)_updateOtherInfo:(UserMedalsModel *)userModel {
|
||||
@@ -416,8 +459,10 @@ typedef enum : NSInteger {
|
||||
|
||||
- (void)_updateDataSource:(NSArray <MedalSeriesVo *>*)models {
|
||||
|
||||
if (models.count < 8) {
|
||||
if (models.count < [self.presenter pageSize]) {
|
||||
[self.medalsCollectionView.mj_footer endRefreshingWithNoMoreData];
|
||||
} else {
|
||||
[self.medalsCollectionView.mj_footer resetNoMoreData];
|
||||
}
|
||||
|
||||
switch (self.currentTabType) {
|
||||
|
@@ -22,7 +22,9 @@
|
||||
@property (nonatomic, assign) NSInteger medalsAreaPage;
|
||||
|
||||
@property (nonatomic, copy) NSArray <MedalVo *> *allMedalsVo;
|
||||
@property (nonatomic, copy) NSArray <VipMedalSeatVo *> *vipSeatVo;
|
||||
//@property (nonatomic, copy) NSArray <VipMedalSeatVo *> *vipSeatVo;
|
||||
@property (nonatomic, copy) NSDictionary *vipSeatDic;
|
||||
@property (nonatomic, assign) NSInteger minVipLevelForSeats;
|
||||
|
||||
@end
|
||||
|
||||
@@ -59,13 +61,13 @@
|
||||
make.height.mas_equalTo(kGetScaleWidth(147));
|
||||
}];
|
||||
[self.controlAreaCollectionView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.edges.mas_equalTo(self.controlAreaBG);
|
||||
make.edges.mas_equalTo(self.controlAreaBG).insets(UIEdgeInsetsMake(15, 15, 15, 15));
|
||||
}];
|
||||
|
||||
[self.contentArea addSubview:self.medalsAreaCollectionView];
|
||||
[self.medalsAreaCollectionView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(self.controlAreaCollectionView.mas_bottom).offset(14);
|
||||
make.leading.trailing.mas_equalTo(self.controlAreaCollectionView);
|
||||
make.top.mas_equalTo(self.controlAreaBG.mas_bottom).offset(14);
|
||||
make.leading.trailing.mas_equalTo(self.controlAreaBG);
|
||||
make.bottom.mas_equalTo(self.contentArea);
|
||||
}];
|
||||
}
|
||||
@@ -94,12 +96,18 @@
|
||||
- (void)mineAllMedalsSuccess:(MineAllMedalModel *)model {
|
||||
[self endRefresh];
|
||||
|
||||
self.vipSeatVo = model.vipMedalSeatVos;
|
||||
self.allMedalsVo = model.allMedals;
|
||||
// 重置最低VIP level
|
||||
self.minVipLevelForSeats = 0;
|
||||
|
||||
if (model.allMedals.count < [self.presenter pageSize]) {
|
||||
// TODO: footer 显示无更多
|
||||
[self.medalsAreaCollectionView.mj_footer endRefreshingWithNoMoreData];
|
||||
} else {
|
||||
[self.medalsAreaCollectionView.mj_footer resetNoMoreData];
|
||||
}
|
||||
|
||||
self.vipSeatDic = model.vipMedalSeatVos;
|
||||
self.allMedalsVo = model.allMedals;
|
||||
|
||||
[self.controlAreaCollectionView reloadData];
|
||||
[self.medalsAreaCollectionView reloadData];
|
||||
}
|
||||
@@ -131,12 +139,33 @@
|
||||
- (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
|
||||
if (collectionView == self.controlAreaCollectionView) {
|
||||
MedalsWearingControlCollectionViewCell *cell = [MedalsWearingControlCollectionViewCell cellFor:collectionView atIndexPath:indexPath];
|
||||
for (VipMedalSeatVo *vo in self.vipSeatVo) {
|
||||
if (vo.medalSeatNum-1 == indexPath.row) {
|
||||
[cell updateVIPLevel:vo.vipLevel];
|
||||
break;
|
||||
|
||||
// 根据 vipSeatDic 数据判断是否调用 updateVIPLevel
|
||||
NSString *seatKey = [NSString stringWithFormat:@"%ld", (long)(indexPath.row + 1)];
|
||||
NSArray *vipLevels = self.vipSeatDic[seatKey];
|
||||
|
||||
if (vipLevels && vipLevels.count > 0) {
|
||||
// 找到最低的 VIP level
|
||||
NSInteger currentMinVipLevel = NSIntegerMax;
|
||||
for (NSNumber *levelNum in vipLevels) {
|
||||
NSInteger level = [levelNum integerValue];
|
||||
if (level < currentMinVipLevel) {
|
||||
currentMinVipLevel = level;
|
||||
}
|
||||
}
|
||||
|
||||
if (currentMinVipLevel != NSIntegerMax) {
|
||||
// 更新全局最低VIP level
|
||||
if (self.minVipLevelForSeats == 0 || currentMinVipLevel < self.minVipLevelForSeats) {
|
||||
self.minVipLevelForSeats = currentMinVipLevel;
|
||||
}
|
||||
[cell updateVIPLevel:currentMinVipLevel];
|
||||
}
|
||||
} else if (self.minVipLevelForSeats > 0) {
|
||||
// 当前座位没有对应的vip seat vo,但之前已经有最低VIP level,则沿用
|
||||
[cell updateVIPLevel:self.minVipLevelForSeats];
|
||||
}
|
||||
|
||||
return cell;
|
||||
} else if (collectionView == self.medalsAreaCollectionView) {
|
||||
MedalsWearingListCollectionViewCell *cell = [MedalsWearingListCollectionViewCell cellFor:collectionView atIndexPath:indexPath];
|
||||
@@ -149,19 +178,17 @@
|
||||
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
|
||||
MedalVo *vo = [self.allMedalsVo xpSafeObjectAtIndex:indexPath.row];
|
||||
if (vo) {
|
||||
[self.presenter updateMedalUseStatus:vo.medalId isUse:!vo.useStatus];
|
||||
[self.presenter updateMedalUseStatus:vo.id isUse:!vo.useStatus];
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - Refresh Actions
|
||||
- (void)headerRefresh {
|
||||
// TODO: 实现下拉刷新逻辑
|
||||
self.medalsAreaPage = 1;
|
||||
[self loadMedals];
|
||||
}
|
||||
|
||||
- (void)footerRefresh {
|
||||
// TODO: 实现上拉加载更多逻辑
|
||||
self.medalsAreaPage++;
|
||||
[self loadMedals];
|
||||
}
|
||||
|
@@ -219,7 +219,7 @@
|
||||
return;
|
||||
}
|
||||
|
||||
[self configHeaders];
|
||||
// [self configHeaders];
|
||||
AFHTTPSessionManager *manager = [HttpRequestHelper requestManager];
|
||||
params = [MSParamsDecode msDecodeParams:[params mutableCopy] ];
|
||||
|
||||
@@ -307,7 +307,7 @@ constructingBodyWithBlock:^(id<AFMultipartFormData> _Nonnull formData) {
|
||||
}]) {
|
||||
return;
|
||||
}
|
||||
[self configHeaders];
|
||||
// [self configHeaders];
|
||||
params = [MSParamsDecode msDecodeParams:[params mutableCopy] ];
|
||||
params = [self configBaseParmars:params];
|
||||
AFHTTPSessionManager *manager = [HttpRequestHelper requestManager];
|
||||
@@ -413,7 +413,7 @@ constructingBodyWithBlock:^(id<AFMultipartFormData> _Nonnull formData) {
|
||||
@"app" : [YYUtility appName],
|
||||
@"lang" : [YYUtility getLanguage],
|
||||
};
|
||||
|
||||
|
||||
if (!parmars||![parmars isKindOfClass:[NSDictionary class]]){
|
||||
NSMutableDictionary *dic = [NSMutableDictionary dictionaryWithDictionary:defaultBasciParame];
|
||||
if(![[YYUtility getMobileCountryCode] isEqualToString:@"65535"]){
|
||||
@@ -427,6 +427,17 @@ constructingBodyWithBlock:^(id<AFMultipartFormData> _Nonnull formData) {
|
||||
[dic setValue:[YYUtility getMobileCountryCode] forKey:@"mcc"];
|
||||
}
|
||||
[dic addEntriesFromDictionary:defaultBasciParame];
|
||||
|
||||
if ([[AccountInfoStorage instance] getUid].length > 0) {
|
||||
[dic setValue:[[AccountInfoStorage instance] getUid]
|
||||
forKey:@"pub_uid"];
|
||||
}
|
||||
|
||||
if ([[AccountInfoStorage instance] getTicket].length > 0) {
|
||||
[dic setValue:[[AccountInfoStorage instance] getTicket]
|
||||
forKey:@"pub_ticket"];
|
||||
}
|
||||
|
||||
return dic;
|
||||
}
|
||||
|
||||
@@ -473,7 +484,7 @@ constructingBodyWithBlock:^(id<AFMultipartFormData> _Nonnull formData) {
|
||||
return;
|
||||
}
|
||||
|
||||
[self configHeaders];
|
||||
// [self configHeaders];
|
||||
params = [MSParamsDecode msDecodeParams:[params.mj_JSONObject mutableCopy] ].toJSONString;
|
||||
|
||||
NSDictionary *baseParams = [self configBaseParmars:nil];
|
||||
|
Reference in New Issue
Block a user