This commit is contained in:
2025-12-04 20:04:02 +08:00
parent 515487e748
commit 17ce91d40a
7 changed files with 48 additions and 22 deletions

View File

@@ -6,7 +6,7 @@
//
#import <UIKit/UIKit.h>
#import "KBCharacter.h"
NS_ASSUME_NONNULL_BEGIN
/// 排行榜详情弹窗的自定义内容视图(给 LSTPopView 使用)
@@ -17,11 +17,12 @@ NS_ASSUME_NONNULL_BEGIN
/// 关闭按钮点击回调(底部圆形 X
@property (nonatomic, copy, nullable) void (^closeHandler)(void);
/// 配置数据
- (void)configWithAvatar:(UIImage *_Nullable)avatar
title:(NSString *)title
download:(NSString *)download
desc:(NSString *)desc;
///// 配置数据
//- (void)configWithAvatar:(UIImage *_Nullable)avatar
// title:(NSString *)title
// download:(NSString *)download
// desc:(NSString *)desc;
@property (nonatomic, strong) KBCharacter *character;
@end

View File

@@ -43,14 +43,22 @@
#pragma mark - Public
- (void)configWithAvatar:(UIImage *)avatar
title:(NSString *)title
download:(NSString *)download
desc:(NSString *)desc {
self.avatarView.image = avatar ?: [self placeholderAvatar];
self.titleLabel.text = title ?: @"";
self.downloadLabel.text = download ?: @"";
self.descLabel.text = desc ?: @"";
//- (void)configWithAvatar:(UIImage *)avatar
// title:(NSString *)title
// download:(NSString *)download
// desc:(NSString *)desc {
// self.avatarView.image = avatar ?: [self placeholderAvatar];
// self.titleLabel.text = title ?: @"";
// self.downloadLabel.text = download ?: @"";
// self.descLabel.text = desc ?: @"";
//}
- (void)setCharacter:(KBCharacter *)character{
_character = character;
self.titleLabel.text = character.characterName ?: @"";
self.downloadLabel.text = character.download ?: @"";
self.descLabel.text = character.characterBackground ?: @"";
[self.avatarView kb_setImageURL:character.avatarUrl placeholder:KBPlaceholderImage];
}
#pragma mark - Build UI

View File

@@ -262,7 +262,7 @@
NSString *title = c.characterName ?: @"High EQ";
NSString *people = c.download ?: @"Download: 1 Million";
NSString *desc = @"Be Neither Too Close\nNor Too Distant"; //
[content configWithAvatar:nil title:title download:people desc:desc];
content.character = c;
//
LSTPopView *pop = [LSTPopView initWithCustomView:content

View File

@@ -191,8 +191,8 @@
NSString *title = c.characterName ?: @"High EQ";
NSString *people = c.download ?: @"Download: 1 Million";
NSString *desc = @"Be Neither Too Close\nNor Too Distant"; //
[content configWithAvatar:nil title:title download:people desc:desc];
// [content configWithAvatar:nil title:title download:people desc:desc];
content.character = c;
//
LSTPopView *pop = [LSTPopView initWithCustomView:content
parentView:nil

View File

@@ -27,7 +27,13 @@
[KBHUD show];
}
[[KBNetworkManager shared] GET:KB_API_CHARACTER_LIST
NSString *loginUrl = @"";
if ([KBUserSessionManager shared].isLoggedIn) {
loginUrl = API_CHARACTER_LIST;
}else{
loginUrl = API_NOT_LOGIN_CHARACTER_LIST;
}
[[KBNetworkManager shared] GET:loginUrl
parameters:params
headers:nil
autoShowBusinessError:true
@@ -87,8 +93,13 @@
if (needShow) {
[KBHUD show];
}
[[KBNetworkManager shared] GET:KB_API_CHARACTER_LIST_BY_TAG
NSString *loginUrl = @"";
if ([KBUserSessionManager shared].isLoggedIn) {
loginUrl = API_CHARACTER_LIST_BY_TAG;
}else{
loginUrl = API_NOT_LOGIN_CHARACTER_LIST_BY_TAG;
}
[[KBNetworkManager shared] GET:loginUrl
parameters:params
headers:nil
autoShowBusinessError:NO

View File

@@ -399,6 +399,7 @@ autoShowBusinessError:YES
NSString *msg = KBBizMessageFromJSONObject(dict) ?: KBLocalized(@"Server error");
if (autoShowBusinessError) {
dispatch_async(dispatch_get_main_queue(), ^{
[KBHUD dismiss];
[KBHUD showInfo:msg];
});
}
@@ -412,6 +413,7 @@ autoShowBusinessError:YES
return;
}
// code
[KBHUD dismiss];
if (completion) completion(dict, response, nil);
} else {
// JSON JSON