1
This commit is contained in:
@@ -63,17 +63,12 @@
|
||||
}
|
||||
weakSelf.allCharacters = list ?: @[];
|
||||
|
||||
// 顶部前三名数据
|
||||
NSMutableArray *topItems = [NSMutableArray array];
|
||||
// 顶部前三名数据:直接取前三个模型交给 KBTopThreeView
|
||||
NSInteger topCount = MIN(3, weakSelf.allCharacters.count);
|
||||
for (NSInteger i = 0; i < topCount; i++) {
|
||||
KBCharacter *c = weakSelf.allCharacters[i];
|
||||
// NSInteger rank = (c.rank > 0) ? c.rank : (i + 1);
|
||||
NSString *title = c.characterName ?: @"";
|
||||
[topItems addObject:@{ @"title": title, @"rank": @(i + 1) }];
|
||||
}
|
||||
if (topItems.count > 0) {
|
||||
[weakSelf.topThreeView configWithItems:topItems];
|
||||
if (topCount > 0) {
|
||||
NSRange range = NSMakeRange(0, topCount);
|
||||
NSArray<KBCharacter *> *topThree = [weakSelf.allCharacters subarrayWithRange:range];
|
||||
[weakSelf.topThreeView configWithCharacters:topThree];
|
||||
}
|
||||
|
||||
// 列表部分:从第 4 名开始
|
||||
|
||||
Reference in New Issue
Block a user