1
This commit is contained in:
@@ -26,8 +26,12 @@
|
|||||||
#define API_UPDATA_INFO @"/user/updateInfo" // 更新用户
|
#define API_UPDATA_INFO @"/user/updateInfo" // 更新用户
|
||||||
|
|
||||||
#define KB_API_USER_DETAIL @"/user/detail" // 用户详情
|
#define KB_API_USER_DETAIL @"/user/detail" // 用户详情
|
||||||
#define KB_API_CHARACTER_LIST @"/character/list" // 排行榜角色列表(综合)
|
#define API_CHARACTER_LIST @"/character/list" // 排行榜角色列表(综合)
|
||||||
#define KB_API_CHARACTER_LIST_BY_TAG @"/character/listByTag" // 根据 tagId 获取角色列表
|
#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_TAG_LIST @"/tag/list" // 排行榜标签列表
|
||||||
#define KB_API_FILE_UPLOAD @"/file/upload" // 上传头像
|
#define KB_API_FILE_UPLOAD @"/file/upload" // 上传头像
|
||||||
#define KB_API_CHARACTER_DETAIL @"/character/detail" // 人设详情
|
#define KB_API_CHARACTER_DETAIL @"/character/detail" // 人设详情
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
#import <UIKit/UIKit.h>
|
#import <UIKit/UIKit.h>
|
||||||
|
#import "KBCharacter.h"
|
||||||
NS_ASSUME_NONNULL_BEGIN
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
/// 排行榜详情弹窗的自定义内容视图(给 LSTPopView 使用)
|
/// 排行榜详情弹窗的自定义内容视图(给 LSTPopView 使用)
|
||||||
@@ -17,11 +17,12 @@ NS_ASSUME_NONNULL_BEGIN
|
|||||||
/// 关闭按钮点击回调(底部圆形 X)
|
/// 关闭按钮点击回调(底部圆形 X)
|
||||||
@property (nonatomic, copy, nullable) void (^closeHandler)(void);
|
@property (nonatomic, copy, nullable) void (^closeHandler)(void);
|
||||||
|
|
||||||
/// 配置数据
|
///// 配置数据
|
||||||
- (void)configWithAvatar:(UIImage *_Nullable)avatar
|
//- (void)configWithAvatar:(UIImage *_Nullable)avatar
|
||||||
title:(NSString *)title
|
// title:(NSString *)title
|
||||||
download:(NSString *)download
|
// download:(NSString *)download
|
||||||
desc:(NSString *)desc;
|
// desc:(NSString *)desc;
|
||||||
|
@property (nonatomic, strong) KBCharacter *character;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
|||||||
@@ -43,14 +43,22 @@
|
|||||||
|
|
||||||
#pragma mark - Public
|
#pragma mark - Public
|
||||||
|
|
||||||
- (void)configWithAvatar:(UIImage *)avatar
|
//- (void)configWithAvatar:(UIImage *)avatar
|
||||||
title:(NSString *)title
|
// title:(NSString *)title
|
||||||
download:(NSString *)download
|
// download:(NSString *)download
|
||||||
desc:(NSString *)desc {
|
// desc:(NSString *)desc {
|
||||||
self.avatarView.image = avatar ?: [self placeholderAvatar];
|
// self.avatarView.image = avatar ?: [self placeholderAvatar];
|
||||||
self.titleLabel.text = title ?: @"";
|
// self.titleLabel.text = title ?: @"";
|
||||||
self.downloadLabel.text = download ?: @"";
|
// self.downloadLabel.text = download ?: @"";
|
||||||
self.descLabel.text = desc ?: @"";
|
// 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
|
#pragma mark - Build UI
|
||||||
|
|||||||
@@ -262,7 +262,7 @@
|
|||||||
NSString *title = c.characterName ?: @"High EQ";
|
NSString *title = c.characterName ?: @"High EQ";
|
||||||
NSString *people = c.download ?: @"Download: 1 Million";
|
NSString *people = c.download ?: @"Download: 1 Million";
|
||||||
NSString *desc = @"Be Neither Too Close\nNor Too Distant"; // 示例文案
|
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
|
LSTPopView *pop = [LSTPopView initWithCustomView:content
|
||||||
|
|||||||
@@ -191,8 +191,8 @@
|
|||||||
NSString *title = c.characterName ?: @"High EQ";
|
NSString *title = c.characterName ?: @"High EQ";
|
||||||
NSString *people = c.download ?: @"Download: 1 Million";
|
NSString *people = c.download ?: @"Download: 1 Million";
|
||||||
NSString *desc = @"Be Neither Too Close\nNor Too Distant"; // 示例文案
|
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
|
LSTPopView *pop = [LSTPopView initWithCustomView:content
|
||||||
parentView:nil
|
parentView:nil
|
||||||
|
|||||||
@@ -27,7 +27,13 @@
|
|||||||
[KBHUD show];
|
[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
|
parameters:params
|
||||||
headers:nil
|
headers:nil
|
||||||
autoShowBusinessError:true
|
autoShowBusinessError:true
|
||||||
@@ -87,8 +93,13 @@
|
|||||||
if (needShow) {
|
if (needShow) {
|
||||||
[KBHUD show];
|
[KBHUD show];
|
||||||
}
|
}
|
||||||
|
NSString *loginUrl = @"";
|
||||||
[[KBNetworkManager shared] GET:KB_API_CHARACTER_LIST_BY_TAG
|
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
|
parameters:params
|
||||||
headers:nil
|
headers:nil
|
||||||
autoShowBusinessError:NO
|
autoShowBusinessError:NO
|
||||||
|
|||||||
@@ -399,6 +399,7 @@ autoShowBusinessError:YES
|
|||||||
NSString *msg = KBBizMessageFromJSONObject(dict) ?: KBLocalized(@"Server error");
|
NSString *msg = KBBizMessageFromJSONObject(dict) ?: KBLocalized(@"Server error");
|
||||||
if (autoShowBusinessError) {
|
if (autoShowBusinessError) {
|
||||||
dispatch_async(dispatch_get_main_queue(), ^{
|
dispatch_async(dispatch_get_main_queue(), ^{
|
||||||
|
[KBHUD dismiss];
|
||||||
[KBHUD showInfo:msg];
|
[KBHUD showInfo:msg];
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -412,6 +413,7 @@ autoShowBusinessError:YES
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// code 缺失或为成功,按正常成功回调
|
// code 缺失或为成功,按正常成功回调
|
||||||
|
[KBHUD dismiss];
|
||||||
if (completion) completion(dict, response, nil);
|
if (completion) completion(dict, response, nil);
|
||||||
} else {
|
} else {
|
||||||
// 预期 JSON,但未检测到 JSON 内容
|
// 预期 JSON,但未检测到 JSON 内容
|
||||||
|
|||||||
Reference in New Issue
Block a user