1
This commit is contained in:
@@ -26,8 +26,12 @@
|
||||
#define API_UPDATA_INFO @"/user/updateInfo" // 更新用户
|
||||
|
||||
#define KB_API_USER_DETAIL @"/user/detail" // 用户详情
|
||||
#define KB_API_CHARACTER_LIST @"/character/list" // 排行榜角色列表(综合)
|
||||
#define KB_API_CHARACTER_LIST_BY_TAG @"/character/listByTag" // 根据 tagId 获取角色列表
|
||||
#define API_CHARACTER_LIST @"/character/list" // 排行榜角色列表(综合)
|
||||
#define API_NOT_LOGIN_CHARACTER_LIST @"/character/listWithNotLogin" //未登录用户人设列表
|
||||
|
||||
#define API_CHARACTER_LIST_BY_TAG @"/character/listByTag" // 根据 tagId 获取角色列表
|
||||
#define API_NOT_LOGIN_CHARACTER_LIST_BY_TAG @"/character/listByTagWithNotLogin" // 未登录用户按标签查询人设列表
|
||||
|
||||
#define KB_API_TAG_LIST @"/tag/list" // 排行榜标签列表
|
||||
#define KB_API_FILE_UPLOAD @"/file/upload" // 上传头像
|
||||
#define KB_API_CHARACTER_DETAIL @"/character/detail" // 人设详情
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 内容
|
||||
|
||||
Reference in New Issue
Block a user