1
This commit is contained in:
@@ -118,15 +118,8 @@
|
||||
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
|
||||
HomeHotCell *cell = [tableView dequeueReusableCellWithIdentifier:HomeHotCell.reuseId forIndexPath:indexPath];
|
||||
KBCharacter *item = self.listCharacters[indexPath.row];
|
||||
NSInteger rank = (item.rank > 0) ? item.rank : (indexPath.row + 4); // 兜底:接口没给 rank 时,从 4 开始递增
|
||||
NSString *title = item.characterName ?: @"";
|
||||
NSString *sub = item.download ?: @""; // 暂用 download 字段作为副标题展示
|
||||
BOOL joined = item.added;
|
||||
// 配置 cell
|
||||
[cell configWithRank:rank
|
||||
title:title
|
||||
subtitle:sub
|
||||
joined:joined];
|
||||
// 直接把模型交给 cell,由 cell 自己负责展示
|
||||
cell.character = item;
|
||||
return cell;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user